@rekayasa/erica-bubble 1.0.7 → 1.0.8

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/index.cjs CHANGED
@@ -46,5 +46,5 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
46
46
  You can:
47
47
  - Ask me questions
48
48
  - Upload files using the attachment icon
49
- - Drag & drop files to attach`},Input:(0,c.useCallback)(t=>(0,l.jsx)(on,{...t,threadId:e}),[e]),Header:(0,c.useCallback)(()=>(0,l.jsx)(fn,{onNewChat:t,onThreadSelect:n}),[t,n])})}function Ys({runtimeUrl:e,widgetToken:t}){let[n,r]=(0,c.useState)(void 0),i=(0,c.useMemo)(()=>{let t=new URL(e),n=t.pathname.split(`/`).filter(Boolean);return n.length>2&&n.pop(),t.pathname=`/`+n.join(`/`),t.toString()},[e]);(0,c.useMemo)(()=>{$t(i,t)},[i,t]);let a=(0,c.useCallback)(()=>{r(void 0),console.log(`New chat started`)},[]),o=(0,c.useCallback)(e=>{r(e),console.log(`Thread selected:`,e)},[]);return(0,l.jsx)(Xe,{client:qs,children:(0,l.jsx)(d.CopilotChatConfigurationProvider,{isModalDefaultOpen:!0,children:(0,l.jsx)(`div`,{className:`h-full w-full`,children:(0,l.jsx)(u.CopilotKit,{runtimeUrl:e,headers:{Authorization:`Bearer ${t}`},properties:{agent:`platform:ultimate`},threadId:n,children:(0,l.jsx)(Js,{threadId:n,handleNewChat:a,handleThreadSelect:o})})})})})}function Xs(){let{isOpen:e,onClose:t,content:n,title:r}=Hs(),[i,a]=(0,c.useState)(!1);return(0,c.useEffect)(()=>{e?setTimeout(()=>a(!0),10):a(!1)},[e]),e?(0,l.jsxs)(`div`,{className:`erica-artifact-container`,children:[(0,l.jsx)(`div`,{className:`erica-artifact-backdrop ${i?`erica-artifact-backdrop--visible`:``}`,onClick:t}),(0,l.jsxs)(`div`,{className:`erica-artifact-drawer ${i?`erica-artifact-drawer--open`:``}`,children:[(0,l.jsxs)(`div`,{className:`erica-artifact-header`,children:[(0,l.jsx)(`h2`,{className:`erica-artifact-title`,children:r}),(0,l.jsx)(`button`,{onClick:t,className:`erica-artifact-close-button`,"aria-label":`Close drawer`,children:(0,l.jsx)(Tt,{className:`erica-icon-md`})})]}),(0,l.jsx)(`div`,{className:`erica-artifact-body`,children:n})]})]}):null}exports.ArtifactProvider=Vs,exports.ChatArtifact=Xs,exports.EricaChat=Ys;
49
+ - Drag & drop files to attach`},Input:(0,c.useCallback)(t=>(0,l.jsx)(on,{...t,threadId:e}),[e]),Header:(0,c.useCallback)(()=>(0,l.jsx)(fn,{onNewChat:t,onThreadSelect:n}),[t,n])})}function Ys({runtimeUrl:e,widgetToken:t}){let[n,r]=(0,c.useState)(void 0),i=(0,c.useMemo)(()=>{let t=new URL(e),n=t.pathname.split(`/`).filter(Boolean);return n.length>2&&n.pop(),t.pathname=`/`+n.join(`/`),t.toString()},[e]);(0,c.useMemo)(()=>{$t(i,t)},[i,t]);let a=(0,c.useCallback)(()=>{r(void 0),console.log(`New chat started`)},[]),o=(0,c.useCallback)(e=>{r(e),console.log(`Thread selected:`,e)},[]);return(0,l.jsx)(Xe,{client:qs,children:(0,l.jsx)(d.CopilotChatConfigurationProvider,{isModalDefaultOpen:!0,children:(0,l.jsx)(`div`,{className:`h-full w-full`,children:(0,l.jsx)(u.CopilotKit,{runtimeUrl:e,headers:{Authorization:`Bearer ${t}`},properties:{agent:`platform:ultimate`},threadId:n,enableInspector:!1,children:(0,l.jsx)(Js,{threadId:n,handleNewChat:a,handleThreadSelect:o})})})})})}function Xs(){let{isOpen:e,onClose:t,content:n,title:r}=Hs(),[i,a]=(0,c.useState)(!1);return(0,c.useEffect)(()=>{e?setTimeout(()=>a(!0),10):a(!1)},[e]),e?(0,l.jsxs)(`div`,{className:`erica-artifact-container`,children:[(0,l.jsx)(`div`,{className:`erica-artifact-backdrop ${i?`erica-artifact-backdrop--visible`:``}`,onClick:t}),(0,l.jsxs)(`div`,{className:`erica-artifact-drawer ${i?`erica-artifact-drawer--open`:``}`,children:[(0,l.jsxs)(`div`,{className:`erica-artifact-header`,children:[(0,l.jsx)(`h2`,{className:`erica-artifact-title`,children:r}),(0,l.jsx)(`button`,{onClick:t,className:`erica-artifact-close-button`,"aria-label":`Close drawer`,children:(0,l.jsx)(Tt,{className:`erica-icon-md`})})]}),(0,l.jsx)(`div`,{className:`erica-artifact-body`,children:n})]})]}):null}exports.ArtifactProvider=Vs,exports.ChatArtifact=Xs,exports.EricaChat=Ys;
50
50
  //# sourceMappingURL=index.cjs.map