@pickaxeproject/react 4.2.1 → 4.2.3

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.
@@ -1 +1 @@
1
- "use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}Object.defineProperty(exports,"__esModule",{value:!0});var s=e(require("axios"));const n=process.env.NEXT_PUBLIC_PICKAXE_API_URL||"";if(!n)throw new Error("[px/react] NEXT_PUBLIC_PICKAXE_API_URL is not defined");const o="undefined"!=typeof window?window.location.hostname:"",t="undefined"!=typeof window?window.location.href:"",i=o.includes("pickaxe.co")&&!t.includes("https://studio.pickaxe.co/_embed"),c=s.default.create(Object.assign(Object.assign({baseURL:n},(!process.env.NODE_ENV||"development"===process.env.NODE_ENV)&&Object.assign({},process.env.NEXT_PUBLIC_PICKAXE_SESSION_TOKEN&&{headers:{"x-pickaxe-session-token":process.env.NEXT_PUBLIC_PICKAXE_SESSION_TOKEN}})),i&&{withCredentials:!0}));exports.default=c;
1
+ "use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}Object.defineProperty(exports,"__esModule",{value:!0});var n=e(require("axios"));const o=process.env.NEXT_PUBLIC_PICKAXE_API_URL||"";if(!o)throw new Error("[px/react] NEXT_PUBLIC_PICKAXE_API_URL is not defined");const s="undefined"!=typeof window?window.location.hostname:"",t="undefined"!=typeof window?window.location.href:"",i="undefined"!=typeof window&&window.self!==window.top,d=s.includes("pickaxe.co")&&!t.includes("https://studio.pickaxe.co/_embed")&&!i,c=n.default.create(Object.assign(Object.assign({baseURL:o},(!process.env.NODE_ENV||"development"===process.env.NODE_ENV)&&Object.assign({},process.env.NEXT_PUBLIC_PICKAXE_SESSION_TOKEN&&{headers:{"x-pickaxe-session-token":process.env.NEXT_PUBLIC_PICKAXE_SESSION_TOKEN}})),d&&{withCredentials:!0}));exports.default=c;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),s=require("react"),t=require("../../../../hooks/pickaxe/usePickaxeContext.js"),a=require("../../../../hooks/studio/useStyleFontSize.js"),r=require("./hooks/useDocument.js"),l=require("../../../../common/utils.js"),i=require("../../../Icons/spinner-lines.svg.js"),c=require("../../../Icons/file.svg.js"),o=require("../../../Icons/x.svg.js"),n=require("../../../Icons/circle-info.svg.js"),u=require("../../../../common/cn.js");exports.default=({className:d,isDisabled:f})=>{const{styles:h,colors:m,translations:x,isRtl:j}=t.usePickaxeContext(),{documents:b,isUploading:g,removeDocument:p}=r.useDocument(),v=a.useStyleFontSize();return e.jsx("div",Object.assign({className:u.default("flex flex-row gap-3 flex-wrap",d)},{children:b.map(((t,a)=>{var r,d,b,k,y,w;return e.jsx(s.Fragment,{children:"document"===t.type?e.jsxs("div",Object.assign({className:u.default("relative flex items-center gap-x-2.5 pl-2 pr-4 h-[56px] border",j&&"flex-row-reverse"),style:{borderRadius:h.cornerRadius,borderColor:m.secondaryText+"50"}},{children:[e.jsx("div",Object.assign({className:"w-10 h-10 flex items-center justify-center shrink-0",style:Object.assign({borderRadius:h.cornerRadius,backgroundColor:m.accent,color:m.accentText},"failed"===t.status&&{backgroundColor:m.error,color:"white"})},{children:"uploading"===t.status?e.jsx(i.default,{className:"w-5 h-5 animate-spin shrink-0"}):"failed"===t.status?e.jsx(n.default,{className:"w-5 h-5 shrink-0"}):e.jsx(c.default,{className:"w-5 h-5 shrink-0"})})),e.jsxs("div",Object.assign({className:u.default("flex flex-col justify-center truncate",j?"text-right items-end":"text-left items-start")},{children:[e.jsx("p",Object.assign({className:u.default(v.b3,"font-medium truncate")},{children:t.name})),e.jsx("p",Object.assign({className:u.default(v.b4,"opacity-80 truncate")},{children:"failed"===t.status?(null===(r=t.error)||void 0===r?void 0:r.includes("You have reached the file limit"))?null!==(d=null==x?void 0:x["file-limit-reached"])&&void 0!==d?d:"You have reached the file limit.":t.error:l.formatBytes(t.size)}))]})),!g&&e.jsx("button",Object.assign({type:"button",className:u.default("absolute w-5 h-5 rounded-full -top-2 flex items-center justify-center outline-none disabled:cursor-default",j?"-left-1 right-auto":"-right-1 left-auto"),style:{backgroundColor:m.accent,color:m.accentText},disabled:g||f,onClick:()=>p(t.id)},{children:e.jsx(o.default,{className:"w-4 h-4 shrink-0"})}))]})):"image"===t.type?e.jsxs("div",Object.assign({className:"relative h-[56px] flex flex-col items-center justify-center w-[56px]",style:Object.assign({borderRadius:h.cornerRadius,backgroundColor:m.accent,color:m.accentText},"failed"===t.status&&{backgroundColor:m.error,color:"white"})},{children:["finished"===t.status?e.jsx("img",{className:"object-cover w-full h-full",style:{borderRadius:h.cornerRadius},src:`https://prod-pickaxe-assets.s3.us-west-2.amazonaws.com/documentinterrogation/${null!==(b=t.folder)&&void 0!==b?b:"jpg"}/${t.documentId}.${null!==(k=t.folder)&&void 0!==k?k:"jpg"}`,alt:""}):"failed"===t.status?e.jsx(n.default,{className:"w-5 h-5 shrink-0"}):e.jsx(i.default,{className:"w-5 h-5 animate-spin shrink-0"}),!g&&e.jsx("button",Object.assign({type:"button",className:u.default("absolute w-5 h-5 rounded-full -top-2 flex items-center justify-center outline-none disabled:cursor-default",j?"-left-1 right-auto":"-right-1 left-auto"),style:{backgroundColor:m.accent,color:m.accentText},disabled:g||f,onClick:()=>p(t.id)},{children:e.jsx(o.default,{className:"w-4 h-4 shrink-0"})}))]})):"website"===t.type?e.jsxs("div",Object.assign({className:u.default("relative flex items-center gap-x-2.5 pl-2 pr-4 h-[56px] border",j&&"flex-row-reverse"),style:{borderRadius:h.cornerRadius,borderColor:m.secondaryText+"50"}},{children:[e.jsx("div",Object.assign({className:"w-10 h-10 flex items-center justify-center shrink-0",style:Object.assign({borderRadius:h.cornerRadius,backgroundColor:m.accent,color:m.accentText},"failed"===t.status&&{backgroundColor:m.error,color:"white"})},{children:"uploading"===t.status?e.jsx(i.default,{className:"w-5 h-5 animate-spin shrink-0"}):"failed"===t.status?e.jsx(n.default,{className:"w-5 h-5 shrink-0"}):e.jsx(c.default,{className:"w-5 h-5 shrink-0"})})),e.jsxs("div",Object.assign({className:u.default("flex flex-col justify-center truncate",j?"text-right items-end":"text-left items-start")},{children:[e.jsx("p",Object.assign({className:u.default(v.b3,"font-medium truncate")},{children:t.name})),e.jsx("p",Object.assign({className:u.default(v.b4,"opacity-80 truncate")},{children:"failed"===t.status?(null===(y=t.error)||void 0===y?void 0:y.includes("You have reached the file limit"))?null!==(w=null==x?void 0:x["file-limit-reached"])&&void 0!==w?w:"You have reached the file limit.":t.error:"Website "}))]})),!g&&e.jsx("button",Object.assign({type:"button",className:u.default("absolute w-5 h-5 rounded-full -top-2 flex items-center justify-center outline-none disabled:cursor-default",j?"-left-1 right-auto":"-right-1 left-auto"),style:{backgroundColor:m.accent,color:m.accentText},disabled:g||f,onClick:()=>p(t.id)},{children:e.jsx(o.default,{className:"w-4 h-4 shrink-0"})}))]})):null},a)}))}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),s=require("react"),t=require("../../../../hooks/pickaxe/usePickaxeContext.js"),a=require("../../../../hooks/studio/useStyleFontSize.js"),r=require("./hooks/useDocument.js"),l=require("../../../../common/utils.js"),i=require("../../../Icons/spinner-lines.svg.js"),c=require("../../../Icons/file.svg.js"),n=require("../../../Icons/x.svg.js"),o=require("../../../Icons/circle-info.svg.js"),u=require("../../../../common/cn.js");exports.default=({className:d,isDisabled:f})=>{const{styles:h,colors:m,translations:x,isRtl:j}=t.usePickaxeContext(),{documents:b,isUploading:g,removeDocument:p}=r.useDocument(),v=a.useStyleFontSize();return e.jsx("div",Object.assign({className:u.default("flex flex-row gap-3 flex-wrap",d)},{children:b.map(((t,a)=>{var r,d,b,y,k,N;return e.jsx(s.Fragment,{children:"document"===t.type?e.jsxs("div",Object.assign({className:u.default("relative flex items-center gap-x-2.5 pl-2 pr-4 h-[56px] border",j&&"flex-row-reverse"),style:{borderRadius:h.cornerRadius,borderColor:m.secondaryText+"50"}},{children:[e.jsx("div",Object.assign({className:"w-10 h-10 flex items-center justify-center shrink-0",style:Object.assign({borderRadius:h.cornerRadius,backgroundColor:m.accent,color:m.accentText},"failed"===t.status&&{backgroundColor:m.error,color:"white"})},{children:"uploading"===t.status?e.jsx(i.default,{className:"w-5 h-5 animate-spin shrink-0"}):"failed"===t.status?e.jsx(o.default,{className:"w-5 h-5 shrink-0"}):e.jsx(c.default,{className:"w-5 h-5 shrink-0"})})),e.jsxs("div",Object.assign({className:u.default("flex flex-col justify-center truncate",j?"text-right items-end":"text-left items-start")},{children:[e.jsx("p",Object.assign({className:u.default(v.b3,"font-medium truncate")},{children:t.name})),e.jsx("p",Object.assign({className:u.default(v.b4,"opacity-80 truncate")},{children:"failed"===t.status?(null===(r=t.error)||void 0===r?void 0:r.includes("You have reached the file limit"))?null!==(d=null==x?void 0:x["file-limit-reached"])&&void 0!==d?d:"You have reached the file limit.":t.error:l.formatBytes(t.size)}))]})),!g&&e.jsx("button",Object.assign({type:"button",className:u.default("absolute w-5 h-5 rounded-full -top-2 flex items-center justify-center outline-none disabled:cursor-default",j?"-left-1 right-auto":"-right-1 left-auto"),style:{backgroundColor:m.accent,color:m.accentText},disabled:g||f,onClick:()=>p(t.id)},{children:e.jsx(n.default,{className:"w-4 h-4 shrink-0"})}))]})):"image"===t.type?e.jsxs("div",Object.assign({className:"relative h-[56px] flex flex-col items-center justify-center w-[56px]",style:Object.assign({borderRadius:h.cornerRadius,backgroundColor:m.accent,color:m.accentText},"failed"===t.status&&{backgroundColor:m.error,color:"white"})},{children:["finished"===t.status?e.jsx("img",{className:"object-cover w-full h-full",style:{borderRadius:h.cornerRadius},src:`https://cdn.mail.studio/documentinterrogation/${null!==(b=t.folder)&&void 0!==b?b:"jpg"}/${t.documentId}.${null!==(y=t.folder)&&void 0!==y?y:"jpg"}`,alt:""}):"failed"===t.status?e.jsx(o.default,{className:"w-5 h-5 shrink-0"}):e.jsx(i.default,{className:"w-5 h-5 animate-spin shrink-0"}),!g&&e.jsx("button",Object.assign({type:"button",className:u.default("absolute w-5 h-5 rounded-full -top-2 flex items-center justify-center outline-none disabled:cursor-default",j?"-left-1 right-auto":"-right-1 left-auto"),style:{backgroundColor:m.accent,color:m.accentText},disabled:g||f,onClick:()=>p(t.id)},{children:e.jsx(n.default,{className:"w-4 h-4 shrink-0"})}))]})):"website"===t.type?e.jsxs("div",Object.assign({className:u.default("relative flex items-center gap-x-2.5 pl-2 pr-4 h-[56px] border",j&&"flex-row-reverse"),style:{borderRadius:h.cornerRadius,borderColor:m.secondaryText+"50"}},{children:[e.jsx("div",Object.assign({className:"w-10 h-10 flex items-center justify-center shrink-0",style:Object.assign({borderRadius:h.cornerRadius,backgroundColor:m.accent,color:m.accentText},"failed"===t.status&&{backgroundColor:m.error,color:"white"})},{children:"uploading"===t.status?e.jsx(i.default,{className:"w-5 h-5 animate-spin shrink-0"}):"failed"===t.status?e.jsx(o.default,{className:"w-5 h-5 shrink-0"}):e.jsx(c.default,{className:"w-5 h-5 shrink-0"})})),e.jsxs("div",Object.assign({className:u.default("flex flex-col justify-center truncate",j?"text-right items-end":"text-left items-start")},{children:[e.jsx("p",Object.assign({className:u.default(v.b3,"font-medium truncate")},{children:t.name})),e.jsx("p",Object.assign({className:u.default(v.b4,"opacity-80 truncate")},{children:"failed"===t.status?(null===(k=t.error)||void 0===k?void 0:k.includes("You have reached the file limit"))?null!==(N=null==x?void 0:x["file-limit-reached"])&&void 0!==N?N:"You have reached the file limit.":t.error:"Website "}))]})),!g&&e.jsx("button",Object.assign({type:"button",className:u.default("absolute w-5 h-5 rounded-full -top-2 flex items-center justify-center outline-none disabled:cursor-default",j?"-left-1 right-auto":"-right-1 left-auto"),style:{backgroundColor:m.accent,color:m.accentText},disabled:g||f,onClick:()=>p(t.id)},{children:e.jsx(n.default,{className:"w-4 h-4 shrink-0"})}))]})):null},a)}))}))};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),s=require("../../../../hooks/pickaxe/usePickaxeContext.js"),t=require("../../../../hooks/studio/useStyleFontSize.js"),l=require("../../common/PickaxeIcon.js"),a=require("../../../../common/cn.js");exports.default=({chatRole:i,children:r})=>{var c;const{pickaxeId:o,pickaxe:n,styles:d,colors:u,isRtl:x}=s.usePickaxeContext(),f=t.useStyleFontSize(),j=null!==(c=null==n?void 0:n.chaticon)&&void 0!==c?c:`https://prod-pickaxe-assets.s3.us-west-2.amazonaws.com/chaticons/${o}.png`;return"assistant"===i?e.jsx("div",Object.assign({className:a.default(f.b2,"flex w-full",x?"justify-end":"justify-start"),dir:x?"rtl":"ltr"},{children:e.jsx("div",Object.assign({className:"flex flex-col"},{children:e.jsxs("div",Object.assign({className:a.default("flex gap-x-3",x&&"flex-row-reverse")},{children:["NONE"!==j&&e.jsx(l.default,{src:j,alt:`${null==n?void 0:n.formtitle}'s Chat Icon`,width:24,height:24,className:"my-3 h-6 w-6",textColor:u.text}),r]}))}))})):e.jsx("div",Object.assign({className:a.default(f.b2,"flex w-full",x?"justify-start":"justify-end"),dir:x?"rtl":"ltr"},{children:e.jsx("div",Object.assign({className:a.default("px-4 py-3",x?"text-right":"text-left"),style:{backgroundColor:u.secondary+"80",color:u.secondaryText,borderRadius:d.cornerRadius}},{children:r}))}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),s=require("../../../../hooks/pickaxe/usePickaxeContext.js"),t=require("../../../../hooks/studio/useStyleFontSize.js"),l=require("../../common/PickaxeIcon.js"),i=require("../../../../common/cn.js");exports.default=({chatRole:r,children:a})=>{var c;const{pickaxeId:o,pickaxe:n,styles:d,colors:u,isRtl:x}=s.usePickaxeContext(),f=t.useStyleFontSize(),j=null!==(c=null==n?void 0:n.chaticon)&&void 0!==c?c:`https://cdn.mail.studio/chaticons/${o}.png`;return"assistant"===r?e.jsx("div",Object.assign({className:i.default(f.b2,"flex w-full",x?"justify-end":"justify-start"),dir:x?"rtl":"ltr"},{children:e.jsx("div",Object.assign({className:"flex flex-col"},{children:e.jsxs("div",Object.assign({className:i.default("flex gap-x-3",x&&"flex-row-reverse")},{children:["NONE"!==j&&e.jsx(l.default,{src:j,alt:`${null==n?void 0:n.formtitle}'s Chat Icon`,width:24,height:24,className:"my-3 h-6 w-6",textColor:u.text}),a]}))}))})):e.jsx("div",Object.assign({className:i.default(f.b2,"flex w-full",x?"justify-start":"justify-end"),dir:x?"rtl":"ltr"},{children:e.jsx("div",Object.assign({className:i.default("px-4 py-3",x?"text-right":"text-left"),style:{backgroundColor:u.secondary+"80",color:u.secondaryText,borderRadius:d.cornerRadius}},{children:a}))}))};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),s=require("react"),t=require("../../../../hooks/pickaxe/usePickaxeContext.js"),a=require("../../../../hooks/studio/useStyleFontSize.js"),i=require("../../../../hooks/pickaxe/useResponseContext.js"),l=require("../../Addons/Artifact/hooks/useArtifact.js"),r=require("../../common/PickaxeMarkdown/index.js"),o=require("../../common/PickaxeIcon.js"),c=require("./Document.js"),n=require("../../common/PickaxeMessageActions.js"),d=require("../../common/PickaxeMessageParts/index.js"),x=require("../../../../common/cn.js");exports.default=({index:u,message:m,isLastMessage:p=!1})=>{var f,j;const{pickaxeId:h,pickaxe:g,styles:b,colors:k,misc:v,responsiveBy:w,disableHtml:y,disableJs:N,disableCss:O,isNewChat:C,isRtl:q}=t.usePickaxeContext(),{isGenerating:A}=i.useResponseContext(),{onLoadArtifact:P}=l.useArtifact(),I=a.useStyleFontSize(),M=null!==(f=null==g?void 0:g.chaticon)&&void 0!==f?f:`https://prod-pickaxe-assets.s3.us-west-2.amazonaws.com/chaticons/${h}.png`,R=p&&A,z=!m.parts.some((e=>["text","reasoning","data-action-tool-caption"].includes(e.type)));return"assistant"===m.role?e.jsx("div",Object.assign({className:x.default("flex w-full",q?"justify-end":"justify-start")},{children:e.jsx("div",Object.assign({className:x.default("flex flex-col w-full",0===u&&C&&"viewport"===w&&"min-[767px]:max-w-[80%]",0===u&&C&&"container"===w&&"@[767px]/pickaxe-root:max-w-[80%]")},{children:e.jsxs("div",Object.assign({className:x.default("flex gap-x-3",q&&"flex-row-reverse")},{children:[v.isChatImage&&"NONE"!==M&&e.jsx(o.default,{src:M,alt:"Assistant",width:24,height:24,className:"my-3 h-6 w-6",textColor:k.text}),e.jsxs("div",Object.assign({className:x.default("flex flex-col flex-grow",q?"items-end":"items-start")},{children:[e.jsx("div",Object.assign({className:x.default(I.b2,"chat-message pt-3 w-full",q?"text-right":"text-left")},{children:e.jsx(r.PickaxeMarkdown,Object.assign({theme:b.theme,colors:k},q&&{rtl:!0},y&&{disableHtml:!0},N&&{disableJs:!0},O&&{disableCss:!0},{disableReasoning:null!==(j=null==g?void 0:g.enablereasoningdisplay)&&void 0!==j&&j,onArtifactClick:P},{children:e.jsx(d.default,{parts:m.parts})}))})),e.jsx("div",Object.assign({className:x.default("flex flex-col gap-6 my-4",z&&"mt-2")},{children:R?e.jsx("div",Object.assign({className:"flex items-center gap-x-2 rounded"},{children:Array.from({length:3}).map(((s,t)=>e.jsx("div",{className:x.default("h-1.5 w-1.5 animate-dot rounded-full",1===t&&"animate-dot-down"),style:{backgroundColor:k.secondaryText}},t)))})):e.jsx(n.default,Object.assign({content:m.parts.filter((e=>e.isVisible&&"text"===e.type)).map((e=>e.content)).join("\n"),index:u},"intromessage"===m.area&&{isHideFeedback:!0}))}))]}))]}))}))})):"user"===m.role?e.jsx("div",Object.assign({className:x.default("flex w-full",q?"justify-start":"justify-end")},{children:e.jsx("div",Object.assign({className:x.default("flex gap-x-3 max-w-[80%]",q?"pr-9":"pl-9","viewport"===w?q?"min-[767px]:pr-0":"min-[767px]:pl-0":q?"@[767px]/pickaxe-root:pr-0":"@[767px]/pickaxe-root:pl-0")},{children:e.jsxs("div",Object.assign({className:x.default(I.b2,"overflow-x-auto overflow-y-hidden px-4 py-3 scrollbar-thin scrollbar-track-white scrollbar-thumb-[#4A4A4B] flex flex-col gap-y-3",q?"text-right":"text-left"),style:{backgroundColor:k.secondary+"80",color:k.secondaryText,borderRadius:b.cornerRadius}},{children:[m.documentIds&&m.documentIds.length>0&&e.jsx("div",Object.assign({className:x.default("flex flex-col gap-y-2",q?"items-start":"items-end")},{children:m.documentIds.map((t=>e.jsx(s.Fragment,{children:t.startsWith("IMAGE-")?e.jsx("div",Object.assign({className:"max-w-[300px]"},{children:e.jsx("img",{style:{borderRadius:b.cornerRadius},className:"object-cover w-full h-full",src:`https://prod-pickaxe-assets.s3.us-west-2.amazonaws.com/documentinterrogation/${t.split("-")[2]}/${t.split("-")[1]}.${null==t?void 0:t.split("-")[2]}`,alt:""})})):e.jsx(c.default,{documentId:t})},t)))})),e.jsx(r.PickaxeMarkdown,Object.assign({theme:b.theme,colors:k},q&&{rtl:!0},y&&{disableHtml:!0},N&&{disableJs:!0},O&&{disableCss:!0},{children:e.jsx(d.default,{parts:m.parts})}))]}))}))})):e.jsx("div",{})};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),s=require("react"),t=require("../../../../hooks/pickaxe/usePickaxeContext.js"),a=require("../../../../hooks/studio/useStyleFontSize.js"),i=require("../../../../hooks/pickaxe/useResponseContext.js"),l=require("../../Addons/Artifact/hooks/useArtifact.js"),r=require("../../common/PickaxeMarkdown/index.js"),o=require("../../common/PickaxeIcon.js"),n=require("./Document.js"),c=require("../../common/PickaxeMessageActions.js"),d=require("../../common/PickaxeMessageParts/index.js"),x=require("../../../../common/cn.js");exports.default=({index:u,message:m,isLastMessage:f=!1})=>{var j,p;const{pickaxeId:h,pickaxe:g,styles:b,colors:v,misc:k,responsiveBy:y,disableHtml:w,disableJs:N,disableCss:O,isNewChat:C,isRtl:q}=t.usePickaxeContext(),{isGenerating:A}=i.useResponseContext(),{onLoadArtifact:P}=l.useArtifact(),I=a.useStyleFontSize(),M=null!==(j=null==g?void 0:g.chaticon)&&void 0!==j?j:`https://cdn.mail.studio/chaticons/${h}.png`,R=f&&A,F=!m.parts.some((e=>["text","reasoning","data-action-tool-caption"].includes(e.type)));return"assistant"===m.role?e.jsx("div",Object.assign({className:x.default("flex w-full",q?"justify-end":"justify-start")},{children:e.jsx("div",Object.assign({className:x.default("flex flex-col w-full",0===u&&C&&"viewport"===y&&"min-[767px]:max-w-[80%]",0===u&&C&&"container"===y&&"@[767px]/pickaxe-root:max-w-[80%]")},{children:e.jsxs("div",Object.assign({className:x.default("flex gap-x-3",q&&"flex-row-reverse")},{children:[k.isChatImage&&"NONE"!==M&&e.jsx(o.default,{src:M,alt:"Assistant",width:24,height:24,className:"my-3 h-6 w-6",textColor:v.text}),e.jsxs("div",Object.assign({className:x.default("flex flex-col flex-grow",q?"items-end":"items-start")},{children:[e.jsx("div",Object.assign({className:x.default(I.b2,"chat-message pt-3 w-full",q?"text-right":"text-left")},{children:e.jsx(r.PickaxeMarkdown,Object.assign({theme:b.theme,colors:v},q&&{rtl:!0},w&&{disableHtml:!0},N&&{disableJs:!0},O&&{disableCss:!0},{disableReasoning:null!==(p=null==g?void 0:g.enablereasoningdisplay)&&void 0!==p&&p,onArtifactClick:P},{children:e.jsx(d.default,{parts:m.parts})}))})),e.jsx("div",Object.assign({className:x.default("flex flex-col gap-6 my-4",F&&"mt-2")},{children:R?e.jsx("div",Object.assign({className:"flex items-center gap-x-2 rounded"},{children:Array.from({length:3}).map(((s,t)=>e.jsx("div",{className:x.default("h-1.5 w-1.5 animate-dot rounded-full",1===t&&"animate-dot-down"),style:{backgroundColor:v.secondaryText}},t)))})):e.jsx(c.default,Object.assign({content:m.parts.filter((e=>e.isVisible&&"text"===e.type)).map((e=>e.content)).join("\n"),index:u},"intromessage"===m.area&&{isHideFeedback:!0}))}))]}))]}))}))})):"user"===m.role?e.jsx("div",Object.assign({className:x.default("flex w-full",q?"justify-start":"justify-end")},{children:e.jsx("div",Object.assign({className:x.default("flex gap-x-3 max-w-[80%]",q?"pr-9":"pl-9","viewport"===y?q?"min-[767px]:pr-0":"min-[767px]:pl-0":q?"@[767px]/pickaxe-root:pr-0":"@[767px]/pickaxe-root:pl-0")},{children:e.jsxs("div",Object.assign({className:x.default(I.b2,"overflow-x-auto overflow-y-hidden px-4 py-3 scrollbar-thin scrollbar-track-white scrollbar-thumb-[#4A4A4B] flex flex-col gap-y-3",q?"text-right":"text-left"),style:{backgroundColor:v.secondary+"80",color:v.secondaryText,borderRadius:b.cornerRadius}},{children:[m.documentIds&&m.documentIds.length>0&&e.jsx("div",Object.assign({className:x.default("flex flex-col gap-y-2",q?"items-start":"items-end")},{children:m.documentIds.map((t=>e.jsx(s.Fragment,{children:t.startsWith("IMAGE-")?e.jsx("div",Object.assign({className:"max-w-[300px]"},{children:e.jsx("img",{style:{borderRadius:b.cornerRadius},className:"object-cover w-full h-full",src:`https://cdn.mail.studio/documentinterrogation/${t.split("-")[2]}/${t.split("-")[1]}.${null==t?void 0:t.split("-")[2]}`,alt:""})})):e.jsx(n.default,{documentId:t})},t)))})),e.jsx(r.PickaxeMarkdown,Object.assign({theme:b.theme,colors:v},q&&{rtl:!0},w&&{disableHtml:!0},N&&{disableJs:!0},O&&{disableCss:!0},{children:e.jsx(d.default,{parts:m.parts})}))]}))}))})):e.jsx("div",{})};
@@ -1 +1 @@
1
- import e from"axios";const s=process.env.NEXT_PUBLIC_PICKAXE_API_URL||"";if(!s)throw new Error("[px/react] NEXT_PUBLIC_PICKAXE_API_URL is not defined");const o="undefined"!=typeof window?window.location.hostname:"",n="undefined"!=typeof window?window.location.href:"",i=o.includes("pickaxe.co")&&!n.includes("https://studio.pickaxe.co/_embed"),t=e.create(Object.assign(Object.assign({baseURL:s},(!process.env.NODE_ENV||"development"===process.env.NODE_ENV)&&Object.assign({},process.env.NEXT_PUBLIC_PICKAXE_SESSION_TOKEN&&{headers:{"x-pickaxe-session-token":process.env.NEXT_PUBLIC_PICKAXE_SESSION_TOKEN}})),i&&{withCredentials:!0}));export{t as default};
1
+ import e from"axios";const o=process.env.NEXT_PUBLIC_PICKAXE_API_URL||"";if(!o)throw new Error("[px/react] NEXT_PUBLIC_PICKAXE_API_URL is not defined");const n="undefined"!=typeof window?window.location.hostname:"",s="undefined"!=typeof window?window.location.href:"",i="undefined"!=typeof window&&window.self!==window.top,t=n.includes("pickaxe.co")&&!s.includes("https://studio.pickaxe.co/_embed")&&!i,d=e.create(Object.assign(Object.assign({baseURL:o},(!process.env.NODE_ENV||"development"===process.env.NODE_ENV)&&Object.assign({},process.env.NEXT_PUBLIC_PICKAXE_SESSION_TOKEN&&{headers:{"x-pickaxe-session-token":process.env.NEXT_PUBLIC_PICKAXE_SESSION_TOKEN}})),t&&{withCredentials:!0}));export{d as default};
@@ -1 +1 @@
1
- import{jsx as e,jsxs as t}from"react/jsx-runtime";import{Fragment as s}from"react";import{usePickaxeContext as r}from"../../../../hooks/pickaxe/usePickaxeContext.js";import{useStyleFontSize as i}from"../../../../hooks/studio/useStyleFontSize.js";import{useDocument as a}from"./hooks/useDocument.js";import{formatBytes as o}from"../../../../common/utils.js";import l from"../../../Icons/spinner-lines.svg.js";import c from"../../../Icons/file.svg.js";import n from"../../../Icons/x.svg.js";import d from"../../../Icons/circle-info.svg.js";import u from"../../../../common/cn.js";const m=({className:m,isDisabled:h})=>{const{styles:f,colors:b,translations:p,isRtl:g}=r(),{documents:x,isUploading:j,removeDocument:v}=a(),k=i();return e("div",Object.assign({className:u("flex flex-row gap-3 flex-wrap",m)},{children:x.map(((r,i)=>{var a,m,x,y,w,N;return e(s,{children:"document"===r.type?t("div",Object.assign({className:u("relative flex items-center gap-x-2.5 pl-2 pr-4 h-[56px] border",g&&"flex-row-reverse"),style:{borderRadius:f.cornerRadius,borderColor:b.secondaryText+"50"}},{children:[e("div",Object.assign({className:"w-10 h-10 flex items-center justify-center shrink-0",style:Object.assign({borderRadius:f.cornerRadius,backgroundColor:b.accent,color:b.accentText},"failed"===r.status&&{backgroundColor:b.error,color:"white"})},{children:"uploading"===r.status?e(l,{className:"w-5 h-5 animate-spin shrink-0"}):"failed"===r.status?e(d,{className:"w-5 h-5 shrink-0"}):e(c,{className:"w-5 h-5 shrink-0"})})),t("div",Object.assign({className:u("flex flex-col justify-center truncate",g?"text-right items-end":"text-left items-start")},{children:[e("p",Object.assign({className:u(k.b3,"font-medium truncate")},{children:r.name})),e("p",Object.assign({className:u(k.b4,"opacity-80 truncate")},{children:"failed"===r.status?(null===(a=r.error)||void 0===a?void 0:a.includes("You have reached the file limit"))?null!==(m=null==p?void 0:p["file-limit-reached"])&&void 0!==m?m:"You have reached the file limit.":r.error:o(r.size)}))]})),!j&&e("button",Object.assign({type:"button",className:u("absolute w-5 h-5 rounded-full -top-2 flex items-center justify-center outline-none disabled:cursor-default",g?"-left-1 right-auto":"-right-1 left-auto"),style:{backgroundColor:b.accent,color:b.accentText},disabled:j||h,onClick:()=>v(r.id)},{children:e(n,{className:"w-4 h-4 shrink-0"})}))]})):"image"===r.type?t("div",Object.assign({className:"relative h-[56px] flex flex-col items-center justify-center w-[56px]",style:Object.assign({borderRadius:f.cornerRadius,backgroundColor:b.accent,color:b.accentText},"failed"===r.status&&{backgroundColor:b.error,color:"white"})},{children:["finished"===r.status?e("img",{className:"object-cover w-full h-full",style:{borderRadius:f.cornerRadius},src:`https://prod-pickaxe-assets.s3.us-west-2.amazonaws.com/documentinterrogation/${null!==(x=r.folder)&&void 0!==x?x:"jpg"}/${r.documentId}.${null!==(y=r.folder)&&void 0!==y?y:"jpg"}`,alt:""}):"failed"===r.status?e(d,{className:"w-5 h-5 shrink-0"}):e(l,{className:"w-5 h-5 animate-spin shrink-0"}),!j&&e("button",Object.assign({type:"button",className:u("absolute w-5 h-5 rounded-full -top-2 flex items-center justify-center outline-none disabled:cursor-default",g?"-left-1 right-auto":"-right-1 left-auto"),style:{backgroundColor:b.accent,color:b.accentText},disabled:j||h,onClick:()=>v(r.id)},{children:e(n,{className:"w-4 h-4 shrink-0"})}))]})):"website"===r.type?t("div",Object.assign({className:u("relative flex items-center gap-x-2.5 pl-2 pr-4 h-[56px] border",g&&"flex-row-reverse"),style:{borderRadius:f.cornerRadius,borderColor:b.secondaryText+"50"}},{children:[e("div",Object.assign({className:"w-10 h-10 flex items-center justify-center shrink-0",style:Object.assign({borderRadius:f.cornerRadius,backgroundColor:b.accent,color:b.accentText},"failed"===r.status&&{backgroundColor:b.error,color:"white"})},{children:"uploading"===r.status?e(l,{className:"w-5 h-5 animate-spin shrink-0"}):"failed"===r.status?e(d,{className:"w-5 h-5 shrink-0"}):e(c,{className:"w-5 h-5 shrink-0"})})),t("div",Object.assign({className:u("flex flex-col justify-center truncate",g?"text-right items-end":"text-left items-start")},{children:[e("p",Object.assign({className:u(k.b3,"font-medium truncate")},{children:r.name})),e("p",Object.assign({className:u(k.b4,"opacity-80 truncate")},{children:"failed"===r.status?(null===(w=r.error)||void 0===w?void 0:w.includes("You have reached the file limit"))?null!==(N=null==p?void 0:p["file-limit-reached"])&&void 0!==N?N:"You have reached the file limit.":r.error:"Website "}))]})),!j&&e("button",Object.assign({type:"button",className:u("absolute w-5 h-5 rounded-full -top-2 flex items-center justify-center outline-none disabled:cursor-default",g?"-left-1 right-auto":"-right-1 left-auto"),style:{backgroundColor:b.accent,color:b.accentText},disabled:j||h,onClick:()=>v(r.id)},{children:e(n,{className:"w-4 h-4 shrink-0"})}))]})):null},i)}))}))};export{m as default};
1
+ import{jsx as e,jsxs as t}from"react/jsx-runtime";import{Fragment as s}from"react";import{usePickaxeContext as r}from"../../../../hooks/pickaxe/usePickaxeContext.js";import{useStyleFontSize as i}from"../../../../hooks/studio/useStyleFontSize.js";import{useDocument as a}from"./hooks/useDocument.js";import{formatBytes as o}from"../../../../common/utils.js";import l from"../../../Icons/spinner-lines.svg.js";import c from"../../../Icons/file.svg.js";import n from"../../../Icons/x.svg.js";import d from"../../../Icons/circle-info.svg.js";import u from"../../../../common/cn.js";const m=({className:m,isDisabled:h})=>{const{styles:f,colors:b,translations:p,isRtl:g}=r(),{documents:x,isUploading:j,removeDocument:v}=a(),k=i();return e("div",Object.assign({className:u("flex flex-row gap-3 flex-wrap",m)},{children:x.map(((r,i)=>{var a,m,x,y,N,w;return e(s,{children:"document"===r.type?t("div",Object.assign({className:u("relative flex items-center gap-x-2.5 pl-2 pr-4 h-[56px] border",g&&"flex-row-reverse"),style:{borderRadius:f.cornerRadius,borderColor:b.secondaryText+"50"}},{children:[e("div",Object.assign({className:"w-10 h-10 flex items-center justify-center shrink-0",style:Object.assign({borderRadius:f.cornerRadius,backgroundColor:b.accent,color:b.accentText},"failed"===r.status&&{backgroundColor:b.error,color:"white"})},{children:"uploading"===r.status?e(l,{className:"w-5 h-5 animate-spin shrink-0"}):"failed"===r.status?e(d,{className:"w-5 h-5 shrink-0"}):e(c,{className:"w-5 h-5 shrink-0"})})),t("div",Object.assign({className:u("flex flex-col justify-center truncate",g?"text-right items-end":"text-left items-start")},{children:[e("p",Object.assign({className:u(k.b3,"font-medium truncate")},{children:r.name})),e("p",Object.assign({className:u(k.b4,"opacity-80 truncate")},{children:"failed"===r.status?(null===(a=r.error)||void 0===a?void 0:a.includes("You have reached the file limit"))?null!==(m=null==p?void 0:p["file-limit-reached"])&&void 0!==m?m:"You have reached the file limit.":r.error:o(r.size)}))]})),!j&&e("button",Object.assign({type:"button",className:u("absolute w-5 h-5 rounded-full -top-2 flex items-center justify-center outline-none disabled:cursor-default",g?"-left-1 right-auto":"-right-1 left-auto"),style:{backgroundColor:b.accent,color:b.accentText},disabled:j||h,onClick:()=>v(r.id)},{children:e(n,{className:"w-4 h-4 shrink-0"})}))]})):"image"===r.type?t("div",Object.assign({className:"relative h-[56px] flex flex-col items-center justify-center w-[56px]",style:Object.assign({borderRadius:f.cornerRadius,backgroundColor:b.accent,color:b.accentText},"failed"===r.status&&{backgroundColor:b.error,color:"white"})},{children:["finished"===r.status?e("img",{className:"object-cover w-full h-full",style:{borderRadius:f.cornerRadius},src:`https://cdn.mail.studio/documentinterrogation/${null!==(x=r.folder)&&void 0!==x?x:"jpg"}/${r.documentId}.${null!==(y=r.folder)&&void 0!==y?y:"jpg"}`,alt:""}):"failed"===r.status?e(d,{className:"w-5 h-5 shrink-0"}):e(l,{className:"w-5 h-5 animate-spin shrink-0"}),!j&&e("button",Object.assign({type:"button",className:u("absolute w-5 h-5 rounded-full -top-2 flex items-center justify-center outline-none disabled:cursor-default",g?"-left-1 right-auto":"-right-1 left-auto"),style:{backgroundColor:b.accent,color:b.accentText},disabled:j||h,onClick:()=>v(r.id)},{children:e(n,{className:"w-4 h-4 shrink-0"})}))]})):"website"===r.type?t("div",Object.assign({className:u("relative flex items-center gap-x-2.5 pl-2 pr-4 h-[56px] border",g&&"flex-row-reverse"),style:{borderRadius:f.cornerRadius,borderColor:b.secondaryText+"50"}},{children:[e("div",Object.assign({className:"w-10 h-10 flex items-center justify-center shrink-0",style:Object.assign({borderRadius:f.cornerRadius,backgroundColor:b.accent,color:b.accentText},"failed"===r.status&&{backgroundColor:b.error,color:"white"})},{children:"uploading"===r.status?e(l,{className:"w-5 h-5 animate-spin shrink-0"}):"failed"===r.status?e(d,{className:"w-5 h-5 shrink-0"}):e(c,{className:"w-5 h-5 shrink-0"})})),t("div",Object.assign({className:u("flex flex-col justify-center truncate",g?"text-right items-end":"text-left items-start")},{children:[e("p",Object.assign({className:u(k.b3,"font-medium truncate")},{children:r.name})),e("p",Object.assign({className:u(k.b4,"opacity-80 truncate")},{children:"failed"===r.status?(null===(N=r.error)||void 0===N?void 0:N.includes("You have reached the file limit"))?null!==(w=null==p?void 0:p["file-limit-reached"])&&void 0!==w?w:"You have reached the file limit.":r.error:"Website "}))]})),!j&&e("button",Object.assign({type:"button",className:u("absolute w-5 h-5 rounded-full -top-2 flex items-center justify-center outline-none disabled:cursor-default",g?"-left-1 right-auto":"-right-1 left-auto"),style:{backgroundColor:b.accent,color:b.accentText},disabled:j||h,onClick:()=>v(r.id)},{children:e(n,{className:"w-4 h-4 shrink-0"})}))]})):null},i)}))}))};export{m as default};
@@ -1 +1 @@
1
- import{jsx as s,jsxs as t}from"react/jsx-runtime";import{usePickaxeContext as e}from"../../../../hooks/pickaxe/usePickaxeContext.js";import{useStyleFontSize as o}from"../../../../hooks/studio/useStyleFontSize.js";import i from"../../common/PickaxeIcon.js";import r from"../../../../common/cn.js";const a=({chatRole:a,children:l})=>{var c;const{pickaxeId:n,pickaxe:d,styles:m,colors:x,isRtl:f}=e(),u=o(),h=null!==(c=null==d?void 0:d.chaticon)&&void 0!==c?c:`https://prod-pickaxe-assets.s3.us-west-2.amazonaws.com/chaticons/${n}.png`;return s("div","assistant"===a?Object.assign({className:r(u.b2,"flex w-full",f?"justify-end":"justify-start"),dir:f?"rtl":"ltr"},{children:s("div",Object.assign({className:"flex flex-col"},{children:t("div",Object.assign({className:r("flex gap-x-3",f&&"flex-row-reverse")},{children:["NONE"!==h&&s(i,{src:h,alt:`${null==d?void 0:d.formtitle}'s Chat Icon`,width:24,height:24,className:"my-3 h-6 w-6",textColor:x.text}),l]}))}))}):Object.assign({className:r(u.b2,"flex w-full",f?"justify-start":"justify-end"),dir:f?"rtl":"ltr"},{children:s("div",Object.assign({className:r("px-4 py-3",f?"text-right":"text-left"),style:{backgroundColor:x.secondary+"80",color:x.secondaryText,borderRadius:m.cornerRadius}},{children:l}))}))};export{a as default};
1
+ import{jsx as t,jsxs as s}from"react/jsx-runtime";import{usePickaxeContext as e}from"../../../../hooks/pickaxe/usePickaxeContext.js";import{useStyleFontSize as i}from"../../../../hooks/studio/useStyleFontSize.js";import o from"../../common/PickaxeIcon.js";import l from"../../../../common/cn.js";const r=({chatRole:r,children:c})=>{var a;const{pickaxeId:n,pickaxe:d,styles:m,colors:x,isRtl:f}=e(),u=i(),h=null!==(a=null==d?void 0:d.chaticon)&&void 0!==a?a:`https://cdn.mail.studio/chaticons/${n}.png`;return t("div","assistant"===r?Object.assign({className:l(u.b2,"flex w-full",f?"justify-end":"justify-start"),dir:f?"rtl":"ltr"},{children:t("div",Object.assign({className:"flex flex-col"},{children:s("div",Object.assign({className:l("flex gap-x-3",f&&"flex-row-reverse")},{children:["NONE"!==h&&t(o,{src:h,alt:`${null==d?void 0:d.formtitle}'s Chat Icon`,width:24,height:24,className:"my-3 h-6 w-6",textColor:x.text}),c]}))}))}):Object.assign({className:l(u.b2,"flex w-full",f?"justify-start":"justify-end"),dir:f?"rtl":"ltr"},{children:t("div",Object.assign({className:l("px-4 py-3",f?"text-right":"text-left"),style:{backgroundColor:x.secondary+"80",color:x.secondaryText,borderRadius:m.cornerRadius}},{children:c}))}))};export{r as default};
@@ -1 +1 @@
1
- import{jsx as e,jsxs as s}from"react/jsx-runtime";import{Fragment as t}from"react";import{usePickaxeContext as a}from"../../../../hooks/pickaxe/usePickaxeContext.js";import{useStyleFontSize as i}from"../../../../hooks/studio/useStyleFontSize.js";import{useResponseContext as o}from"../../../../hooks/pickaxe/useResponseContext.js";import{useArtifact as l}from"../../Addons/Artifact/hooks/useArtifact.js";import{PickaxeMarkdown as r}from"../../common/PickaxeMarkdown/index.js";import c from"../../common/PickaxeIcon.js";import n from"./Document.js";import d from"../../common/PickaxeMessageActions.js";import m from"../../common/PickaxeMessageParts/index.js";import p from"../../../../common/cn.js";const x=({index:x,message:f,isLastMessage:h=!1})=>{var u,g;const{pickaxeId:b,pickaxe:j,styles:v,colors:w,misc:k,responsiveBy:y,disableHtml:N,disableJs:O,disableCss:A,isNewChat:C,isRtl:I}=a(),{isGenerating:R}=o(),{onLoadArtifact:P}=l(),M=i(),H=null!==(u=null==j?void 0:j.chaticon)&&void 0!==u?u:`https://prod-pickaxe-assets.s3.us-west-2.amazonaws.com/chaticons/${b}.png`,$=h&&R,z=!f.parts.some((e=>["text","reasoning","data-action-tool-caption"].includes(e.type)));return"assistant"===f.role?e("div",Object.assign({className:p("flex w-full",I?"justify-end":"justify-start")},{children:e("div",Object.assign({className:p("flex flex-col w-full",0===x&&C&&"viewport"===y&&"min-[767px]:max-w-[80%]",0===x&&C&&"container"===y&&"@[767px]/pickaxe-root:max-w-[80%]")},{children:s("div",Object.assign({className:p("flex gap-x-3",I&&"flex-row-reverse")},{children:[k.isChatImage&&"NONE"!==H&&e(c,{src:H,alt:"Assistant",width:24,height:24,className:"my-3 h-6 w-6",textColor:w.text}),s("div",Object.assign({className:p("flex flex-col flex-grow",I?"items-end":"items-start")},{children:[e("div",Object.assign({className:p(M.b2,"chat-message pt-3 w-full",I?"text-right":"text-left")},{children:e(r,Object.assign({theme:v.theme,colors:w},I&&{rtl:!0},N&&{disableHtml:!0},O&&{disableJs:!0},A&&{disableCss:!0},{disableReasoning:null!==(g=null==j?void 0:j.enablereasoningdisplay)&&void 0!==g&&g,onArtifactClick:P},{children:e(m,{parts:f.parts})}))})),e("div",Object.assign({className:p("flex flex-col gap-6 my-4",z&&"mt-2")},{children:$?e("div",Object.assign({className:"flex items-center gap-x-2 rounded"},{children:Array.from({length:3}).map(((s,t)=>e("div",{className:p("h-1.5 w-1.5 animate-dot rounded-full",1===t&&"animate-dot-down"),style:{backgroundColor:w.secondaryText}},t)))})):e(d,Object.assign({content:f.parts.filter((e=>e.isVisible&&"text"===e.type)).map((e=>e.content)).join("\n"),index:x},"intromessage"===f.area&&{isHideFeedback:!0}))}))]}))]}))}))})):"user"===f.role?e("div",Object.assign({className:p("flex w-full",I?"justify-start":"justify-end")},{children:e("div",Object.assign({className:p("flex gap-x-3 max-w-[80%]",I?"pr-9":"pl-9","viewport"===y?I?"min-[767px]:pr-0":"min-[767px]:pl-0":I?"@[767px]/pickaxe-root:pr-0":"@[767px]/pickaxe-root:pl-0")},{children:s("div",Object.assign({className:p(M.b2,"overflow-x-auto overflow-y-hidden px-4 py-3 scrollbar-thin scrollbar-track-white scrollbar-thumb-[#4A4A4B] flex flex-col gap-y-3",I?"text-right":"text-left"),style:{backgroundColor:w.secondary+"80",color:w.secondaryText,borderRadius:v.cornerRadius}},{children:[f.documentIds&&f.documentIds.length>0&&e("div",Object.assign({className:p("flex flex-col gap-y-2",I?"items-start":"items-end")},{children:f.documentIds.map((s=>e(t,{children:s.startsWith("IMAGE-")?e("div",Object.assign({className:"max-w-[300px]"},{children:e("img",{style:{borderRadius:v.cornerRadius},className:"object-cover w-full h-full",src:`https://prod-pickaxe-assets.s3.us-west-2.amazonaws.com/documentinterrogation/${s.split("-")[2]}/${s.split("-")[1]}.${null==s?void 0:s.split("-")[2]}`,alt:""})})):e(n,{documentId:s})},s)))})),e(r,Object.assign({theme:v.theme,colors:w},I&&{rtl:!0},N&&{disableHtml:!0},O&&{disableJs:!0},A&&{disableCss:!0},{children:e(m,{parts:f.parts})}))]}))}))})):e("div",{})};export{x as default};
1
+ import{jsx as e,jsxs as s}from"react/jsx-runtime";import{Fragment as t}from"react";import{usePickaxeContext as i}from"../../../../hooks/pickaxe/usePickaxeContext.js";import{useStyleFontSize as a}from"../../../../hooks/studio/useStyleFontSize.js";import{useResponseContext as o}from"../../../../hooks/pickaxe/useResponseContext.js";import{useArtifact as l}from"../../Addons/Artifact/hooks/useArtifact.js";import{PickaxeMarkdown as r}from"../../common/PickaxeMarkdown/index.js";import c from"../../common/PickaxeIcon.js";import n from"./Document.js";import d from"../../common/PickaxeMessageActions.js";import m from"../../common/PickaxeMessageParts/index.js";import p from"../../../../common/cn.js";const x=({index:x,message:f,isLastMessage:h=!1})=>{var u,g;const{pickaxeId:b,pickaxe:j,styles:v,colors:y,misc:k,responsiveBy:w,disableHtml:N,disableJs:O,disableCss:A,isNewChat:C,isRtl:I}=i(),{isGenerating:R}=o(),{onLoadArtifact:P}=l(),M=a(),H=null!==(u=null==j?void 0:j.chaticon)&&void 0!==u?u:`https://cdn.mail.studio/chaticons/${b}.png`,$=h&&R,J=!f.parts.some((e=>["text","reasoning","data-action-tool-caption"].includes(e.type)));return"assistant"===f.role?e("div",Object.assign({className:p("flex w-full",I?"justify-end":"justify-start")},{children:e("div",Object.assign({className:p("flex flex-col w-full",0===x&&C&&"viewport"===w&&"min-[767px]:max-w-[80%]",0===x&&C&&"container"===w&&"@[767px]/pickaxe-root:max-w-[80%]")},{children:s("div",Object.assign({className:p("flex gap-x-3",I&&"flex-row-reverse")},{children:[k.isChatImage&&"NONE"!==H&&e(c,{src:H,alt:"Assistant",width:24,height:24,className:"my-3 h-6 w-6",textColor:y.text}),s("div",Object.assign({className:p("flex flex-col flex-grow",I?"items-end":"items-start")},{children:[e("div",Object.assign({className:p(M.b2,"chat-message pt-3 w-full",I?"text-right":"text-left")},{children:e(r,Object.assign({theme:v.theme,colors:y},I&&{rtl:!0},N&&{disableHtml:!0},O&&{disableJs:!0},A&&{disableCss:!0},{disableReasoning:null!==(g=null==j?void 0:j.enablereasoningdisplay)&&void 0!==g&&g,onArtifactClick:P},{children:e(m,{parts:f.parts})}))})),e("div",Object.assign({className:p("flex flex-col gap-6 my-4",J&&"mt-2")},{children:$?e("div",Object.assign({className:"flex items-center gap-x-2 rounded"},{children:Array.from({length:3}).map(((s,t)=>e("div",{className:p("h-1.5 w-1.5 animate-dot rounded-full",1===t&&"animate-dot-down"),style:{backgroundColor:y.secondaryText}},t)))})):e(d,Object.assign({content:f.parts.filter((e=>e.isVisible&&"text"===e.type)).map((e=>e.content)).join("\n"),index:x},"intromessage"===f.area&&{isHideFeedback:!0}))}))]}))]}))}))})):"user"===f.role?e("div",Object.assign({className:p("flex w-full",I?"justify-start":"justify-end")},{children:e("div",Object.assign({className:p("flex gap-x-3 max-w-[80%]",I?"pr-9":"pl-9","viewport"===w?I?"min-[767px]:pr-0":"min-[767px]:pl-0":I?"@[767px]/pickaxe-root:pr-0":"@[767px]/pickaxe-root:pl-0")},{children:s("div",Object.assign({className:p(M.b2,"overflow-x-auto overflow-y-hidden px-4 py-3 scrollbar-thin scrollbar-track-white scrollbar-thumb-[#4A4A4B] flex flex-col gap-y-3",I?"text-right":"text-left"),style:{backgroundColor:y.secondary+"80",color:y.secondaryText,borderRadius:v.cornerRadius}},{children:[f.documentIds&&f.documentIds.length>0&&e("div",Object.assign({className:p("flex flex-col gap-y-2",I?"items-start":"items-end")},{children:f.documentIds.map((s=>e(t,{children:s.startsWith("IMAGE-")?e("div",Object.assign({className:"max-w-[300px]"},{children:e("img",{style:{borderRadius:v.cornerRadius},className:"object-cover w-full h-full",src:`https://cdn.mail.studio/documentinterrogation/${s.split("-")[2]}/${s.split("-")[1]}.${null==s?void 0:s.split("-")[2]}`,alt:""})})):e(n,{documentId:s})},s)))})),e(r,Object.assign({theme:v.theme,colors:y},I&&{rtl:!0},N&&{disableHtml:!0},O&&{disableJs:!0},A&&{disableCss:!0},{children:e(m,{parts:f.parts})}))]}))}))})):e("div",{})};export{x as default};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pickaxeproject/react",
3
- "version": "4.2.1",
3
+ "version": "4.2.3",
4
4
  "description": "Client utility library for Pickaxe",
5
5
  "repository": {
6
6
  "type": "git",