minerva-plexus-csd 1.1.57 → 1.1.58

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.
@@ -32545,6 +32545,7 @@ const EL = (e) => {
32545
32545
  role: "log",
32546
32546
  "aria-live": "polite",
32547
32547
  "aria-relevant": "additions",
32548
+ "aria-atomic": "false",
32548
32549
  "aria-label": o("text.chat_messages"),
32549
32550
  children: [
32550
32551
  n && /* @__PURE__ */ g.jsx(CL, { "aria-hidden": "true", children: EL(s.created_at) }),
@@ -1062,7 +1062,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1062
1062
  font-style: normal;
1063
1063
  font-weight: 400;
1064
1064
  word-wrap: break-word;
1065
- `,FE=({showControlButtons:e=!0,showConversationTitle:t=!0,showDate:n=!0,showPlexo:r=!0,showFeedbackButtons:a=!0,showeditIcon:i=!0})=>{const{t:o}=Ve.useTranslation("minerva"),{selectedConversation:s}=Mt(),{messages:l,fetchMessages:u,isBotStreaming:c}=Cr(),[d,f]=I.useState(null),[p,E]=I.useState(0),S=I.useRef(null),_=I.useRef(null);I.useEffect(()=>{console.log("Estado de messages en ChatPlayground:",l);const x=l.filter(b=>b.isStatus201);console.log("Mensajes con isStatus201 en ChatPlayground:",x)},[l]),I.useEffect(()=>{S.current&&S.current.scrollIntoView({behavior:"smooth"})},[l]),I.useEffect(()=>{s&&s.id!==_.current&&(_.current=s.id,E(0),setTimeout(()=>{u(s.id)},0))},[s,u]),I.useEffect(()=>{(l.length>p&&p>0||p===0&&l.length>0)&&E(l.length)},[l.length,p]);const T=I.useCallback((x,b)=>{const h=new SpeechSynthesisUtterance(x);f(b),h.onend=()=>{f(null)},speechSynthesis.speak(h)},[]),y=I.useCallback(()=>{speechSynthesis.cancel(),f(null)},[]),m=x=>{console.log("Feedback recibido:",x)};return g.jsx(i2,{children:s?g.jsxs("div",{children:[t&&g.jsx(s2,{children:s.title}),g.jsxs(o2,{role:"log","aria-live":"polite","aria-relevant":"additions","aria-label":o("text.chat_messages"),children:[n&&g.jsx(l2,{"aria-hidden":"true",children:a2(s.created_at)}),l.length===0?g.jsx(u2,{role:"status",children:o("text.welcome_text")}):l.map((x,b)=>{console.log("Renderizando mensaje:",x);const h=d===x.id,R=b===l.length-1;return console.log("isLastMessage: ",R),R&&x.sender_type==="ai"&&!c||x.sender_type,g.jsx("div",{children:x.sender_type==="user"?g.jsx(S1,{showeditIcon:i,message:x,showControlButtons:e}):g.jsx(QN,{showPlexo:r,showFeedbackButtons:a,message:x,isReading:h,onReadAloud:T,onStopReading:y,showControlButtons:e,onFeedback:m,isStreaming:c})},x.id)}),g.jsx("div",{ref:S,"aria-hidden":"true"})]})]}):g.jsx(g.Fragment,{children:g.jsx("p",{role:"status",children:t?o("logMessages.no_conversations_available"):null})})})};var UE={exports:{}};/*!
1065
+ `,FE=({showControlButtons:e=!0,showConversationTitle:t=!0,showDate:n=!0,showPlexo:r=!0,showFeedbackButtons:a=!0,showeditIcon:i=!0})=>{const{t:o}=Ve.useTranslation("minerva"),{selectedConversation:s}=Mt(),{messages:l,fetchMessages:u,isBotStreaming:c}=Cr(),[d,f]=I.useState(null),[p,E]=I.useState(0),S=I.useRef(null),_=I.useRef(null);I.useEffect(()=>{console.log("Estado de messages en ChatPlayground:",l);const x=l.filter(b=>b.isStatus201);console.log("Mensajes con isStatus201 en ChatPlayground:",x)},[l]),I.useEffect(()=>{S.current&&S.current.scrollIntoView({behavior:"smooth"})},[l]),I.useEffect(()=>{s&&s.id!==_.current&&(_.current=s.id,E(0),setTimeout(()=>{u(s.id)},0))},[s,u]),I.useEffect(()=>{(l.length>p&&p>0||p===0&&l.length>0)&&E(l.length)},[l.length,p]);const T=I.useCallback((x,b)=>{const h=new SpeechSynthesisUtterance(x);f(b),h.onend=()=>{f(null)},speechSynthesis.speak(h)},[]),y=I.useCallback(()=>{speechSynthesis.cancel(),f(null)},[]),m=x=>{console.log("Feedback recibido:",x)};return g.jsx(i2,{children:s?g.jsxs("div",{children:[t&&g.jsx(s2,{children:s.title}),g.jsxs(o2,{role:"log","aria-live":"polite","aria-relevant":"additions","aria-atomic":"false","aria-label":o("text.chat_messages"),children:[n&&g.jsx(l2,{"aria-hidden":"true",children:a2(s.created_at)}),l.length===0?g.jsx(u2,{role:"status",children:o("text.welcome_text")}):l.map((x,b)=>{console.log("Renderizando mensaje:",x);const h=d===x.id,R=b===l.length-1;return console.log("isLastMessage: ",R),R&&x.sender_type==="ai"&&!c||x.sender_type,g.jsx("div",{children:x.sender_type==="user"?g.jsx(S1,{showeditIcon:i,message:x,showControlButtons:e}):g.jsx(QN,{showPlexo:r,showFeedbackButtons:a,message:x,isReading:h,onReadAloud:T,onStopReading:y,showControlButtons:e,onFeedback:m,isStreaming:c})},x.id)}),g.jsx("div",{ref:S,"aria-hidden":"true"})]})]}):g.jsx(g.Fragment,{children:g.jsx("p",{role:"status",children:t?o("logMessages.no_conversations_available"):null})})})};var UE={exports:{}};/*!
1066
1066
  Copyright (c) 2018 Jed Watson.
1067
1067
  Licensed under the MIT License (MIT), see
1068
1068
  http://jedwatson.github.io/classnames
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "minerva-plexus-csd",
3
3
  "private": false,
4
4
  "description": "A reusable chat logic library for React applications",
5
- "version": "1.1.57",
5
+ "version": "1.1.58",
6
6
  "main": "dist/minerva-plexus-csd.umd.js",
7
7
  "module": "dist/minerva-plexus-csd.es.js",
8
8
  "types": "dist/index.d.ts",