minerva-plexus-csd 1.1.54 → 1.1.55

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.
@@ -32517,33 +32517,27 @@ const bL = (e) => {
32517
32517
  l.length === 0 ? /* @__PURE__ */ g.jsx(wL, { role: "status", children: o("text.welcome_text") }) : l.map((x, b) => {
32518
32518
  console.log("Renderizando mensaje:", x);
32519
32519
  const h = d === x.id, k = b === l.length - 1;
32520
- return console.log("isLastMessage: ", k), k && (x.sender_type === "ai" && !c || x.sender_type), /* @__PURE__ */ g.jsx(
32521
- "div",
32520
+ return console.log("isLastMessage: ", k), k && (x.sender_type === "ai" && !c || x.sender_type), /* @__PURE__ */ g.jsx("div", { "aria-live": "polite", children: x.sender_type === "user" ? /* @__PURE__ */ g.jsx(
32521
+ N1,
32522
32522
  {
32523
- children: x.sender_type === "user" ? /* @__PURE__ */ g.jsx(
32524
- N1,
32525
- {
32526
- showeditIcon: i,
32527
- message: x,
32528
- showControlButtons: e
32529
- }
32530
- ) : /* @__PURE__ */ g.jsx(
32531
- b4,
32532
- {
32533
- showPlexo: r,
32534
- showFeedbackButtons: a,
32535
- message: x,
32536
- isReading: h,
32537
- onReadAloud: T,
32538
- onStopReading: E,
32539
- showControlButtons: e,
32540
- onFeedback: m,
32541
- isStreaming: c
32542
- }
32543
- )
32544
- },
32545
- x.id
32546
- );
32523
+ showeditIcon: i,
32524
+ message: x,
32525
+ showControlButtons: e
32526
+ }
32527
+ ) : /* @__PURE__ */ g.jsx(
32528
+ b4,
32529
+ {
32530
+ showPlexo: r,
32531
+ showFeedbackButtons: a,
32532
+ message: x,
32533
+ isReading: h,
32534
+ onReadAloud: T,
32535
+ onStopReading: E,
32536
+ showControlButtons: e,
32537
+ onFeedback: m,
32538
+ isStreaming: c
32539
+ }
32540
+ ) }, x.id);
32547
32541
  }),
32548
32542
  /* @__PURE__ */ g.jsx("div", { ref: S, "aria-hidden": "true" })
32549
32543
  ]
@@ -1042,7 +1042,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1042
1042
  font-style: normal;
1043
1043
  font-weight: 400;
1044
1044
  word-wrap: break-word;
1045
- `,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(r2,{children:s?g.jsxs("div",{children:[t&&g.jsx(i2,{children:s.title}),g.jsxs(a2,{role:"log","aria-live":"polite","aria-relevant":"additions","aria-label":o("text.chat_messages"),children:[n&&g.jsx(o2,{"aria-hidden":"true",children:n2(s.created_at)}),l.length===0?g.jsx(s2,{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(v1,{showeditIcon:i,message:x,showControlButtons:e}):g.jsx(XN,{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:{}};/*!
1045
+ `,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(r2,{children:s?g.jsxs("div",{children:[t&&g.jsx(i2,{children:s.title}),g.jsxs(a2,{role:"log","aria-live":"polite","aria-relevant":"additions","aria-label":o("text.chat_messages"),children:[n&&g.jsx(o2,{"aria-hidden":"true",children:n2(s.created_at)}),l.length===0?g.jsx(s2,{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",{"aria-live":"polite",children:x.sender_type==="user"?g.jsx(v1,{showeditIcon:i,message:x,showControlButtons:e}):g.jsx(XN,{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:{}};/*!
1046
1046
  Copyright (c) 2018 Jed Watson.
1047
1047
  Licensed under the MIT License (MIT), see
1048
1048
  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.54",
5
+ "version": "1.1.55",
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",