@mypatientspace/chatbot-widget 1.0.57 → 1.0.59

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.
@@ -12658,7 +12658,7 @@ const Bp = [
12658
12658
  p && /* @__PURE__ */ T.jsxs($p, { fontFamily: s.fontFamily, children: [
12659
12659
  p,
12660
12660
  " v",
12661
- "1.0.57"
12661
+ "1.0.59"
12662
12662
  ] })
12663
12663
  ] })
12664
12664
  ] }),
@@ -13004,7 +13004,7 @@ const Bp = [
13004
13004
  isUser: r,
13005
13005
  isError: u.status === "error",
13006
13006
  theme: c,
13007
- dangerouslySetInnerHTML: { __html: u.content }
13007
+ dangerouslySetInnerHTML: { __html: u.content.replace(/\n/g, "<br>") }
13008
13008
  }
13009
13009
  ),
13010
13010
  !r && u.citations && u.citations.length > 0 && /* @__PURE__ */ T.jsx(
@@ -82,7 +82,7 @@ Error generating stack: `+a.message+`
82
82
  display: flex;
83
83
  align-items: center;
84
84
  gap: 8px;
85
- `,hm=()=>{const{close:u,config:c,theme:s,assistant:r,isExpanded:d,toggleExpanded:y}=ga(),S=c.headerTitle||r?.chatUiConfig?.avatarTitle||"Chat",E=c.headerIcon||r?.chatUiConfig?.avatarImage?.iconURL||r?.chatUiConfig?.avatarImage?.thumbnailURL,A=c.headerSubtitle||r?.chatUiConfig?.headerSubtitle,p=c.brandingText||r?.chatUiConfig?.brandingText;return T.jsxs(nm,{theme:s,children:[T.jsxs(um,{children:[E&&T.jsx(im,{theme:s,hasCustomIcon:!0,children:T.jsx(cm,{src:E,alt:""})}),T.jsxs(om,{children:[T.jsx(rm,{fontFamily:s.fontFamily,children:S}),A&&T.jsx(fm,{fontFamily:s.fontFamily,children:A}),p&&T.jsxs(sm,{fontFamily:s.fontFamily,children:[p," v","1.0.57"]})]})]}),T.jsxs(dm,{children:[T.jsx(df,{theme:s,onClick:y,"aria-label":d?"Collapse chat":"Expand chat",children:d?T.jsx(tm,{size:18}):T.jsx(Iy,{size:18})}),c.floatingMode&&T.jsx(df,{theme:s,onClick:u,"aria-label":"Minimize chat",children:T.jsx(Wy,{size:20})})]})]})},ym=H.div`
85
+ `,hm=()=>{const{close:u,config:c,theme:s,assistant:r,isExpanded:d,toggleExpanded:y}=ga(),S=c.headerTitle||r?.chatUiConfig?.avatarTitle||"Chat",E=c.headerIcon||r?.chatUiConfig?.avatarImage?.iconURL||r?.chatUiConfig?.avatarImage?.thumbnailURL,A=c.headerSubtitle||r?.chatUiConfig?.headerSubtitle,p=c.brandingText||r?.chatUiConfig?.brandingText;return T.jsxs(nm,{theme:s,children:[T.jsxs(um,{children:[E&&T.jsx(im,{theme:s,hasCustomIcon:!0,children:T.jsx(cm,{src:E,alt:""})}),T.jsxs(om,{children:[T.jsx(rm,{fontFamily:s.fontFamily,children:S}),A&&T.jsx(fm,{fontFamily:s.fontFamily,children:A}),p&&T.jsxs(sm,{fontFamily:s.fontFamily,children:[p," v","1.0.59"]})]})]}),T.jsxs(dm,{children:[T.jsx(df,{theme:s,onClick:y,"aria-label":d?"Collapse chat":"Expand chat",children:d?T.jsx(tm,{size:18}):T.jsx(Iy,{size:18})}),c.floatingMode&&T.jsx(df,{theme:s,onClick:u,"aria-label":"Minimize chat",children:T.jsx(Wy,{size:20})})]})]})},ym=H.div`
86
86
  position: relative;
87
87
  background-color: ${({theme:u})=>u.colors.background};
88
88
  border-bottom: 1px solid ${({theme:u})=>u.colors.borderLight};
@@ -317,7 +317,7 @@ Error generating stack: `+a.message+`
317
317
  background-color: ${({theme:u})=>u.colors.primary};
318
318
  color: ${({theme:u})=>u.colors.white};
319
319
  }
