sage-nexus-ui 1.14.8 → 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/_virtual/index.mjs +1 -1
- package/dist/_virtual/index2.mjs +1 -1
- 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/generated/version.mjs +1 -1
- package/dist/index.d.ts +3 -5
- package/dist/node_modules/hast-util-to-jsx-runtime/lib/index.mjs +1 -1
- package/dist/node_modules/unified/lib/index.mjs +1 -1
- package/package.json +1 -1
package/dist/_virtual/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{getDefaultExportFromCjs as e}from"./_commonjsHelpers.mjs";import{__require as
|
|
1
|
+
import{getDefaultExportFromCjs as e}from"./_commonjsHelpers.mjs";import{__require as o}from"../node_modules/style-to-js/cjs/index.mjs";var s=e(o());export{s as default};
|
package/dist/_virtual/index2.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{getDefaultExportFromCjs as e}from"./_commonjsHelpers.mjs";import{__require as
|
|
1
|
+
import{getDefaultExportFromCjs as e}from"./_commonjsHelpers.mjs";import{__require as m}from"../node_modules/extend/index.mjs";var o=e(m());export{o as default};
|
|
@@ -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
|
-
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;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{stringify as e}from"../../comma-separated-tokens/index.mjs";import{ok as t}from"../../devlop/lib/default.mjs";import{svg as n,html as r}from"../../property-information/index.mjs";import{stringify as o}from"../../space-separated-tokens/index.mjs";import s from"../../../_virtual/
|
|
1
|
+
import{stringify as e}from"../../comma-separated-tokens/index.mjs";import{ok as t}from"../../devlop/lib/default.mjs";import{svg as n,html as r}from"../../property-information/index.mjs";import{stringify as o}from"../../space-separated-tokens/index.mjs";import s from"../../../_virtual/index.mjs";import{whitespace as a}from"../../hast-util-whitespace/lib/index.mjs";import{name as i}from"../../estree-util-is-identifier-name/lib/index.mjs";import{VFileMessage as l}from"../../vfile-message/lib/index.mjs";import{find as p}from"../../property-information/lib/find.mjs";import{hastToReact as c}from"../../property-information/lib/hast-to-react.mjs";import{pointStart as u}from"../../unist-util-position/lib/index.mjs";const m={}.hasOwnProperty,f=new Map,d=/[A-Z]/g,y=new Set(["table","tbody","thead","tfoot","tr"]),x=new Set(["td","th"]),v="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function h(e,t){if(!t||void 0===t.Fragment)throw new TypeError("Expected `Fragment` in options");const o=t.filePath||void 0;let s;if(t.development){if("function"!=typeof t.jsxDEV)throw new TypeError("Expected `jsxDEV` in options when `development: true`");s=function(e,t){return n;function n(n,r,o,s){const a=Array.isArray(o.children),i=u(n);return t(r,o,s,a,{columnNumber:i?i.column-1:void 0,fileName:e,lineNumber:i?i.line:void 0},void 0)}}(o,t.jsxDEV)}else{if("function"!=typeof t.jsx)throw new TypeError("Expected `jsx` in production options");if("function"!=typeof t.jsxs)throw new TypeError("Expected `jsxs` in production options");s=function(e,t,n){return r;function r(e,r,o,s){const a=Array.isArray(o.children)?n:t;return s?a(r,o,s):a(r,o)}}(0,t.jsx,t.jsxs)}const a={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:s,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:o,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:!1!==t.passKeys,passNode:t.passNode||!1,schema:"svg"===t.space?n:r,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:!1!==t.tableCellAlignToStyle},i=g(a,e,void 0);return i&&"string"!=typeof i?i:a.create(e,a.Fragment,{children:i||void 0},void 0)}function g(e,r,o){return"element"===r.type?function(e,t,r){const o=e.schema;let s=o;"svg"===t.tagName.toLowerCase()&&"html"===o.space&&(s=n,e.schema=s);e.ancestors.push(t);const i=N(e,t.tagName,!1),l=function(e,t){const n={};let r,o;for(o in t.properties)if("children"!==o&&m.call(t.properties,o)){const s=w(e,o,t.properties[o]);if(s){const[o,a]=s;e.tableCellAlignToStyle&&"align"===o&&"string"==typeof a&&x.has(t.tagName)?r=a:n[o]=a}}if(r){(n.style||(n.style={}))["css"===e.stylePropertyNameCase?"text-align":"textAlign"]=r}return n}(e,t);let p=j(e,t);y.has(t.tagName)&&(p=p.filter(function(e){return"string"!=typeof e||!a(e)}));return b(e,l,i,t),E(l,p),e.ancestors.pop(),e.schema=o,e.create(t,i,l,r)}(e,r,o):"mdxFlowExpression"===r.type||"mdxTextExpression"===r.type?function(e,n){if(n.data&&n.data.estree&&e.evaluater){const r=n.data.estree.body[0];return t("ExpressionStatement"===r.type),e.evaluater.evaluateExpression(r.expression)}A(e,n.position)}(e,r):"mdxJsxFlowElement"===r.type||"mdxJsxTextElement"===r.type?function(e,r,o){const s=e.schema;let a=s;"svg"===r.name&&"html"===s.space&&(a=n,e.schema=a);e.ancestors.push(r);const i=null===r.name?e.Fragment:N(e,r.name,!0),l=function(e,n){const r={};for(const o of n.attributes)if("mdxJsxExpressionAttribute"===o.type)if(o.data&&o.data.estree&&e.evaluater){const n=o.data.estree.body[0];t("ExpressionStatement"===n.type);const s=n.expression;t("ObjectExpression"===s.type);const a=s.properties[0];t("SpreadElement"===a.type),Object.assign(r,e.evaluater.evaluateExpression(a.argument))}else A(e,n.position);else{const s=o.name;let a;if(o.value&&"object"==typeof o.value)if(o.value.data&&o.value.data.estree&&e.evaluater){const n=o.value.data.estree.body[0];t("ExpressionStatement"===n.type),a=e.evaluater.evaluateExpression(n.expression)}else A(e,n.position);else a=null===o.value||o.value;r[s]=a}return r}(e,r),p=j(e,r);return b(e,l,i,r),E(l,p),e.ancestors.pop(),e.schema=s,e.create(r,i,l,o)}(e,r,o):"mdxjsEsm"===r.type?function(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);A(e,t.position)}(e,r):"root"===r.type?function(e,t,n){const r={};return E(r,j(e,t)),e.create(t,e.Fragment,r,n)}(e,r,o):"text"===r.type?function(e,t){return t.value}(0,r):void 0}function b(e,t,n,r){"string"!=typeof n&&n!==e.Fragment&&e.passNode&&(t.node=r)}function E(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function j(e,t){const n=[];let r=-1;const o=e.passKeys?new Map:f;for(;++r<t.children.length;){const s=t.children[r];let a;if(e.passKeys){const e="element"===s.type?s.tagName:"mdxJsxFlowElement"===s.type||"mdxJsxTextElement"===s.type?s.name:void 0;if(e){const t=o.get(e)||0;a=e+"-"+t,o.set(e,t+1)}}const i=g(e,s,a);void 0!==i&&n.push(i)}return n}function w(t,n,r){const a=p(t.schema,n);if(!(null==r||"number"==typeof r&&Number.isNaN(r))){if(Array.isArray(r)&&(r=a.commaSeparated?e(r):o(r)),"style"===a.property){let e="object"==typeof r?r:function(e,t){try{return s(t,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};const n=t,r=new l("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw r.file=e.filePath||void 0,r.url=v+"#cannot-parse-style-attribute",r}}(t,String(r));return"css"===t.stylePropertyNameCase&&(e=function(e){const t={};let n;for(n in e)m.call(e,n)&&(t[C(n)]=e[n]);return t}(e)),["style",e]}return["react"===t.elementAttributeNameCase&&a.space?c[a.property]||a.property:a.attribute,r]}}function N(e,t,n){let r;if(n)if(t.includes(".")){const e=t.split(".");let n,o=-1;for(;++o<e.length;){const t=i(e[o])?{type:"Identifier",name:e[o]}:{type:"Literal",value:e[o]};n=n?{type:"MemberExpression",object:n,property:t,computed:Boolean(o&&"Literal"===t.type),optional:!1}:t}r=n}else r=i(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};else r={type:"Literal",value:t};if("Literal"===r.type){const t=r.value;return m.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);A(e)}function A(e,t){const n=new l("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=v+"#cannot-handle-mdx-estrees-without-createevaluater",n}function C(e){let t=e.replace(d,S);return"ms-"===t.slice(0,3)&&(t="-"+t),t}function S(e){return"-"+e.toLowerCase()}export{h as toJsxRuntime};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{bail as e}from"../../bail/index.mjs";import t from"../../../_virtual/
|
|
1
|
+
import{bail as e}from"../../bail/index.mjs";import t from"../../../_virtual/index2.mjs";import s from"../../is-plain-obj/index.mjs";import{CallableInstance as r}from"./callable-instance.mjs";import{trough as n}from"../../trough/lib/index.mjs";import{VFile as i}from"../../vfile/lib/index.mjs";const o={}.hasOwnProperty;class c extends r{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=n()}copy(){const e=new c;let s=-1;for(;++s<this.attachers.length;){const t=this.attachers[s];e.use(...t)}return e.data(t(!0,{},this.namespace)),e}data(e,t){return"string"==typeof e?2===arguments.length?(p("data",this.frozen),this.namespace[e]=t,this):o.call(this.namespace,e)&&this.namespace[e]||void 0:e?(p("data",this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;const e=this;for(;++this.freezeIndex<this.attachers.length;){const[t,...s]=this.attachers[this.freezeIndex];if(!1===s[0])continue;!0===s[0]&&(s[0]=void 0);const r=t.call(e,...s);"function"==typeof r&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(e){this.freeze();const t=m(e),s=this.parser||this.Parser;return f("parse",s),s(String(t),t)}process(e,t){const s=this;return this.freeze(),f("process",this.parser||this.Parser),h("process",this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,n){const i=m(e),o=s.parse(i);function c(e,s){e||!s?n(e):r?r(s):t(void 0,s)}s.run(o,i,function(e,t,r){if(e||!t||!r)return c(e);const n=t,i=s.stringify(n,r);var o;"string"==typeof(o=i)||function(e){return Boolean(e&&"object"==typeof e&&"byteLength"in e&&"byteOffset"in e)}(o)?r.value=i:r.result=i,c(e,r)})}}processSync(t){let s,r=!1;return this.freeze(),f("processSync",this.parser||this.Parser),h("processSync",this.compiler||this.Compiler),this.process(t,function(t,n){r=!0,e(t),s=n}),l("processSync","process",r),s}run(e,t,s){u(e),this.freeze();const r=this.transformers;return s||"function"!=typeof t||(s=t,t=void 0),s?n(void 0,s):new Promise(n);function n(n,i){const o=m(t);r.run(e,o,function(t,r,o){const c=r||e;t?i(t):n?n(c):s(void 0,c,o)})}}runSync(t,s){let r,n=!1;return this.run(t,s,function(t,s){e(t),r=s,n=!0}),l("runSync","run",n),r}stringify(e,t){this.freeze();const s=m(t),r=this.compiler||this.Compiler;return h("stringify",r),u(e),r(e,s)}use(e,...r){const n=this.attachers,i=this.namespace;if(p("use",this.frozen),null==e);else if("function"==typeof e)f(e,r);else{if("object"!=typeof e)throw new TypeError("Expected usable value, not `"+e+"`");Array.isArray(e)?a(e):c(e)}return this;function o(e){if("function"==typeof e)f(e,[]);else{if("object"!=typeof e)throw new TypeError("Expected usable value, not `"+e+"`");if(Array.isArray(e)){const[t,...s]=e;f(t,s)}else c(e)}}function c(e){if(!("plugins"in e)&&!("settings"in e))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");a(e.plugins),e.settings&&(i.settings=t(!0,i.settings,e.settings))}function a(e){let t=-1;if(null==e);else{if(!Array.isArray(e))throw new TypeError("Expected a list of plugins, not `"+e+"`");for(;++t<e.length;){o(e[t])}}}function f(e,r){let i=-1,o=-1;for(;++i<n.length;)if(n[i][0]===e){o=i;break}if(-1===o)n.push([e,...r]);else if(r.length>0){let[i,...c]=r;const a=n[o][1];s(a)&&s(i)&&(i=t(!0,a,i)),n[o]=[e,i,...c]}}}}const a=(new c).freeze();function f(e,t){if("function"!=typeof t)throw new TypeError("Cannot `"+e+"` without `parser`")}function h(e,t){if("function"!=typeof t)throw new TypeError("Cannot `"+e+"` without `compiler`")}function p(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function u(e){if(!s(e)||"string"!=typeof e.type)throw new TypeError("Expected node, got `"+e+"`")}function l(e,t,s){if(!s)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function m(e){return function(e){return Boolean(e&&"object"==typeof e&&"message"in e&&"messages"in e)}(e)?e:new i(e)}export{c as Processor,a as unified};
|