sage-nexus-ui 1.14.7 → 1.14.9
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/NexusChat/AgentChatWindow.mjs +1 -1
- package/dist/components/NexusChat/ChatComponents/MessageBubble.mjs +1 -1
- package/dist/components/NexusChat/ChatComponents/MessageList.mjs +1 -1
- package/dist/components/NexusChat/ChatComponents/StreamingBubble.mjs +1 -1
- package/dist/components/NexusChat/ChatHistoryButtonBase.mjs +1 -1
- package/dist/components/NexusChat/NexusChatDialog.mjs +1 -1
- package/dist/components/SideBlade.mjs +1 -1
- package/dist/generated/version.mjs +1 -1
- package/dist/index.d.ts +5 -18
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as i,jsxs as e,Fragment as t}from"react/jsx-runtime";import{Box as o}from"../Box.mjs";import{Stack as r}from"../Stack.mjs";import{Caption as
|
|
1
|
+
import{jsx as i,jsxs as e,Fragment as t}from"react/jsx-runtime";import{Box as o}from"../Box.mjs";import{Stack as r}from"../Stack.mjs";import{Caption as n}from"../Typography.mjs";import{GlassPaper as m}from"../GlassPaper.mjs";import{Paper as s}from"../Paper.mjs";import{ChatInput as l}from"./ChatInput.mjs";import"./ChatComponents/ChatAvatar.mjs";import"react";import"../Code.mjs";import"@mui/icons-material/ExpandMore";import"@mui/icons-material/ExpandLess";import"@mui/icons-material/Download";import"@mui/material";import"../../theme/tokens.mjs";import"@mui/icons-material/CheckCircle";import"@mui/icons-material/OpenInNew";import"@mui/material/styles";import"@mui/icons-material/ThumbUp";import"@mui/icons-material/ThumbDown";import"@mui/icons-material/ContentCopy";import"@mui/icons-material/Check";import"@mui/icons-material/StopCircle";import p from"./ChatComponents/SuggestedPrompts.mjs";import{AgentChatWindowHeader as a}from"./AgentChatWindowHeader.mjs";const c=({title:c="Nexus AI Chat",subtitle:d="Your intelligent assistant",showAiChip:h=!0,headerActions:u,body:x,followUpLabel:f="Suggested follow-ups:",followUpPrompts:C,onSelectFollowUp:b,onSend:g,inputDisabled:y=!1,inputPlaceholder:w="Ask me anything...",isStreaming:j=!1,onStop:S,inputActions:A,inputRef:k,isEmpty:D=!1,sx:I})=>{const P=Boolean(C&&C.length>0&&b),R=i(l,{onSend:g,disabled:y,placeholder:w,isStreaming:j,onStop:S,actions:A,inputRef:k});return e(o,{sx:[{display:"flex",flex:1,flexDirection:"column",minWidth:0,minHeight:0,height:"100%"},...Array.isArray(I)?I:I?[I]:[]],children:[i(a,{title:c,subtitle:d,showAiChip:h,actions:u}),D?i(s,{sx:{borderRadius:0,border:"none",flex:1,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",px:2,pb:4},children:e(m,{sx:{width:"60%",px:4,py:12,textAlign:"center"},children:[x,i(o,{sx:{mt:3,width:"100%",minWidth:"min(40vw, 100%)"},children:R})]})}):e(t,{children:[i(s,{sx:{borderRadius:0,border:"none",flex:1,display:"flex",flexDirection:"column",overflowY:"scroll"},children:x}),P&&e(r,{direction:{xs:"column",md:"row"},spacing:1,sx:{px:2,py:1,justifyContent:{xs:"center",sm:"flex-end"},alignItems:"center"},children:[i(n,{sx:{display:"block",mb:1},children:f}),i(p,{prompts:C??[],onSelect:b})]}),i(s,{sx:{borderRadius:0,border:"none"},children:i(o,{sx:{p:2,flexShrink:0},children:R})})]})]})};export{c as AgentChatWindow};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{jsx as e,jsxs as o}from"react/jsx-runtime";import{useState as r}from"react";import t from"@mui/icons-material/ExpandMore";import n from"@mui/icons-material/ExpandLess";import i from"@mui/icons-material/Download";import a from"../AgentActivity/AgentActivity.mjs";import{Box as l}from"../../Box.mjs";import{Stack as c}from"../../Stack.mjs";import{IconButton as m}from"../../IconButton.mjs";import{SecondaryButton as s}from"../../SecondaryButton.mjs";import d from"./MarkdownContent.mjs";import p from"./MessageFeedbackBar.mjs";import{colours as f}from"../../../theme/tokens.mjs";const u=({block:i})=>{const[a,c]=r(!1),s=i.language?.trim()||"text",d=i.content||"";if(!d.trim())return null;const p=Boolean(i.title);return o(l,{sx:{border:"1px solid",borderColor:"divider",borderRadius:1.5,overflow:"hidden",mb:1,"&:last-child":{mb:0}},children:[p&&o(l,{onClick:()=>c(e=>!e),sx:{display:"flex",justifyContent:"space-between",alignItems:"center",px:1.5,py:.75,bgcolor:"action.hover",borderBottom:a?"1px solid":"none",borderColor:"divider",cursor:"pointer",userSelect:"none"},children:[e(l,{component:"span",sx:{fontSize:"0.8rem",fontWeight:600,color:"text.secondary"},children:i.title}),e(m,{size:"small",ariaLabel:a?"Collapse":"Expand",children:e(a?n:t,{sx:{fontSize:16}})})]}),(!p||a)&&e(l,{component:"pre",sx:{m:0,p:1.5,overflowX:"auto",whiteSpace:"pre-wrap",wordBreak:"break-word",fontSize:"0.8125rem",fontFamily:'"SFMono-Regular", "Consolas", "Liberation Mono", "Menlo", monospace',lineHeight:1.5,bgcolor:"action.hover"},children:e(l,{component:"code",className:`language-${s}`,children:d})})]})},g=({file:o,onDownloadFile:t})=>{const[n,a]=r(!1);return e(s,{size:"small",startIcon:e(i,{}),onClick:async()=>{if(t){a(!0);try{await t(o)}finally{a(!1)}}},disabled:n||!t,children:n?"Preparing…":o.downloadLabel||o.displayName||"Download file"})},h=(o,r)=>{const t=r?.trim();if(!t)return o;const n=new RegExp(`(${(e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"))(t)})`,"ig");return o.split(n).map((o,r)=>{if(!o)return null;return o.toLowerCase()===t.toLowerCase()?e(l,{component:"mark",sx:{backgroundColor:e=>"dark"===e.palette.mode?"rgba(255, 214, 10, 0.35)":"rgba(255, 214, 10, 0.45)",color:"inherit",borderRadius:.5,px:.25,py:0},children:o},`${o}-${r}`):o})},x=({message:r,highlightQuery:t,showActivity:n=!1,onFeedback:i,onDownloadFile:m,contentRenderer:s,markdownComponents:x})=>{const b="user"===r.role,y=!b&&r.codeBlocks&&r.codeBlocks.length>0,w=!b&&r.files&&r.files.length>0;return e(l,{sx:{display:"flex",justifyContent:b?"flex-end":"flex-start"},children:o(l,{sx:{display:"flex",flexDirection:"column",gap:1,minWidth:0,...b?{}:{flex:1}},children:[o(l,{sx:{borderRadius:b?"1rem 0.25rem 1rem 1rem":"0.25rem 1rem 1rem 1rem",px:1.75,py:1.25,bgcolor:b?f.jadeLight:"background.default",color:b?f.black:"text.primary",border:"none",whiteSpace:b?"pre-wrap":"normal",lineHeight:1.6},children:[y&&e(c,{spacing:0,sx:{mb:1.5},children:r.codeBlocks.map((o,r)=>e(u,{block:o},r))}),b?h(r.content,t):s?s(r.content):e(d,{content:r.content,highlightQuery:t,components:x}),w&&e(c,{direction:"row",spacing:1,sx:{mt:1.5,flexWrap:"wrap"},children:r.files.map((o,r)=>e(g,{file:o,onDownloadFile:m},`${o.bucket}-${o.key}-${r}`))})]}),!b&&n&&r.traceEvents&&r.traceEvents.length>0&&e(a,{isStreaming:!1,traceEvents:r.traceEvents,latency:r.latency,activitySummary:r.activitySummary,compact:!0}),!b&&i&&e(p,{message:r,onFeedback:i})]})})};export{x as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as r,jsx as t}from"react/jsx-runtime";import{useRef as e,useEffect as o}from"react";import{Box as n}from"../../Box.mjs";import i from"./MessageBubble.mjs";import l from"./StreamingBubble.mjs";import
|
|
1
|
+
import{jsxs as r,jsx as t}from"react/jsx-runtime";import{useRef as e,useEffect as o}from"react";import{Box as n}from"../../Box.mjs";import i from"./MessageBubble.mjs";import l from"./StreamingBubble.mjs";import s from"./TypingIndicator.mjs";import{latestTraceLabel as c}from"./latestTraceLabel.mjs";const m=({messages:m,isTyping:u,streamingText:g,liveTraceEvents:a,highlightQuery:h,onAbort:p,showActivity:f=!1})=>{const x=e(null),y=e(null),b=e(!1),v=e(m.length),T=e(!1),d=()=>{const r=y.current;r&&(T.current=!0,r.scrollTop=r.scrollHeight,requestAnimationFrame(()=>{T.current=!1}))};o(()=>{const r=m[m.length-1];m.length>v.current&&"user"===r?.role&&(b.current=!1,d()),v.current=m.length},[m]),o(()=>{b.current||d()},[u,g]);const j=(g||"").trim().length>0,A=u&&j,w=u&&!A;return r(n,{ref:y,onScroll:()=>{T.current||(b.current=!(()=>{const r=y.current;return!r||r.scrollHeight-r.scrollTop-r.clientHeight<80})())},sx:{flex:1,minHeight:0,overflowY:"auto",display:"flex",flexDirection:"column",gap:1.5,px:2,py:1.5},children:[m.filter(r=>"user"===r.role||r.content).map(r=>t(i,{message:r,highlightQuery:h,showActivity:f},r.id)),A&&t(l,{text:g||"",traceEvents:a||[],highlightQuery:h,onAbort:p,showActivity:f}),w&&t(s,{traceLabel:a&&a.length>0?c(a):void 0}),t(n,{ref:x})]})};export{m as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as
|
|
1
|
+
import{jsxs as t,jsx as i}from"react/jsx-runtime";import e from"@mui/icons-material/StopCircle";import r from"../AgentActivity/AgentActivity.mjs";import{Box as o}from"../../Box.mjs";import{Stack as n}from"../../Stack.mjs";import{ButtonBase as a}from"../../ButtonBase.mjs";import{Caption as s}from"../../Typography.mjs";import{NexusLogoNodeSvg as m}from"../../NexusLogoNode.mjs";import c from"./MarkdownContent.mjs";import{latestTraceLabel as l}from"./latestTraceLabel.mjs";const p=({text:p,traceEvents:g,highlightQuery:d,avatarIcon:f,onAbort:x,showActivity:h=!1})=>t(n,{direction:"row",spacing:1,sx:{justifyContent:"flex-start"},children:[i(o,{sx:{mt:.25,flexShrink:0},children:f??i(m,{size:28})}),t(n,{spacing:1,children:[p?t(o,{sx:{bgcolor:"background.default",color:"text.primary",px:1.75,py:1.25,lineHeight:1.6},children:[i(c,{content:p,highlightQuery:d}),i(o,{sx:{display:"inline-block",height:16,bgcolor:"primary.main",verticalAlign:"text-bottom",animation:"pulse 1.2s ease-in-out infinite","@keyframes pulse":{"0%, 100%":{opacity:.35},"50%":{opacity:1}}}})]}):i(o,{sx:{bgcolor:"background.default",px:1.75,py:1.25},children:i(n,{direction:"row",spacing:1,sx:{alignItems:"center"},children:t(n,{direction:"row",spacing:.5,children:[" ",i(s,{children:g.length>0?`Agent is working... ${l(g)}`:"Agent is working..."}),[0,150,300].map(t=>i(o,{component:"span",sx:{bgcolor:"primary.main",animation:"bounce 1s ease-in-out infinite",animationDelay:`${t}ms`,"@keyframes bounce":{"0%, 80%, 100%":{opacity:.35,transform:"translateY(0)"},"40%":{opacity:1,transform:"translateY(-1px)"}}}},t))]})})}),h&&i(r,{isStreaming:!0,traceEvents:g,defaultExpanded:!0}),x&&t(a,{onClick:x,sx:{display:"inline-flex",alignItems:"center",gap:.5,fontSize:"0.625rem",color:"text.secondary","&:hover":{color:"error.main"},borderRadius:.5,px:.5},children:[i(e,{sx:{fontSize:11}}),"Stop generating"]})]})]});export{p as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as e,jsx as o}from"react/jsx-runtime";import r from"@mui/icons-material/ChatBubbleOutlined";import t from"@mui/icons-material/DeleteForeverOutlined";import{Body1 as
|
|
1
|
+
import{jsxs as e,jsx as o}from"react/jsx-runtime";import r from"@mui/icons-material/ChatBubbleOutlined";import t from"@mui/icons-material/DeleteForeverOutlined";import{Body1 as i,Caption as n}from"../Typography.mjs";import{Box as a}from"../Box.mjs";import{IconButton as s}from"../IconButton.mjs";import{colours as l}from"../../theme/tokens.mjs";const d=(e,r)=>{const t=r?.trim();if(!t)return e;const i=new RegExp(`(${(e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"))(t)})`,"ig");return e.split(i).map((e,r)=>{if(!e)return null;return e.toLowerCase()===t.toLowerCase()?o(a,{component:"mark",sx:{backgroundColor:e=>"dark"===e.palette.mode?"rgba(255, 214, 10, 0.35)":"rgba(255, 214, 10, 0.45)",color:"inherit",borderRadius:.5,px:.25,py:0},children:e},`${e}-${r}`):e})},m=({conversation:m,isActive:p,highlightQuery:c,onSelectConversation:u,onDeleteConversation:b,deleteConversationTitle:x,formatMessageCount:g,showMessageCount:h=!1,sx:y})=>{const f=(e=>"number"==typeof e.messageCount?e.messageCount:Array.isArray(e.messages)?e.messages.length:0)(m);return e(a,{component:"div",role:"button",tabIndex:0,onClick:()=>u(m.id),onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),u(m.id))},sx:[{width:"100%",display:"flex",alignItems:"center",gap:1.25,borderRadius:1,px:1.5,py:1.25,textAlign:"left",backgroundColor:p?e=>"dark"===e.palette.mode?l.black:l.white:"transparent",backgroundImage:"none",opacity:1,position:"relative",zIndex:1,border:"1px solid",borderColor:p?l.primaryGreenActive:"transparent",cursor:"pointer",outline:"none","&:hover":{backgroundColor:p?e=>"dark"===e.palette.mode?l.black:l.white:"action.hover",backgroundImage:"none","& .delete-button":{visibility:"visible"}},"&:focus-visible":{boxShadow:e=>`0 0 0 2px ${e.palette.primary.main}`},mb:.25},...Array.isArray(y)?y:y?[y]:[]],children:[o(r,{sx:{fontSize:14,color:p?l.primaryGreenActive:"text.disabled"}}),e(a,{sx:{flex:1,minWidth:0},children:[o(i,{component:"span",sx:{display:"block",fontWeight:500,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:p?"text.primary":"text.secondary"},children:d(m.title,c)}),h&&o(n,{noWrap:!0,sx:{display:"block"},children:g(f)})]}),o(s,{className:"delete-button",title:x,ariaLabel:x,onClick:e=>{e.stopPropagation(),b&&Promise.resolve(b(m.id))},disabled:!b,sx:{visibility:"hidden"},children:o(t,{sx:{fontSize:14,color:p?"error.main":"text.disabled"}})})]})};export{m as ChatHistoryButtonBase};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,jsxs as o,Fragment as i}from"react/jsx-runtime";import{useState as
|
|
1
|
+
import{jsx as e,jsxs as o,Fragment as i}from"react/jsx-runtime";import{useState as n}from"react";import{useTheme as t,useMediaQuery as r,Popover as l}from"@mui/material";import s from"@mui/icons-material/CloseFullscreen";import m from"@mui/icons-material/ExpandLess";import a from"@mui/icons-material/ExpandMore";import c from"@mui/icons-material/GridView";import p from"@mui/icons-material/History";import{ChatHistory as d}from"./ChatHistory.mjs";import{ChatInput as h}from"./ChatInput.mjs";import{Dialog as x}from"../Dialog.mjs";import{Box as f}from"../Box.mjs";import{Stack as u}from"../Stack.mjs";import{Paper as g}from"../Paper.mjs";import{GlassPaper as C}from"../GlassPaper.mjs";import{IconButton as v}from"../IconButton.mjs";import{AiChip as b}from"../AiChip.mjs";import{Caption as w,H1 as y,H2 as S}from"../Typography.mjs";import{AgentChatWindowHeader as j}from"./AgentChatWindowHeader.mjs";import"./ChatComponents/ChatAvatar.mjs";import"../Code.mjs";import"@mui/icons-material/Download";import"../../theme/tokens.mjs";import"@mui/icons-material/CheckCircle";import"@mui/icons-material/OpenInNew";import"@mui/material/styles";import"@mui/icons-material/ThumbUp";import"@mui/icons-material/ThumbDown";import"@mui/icons-material/ContentCopy";import"@mui/icons-material/Check";import"@mui/icons-material/StopCircle";import k from"./ChatComponents/SuggestedPrompts.mjs";import z from"./ChatComponents/MessageList.mjs";import I from"./WidgetParts/WidgetInput.mjs";function D({open:D,onClose:T,title:A="Ask Nexus",subtitle:H="Ready to help",placeholder:E,suggestedPrompts:O=[],showAiChip:P=!0,isTyping:N,messages:W,streamingText:L,liveTraceEvents:R,showActivity:B=!1,onSend:U,onAbort:G,background:M,followUpPrompts:X,followUpLabel:$="Suggested follow-ups:",topOffset:F,conversations:V,activeConversationId:Y,onSelectConversation:q,onDeleteConversation:J,onNewConversation:K}){const Q=t(),Z=r(Q.breakpoints.down("md")),[_,ee]=n(!0),[oe,ie]=n(!1),[ne,te]=n(!1),[re,le]=n(null),se=W.length>0||N,me=se&&X&&X.length>0,ae=!Z||_,ce=void 0!==V;return e(x,{open:D,fullScreen:!0,onClose:T,sx:F?{top:`${F}px`}:void 0,children:o(f,{sx:{display:"flex",flexDirection:"column",height:F?`calc(100vh - ${F}px)`:"100vh",overflow:"hidden"},children:[o(f,{sx:{display:"flex",flex:1,minHeight:0,overflow:"hidden"},children:[ce&&e(f,{sx:{display:{xs:"none",md:"flex"},flexDirection:"column",minHeight:0,flexShrink:0},children:e(d,{conversations:V,activeConversationId:Y??null,onSelectConversation:q??(()=>{}),onDeleteConversation:J,onNewConversation:K,isCollapsed:ne,onToggleCollapse:()=>te(e=>!e)})}),o(f,{sx:{display:"flex",flexDirection:"column",flex:1,minHeight:0,overflow:"hidden"},children:[o(f,{sx:{position:"relative",flexShrink:0},children:[e(j,{title:A,subtitle:H,showAiChip:!1,actions:Z?e(u,{}):o(u,{direction:"row",spacing:1,sx:{alignItems:"center"},children:[P&&e(b,{}),e(v,{title:"Close full view",size:"small",onClick:T,children:e(s,{sx:{fontSize:16}})})]})}),Z&&o(u,{direction:"row",sx:{position:"absolute",top:6,right:4,alignItems:"center"},children:[ce&&e(v,{title:"Chat history",size:"small",onClick:()=>ie(e=>!e),children:e(p,{sx:{fontSize:18}})}),e(v,{title:"Close full view",size:"small",onClick:T,children:e(s,{sx:{fontSize:16}})})]})]}),o(f,{sx:{flex:1,minHeight:0,position:"relative",display:"flex",flexDirection:"column",overflow:"hidden"},children:[M&&e(f,{sx:{position:"absolute",inset:0,zIndex:0,overflow:"hidden",pointerEvents:"none"},children:M}),se?o(f,{sx:{position:"relative",zIndex:1,flex:1,minHeight:0,display:"flex",flexDirection:"column",overflow:"hidden"},children:[e(g,{sx:{borderRadius:0,border:"none",flex:1,minHeight:0,display:"flex",flexDirection:"column",overflowY:"auto"},children:e(z,{messages:W,isTyping:N,streamingText:L,liveTraceEvents:R,onAbort:G,showActivity:B})}),me&&o(f,{sx:{bgcolor:"background.paper",borderTop:"1px solid",borderColor:"divider",px:2,pt:1,pb:ae?.5:1,flexShrink:0},children:[o(u,{direction:"row",sx:{alignItems:"center",justifyContent:"space-between",mb:ae?.75:0},children:[e(w,{children:$}),Z&&e(v,{size:"small",onClick:()=>ee(e=>!e),title:_?"Collapse suggestions":"Expand suggestions",children:e(_?a:m,{sx:{fontSize:16}})})]}),ae&&e(k,{prompts:X,onSelect:U})]}),e(g,{sx:{borderRadius:0,border:"none"},children:e(I,{placeholder:E,isTyping:N,onSend:U})})]}):e(g,{sx:{borderRadius:0,border:"none",flex:1,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",px:2,pb:4},children:o(C,{sx:{width:"60%",px:4,py:8,textAlign:"center"},children:[o(u,{direction:"column",sx:{gap:4,alignItems:"center"},children:[e(y,{children:A}),e(S,{sx:{color:"text.secondary"},children:H})]}),e(f,{sx:{mt:10,width:"100%",minWidth:"min(40vw, 100%)"},children:e(h,{onSend:U,disabled:N,placeholder:E,actions:O.length>0?o(i,{children:[e(v,{title:"Open prompt gallery",ariaLabel:"Open prompt gallery",size:"small",sx:{color:"text.jades"},onClick:e=>le(e.currentTarget),children:e(c,{sx:{fontSize:18}})}),e(l,{open:Boolean(re),anchorEl:re,onClose:()=>le(null),anchorOrigin:{vertical:"top",horizontal:"left"},transformOrigin:{vertical:"bottom",horizontal:"left"},children:e(f,{sx:{p:2,maxWidth:360},children:e(k,{prompts:O,onSelect:e=>{le(null),U(e)}})})})]}):void 0})})]})})]})]})]}),ce&&Z&&o(i,{children:[oe&&e(f,{onClick:()=>ie(!1),sx:{position:"absolute",inset:0,zIndex:9,bgcolor:"rgba(0,0,0,0.45)"}}),e(f,{sx:{position:"absolute",top:0,left:0,bottom:0,width:288,zIndex:10,bgcolor:"background.paper",boxShadow:4,display:"flex",flexDirection:"column",overflow:"hidden",transform:oe?"translateX(0)":"translateX(-100%)",transition:"transform 0.25s ease"},children:e(d,{conversations:V,activeConversationId:Y??null,onSelectConversation:e=>{q?.(e),ie(!1)},onDeleteConversation:J,onNewConversation:K?()=>{K(),ie(!1)}:void 0,onClose:()=>ie(!1)})})]})]})})}export{D as NexusChatDialog};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as e,jsx as i}from"react/jsx-runtime";import{useTheme as o,useMediaQuery as r,Drawer as n,Box as t,IconButton as l}from"@mui/material";import a from"@mui/icons-material/ChevronLeft";import d from"@mui/icons-material/Menu";const s="0.25s",p=({open:t,onToggle:l,children:a,collapsedContent:d,expandedWidth:p=
|
|
1
|
+
import{jsxs as e,jsx as i}from"react/jsx-runtime";import{useTheme as o,useMediaQuery as r,Drawer as n,Box as t,IconButton as l}from"@mui/material";import a from"@mui/icons-material/ChevronLeft";import d from"@mui/icons-material/Menu";const s="0.25s",p=({open:t,onToggle:l,children:a,collapsedContent:d,expandedWidth:p=300,collapsedWidth:x=64,sx:b,headerActions:f})=>{const m=o(),v=r(m.breakpoints.down("sm"));return e(n,v?{anchor:"left",variant:"temporary",open:t,onClose:l,keepMounted:!0,slotProps:{paper:{sx:[{width:p,boxSizing:"border-box",backgroundColor:"background.paper",borderRight:`1px solid ${m.palette.divider}`,overflowX:"hidden"},...Array.isArray(b)?b:b?[b]:[]]}},children:[i(h,{open:t,onToggle:l,collapsedWidth:x,headerActions:f}),i(c,{open:t,collapsedContent:d,children:a})]}:{anchor:"left",variant:"permanent",open:t,slotProps:{paper:{sx:[{position:"relative",width:t?p:x,flexShrink:0,whiteSpace:"nowrap",boxSizing:"border-box",overflowX:"hidden",transition:`width ${s} ease`,backgroundColor:"background.paper",borderRadius:0,borderRight:`1px solid ${m.palette.divider}`,display:"flex",flexDirection:"column"},...Array.isArray(b)?b:b?[b]:[]]}},sx:{width:t?p:x,flexShrink:0,transition:`width ${s} ease`,"& .MuiDrawer-paper":{width:t?p:x,transition:`width ${s} ease`}},children:[i(h,{open:t,onToggle:l,collapsedWidth:x,headerActions:f}),i(c,{open:t,collapsedContent:d,children:a})]})},c=({open:o,children:r,collapsedContent:n})=>e(t,{sx:{position:"relative",flex:1,overflow:"hidden"},children:[i(t,{sx:{height:"100%",overflowY:"auto",overflowX:"hidden",opacity:o?1:0,visibility:o?"visible":"hidden",transition:`opacity ${s} ease, visibility ${s} ease`},children:r}),n&&i(t,{sx:{position:"absolute",inset:0,overflowY:"auto",overflowX:"hidden",opacity:o?0:1,visibility:o?"hidden":"visible",transition:`opacity ${s} ease, visibility ${s} ease`},children:n})]}),h=({open:o,onToggle:r,collapsedWidth:n,headerActions:s})=>{const p=i(o?a:d,{fontSize:"small"});return e(t,{sx:{display:"flex",alignItems:"center",justifyContent:o&&s?"space-between":o?"flex-end":"center",minHeight:48,px:.5,flexShrink:0},children:[o&&s&&i(t,{sx:{display:"flex",alignItems:"center"},children:s}),i(l,{onClick:r,size:"small","aria-label":o?"Collapse side blade":"Expand side blade",sx:{width:n-16,borderRadius:1,color:"text.secondary","&:hover":{color:"text.primary",backgroundColor:"action.hover"}},children:p})]})};export{p as SideBlade};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const o="1.14.
|
|
1
|
+
const o="1.14.9";export{o as SAGE_NEXUS_UI_VERSION};
|
package/dist/index.d.ts
CHANGED
|
@@ -191,7 +191,6 @@ interface NexusChatDialogProps {
|
|
|
191
191
|
onClose: () => void;
|
|
192
192
|
title?: string;
|
|
193
193
|
subtitle?: string;
|
|
194
|
-
avatarIcon?: React.ReactNode;
|
|
195
194
|
placeholder?: string;
|
|
196
195
|
suggestedPrompts?: string[];
|
|
197
196
|
showAiChip?: boolean;
|
|
@@ -218,7 +217,7 @@ interface NexusChatDialogProps {
|
|
|
218
217
|
onDeleteConversation?: (id: string) => void | Promise<boolean>;
|
|
219
218
|
onNewConversation?: () => void;
|
|
220
219
|
}
|
|
221
|
-
declare function NexusChatDialog({ open, onClose, title, subtitle,
|
|
220
|
+
declare function NexusChatDialog({ open, onClose, title, subtitle, placeholder, suggestedPrompts, showAiChip, isTyping, messages, streamingText, liveTraceEvents, showActivity, onSend, onAbort, background, followUpPrompts, followUpLabel, topOffset, conversations, activeConversationId, onSelectConversation, onDeleteConversation, onNewConversation, }: NexusChatDialogProps): react_jsx_runtime.JSX.Element;
|
|
222
221
|
|
|
223
222
|
interface FABButtonProps {
|
|
224
223
|
onOpen: () => void;
|
|
@@ -321,7 +320,6 @@ declare const MarkdownContent: ({ content, highlightQuery, components: extraComp
|
|
|
321
320
|
interface MessageBubbleProps {
|
|
322
321
|
message: ChatMessage;
|
|
323
322
|
highlightQuery?: string;
|
|
324
|
-
avatarIcon?: React.ReactNode;
|
|
325
323
|
showActivity?: boolean;
|
|
326
324
|
/** Called when the user submits thumbs-up/down feedback */
|
|
327
325
|
onFeedback?: (messageId: string, rating: "positive" | "negative", comment?: string) => void;
|
|
@@ -332,7 +330,7 @@ interface MessageBubbleProps {
|
|
|
332
330
|
/** Override or extend individual markdown element renderers */
|
|
333
331
|
markdownComponents?: Partial<Components>;
|
|
334
332
|
}
|
|
335
|
-
declare const MessageBubble: ({ message, highlightQuery,
|
|
333
|
+
declare const MessageBubble: ({ message, highlightQuery, showActivity, onFeedback, onDownloadFile, contentRenderer, markdownComponents, }: MessageBubbleProps) => react_jsx_runtime.JSX.Element;
|
|
336
334
|
|
|
337
335
|
interface MessageFeedbackBarProps {
|
|
338
336
|
message: ChatMessage;
|
|
@@ -372,7 +370,7 @@ interface MessageListProps {
|
|
|
372
370
|
avatarIcon?: React.ReactNode;
|
|
373
371
|
showActivity?: boolean;
|
|
374
372
|
}
|
|
375
|
-
declare const MessageList: ({ messages, isTyping, streamingText, liveTraceEvents, highlightQuery, onAbort,
|
|
373
|
+
declare const MessageList: ({ messages, isTyping, streamingText, liveTraceEvents, highlightQuery, onAbort, showActivity, }: MessageListProps) => react_jsx_runtime.JSX.Element;
|
|
376
374
|
|
|
377
375
|
interface EmptyStateProps {
|
|
378
376
|
title: string;
|
|
@@ -819,24 +817,13 @@ interface SearchInputProps {
|
|
|
819
817
|
declare const SearchInput: react__default.FC<SearchInputProps>;
|
|
820
818
|
|
|
821
819
|
interface SideBladeProps {
|
|
822
|
-
/** Whether the blade is currently expanded */
|
|
823
820
|
open: boolean;
|
|
824
|
-
/** Called when the toggle button is clicked, or when the mobile backdrop is clicked */
|
|
825
821
|
onToggle: () => void;
|
|
826
|
-
/** Content shown when the blade is expanded */
|
|
827
822
|
children?: ReactNode;
|
|
828
|
-
/**
|
|
829
|
-
|
|
830
|
-
* When omitted the blade shows only the toggle button in its collapsed state.
|
|
831
|
-
*/
|
|
832
|
-
collapsedContent?: ReactNode;
|
|
833
|
-
/** Width of the blade when expanded (px). Default: 240 */
|
|
834
|
-
expandedWidth?: number;
|
|
835
|
-
/** Width of the blade when collapsed (px). Default: 64 */
|
|
823
|
+
collapsedContent?: ReactNode; /** Width of the blade when expanded (px). Default: 300 */
|
|
824
|
+
expandedWidth?: number; /** Width of the blade when collapsed (px). Default: 64 */
|
|
836
825
|
collapsedWidth?: number;
|
|
837
|
-
/** Additional sx overrides applied to the Drawer Paper */
|
|
838
826
|
sx?: SxProps$1<Theme$1>;
|
|
839
|
-
/** Extra actions rendered in the header row alongside the collapse/expand toggle (expanded state only) */
|
|
840
827
|
headerActions?: ReactNode;
|
|
841
828
|
}
|
|
842
829
|
/**
|