320
- `,Hm=u=>u.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}),Bm=N.memo(({message:u,theme:c,onCitationClick:s})=>{const r=u.sender==="user",[d,y]=N.useState(!1),S=N.useRef(null),E=()=>{S.current&&(d?(S.current.pause(),S.current.currentTime=0,y(!1)):(S.current.play(),y(!0)))},A=()=>{y(!1)};return T.jsxs(Dm,{isUser:r,children:[T.jsx(jm,{isUser:r,isError:u.status==="error",theme:c,dangerouslySetInnerHTML:{__html:u.content}}),!r&&u.citations&&u.citations.length>0&&T.jsx(Om,{citations:u.citations,theme:c,onCitationClick:s}),u.audioUrl&&T.jsxs(T.Fragment,{children:[T.jsx("audio",{ref:S,src:u.audioUrl,onEnded:A,style:{display:"none"}}),T.jsx(Nm,{theme:c,isPlaying:d,onClick:E,"aria-label":d?"Stop audio":"Play audio",title:d?"Stop audio":"Play audio",children:d?T.jsx(am,{size:16}):T.jsx(lm,{size:16})})]}),r&&T.jsxs(Rm,{theme:c,children:[Hm(u.timestamp),u.status!=="sent"&&T.jsx(Um,{status:u.status,theme:c,children:u.status==="sending"?"Sending...":"Failed"})]})]})}),wm=xl`
320
+ `,Hm=u=>u.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}),Bm=N.memo(({message:u,theme:c,onCitationClick:s})=>{const r=u.sender==="user",[d,y]=N.useState(!1),S=N.useRef(null),E=()=>{S.current&&(d?(S.current.pause(),S.current.currentTime=0,y(!1)):(S.current.play(),y(!0)))},A=()=>{y(!1)};return T.jsxs(Dm,{isUser:r,children:[T.jsx(jm,{isUser:r,isError:u.status==="error",theme:c,dangerouslySetInnerHTML:{__html:u.content.replace(/\n/g,"<br>")}}),!r&&u.citations&&u.citations.length>0&&T.jsx(Om,{citations:u.citations,theme:c,onCitationClick:s}),u.audioUrl&&T.jsxs(T.Fragment,{children:[T.jsx("audio",{ref:S,src:u.audioUrl,onEnded:A,style:{display:"none"}}),T.jsx(Nm,{theme:c,isPlaying:d,onClick:E,"aria-label":d?"Stop audio":"Play audio",title:d?"Stop audio":"Play audio",children:d?T.jsx(am,{size:16}):T.jsx(lm,{size:16})})]}),r&&T.jsxs(Rm,{theme:c,children:[Hm(u.timestamp),u.status!=="sent"&&T.jsx(Um,{status:u.status,theme:c,children:u.status==="sending"?"Sending...":"Failed"})]})]})}),wm=xl`
321
321
  from {
322
322
  opacity: 0;
323
323
  transform: translateY(4px);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mypatientspace/chatbot-widget",
3
- "version": "1.0.57",
3
+ "version": "1.0.59",
4
4
  "description": "Embeddable healthcare chatbot widget for websites and mobile apps",
5
5
  "type": "module",
6
6
  "main": "dist/mypatientspace-widget.umd.js",