@rustic-ai/ui-components 0.0.20 → 0.0.22
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.map +1 -1
- package/dist/components/calendar/index.css +24 -10
- package/dist/components/calendar/index.js +1 -1
- package/dist/components/codeSnippet/index.js +1 -1
- package/dist/components/elementRenderer/elementRenderer.d.ts +2 -2
- package/dist/components/elementRenderer/elementRenderer.d.ts.map +1 -1
- package/dist/components/elementRenderer/index.js +1 -1
- package/dist/components/helper.d.ts +0 -2
- package/dist/components/helper.d.ts.map +1 -1
- package/dist/components/image/index.js +1 -1
- package/dist/components/input/multimodal/multimodalInput/index.css +4 -0
- package/dist/components/input/multimodal/multimodalInput/index.js +1 -1
- package/dist/components/input/multimodal/uploader/index.js +1 -1
- package/dist/components/input/textInput/index.css +4 -0
- package/dist/components/input/textInput/index.js +1 -1
- package/dist/components/map/index.js +1 -1
- package/dist/components/markdown/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/messageCanvas/actions/action.d.ts +3 -3
- package/dist/components/messageCanvas/actions/action.d.ts.map +1 -1
- package/dist/components/messageCanvas/actions/copy/copyText.d.ts +2 -2
- 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 +2 -2
- 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 +5 -5
- 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 +6 -3
- package/dist/components/messageSpace/messageSpace.d.ts.map +1 -1
- package/dist/components/{promptBuilder/mockWebSocket.d.ts → mockWebSocket.d.ts} +1 -1
- package/dist/components/mockWebSocket.d.ts.map +1 -0
- package/dist/components/multipart/index.js +1 -1
- package/dist/components/multipart/multipart.d.ts +2 -2
- package/dist/components/multipart/multipart.d.ts.map +1 -1
- package/dist/components/participantsContainer/index.d.ts +2 -1
- package/dist/components/participantsContainer/index.d.ts.map +1 -1
- package/dist/components/participantsContainer/index.js +1 -1
- package/dist/components/participantsContainer/participantsContainer.d.ts +14 -1
- package/dist/components/participantsContainer/participantsContainer.d.ts.map +1 -1
- package/dist/components/pdfViewer/index.js +1 -1
- package/dist/components/promptBuilder/index.js +1 -1
- package/dist/components/promptBuilder/promptBuilder.d.ts.map +1 -1
- package/dist/components/question/index.js +1 -1
- package/dist/components/table/index.js +1 -1
- package/dist/components/text/index.js +1 -1
- package/dist/components/timestamp/index.d.ts.map +1 -1
- package/dist/components/timestamp/index.js +1 -0
- package/dist/components/types.d.ts +4 -20
- package/dist/components/types.d.ts.map +1 -1
- package/dist/components/video/index.js +1 -1
- package/dist/components/visualization/chart/index.js +1 -1
- package/dist/components/visualization/perspectiveViz/index.js +1 -1
- package/dist/components/weather/index.js +1 -1
- package/dist/index.css +28 -10
- package/dist/index.js +1 -1
- package/package.json +8 -4
- package/dist/components/promptBuilder/mockWebSocket.d.ts.map +0 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import './action.css';
|
|
2
2
|
import type { ReactNode } from 'react';
|
|
3
|
-
import type {
|
|
3
|
+
import type { Message } from '../../types';
|
|
4
4
|
interface ActionProps {
|
|
5
5
|
label: string;
|
|
6
|
-
message:
|
|
6
|
+
message: Message;
|
|
7
7
|
icon: ReactNode;
|
|
8
|
-
onClick: (message:
|
|
8
|
+
onClick: (message: Message) => void;
|
|
9
9
|
}
|
|
10
10
|
export default function Action(props: ActionProps): import("react/jsx-runtime").JSX.Element;
|
|
11
11
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"action.d.ts","sourceRoot":"","sources":["../../../../src/components/messageCanvas/actions/action.tsx"],"names":[],"mappings":"AAAA,OAAO,cAAc,CAAA;AAIrB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAGtC,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"action.d.ts","sourceRoot":"","sources":["../../../../src/components/messageCanvas/actions/action.tsx"],"names":[],"mappings":"AAAA,OAAO,cAAc,CAAA;AAIrB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAGtC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAE1C,UAAU,WAAW;IACnB,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,OAAO,CAAA;IAChB,IAAI,EAAE,SAAS,CAAA;IACf,OAAO,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAA;CACpC;AAED,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,KAAK,EAAE,WAAW,2CAsBhD"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Message } from '../../../types';
|
|
2
2
|
export interface CopyTextProps {
|
|
3
|
-
message:
|
|
3
|
+
message: Message;
|
|
4
4
|
}
|
|
5
5
|
export default function CopyText(props: CopyTextProps): import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
//# sourceMappingURL=copyText.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"copyText.d.ts","sourceRoot":"","sources":["../../../../../src/components/messageCanvas/actions/copy/copyText.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"copyText.d.ts","sourceRoot":"","sources":["../../../../../src/components/messageCanvas/actions/copy/copyText.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAA;AAG7C,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,OAAO,CAAA;CACjB;AAED,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,KAAK,EAAE,aAAa,2CA4BpD"}
|
|
@@ -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={986:(e,t,o)=>{o.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={986:(e,t,o)=>{o.d(t,{default:()=>c});var r=o(997),n=o(934),a=o.n(n),i=o(229),s=o.n(i);o(689);const c=function(e){return(0,r.jsx)(s(),{title:e.label,children:(0,r.jsx)(a(),{color:"inherit","aria-label":e.label,onClick:function(t){t.stopPropagation(),t.preventDefault(),e.onClick(e.message)},className:"rustic-message-actions",children:e.icon})})}},934:e=>{e.exports=require("@mui/material/IconButton")},229:e=>{e.exports=require("@mui/material/Tooltip")},689:e=>{e.exports=require("react")},997:e=>{e.exports=require("react/jsx-runtime")}},t={};function o(r){var n=t[r];if(void 0!==n)return n.exports;var a=t[r]={exports:{}};return e[r](a,a.exports,o),a.exports}o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},o.d=(e,t)=>{for(var r in t)o.o(t,r)&&!o.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};return(()=>{o.r(r),o.d(r,{default:()=>i});var e=o(997),t=o(689);function n(t){return t.name.replaceAll("_","-"),(0,e.jsx)("span",{className:"".concat(t.className?t.className+" ":"","material-symbols-rounded"),children:t.name})}var a=o(986);const i=function(o){var r=(0,t.useState)("Copy text"),i=r[0],s=r[1];return(0,e.jsx)(a.default,{message:o.message,icon:(0,e.jsx)(n,{name:"file_copy"}),onClick:function(e){e.data.text&&navigator.clipboard.writeText(e.data.text).then((function(){s("Copied"),setTimeout((function(){s("Copy text")}),2e3)})).catch((function(){s("Failed to copy")}))},label:i})}})(),r})()));
|
|
@@ -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={
|
|
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={934:e=>{e.exports=require("@mui/material/IconButton")},229:e=>{e.exports=require("@mui/material/Tooltip")},689:e=>{e.exports=require("react")},997:e=>{e.exports=require("react/jsx-runtime")}},t={};function r(o){var n=t[o];if(void 0!==n)return n.exports;var i=t[o]={exports:{}};return e[o](i,i.exports,r),i.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var o in t)r.o(t,o)&&!r.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};return(()=>{r.r(o),r.d(o,{default:()=>u});var e=r(997),t=r(934),n=r.n(t),i=r(229),a=r.n(i);r(689);const u=function(t){return(0,e.jsx)(a(),{title:t.label,children:(0,e.jsx)(n(),{color:"inherit","aria-label":t.label,onClick:function(e){e.stopPropagation(),e.preventDefault(),t.onClick(t.message)},className:"rustic-message-actions",children:t.icon})})}})(),o})()));
|
|
@@ -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={986:(e,t,a)=>{a.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={986:(e,t,a)=>{a.d(t,{default:()=>l});var r=a(997),n=a(934),o=a.n(n),s=a(229),i=a.n(s);a(689);const l=function(e){return(0,r.jsx)(i(),{title:e.label,children:(0,r.jsx)(o(),{color:"inherit","aria-label":e.label,onClick:function(t){t.stopPropagation(),t.preventDefault(),e.onClick(e.message)},className:"rustic-message-actions",children:e.icon})})}},934:e=>{e.exports=require("@mui/material/IconButton")},229:e=>{e.exports=require("@mui/material/Tooltip")},689:e=>{e.exports=require("react")},997:e=>{e.exports=require("react/jsx-runtime")}},t={};function a(r){var n=t[r];if(void 0!==n)return n.exports;var o=t[r]={exports:{}};return e[r](o,o.exports,a),o.exports}a.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return a.d(t,{a:t}),t},a.d=(e,t)=>{for(var r in t)a.o(t,r)&&!a.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),a.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};return(()=>{a.r(r),a.d(r,{default:()=>s});var e=a(997),t=a(689);function n(t){return t.name.replaceAll("_","-"),(0,e.jsx)("span",{className:"".concat(t.className?t.className+" ":"","material-symbols-rounded"),children:t.name})}var o=a(986);const s=function(a){var r=(0,t.useState)("Start reading aloud"),s=r[0],i=r[1],l=[a.message.data.title,a.message.data.description,a.message.data.alt,a.message.data.text,a.message.data.transcript].filter(Boolean).join(" "),c=new SpeechSynthesisUtterance(l);return(0,e.jsx)(o.default,{message:a.message,icon:(0,e.jsx)(n,{name:"text_to_speech"}),onClick:function(){window.speechSynthesis.speaking?(window.speechSynthesis.cancel(),i("Start reading aloud")):(c.onend=function(){i("Start reading aloud")},window.speechSynthesis.speak(c),i("Stop reading aloud"))},label:s})}})(),r})()));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Message } from '../../../types';
|
|
2
2
|
export interface TextToSpeechProps {
|
|
3
|
-
message:
|
|
3
|
+
message: Message;
|
|
4
4
|
}
|
|
5
5
|
export default function TextToSpeech(props: TextToSpeechProps): import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
//# sourceMappingURL=textToSpeech.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"textToSpeech.d.ts","sourceRoot":"","sources":["../../../../../src/components/messageCanvas/actions/textToSpeech/textToSpeech.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"textToSpeech.d.ts","sourceRoot":"","sources":["../../../../../src/components/messageCanvas/actions/textToSpeech/textToSpeech.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAA;AAG7C,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,OAAO,CAAA;CACjB;AAED,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,KAAK,EAAE,iBAAiB,2CAkC5D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["@rustic-ai/ui-components"]=t():e["@rustic-ai/ui-components"]=t()}(global,(()=>(()=>{"use strict";var e={n:t=>{var r=t&&t.__esModule?()=>t.default:()=>t;return e.d(r,{a:r}),r},d:(t,r)=>{for(var a in r)e.o(r,a)&&!e.o(t,a)&&Object.defineProperty(t,a,{enumerable:!0,get:r[a]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{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 a in r)e.o(r,a)&&!e.o(t,a)&&Object.defineProperty(t,a,{enumerable:!0,get:r[a]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{default:()=>g});const r=require("react/jsx-runtime"),a=require("@mui/material"),n=require("@mui/material/Card");var o=e.n(n);const i=require("@mui/material/Stack");var s=e.n(i);const c=require("react"),u=require("@mui/material/Typography");var m,l=e.n(u);!function(e){e[e.HOUR=0]="HOUR",e[e.MONTH_DATE=1]="MONTH_DATE"}(m||(m={}));const d=function(e){return(0,r.jsx)(l(),{variant:"caption",color:"text.secondary",className:"rustic-timestamp",children:(t=e.timestamp,a=new Date(t),n=navigator.language,o={month:"short",day:"numeric"},i=new Date,s=a.getFullYear()!==i.getFullYear(),c=s?" at ":", ",s&&(o.year="numeric"),a.toLocaleDateString(n,o)+c+a.toLocaleTimeString(n,{hour:"numeric",minute:"2-digit",hour12:!0}))});var t,a,n,o,i,s,c},g=(0,c.forwardRef)((function(e,t){var n=(0,a.useTheme)();return(0,r.jsxs)(s(),{id:e.message.id,className:"rustic-message-canvas",ref:t,children:[(0,r.jsxs)(s(),{direction:"row",alignItems:"center",spacing:1,children:[e.getProfileComponent&&e.getProfileComponent(e.message),(0,r.jsx)(d,{timestamp:e.message.timestamp})]}),e.getActionsComponent&&e.getActionsComponent(e.message)&&(0,r.jsx)(o(),{variant:"outlined",className:"rustic-message-actions-container",sx:{boxShadow:n.shadows[1]},children:e.getActionsComponent(e.message)}),(0,r.jsx)(o(),{variant:"outlined",className:"rustic-message-container",children:e.children})]})}));return t})()));
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import './messageCanvas.css';
|
|
2
2
|
import React, { type ReactNode } from 'react';
|
|
3
|
-
import type {
|
|
3
|
+
import type { Message } from '../types';
|
|
4
4
|
export interface MessageContainerProps {
|
|
5
5
|
/** A function that returns a React element to display sender details, like names and/or avatars. */
|
|
6
|
-
getProfileComponent?: (message:
|
|
6
|
+
getProfileComponent?: (message: Message) => ReactNode;
|
|
7
7
|
/** A function that returns a single React element which may be composed of several actions supported for the message, such as editing, copying, and deleting, etc.
|
|
8
8
|
* In case no actions are applicable or available for a particular message, the function may return `undefined`.
|
|
9
9
|
* This approach offers flexibility in tailoring message interactions to specific application requirements.
|
|
10
10
|
* To define individual message actions, developers can extend the `Action` component's functionality.
|
|
11
11
|
* One such example is the `CopyText` component.
|
|
12
12
|
*/
|
|
13
|
-
getActionsComponent?: (message:
|
|
13
|
+
getActionsComponent?: (message: Message) => ReactNode | undefined;
|
|
14
14
|
}
|
|
15
15
|
export interface MessageCanvasProps extends MessageContainerProps {
|
|
16
|
-
/** Message information to be displayed. Please see the `MessageSpace` docs for more information about the `
|
|
17
|
-
message:
|
|
16
|
+
/** Message information to be displayed. Please see the `MessageSpace` docs for more information about the `Message` interface. */
|
|
17
|
+
message: Message;
|
|
18
18
|
/** React component to be displayed in the message canvas. */
|
|
19
19
|
children: ReactNode;
|
|
20
20
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messageCanvas.d.ts","sourceRoot":"","sources":["../../../src/components/messageCanvas/messageCanvas.tsx"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAA;AAK5B,OAAO,KAAK,EAAE,EAAc,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAGzD,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"messageCanvas.d.ts","sourceRoot":"","sources":["../../../src/components/messageCanvas/messageCanvas.tsx"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAA;AAK5B,OAAO,KAAK,EAAE,EAAc,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAGzD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,UAAU,CAAA;AAEvC,MAAM,WAAW,qBAAqB;IACpC,oGAAoG;IACpG,mBAAmB,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,SAAS,CAAA;IACrD;;;;;OAKG;IACH,mBAAmB,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,SAAS,GAAG,SAAS,CAAA;CAClE;AAED,MAAM,WAAW,kBAAmB,SAAQ,qBAAqB;IAC/D,kIAAkI;IAClI,OAAO,EAAE,OAAO,CAAA;IAChB,6DAA6D;IAC7D,QAAQ,EAAE,SAAS,CAAA;CACpB;AAyCD,QAAA,MAAM,aAAa,2FAAmC,CAAA;AACtD,eAAe,aAAa,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 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:()=>S});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]})})};function f(e){return e.name.replaceAll("_","-"),(0,n.jsx)("span",{className:"".concat(e.className?e.className+" ":"","material-symbols-rounded"),children:e.name})}const p=require("@mui/material"),g=require("@mui/material/Card");var v=e.n(g);const h=require("@mui/material/Stack");var y,j=e.n(h);!function(e){e[e.HOUR=0]="HOUR",e[e.MONTH_DATE=1]="MONTH_DATE"}(y||(y={}));const b=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},w=(0,i.forwardRef)((function(e,t){var r=(0,p.useTheme)();return(0,n.jsxs)(j(),{id:e.message.id,className:"rustic-message-canvas",ref:t,children:[(0,n.jsxs)(j(),{direction:"row",alignItems:"center",spacing:1,children:[e.getProfileComponent&&e.getProfileComponent(e.message),(0,n.jsx)(b,{timestamp:e.message.timestamp})]}),e.getActionsComponent&&e.getActionsComponent(e.message)&&(0,n.jsx)(v(),{variant:"outlined",className:"rustic-message-actions-container",sx:{boxShadow:r.shadows[1]},children:e.getActionsComponent(e.message)}),(0,n.jsx)(v(),{variant:"outlined",className:"rustic-message-container",children:e.children})]})}));var x=function(){return x=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},x.apply(this,arguments)};function O(e,t){var n=t.format.includes("update")?t.threadId:t.id;if(n){var r=x({},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 E(e){var t,r,s,c=(0,i.useRef)(null),u=(0,i.useRef)(null),l=(0,i.useRef)(),m=(0,i.useState)(!0),p=m[0],g=m[1],v=(0,i.useState)(!0),h=v[0],y=v[1],j=(0,i.useState)(!1),b=j[0],x=j[1],E=(0,i.useState)({}),S=E[0],C=E[1],T=Object.keys(S).length,N=(r=T,s=(0,i.useRef)(0),(0,i.useEffect)((function(){s.current=r})),s.current),P=2e3;function R(){y(!0),l.current&&clearTimeout(l.current),l.current=setTimeout((function(){y(!1)}),P)}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;x(!0),e&&setTimeout((function(){R(),e.scrollTop=e.scrollHeight}),0)}else setTimeout(q,1)}function D(e){C((function(t){return O(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)}}),[p]),(0,i.useEffect)((function(){q()}),[b]),(0,i.useEffect)((function(){p&&0!==N&&T>N&&(R(),q())}),[p,Object.keys(S).length]),(0,i.useEffect)((function(){var t,n={};null===(t=e.receivedMessages)||void 0===t||t.forEach((function(e){var t=O(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)(w,{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)})),!p&&!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)(f,{name:"arrow_downward"})]})})]})}E.defaultProps={scrollDownLabel:"Scroll down"};const S=E;return t})()));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import './messageSpace.css';
|
|
2
2
|
import { type MessageContainerProps } from '../messageCanvas/messageCanvas';
|
|
3
|
-
import type { ComponentMap,
|
|
3
|
+
import type { ComponentMap, Message, Sender, WebSocketClient } from '../types';
|
|
4
4
|
export interface MessageSpaceProps extends MessageContainerProps {
|
|
5
5
|
/** WebSocket connection to send and receive messages to and from a backend. This can be useful for component interactions, for example, to send filter conditions, user location, etc. */
|
|
6
6
|
ws: WebSocketClient;
|
|
@@ -8,12 +8,15 @@ export interface MessageSpaceProps extends MessageContainerProps {
|
|
|
8
8
|
sender: Sender;
|
|
9
9
|
/** A component map contains message formats as keys and their corresponding React components as values. */
|
|
10
10
|
supportedElements: ComponentMap;
|
|
11
|
-
messages
|
|
11
|
+
/** Messages received before the component was mounted. These messages are rendered along with new messages received from the websocket. */
|
|
12
|
+
receivedMessages?: Message[];
|
|
12
13
|
/** Text label for scroll down button. Default value is 'scroll down'. */
|
|
13
14
|
scrollDownLabel?: string;
|
|
14
15
|
}
|
|
15
16
|
/**
|
|
16
|
-
The `MessageSpace` component uses `MessageCanvas` and `ElementRenderer` to render a list of messages. It serves as a container for individual message items, each encapsulated within a `MessageCanvas` for consistent styling and layout.
|
|
17
|
+
The `MessageSpace` component uses `MessageCanvas` and `ElementRenderer` to render a list of messages. It serves as a container for individual message items, each encapsulated within a `MessageCanvas` for consistent styling and layout. It can receive and process messages to dynamically update the displayed content.
|
|
18
|
+
|
|
19
|
+
The `MessageSpace` component can combine update messages with the original message and render them as a single message. For this to work, the `threadId` of the update message must match the `id` of the original message, and the format of the update message should be prefixed with 'update'. For example, if the original message format is 'streamingText', the update message format should be 'updateStreamingText'.
|
|
17
20
|
|
|
18
21
|
Note: For more information about the `getActionsComponent` and `getProfileComponent` fields, refer to the [MessageCanvas' docs](http://localhost:6006/?path=/docs/rustic-ui-message-canvas-message-canvas--docs).
|
|
19
22
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messageSpace.d.ts","sourceRoot":"","sources":["../../../src/components/messageSpace/messageSpace.tsx"],"names":[],"mappings":"AAAA,OAAO,oBAAoB,CAAA;AAQ3B,OAAsB,EACpB,KAAK,qBAAqB,EAC3B,MAAM,gCAAgC,CAAA;AACvC,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"messageSpace.d.ts","sourceRoot":"","sources":["../../../src/components/messageSpace/messageSpace.tsx"],"names":[],"mappings":"AAAA,OAAO,oBAAoB,CAAA;AAQ3B,OAAsB,EACpB,KAAK,qBAAqB,EAC3B,MAAM,gCAAgC,CAAA;AACvC,OAAO,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAE9E,MAAM,WAAW,iBAAkB,SAAQ,qBAAqB;IAC9D,0LAA0L;IAC1L,EAAE,EAAE,eAAe,CAAA;IACnB,0GAA0G;IAC1G,MAAM,EAAE,MAAM,CAAA;IACd,2GAA2G;IAC3G,iBAAiB,EAAE,YAAY,CAAA;IAC/B,2IAA2I;IAC3I,gBAAgB,CAAC,EAAE,OAAO,EAAE,CAAA;IAC5B,yEAAyE;IACzE,eAAe,CAAC,EAAE,MAAM,CAAA;CACzB;AA0CD;;;;;;EAME;AAEF,iBAAwB,YAAY,CAAC,KAAK,EAAE,iBAAiB,2CAiK5D;kBAjKuB,YAAY;;;;;eAAZ,YAAY"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type Client } from 'mock-socket';
|
|
2
|
-
import type { MessageData, WebSocketClient } from '
|
|
2
|
+
import type { MessageData, WebSocketClient } from './types';
|
|
3
3
|
export declare function sendMessageToClient(socket: Client, format: string, data: MessageData): void;
|
|
4
4
|
export declare function getMockWebSocketClient(webSocketUrl: string): WebSocketClient;
|
|
5
5
|
//# sourceMappingURL=mockWebSocket.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mockWebSocket.d.ts","sourceRoot":"","sources":["../../src/components/mockWebSocket.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,EAAa,MAAM,aAAa,CAAA;AAGpD,OAAO,KAAK,EAAW,WAAW,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAKpE,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,WAAW,QAalB;AAED,wBAAgB,sBAAsB,CAAC,YAAY,EAAE,MAAM,GAAG,eAAe,CAkC5E"}
|
|
@@ -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,{
|
|
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:()=>I});const t=require("react/jsx-runtime"),n=require("@mui/material/IconButton");var i=e.n(n);const a=require("@mui/material/Tooltip");var s=e.n(a);const o=require("@mui/system/Box");var l=e.n(o);const c=require("react"),u=require("@mui/material/Card");var d=e.n(u);const m=require("@mui/material/Modal");var f=e.n(m);const p=require("@mui/material/styles"),x=require("@mui/material/Typography");var h,v=e.n(x);function j(e){return e.name.replaceAll("_","-"),(0,t.jsx)("span",{className:"".concat(e.className?e.className+" ":"","material-symbols-rounded"),children:e.name})}!function(e){e[e.HOUR=0]="HOUR",e[e.MONTH_DATE=1]="MONTH_DATE"}(h||(h={}));const b=require("@mui/material/Box");var y=e.n(b);const g=require("@mui/material/TextField");var w=e.n(g);const N=require("@mui/material/useMediaQuery");var C=e.n(N);const k=require("@mui/system/Stack");var P=e.n(k);const q=require("@mui/system/useTheme");var S=e.n(q);const O=require("pdfjs-dist"),T=function(e){var r={zoomIn:{symbol:"zoom_in",label:"Zoom in"},zoomOut:{symbol:"zoom_out",label:"Zoom out"},close:{symbol:"close",label:"Close"},previousPage:{symbol:"arrow_back",label:"Previous page"},nextPage:{symbol:"arrow_forward",label:"Next page"}},n=(r[e.action].label.replaceAll(" ","-").toLowerCase(),r[e.action]);return(0,t.jsx)(s(),{title:n.label,children:(0,t.jsx)("span",{children:(0,t.jsx)(i(),{onClick:e.onClick,className:e.className,disabled:e.isDisabled,children:(0,t.jsx)(j,{name:n.symbol})})})})};var _={pdf:function(e){var r,n=(0,c.useRef)(null),i=(0,c.useState)(1),a=i[0],s=i[1],o=(0,c.useState)(1),l=o[0],u=o[1],m=(0,c.useState)(1),f=m[0],p=m[1],x=(0,c.useState)(!1),h=x[0],j=x[1],b=(0,c.useState)(),g=b[0],N=b[1],k=S()(),q=C()(k.breakpoints.down("sm")),_=C()(k.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 q?.5:_?1:1.5})),z=D[0],M=D[1];return(0,c.useEffect)((function(){O.GlobalWorkerOptions.workerSrc||(O.GlobalWorkerOptions.workerSrc="https://cdnjs.cloudflare.com/ajax/libs/pdf.js/".concat(O.version,"/pdf.worker.mjs")),O.getDocument({url:"".concat(e.url)}).promise.then((function(e){u(e.numPages),function(e){e.getPage(a).then((function(e){var r=e.getViewport({scale:z}),t=n.current;if(t){var i=t.getContext("2d");if(i){var a=window.devicePixelRatio||1;t.style.width="".concat(r.width,"px"),t.style.height="".concat(r.height,"px"),t.width=r.width*a,t.height=r.height*a;var s={canvasContext:i,viewport:r,transform:[a,0,0,a,0,0]};g&&g.cancel();var o=e.render(s);N(o),o.promise.then((function(){N(void 0)})).catch((function(e){console.error(e)}))}}}))}(e)})).catch((function(){j(!0)}))}),[e.url,a,z]),h?(0,t.jsx)(d(),{variant:"outlined",className:"rustic-pdf-error",children:(0,t.jsx)(v(),{variant:"body2",children:"Failed to load the PDF file."})}):(0,t.jsxs)(d(),{variant:"outlined",className:"rustic-pdf-viewer",children:[(0,t.jsxs)(y(),{className:"rustic-pdf-viewer-header",children:[(0,t.jsx)(T,{action:"zoomOut",onClick:function(){M((function(e){return Math.max(e-.2,.2)}))}}),(0,t.jsx)(T,{action:"zoomIn",onClick:function(){M((function(e){return e+.2}))}})]}),(0,t.jsx)(y(),{className:"rustic-pdf-viewer-body",children:(0,t.jsx)(y(),{className:"rustic-pdf-viewer-body-inner",children:(0,t.jsx)("canvas",{ref:n})})}),(0,t.jsxs)(P(),{direction:"row",justifyContent:"center",alignItems:"center",gap:1,children:[(0,t.jsx)(T,{action:"previousPage",onClick:function(){a>1&&(s(a-1),p(a-1))},isDisabled:1===a}),(0,t.jsx)(v(),{variant:"body1",className:"rustic-page-indicator",children:"Page"}),(0,t.jsx)(w(),{type:"number",value:f,onChange:function(e){var r=parseInt(e.target.value);p(r),!isNaN(r)&&r>=1&&r<=l&&s(r)},size:"small",className:"rustic-pdf-page-input"}),(0,t.jsxs)(v(),{variant:"body1",className:"rustic-page-indicator",children:["of ",l]}),(0,t.jsx)(T,{action:"nextPage",onClick:function(){a<l&&(s(a+1),p(a+1))},isDisabled:a===l})]})]})}};function D(e){var r=(0,p.useTheme)(),n=(0,c.useState)(!1),a=n[0],o=n[1];function l(){o(!1)}var u,m,x=e.file.url&&(u=e.file.url.split("."))[u.length-1].toLowerCase(),h=x&&e.supportedViewers?e.supportedViewers[x]:null,b=!!h;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(d(),{className:"rustic-file-preview".concat(b?" rustic-cursor-pointer":""),variant:"outlined",sx:{boxShadow:r.shadows[1]},onClick:function(){o(!0)},children:[(0,t.jsx)(v(),{variant:"subtitle2",children:(m=e.file.name,15,m.length<=15?m:m.substring(0,12)+"...")}),(0,t.jsx)("div",{onClick:function(e){return e.stopPropagation()},children:e.children})]}),b&&(0,t.jsx)(f(),{open:a,onClose:l,className:"rustic-file-preview-modal",children:(0,t.jsxs)("div",{className:"rustic-modal-content",children:[(0,t.jsx)(s(),{title:"Close",children:(0,t.jsx)(i(),{onClick:l,className:"rustic-close-button",children:(0,t.jsx)(j,{name:"close"})})}),e.file.url&&(0,t.jsx)(h,{url:e.file.url})]})})]})}D.defaultProps={supportedViewers:_};const z=require("dompurify");var M=e.n(z);const F=function(e){return(0,t.jsx)(v(),{variant:"body2",className:"rustic-text",children:M().sanitize(e.text)})},I=function(e){return(0,t.jsxs)(l(),{className:"rustic-multipart",children:[e.text&&(0,t.jsx)(F,{text:e.text}),(r=e.files.map((function(e,r){return(0,t.jsx)(D,{file:e,children:e.url&&(0,t.jsx)(s(),{title:"Download",children:(0,t.jsx)(i(),{component:"a",href:e.url,download:e.name,children:(0,t.jsx)(j,{name:"download"})})})},r)})),(0,t.jsx)(l(),{className:"rustic-files",children:r}))]});var r};return r})()));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import '../../index.css';
|
|
2
2
|
import './multipart.css';
|
|
3
|
-
import type {
|
|
3
|
+
import type { MultipartProps } from '../types';
|
|
4
4
|
/** The `Multipart` component is a versatile message format designed to accommodate both textual content and file attachments within a single message interface. */
|
|
5
|
-
export default function Multipart(props:
|
|
5
|
+
export default function Multipart(props: MultipartProps): import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
//# sourceMappingURL=multipart.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"multipart.d.ts","sourceRoot":"","sources":["../../../src/components/multipart/multipart.tsx"],"names":[],"mappings":"AAAA,OAAO,iBAAiB,CAAA;AACxB,OAAO,iBAAiB,CAAA;AAUxB,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"multipart.d.ts","sourceRoot":"","sources":["../../../src/components/multipart/multipart.tsx"],"names":[],"mappings":"AAAA,OAAO,iBAAiB,CAAA;AACxB,OAAO,iBAAiB,CAAA;AAUxB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAE9C,mKAAmK;AACnK,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,KAAK,EAAE,cAAc,2CA8BtD"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import './participantsContainer.css';
|
|
2
|
-
import ParticipantsContainer from './participantsContainer';
|
|
2
|
+
import ParticipantsContainer, { type Participant, ParticipantRole, ParticipantType } from './participantsContainer';
|
|
3
3
|
export default ParticipantsContainer;
|
|
4
|
+
export { type Participant, ParticipantRole, ParticipantType };
|
|
4
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/participantsContainer/index.ts"],"names":[],"mappings":"AAAA,OAAO,6BAA6B,CAAA;AAEpC,OAAO,qBAAqB,MAAM,yBAAyB,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/participantsContainer/index.ts"],"names":[],"mappings":"AAAA,OAAO,6BAA6B,CAAA;AAEpC,OAAO,qBAAqB,EAAE,EAC5B,KAAK,WAAW,EAChB,eAAe,EACf,eAAe,EAChB,MAAM,yBAAyB,CAAA;AAEhC,eAAe,qBAAqB,CAAA;AAEpC,OAAO,EAAE,KAAK,WAAW,EAAE,eAAe,EAAE,eAAe,EAAE,CAAA"}
|
|
@@ -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
|
|
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:()=>q,ParticipantType:()=>_,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 p=require("@mui/material/Divider");var l=t.n(p);const u=require("@mui/material/List");var m=t.n(u);const d=require("@mui/material/ListItem");var y=t.n(d);const f=require("@mui/material/ListSubheader");var h=t.n(f);const x=require("@mui/material/Typography");var j=t.n(x);const v=require("@mui/system"),b=require("pluralize");var g=t.n(b);const T=require("react");var N;function O(t){return t.name.replaceAll("_","-"),(0,r.jsx)("span",{className:"".concat(t.className?t.className+" ":"","material-symbols-rounded"),children:t.name})}!function(t){t[t.HOUR=0]="HOUR",t[t.MONTH_DATE=1]="MONTH_DATE"}(N||(N={}));var q,_;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,")"),p=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)(v.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)(O,{name:"keyboard_arrow_down"}),children:p})]}),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===q.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"}(q||(q={})),function(t){t.Human="human",t.Agent="agent"}(_||(_={}));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===q.Owner?1:-1}))}(t.filter((function(t){return t.participantType===e})))}var a=e(t.participants,_.Human),i=e(t.participants,_.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)(O,{name:"account_circle"}),participants:a}),i.length>0&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(l(),{className:"rustic-participants-container-divider"}),(0,r.jsx)(A,{participantType:"Agent",participantTypeIcon:(0,r.jsx)(O,{name:"smart_toy"}),participants:i})]})]})};return e})()));
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import './participantsContainer.css';
|
|
2
|
-
import { type Participant } from '../types';
|
|
3
2
|
export interface ParticipantsContainerProps {
|
|
4
3
|
participants: Participant[];
|
|
5
4
|
/** Boolean that dictates the open/closed state of the participants modal. */
|
|
@@ -7,6 +6,20 @@ export interface ParticipantsContainerProps {
|
|
|
7
6
|
/** Callback function to close the participants modal. */
|
|
8
7
|
onClose: () => void;
|
|
9
8
|
}
|
|
9
|
+
export declare enum ParticipantRole {
|
|
10
|
+
Owner = "owner",
|
|
11
|
+
Member = "member"
|
|
12
|
+
}
|
|
13
|
+
export declare enum ParticipantType {
|
|
14
|
+
Human = "human",
|
|
15
|
+
Agent = "agent"
|
|
16
|
+
}
|
|
17
|
+
export interface Participant {
|
|
18
|
+
id: string;
|
|
19
|
+
displayName: string;
|
|
20
|
+
participantRole: ParticipantRole;
|
|
21
|
+
participantType: ParticipantType;
|
|
22
|
+
}
|
|
10
23
|
/** The `ParticipantsContainer` component is responsible for displaying a list of participants within a dialog window. It organizes participants into separate lists based on their type (human or agent) and provides options to toggle between showing a subset of participants and displaying the full list. This component enhances the user experience by presenting participant information in a structured format and allowing users to view additional details as needed.
|
|
11
24
|
*
|
|
12
25
|
* Note: The component does not include the button displayed to toggle between the two views. This button is typically implemented in the parent component that uses the `ParticipantsContainer` component. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"participantsContainer.d.ts","sourceRoot":"","sources":["../../../src/components/participantsContainer/participantsContainer.tsx"],"names":[],"mappings":"AAAA,OAAO,6BAA6B,CAAA;
|
|
1
|
+
{"version":3,"file":"participantsContainer.d.ts","sourceRoot":"","sources":["../../../src/components/participantsContainer/participantsContainer.tsx"],"names":[],"mappings":"AAAA,OAAO,6BAA6B,CAAA;AAmBpC,MAAM,WAAW,0BAA0B;IACzC,YAAY,EAAE,WAAW,EAAE,CAAA;IAC3B,6EAA6E;IAC7E,qBAAqB,EAAE,OAAO,CAAA;IAC9B,yDAAyD;IACzD,OAAO,EAAE,MAAM,IAAI,CAAA;CACpB;AAED,oBAAY,eAAe;IACzB,KAAK,UAAU;IACf,MAAM,WAAW;CAClB;AAED,oBAAY,eAAe;IACzB,KAAK,UAAU;IACf,KAAK,UAAU;CAChB;AAED,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAA;IACV,WAAW,EAAE,MAAM,CAAA;IACnB,eAAe,EAAE,eAAe,CAAA;IAChC,eAAe,EAAE,eAAe,CAAA;CACjC;AA+FD;;8MAE8M;AAC9M,iBAAS,qBAAqB,CAAC,KAAK,EAAE,0BAA0B,2CAyE/D;AAED,eAAe,qBAAqB,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
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["@rustic-ai/ui-components"]=t():e["@rustic-ai/ui-components"]=t()}(global,(()=>(()=>{"use strict";var e={n:t=>{var r=t&&t.__esModule?()=>t.default:()=>t;return e.d(r,{a:r}),r},d:(t,r)=>{for(var a in r)e.o(r,a)&&!e.o(t,a)&&Object.defineProperty(t,a,{enumerable:!0,get:r[a]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{default:()=>P});const r=require("react/jsx-runtime"),a=require("@mui/material/Box");var n=e.n(a);const o=require("@mui/material/Card");var i=e.n(o);const s=require("@mui/material/TextField");var c=e.n(s);const l=require("@mui/material/Typography");var u=e.n(l);const d=require("@mui/material/useMediaQuery");var m=e.n(d);const f=require("@mui/system/Stack");var p=e.n(f);const v=require("@mui/system/useTheme");var b=e.n(v);const h=require("pdfjs-dist"),x=require("react"),j=require("@mui/material/IconButton");var y=e.n(j);const g=require("@mui/material/Tooltip");var w=e.n(g);function N(e){return e.name.replaceAll("_","-"),(0,r.jsx)("span",{className:"".concat(e.className?e.className+" ":"","material-symbols-rounded"),children:e.name})}const 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"}},a=(t[e.action].label.replaceAll(" ","-").toLowerCase(),t[e.action]);return(0,r.jsx)(w(),{title:a.label,children:(0,r.jsx)("span",{children:(0,r.jsx)(y(),{onClick:e.onClick,className:e.className,disabled:e.isDisabled,children:(0,r.jsx)(N,{name:a.symbol})})})})},P=function(e){var t,a=(0,x.useRef)(null),o=(0,x.useState)(1),s=o[0],l=o[1],d=(0,x.useState)(1),f=d[0],v=d[1],j=(0,x.useState)(1),y=j[0],g=j[1],w=(0,x.useState)(!1),N=w[0],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=a.current;if(r){var n=r.getContext("2d");if(n){var o=window.devicePixelRatio||1;r.style.width="".concat(t.width,"px"),r.style.height="".concat(t.height,"px"),r.width=t.width*o,r.height=t.height*o;var i={canvasContext:n,viewport:t,transform:[o,0,0,o,0,0]};C&&C.cancel();var s=e.render(i);q(s),s.promise.then((function(){q(void 0)})).catch((function(e){console.error(e)}))}}}))}(e)})).catch((function(){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)(n(),{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)(n(),{className:"rustic-pdf-viewer-body",children:(0,r.jsx)(n(),{className:"rustic-pdf-viewer-body-inner",children:(0,r.jsx)("canvas",{ref:a})})}),(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:y,onChange:function(e){var t=parseInt(e.target.value);g(t),!isNaN(t)&&t>=1&&t<=f&&l(t)},size:"small",className:"rustic-pdf-page-input"}),(0,r.jsxs)(u(),{variant:"body1",className:"rustic-page-indicator",children:["of ",f]}),(0,r.jsx)(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,{
|
|
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:()=>D});const t=require("react/jsx-runtime"),n=require("@mui/material/Button");var i=e.n(n);const s=require("@mui/material/Card");var a=e.n(s);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 x=e.n(g);const b=require("@mui/material/DialogTitle");var h=e.n(b);const v=require("@mui/material/Divider");var j=e.n(v);const y=require("@mui/material/Typography");var q=e.n(y);const S=require("@mui/system"),w=require("react");var 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 P=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]})})};function O(e){return e.name.replaceAll("_","-"),(0,t.jsx)("span",{className:"".concat(e.className?e.className+" ":"","material-symbols-rounded"),children:e.name})}var B=function(){return B=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},B.apply(this,arguments)},I=function(e,r,t){if(t||2===arguments.length)for(var n,i=0,s=r.length;i<s;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 D=function(e){var r=(0,w.useState)(!1),n=r[0],s=r[1],o=(0,w.useState)(!1),c=o[0],d=o[1],p=(0,w.useState)(!1),g=p[0],b=p[1],v=(0,w.useState)(!1),y=v[0],C=v[1],N=(0,w.useState)([]),D=N[0],A=N[1],E=(0,w.useState)(null),T=E[0],_=E[1],k=(0,S.useTheme)(),M=D[D.length-1],Q=B(B({},e.ws),{send:function(e){_(e)}});function F(e){A((function(r){return I(I([],r,!0),[e],!1)}))}function R(){if(T){var r=B(B({},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(){D.length>0&&(M&&M.sender.id!==e.sender.id&&d(!1),"promptBuilder"===M.format&&M.data.isLastQuestion&&s(!0))}),[D.length]),0!==D.length)return(0,t.jsxs)(a(),{variant:"outlined",className:"rustic-prompt-builder",children:[(0,t.jsxs)(u(),{open:g,onClose:function(){return b(!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)(h(),{id:"quit-dialog-title",className:"rustic-align-self-center",children:"Are you sure?"}),(0,t.jsx)(j(),{}),(0,t.jsx)(f(),{children:(0,t.jsx)(x(),{id:"quit-dialog-description",className:"rustic-align-self-center",children:"All progress will be lost."})}),(0,t.jsxs)(m(),{className:"rustic-prompt-builder-dialog-buttons",disableSpacing:!0,children:[(0,t.jsx)(i(),{variant:"rusticSecondary",startIcon:(0,t.jsx)(O,{name:"close"}),onClick:function(){b(!1),e.onCancel()},children:"Quit"}),(0,t.jsx)(i(),{variant:"rusticPrimary",onClick:function(){return b(!1)},children:"Continue build"})]})]}),e.getProfileComponent?e.getProfileComponent(D[0]):(0,t.jsx)(q(),{color:"text.secondary",children:"Prompt Builder"}),(0,t.jsx)(j(),{className:"rustic-prompt-builder-divider"}),(0,t.jsxs)(S.Box,{className:"rustic-prompt-builder-questions",children:[function(){if(!y&&D.length>0)return D.map((function(r){if(r.sender.id!==e.sender.id&&"promptBuilder"!==r.format)return(0,t.jsx)(P,{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:!y&&(0,t.jsxs)(S.Box,{className:"rustic-prompt-builder-buttons",children:[(0,t.jsxs)(S.Box,{className:"rustic-prompt-builder-buttons-left",children:[(0,t.jsx)(i(),{variant:"rusticSecondary",startIcon:(0,t.jsx)(O,{name:"close"}),onClick:function(){return b(!0)},children:"Quit"}),(0,t.jsx)(i(),{variant:"rusticSecondary",endIcon:(0,t.jsx)(O,{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
|
-
{"version":3,"file":"promptBuilder.d.ts","sourceRoot":"","sources":["../../../src/components/promptBuilder/promptBuilder.tsx"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAA;AAC5B,OAAO,iBAAiB,CAAA;AAiBxB,OAAO,KAAK,EAAW,kBAAkB,EAAE,MAAM,UAAU,CAAA;AAE3D;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,KAAK,EAAE,kBAAkB,
|
|
1
|
+
{"version":3,"file":"promptBuilder.d.ts","sourceRoot":"","sources":["../../../src/components/promptBuilder/promptBuilder.tsx"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAA;AAC5B,OAAO,iBAAiB,CAAA;AAiBxB,OAAO,KAAK,EAAW,kBAAkB,EAAE,MAAM,UAAU,CAAA;AAE3D;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,KAAK,EAAE,kBAAkB,uDAqP9D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["@rustic-ai/ui-components"]=t():e["@rustic-ai/ui-components"]=t()}(global,(()=>(()=>{"use strict";var e={n:t=>{var r=t&&t.__esModule?()=>t.default:()=>t;return e.d(r,{a:r}),r},d:(t,r)=>{for(var i in r)e.o(r,i)&&!e.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:r[i]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["@rustic-ai/ui-components"]=t():e["@rustic-ai/ui-components"]=t()}(global,(()=>(()=>{"use strict";var e={n:t=>{var r=t&&t.__esModule?()=>t.default:()=>t;return e.d(r,{a:r}),r},d:(t,r)=>{for(var i in r)e.o(r,i)&&!e.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:r[i]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{default:()=>f});const r=require("react/jsx-runtime"),i=require("@mui/material"),o=require("@mui/material/Box");var n=e.n(o);const a=require("@mui/material/Chip");var s=e.n(a);const u=require("@mui/material/Stack");var c=e.n(u);const l=require("@mui/material/Typography");var d=e.n(l);const m=require("react"),p=require("uuid"),f=function(e){var t=(0,m.useState)(""),o=t[0],a=t[1],u=(0,i.useTheme)(),l=(0,i.useMediaQuery)(u.breakpoints.down("md"))?"column":"row",f=e.options.map((function(t,i){return(0,r.jsx)(s(),{onClick:function(){return function(t){a(t);var r=(new Date).toISOString(),i={id:(0,p.v4)(),timestamp:r,sender:e.sender,conversationId:e.conversationId,format:"text",data:{text:t},inReplyTo:e.messageId};e.ws.send(i)}(t)},variant:"rusticSecondary",size:"small",sx:o===t?{"&.Mui-disabled":{backgroundColor:"secondary.light",color:"text.primary"}}:{},className:"rustic-option",disabled:!!o,"aria-disabled":!!o,label:t},i)}));return(0,r.jsxs)(n(),{className:"rustic-question",children:[(e.title||e.description)&&(0,r.jsxs)(n(),{className:"rustic-question-text",children:[e.title&&(0,r.jsx)(d(),{variant:"subtitle2",className:"rustic-title",children:e.title}),e.description&&(0,r.jsx)(d(),{variant:"caption",children:e.description})]}),(0,r.jsx)(c(),{direction:l,className:"rustic-options-container",children:f})]})};return t})()));
|
|
@@ -1 +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,{
|
|
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:()=>D});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 s=e.n(c);const o=require("@mui/material/TableBody");var l=e.n(o);const u=require("@mui/material/TableCell");var d=e.n(u);const m=require("@mui/material/TableContainer");var b=e.n(m);const p=require("@mui/material/TableHead");var f=e.n(p);const y=require("@mui/material/TablePagination");var g=e.n(y);const h=require("@mui/material/TableRow");var j=e.n(h);const v=require("@mui/material/TableSortLabel");var x=e.n(v);const T=require("@mui/material/Tooltip");var O=e.n(T);const q=require("@mui/material/Typography");var P=e.n(q);const S=require("react");var w,N;function k(e){return e.name.replaceAll("_","-"),(0,t.jsx)("span",{className:"".concat(e.className?e.className+" ":"","material-symbols-rounded"),children:e.name})}function A(){return(0,t.jsx)(k,{name:"expand_all"})}!function(e){e[e.HOUR=0]="HOUR",e[e.MONTH_DATE=1]="MONTH_DATE"}(w||(w={})),function(e){e.Ascending="asc",e.Descending="desc"}(N||(N={}));const D=function(e){if(0===e.data.length)return(0,t.jsx)(P(),{variant:"body2",children:"No data available"});var a,n,c,o=e.data.length>10,u=(0,S.useState)({}),m=u[0],p=u[1],y=(0,S.useState)(o?10:-1),h=y[0],v=y[1],T=(0,S.useState)(0),q=T[0],w=T[1],k=(0,r.useTheme)(),D=Array.from(new Set(e.data.flatMap((function(e){return Object.keys(e)})))),K=e.headers||D.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 A}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)(s(),{"aria-label":e.title||"a table of data",size:"small",stickyHeader:!0,children:[K.length>0&&(0,t.jsx)(f(),{children:(0,t.jsx)(j(),{children:K.map((function(e,a){return(0,t.jsx)(d(),{sortDirection:m[e.dataKey]||!1,children:(0,t.jsx)(O(),{title:(n=e.dataKey,i=m[n],i?Object.keys(N)[Object.values(N).indexOf(i)]:"Sort"),children:(0,t.jsx)(x(),{active:!0,direction:m[e.dataKey],onClick:function(){return function(e){p((function(a){var t,r,n={};switch(a[e]){case N.Ascending:(t={})[e]=N.Descending,n=t;break;case N.Descending:n={};break;default:(r={})[e]=N.Ascending,n=r}return n}))}(e.dataKey)},className:"rustic-table-header",IconComponent: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)(j(),{children:K.map((function(r,n){return(0,t.jsx)(d(),{children:e[r.dataKey]},"cell-".concat(a,"-").concat(n))}))},"row-".concat(a))}))})]})}),o&&(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 w(a)},onRowsPerPageChange:function(e){v(+e.target.value),w(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})()));
|
|
@@ -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 a in r)e.o(r,a)&&!e.o(t,a)&&Object.defineProperty(t,a,{enumerable:!0,get:r[a]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{StreamingText:()=>c,Text:()=>f,default:()=>l});const r=require("react/jsx-runtime"),a=require("@mui/material/Alert");var o=e.n(a);const n=require("@mui/material/Typography");var i=e.n(n);const u=require("dompurify");var s=e.n(u);const d=require("react"),c=function(e){var t=(0,d.useState)(s().sanitize(e.text)),a=t[0],n=t[1],u=(0,d.useState)(""),c=u[0],f=u[1];return(0,d.useEffect)((function(){if(e.updatedData&&e.updatedData.length>0){for(var t=e.text,r=0,a=e.updatedData;r<a.length;r++){var o=a[r];"string"!=typeof o.text&&(t+=" [MISSING TEXT]",f("Some of the incoming text was not correctly formatted. Some data may be missing.")),t+=o.text}n(s().sanitize(t))}}),[e.text,e.updatedData]),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(i(),{variant:"body2",children:a}),c&&(0,r.jsx)(o(),{severity:"error",children:c})]})},f=function(e){return(0,r.jsx)(i(),{variant:"body2",className:"rustic-text",children:s().sanitize(e.text)})},l=f;return t})()));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/timestamp/index.
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/timestamp/index.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,aAAa,CAAA;AAEnC,eAAe,SAAS,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["@rustic-ai/ui-components"]=t():e["@rustic-ai/ui-components"]=t()}(global,(()=>(()=>{"use strict";var e={n:t=>{var r=t&&t.__esModule?()=>t.default:()=>t;return e.d(r,{a:r}),r},d:(t,r)=>{for(var o in r)e.o(r,o)&&!e.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:r[o]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{default:()=>i});const r=require("react/jsx-runtime"),o=require("@mui/material/Typography");var n,a=e.n(o);require("react"),function(e){e[e.HOUR=0]="HOUR",e[e.MONTH_DATE=1]="MONTH_DATE"}(n||(n={}));const i=function(e){return(0,r.jsx)(a(),{variant:"caption",color:"text.secondary",className:"rustic-timestamp",children:(t=e.timestamp,o=new Date(t),n=navigator.language,i={month:"short",day:"numeric"},u=new Date,c=o.getFullYear()!==u.getFullYear(),l=c?" at ":", ",c&&(i.year="numeric"),o.toLocaleDateString(n,i)+l+o.toLocaleTimeString(n,{hour:"numeric",minute:"2-digit",hour12:!0}))});var t,o,n,i,u,c,l};return t})()));
|
|
@@ -23,10 +23,6 @@ export interface Message {
|
|
|
23
23
|
taggedParticipants?: string[];
|
|
24
24
|
topic?: string;
|
|
25
25
|
}
|
|
26
|
-
export interface ThreadableMessage extends Message {
|
|
27
|
-
lastThreadMessage?: Message;
|
|
28
|
-
threadMessagesData?: MessageData[];
|
|
29
|
-
}
|
|
30
26
|
export interface ComponentMap {
|
|
31
27
|
[key: string]: React.ComponentType<any>;
|
|
32
28
|
}
|
|
@@ -34,21 +30,7 @@ export interface WebSocketClient {
|
|
|
34
30
|
send: (message: Message) => void;
|
|
35
31
|
close: () => void;
|
|
36
32
|
reconnect: () => void;
|
|
37
|
-
onReceive?: (handler: (
|
|
38
|
-
}
|
|
39
|
-
export declare enum ParticipantRole {
|
|
40
|
-
Owner = "owner",
|
|
41
|
-
Member = "member"
|
|
42
|
-
}
|
|
43
|
-
export declare enum ParticipantType {
|
|
44
|
-
Human = "human",
|
|
45
|
-
Agent = "agent"
|
|
46
|
-
}
|
|
47
|
-
export interface Participant {
|
|
48
|
-
id: string;
|
|
49
|
-
displayName: string;
|
|
50
|
-
participantRole: ParticipantRole;
|
|
51
|
-
participantType: ParticipantType;
|
|
33
|
+
onReceive?: (handler: (message: Message) => void) => void;
|
|
52
34
|
}
|
|
53
35
|
export interface DataFormat {
|
|
54
36
|
/** Optional title. */
|
|
@@ -170,6 +152,9 @@ export interface MultipartFormat extends DataFormat {
|
|
|
170
152
|
files: FileData[];
|
|
171
153
|
/** Text content sent along with the files. */
|
|
172
154
|
text?: string;
|
|
155
|
+
}
|
|
156
|
+
export type MultipartData = MultipartFormat & Updates<MultipartFormat>;
|
|
157
|
+
export interface MultipartProps extends MultipartData {
|
|
173
158
|
/**
|
|
174
159
|
* An object mapping file extensions to their respective viewer components.
|
|
175
160
|
* Each key represents a file type (e.g., 'pdf', 'jpg'), and the corresponding value is a React component
|
|
@@ -182,7 +167,6 @@ export interface MultipartFormat extends DataFormat {
|
|
|
182
167
|
}>;
|
|
183
168
|
};
|
|
184
169
|
}
|
|
185
|
-
export type MultipartData = MultipartFormat & Updates<MultipartFormat>;
|
|
186
170
|
export interface BaseInputProps {
|
|
187
171
|
/** Current user. */
|
|
188
172
|
sender: Sender;
|