@pickaxeproject/react 1.3.12 → 1.4.0
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/cjs/components/Core/Skeleton.js +1 -0
- package/dist/cjs/components/Pickaxe/Addons/IceBreaker/Breaker.js +1 -1
- package/dist/cjs/components/Pickaxe/Addons/IceBreaker/index.js +1 -1
- package/dist/cjs/components/Pickaxe/Chat/History/Message.js +1 -1
- package/dist/cjs/components/Pickaxe/Chat/History/index.js +1 -1
- package/dist/cjs/components/Pickaxe/Chat/Input.js +1 -1
- package/dist/cjs/components/Pickaxe/Chat/index.js +1 -1
- package/dist/cjs/components/Pickaxe/common/PickaxeCompactHead.js +1 -1
- package/dist/cjs/components/Pickaxe/common/PickaxeHead.js +1 -1
- package/dist/cjs/components/Pickaxe/index.js +1 -1
- package/dist/cjs/prose.css +1 -1
- package/dist/cjs/src/components/Pickaxe/Chat/History/Message.d.ts +2 -1
- package/dist/cjs/src/components/Pickaxe/Chat/History/index.d.ts +5 -1
- package/dist/cjs/src/components/Pickaxe/Chat/Input.d.ts +6 -1
- package/dist/cjs/src/components/Pickaxe/common/PickaxeCompactHead.d.ts +2 -1
- package/dist/cjs/src/components/Pickaxe/common/PickaxeHead.d.ts +2 -1
- package/dist/cjs/src/hooks/pickaxe/useSubmit.d.ts +1 -1
- package/dist/esm/components/Core/Skeleton.js +1 -0
- package/dist/esm/components/Pickaxe/Addons/IceBreaker/Breaker.js +1 -1
- package/dist/esm/components/Pickaxe/Addons/IceBreaker/index.js +1 -1
- package/dist/esm/components/Pickaxe/Chat/History/Message.js +1 -1
- package/dist/esm/components/Pickaxe/Chat/History/index.js +1 -1
- package/dist/esm/components/Pickaxe/Chat/Input.js +1 -1
- package/dist/esm/components/Pickaxe/Chat/index.js +1 -1
- package/dist/esm/components/Pickaxe/common/PickaxeCompactHead.js +1 -1
- package/dist/esm/components/Pickaxe/common/PickaxeHead.js +1 -1
- package/dist/esm/components/Pickaxe/index.js +1 -1
- package/dist/esm/prose.css +1 -1
- package/dist/esm/src/components/Pickaxe/Chat/History/Message.d.ts +2 -1
- package/dist/esm/src/components/Pickaxe/Chat/History/index.d.ts +5 -1
- package/dist/esm/src/components/Pickaxe/Chat/Input.d.ts +6 -1
- package/dist/esm/src/components/Pickaxe/common/PickaxeCompactHead.d.ts +2 -1
- package/dist/esm/src/components/Pickaxe/common/PickaxeHead.d.ts +2 -1
- package/dist/esm/src/hooks/pickaxe/useSubmit.d.ts +1 -1
- package/package.json +1 -1
- package/dist/cjs/components/Core/ScrollArea.js +0 -1
- package/dist/cjs/hooks/core/useDebounce.js +0 -1
- package/dist/esm/components/Core/ScrollArea.js +0 -1
- package/dist/esm/hooks/core/useDebounce.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),s=require("../../common/cn.js");exports.default=({children:a,className:r,innerClassName:i,isLoaded:t=!1})=>e.jsx("div",Object.assign({className:s.default("rounded-sm",!t&&"animate-pulse bg-[#E5E7EB] dark:bg-[#1E1E1F]",t&&"animate-none",r)},{children:e.jsx("div",Object.assign({className:s.default("flex items-center",!t&&"opacity-0",i)},{children:a}))}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../../_virtual/_tslib.js"),r=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../../_virtual/_tslib.js"),r=require("react/jsx-runtime"),o=require("../../../../hooks/core/useHover.js"),s=require("../../../../hooks/pickaxe/usePickaxeContext.js"),t=require("../../../../common/cn.js");exports.default=({text:i,onSend:a})=>{const{colors:n,styles:l,forceMobile:c,responsiveBy:u}=s.usePickaxeContext(),x=o.useHover(),{isHover:d}=x,p=e.__rest(x,["isHover"]);return r.jsxs("div",Object.assign({className:t.default("relative text-sm group flex flex-grow cursor-pointer overflow-hidden font-semilight w-full select-none px-[1em] py-[9px] duration-200 transition-colors border w-full ease-in-out","viewport"===u?"min-[767px]:justify-end min-[767px]:max-w-max":"@[767px]/pickaxe-root:justify-end @[767px]/pickaxe-root:max-w-max",c&&"max-w-full"),onClick:()=>null==a?void 0:a(i),style:{background:d?n.secondary:"transparent",borderColor:n.secondaryText+"30",borderRadius:l.cornerRadius}},p,{children:[r.jsx("div",{className:"absolute inset-0 backdrop-blur-md z-0",style:{background:d?n.secondary:n.primary+"10",borderRadius:l.cornerRadius}}),r.jsx("p",Object.assign({className:t.default("line-clamp-2 duration-200 transition-colors ease-in-out relative","viewport"===u?"min-[767px]:text-right":"@[767px]/pickaxe-root:text-right",c&&"text-left"),style:{color:d?n.secondaryText:n.secondaryText+"60"}},{children:i}))]}))};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("./Breaker.js");exports.default=({data:t,onSend:a})=>e.jsx(e.Fragment,{children:t.map(((t,s)=>e.jsx(r.default,{text:t,onSend:a},s)))});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),s=require("react"),a=require("../../../../hooks/pickaxe/usePickaxeContext.js"),t=require("../../../../hooks/studio/useStyleFontSize.js"),c=require("../../common/PickaxeMarkdown/index.js"),i=require("../../common/PickaxeMarkdown/Renderer.js"),o=require("../../common/PickaxeIcon.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),s=require("react"),a=require("../../../../hooks/pickaxe/usePickaxeContext.js"),t=require("../../../../hooks/studio/useStyleFontSize.js"),c=require("../../common/PickaxeMarkdown/index.js"),i=require("../../common/PickaxeMarkdown/Renderer.js"),o=require("../../common/PickaxeIcon.js"),r=require("./Document.js"),n=require("../../common/PickaxeCopyButton.js"),l=require("../../../../common/cn.js");exports.default=({index:x,message:d,isIntroExpand:m})=>{var u;const{formId:j,pickaxe:p,styles:h,colors:k,misc:f,responsiveBy:g,isNewChat:v}=a.usePickaxeContext(),w=t.useStyleFontSize(),b=null!==(u=null==p?void 0:p.chaticon)&&void 0!==u?u:`https://prod-pickaxe-assets.s3.us-west-2.amazonaws.com/chaticons/${j}.png`;return"assistant"===d.role?e.jsx("div",Object.assign({className:l.default("flex flex-col",0===x&&v&&"viewport"===g&&"min-[767px]:max-w-[80%]",0===x&&v&&"container"===g&&"@[767px]/pickaxe-root:max-w-[80%]")},{children:e.jsxs("div",Object.assign({className:"flex gap-x-3"},{children:[f.isChatImage&&"NONE"!==b&&e.jsx(o.default,{src:b,alt:"Assistant",width:24,height:24,className:"my-3 h-6 w-6",textColor:k.text}),e.jsxs("div",Object.assign({className:"flex flex-col"},{children:[e.jsx("div",Object.assign({className:l.default(w.b2,"chat-message pt-3")},{children:e.jsx(c.PickaxeMarkdown,Object.assign({theme:h.theme,accentColor:k.accent,linkPreviews:!0,actions:!0},{children:e.jsx(i.PickaxeMarkdownRenderer,{value:d.content})}))})),e.jsx("div",Object.assign({className:"mt-4 flex gap-3"},{children:e.jsx(n.default,{color:k.accent,text:d.content})}))]}))]}))})):"user"===d.role?e.jsx("div",Object.assign({className:l.default("flex gap-x-3 justify-self-end pl-9","viewport"===g?"min-[767px]:max-w-[80%] min-[767px]:pl-0":"@[767px]/pickaxe-root:max-w-[80%] @[767px]/pickaxe-root:pl-0")},{children:e.jsxs("div",Object.assign({className:l.default(w.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"),style:{backgroundColor:k.secondary+"80",color:k.secondaryText,borderRadius:h.cornerRadius}},{children:[d.documentIds&&d.documentIds.length>0&&e.jsx("div",Object.assign({className:"flex flex-col items-end"},{children:d.documentIds.map((a=>e.jsx(s.Fragment,{children:a.startsWith("IMAGE-")?e.jsx("div",Object.assign({className:"max-w-[300px]"},{children:e.jsx("img",{style:{borderRadius:h.cornerRadius},className:"object-cover w-full h-full",src:`https://prod-pickaxe-assets.s3.us-west-2.amazonaws.com/documentinterrogation/${a.split("-")[2]}/${a.split("-")[1]}.${null==a?void 0:a.split("-")[2]}`,alt:""})})):e.jsx(r.default,{documentId:a})},a)))})),e.jsx(c.PickaxeMarkdown,Object.assign({theme:h.theme,accentColor:k.accent},{children:e.jsx(i.PickaxeMarkdownRenderer,{value:d.content})}))]}))})):e.jsx("div",{})};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),s=require("react"),a=require("../../../../hooks/pickaxe/usePickaxeContext.js"),t=require("../../../../hooks/pickaxe/useResponseContext.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),s=require("react"),a=require("../../../../hooks/pickaxe/usePickaxeContext.js"),t=require("../../../../hooks/pickaxe/useResponseContext.js"),i=require("../../Addons/Scroll/hooks/useScrollContext.js"),l=require("../../../../hooks/studio/useStyleFontSize.js"),o=require("../../../../hooks/pickaxe/useConversation.js"),r=require("../../common/PickaxeIcon.js"),n=require("../../../Core/ErrorAlert.js"),c=require("../../Addons/Scroll/ScrollLockView.js"),d=require("../../common/PickaxeHead.js"),u=require("../../common/PickaxeCompactHead.js"),x=require("../../common/PickaxeUpgradeCard.js"),m=require("./Message.js"),f=require("../../../../common/cn.js"),j=require("../../common/PickaxeBranding.js");exports.default=({hideInfo:h,isInputFocused:g})=>{var p;const v=o.useConversation(),w=l.useStyleFontSize(),{pickaxe:b,colors:k,misc:N,isNewChat:C,isEmbed:y,setChatId:q}=a.usePickaxeContext(),{scrollContainerRef:O}=i.useScrollContext(),{messages:S,status:P,limitData:I,error:E}=t.useResponseContext(),L=s.useMemo((()=>!!v.data&&!(v.data.messages.length<=1)),[v.data]),M=s.useMemo((()=>!h&&v.isSuccess&&C&&!L),[h,v.isSuccess,C,L]),A=s.useMemo((()=>{var e,s;return!!S.length&&!(null!==(s=null===(e=null==S?void 0:S[S.length-1])||void 0===e?void 0:e.content)&&void 0!==s?s:"").trim()}),[S]);return e.jsx("div",Object.assign({ref:O,className:"flex w-full h-[calc(100dvh-74px)] flex-col items-center overflow-y-auto mb-12 pb-8"},{children:e.jsxs("div",Object.assign({className:"relative flex flex-col items-center flex-grow w-full max-w-[800px] px-4"},{children:[(M||!y)&&!N.isWhiteLabel&&e.jsx(j.default,{className:f.default("absolute top-4 right-4",!M&&!y&&"top-2"),animateHover:!0}),e.jsx(d.default,{className:f.default("opacity-0 mt-[0%] transition-all duration-500 ease-in-out max-h-0 overflow-hidden max-w-[500px]",M&&"opacity-100 mt-[10%] max-h-[100%]"),iconClassName:"duration-300 hover:opacity-90",maxLines:2,onIconClick:()=>q("")}),y&&!v.isLoading&&e.jsx(u.default,{className:f.default("opacity-0 transition-all duration-500 ease-in-out h-0 w-full",!M&&"opacity-100 h-[56px]"),iconClassName:"duration-300 hover:opacity-90",onIconClick:()=>q("")}),e.jsx("div",Object.assign({className:f.default("flex flex-col mt-6 transition-all duration-300 ease-in-out w-full",y&&!v.isLoading&&!M&&"mt-0")},{children:v.isError?e.jsx("div",Object.assign({className:"flex w-full justify-center"},{children:e.jsxs("p",Object.assign({className:f.default(w.b2,"text-center font-semibold")},{children:["Something went wrong. Please try again, or"," ",e.jsx("a",Object.assign({href:"mailto:info@pickaxeproject.com?subject=Help",target:"_blank",rel:"noreferrer"},{children:"contact us"}))," ","for help."]}))})):v.data?e.jsxs("div",Object.assign({className:"flex flex-col w-full"},{children:[e.jsxs("div",Object.assign({className:"grid grid-cols-1 gap-y-6 w-full"},{children:[v.data.messages.map(((s,a)=>e.jsx(m.default,Object.assign({index:a,message:s},0===a&&{isIntroExpand:g}),a))),S.map(((s,a)=>e.jsx(m.default,{index:v.data.messages.length+a,message:s},a))),"fetching"===P||A?e.jsxs("div",Object.assign({className:"flex max-w-[80%] items-center gap-x-3"},{children:["NONE"!==(null==b?void 0:b.chaticon)&&e.jsx(r.default,{src:null!==(p=null==b?void 0:b.chaticon)&&void 0!==p?p:`https://prod-pickaxe-assets.s3.us-west-2.amazonaws.com/chaticons/${null==b?void 0:b.formid}.png`,alt:`${null==b?void 0:b.formtitle}'s Chat Icon`,width:24,height:24,className:"h-6 w-6",textColor:k.text}),e.jsx("div",Object.assign({className:"flex items-center gap-x-2 rounded px-4 py-4"},{children:Array.from({length:3}).map(((s,a)=>e.jsx("div",{className:f.default("h-1.5 w-1.5 animate-dot rounded-full",1===a&&"animate-dot-down"),style:{backgroundColor:k.secondaryText}},a)))}))]})):I?e.jsx("div",Object.assign({className:"flex max-w-[80%] items-center gap-x-3"},{children:e.jsx(x.default,{})})):E?e.jsx("div",Object.assign({className:"flex max-w-[80%] items-center gap-x-3"},{children:e.jsx(n.default,{error:E})})):null]})),e.jsx(c.default,{className:"w-full"})]})):null}))]}))}))};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../_virtual/_tslib.js"),s=require("react/jsx-runtime"),t=require("react"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../_virtual/_tslib.js"),s=require("react/jsx-runtime"),t=require("react"),r=require("../../../hooks/pickaxe/usePickaxeContext.js"),o=require("../../../hooks/pickaxe/useResponseContext.js"),n=require("../../../hooks/studio/useStyleInput.js"),i=require("../../../hooks/studio/useStyleFontSize.js"),l=require("../../../hooks/pickaxe/useConversation.js"),a=require("../../../hooks/pickaxe/useSubmit.js"),d=require("../../../hooks/pickaxe/useSubmitResult.js"),c=require("../../../common/documents.js"),u=require("../../../common/api/streamer.js"),m=require("../Addons/Document/hooks/useDocument.js"),g=require("../Addons/Scroll/hooks/useScroll.js"),h=require("../../../hooks/core/useHover.js"),p=require("../../../common/utils.js"),x=require("../../Icons/attach-vertical.svg.js"),f=require("../../Icons/spinner-lines.svg.js"),b=require("../../Icons/file.svg.js"),j=require("../../Icons/x.svg.js"),v=require("../../Icons/arrow-right.svg.js"),y=require("../Addons/IceBreaker/index.js"),w=require("../../Core/Textarea.js"),I=require("../../../common/error.js"),k=require("../../../common/cn.js");exports.default=({isFocused:O,onFocus:N,onBlur:C})=>{var q;const{formId:R,chatId:S,userId:D,studioUserId:A,embedUserId:U,deploymentId:E,pickaxe:_,styles:T,colors:F,responsiveBy:B,isNewChat:H,setIsNewChat:P,setIsShowIceBreaker:z,onGenerateComplete:M}=r.usePickaxeContext(),{messages:G,status:L,limits:W,isGenerating:$,setMessages:K,setStatus:X,setLimitData:J,setError:Q,setIsGenerating:V}=o.useResponseContext(),{documents:Y,isUploading:Z,isImageUploadAllowed:ee,upsertDocuments:se,onFileUpload:te}=m.useDocument(),{scrollStartSession:re,scrollEndSession:oe,scrollToBottom:ne}=g.useScroll({auto:!0}),ie=l.useConversation(),le=a.useSubmit(),ae=d.useSubmitResult(),de=i.useStyleFontSize(),ce=n.useStyleInput(),[ue,me]=t.useState(""),ge=t.useRef(null),he=h.useHover(),{isHover:pe}=he,xe=e.__rest(he,["isHover"]),fe=h.useHover(),{isHover:be}=fe,je=e.__rest(fe,["isHover"]),ve=t.useMemo((()=>{var e,s,t;return!!H&&(!!_&&(!ie.isLoading&&(!((null!==(s=null===(e=ie.data)||void 0===e?void 0:e.messages.length)&&void 0!==s?s:0)>1)&&!!(null===(t=_.icebreakers)||void 0===t?void 0:t.length))))}),[_,H,ie.data,ie.isLoading]),ye=s=>e.__awaiter(void 0,void 0,void 0,(function*(){try{if(Z||"idle"!==L||$)return;const e=null!=s?s:ue;if(!e)return;me(""),Q(""),J(null),V(!0),P(!1);const t=new Date,r="enduserupload"===(null==_?void 0:_.documentuploadtype),o=Y.filter((e=>"finished"===e.status&&!e.isInsertedAsRaw)),n=o.length?o[o.length-1].documentId:"";X("fetching"),re(),ne();const i=Array.from(G);let l=[...i,{id:G.length+1,role:"user",content:e}];K(l),ne();const{success:a,data:d,actionData:c,usedDocumentIds:m,endUserDocumentId:g,endUserImageId:h,rawUserInput:p,error:x}=yield le.mutateAsync(Object.assign(Object.assign(Object.assign(Object.assign({formId:R,responseId:S,value:e},r&&n&&{documentId:n}),A&&{studioUserId:A}),U&&{embedUserId:U}),E&&{deploymentId:E}));if(!a)throw new Error(null!=x?x:"An error occurred, please try again.");const f=[];g&&f.push(g),h&&f.push(h),f.length>0&&(l=[...i,Object.assign({id:G.length+1,role:"user",content:e},f&&{documentIds:f})],K(l),ne()),se([]),ne();const b=(yield u.streamer({formId:R,responseId:S,data:d,actionData:c})).body;if(!b)throw new Error("Streaming error");const j=b.getReader(),v=new TextDecoder,y=l.length;let w="",I=!0,k=!1;for(;I;){const{value:e,done:s}=yield j.read();I=!s;const t=v.decode(e);if(t.startsWith("[PXE-ERROR]"))throw new Error(t.replace("[PXE-ERROR]","").trim());if(w+=t.replace(/\u200B/g,""),w)k||(X("streaming"),k=!0),K([...l.slice(0,y),{id:G.length+1,role:"assistant",content:w}]);else if(!I&&!w)throw new Error("Server error")}const O=new Date;w&&(ne(),yield ae.mutateAsync(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({formId:R,responseId:S,documentIds:m},D&&{userId:D}),A&&{studioUserId:A}),A&&(null==_?void 0:_.studioid)&&{studioId:_.studioid}),U&&{embedUserId:U}),E&&{deploymentId:E}),{messages:[Object.assign(Object.assign({role:"user",message:p},f&&{documentIds:f}),{sentAt:t}),{role:"assistant",message:w,sentAt:O}]})),X("idle"),null==M||M(S))}catch(e){let s=I.default(e)||"";s&&!s.includes("Unexpected token 'A',")||(s="Oops! We're experiencing high traffic at the moment. Please try again later.");const t=Object.entries(W).find((([e])=>s.includes(e)));t?J(t[1]):Q(s),ne()}finally{X("idle"),V(!1),oe()}}));return t.useEffect((()=>{z(ve)}),[ve]),s.jsx("div",Object.assign({className:"px-4 pb-4 w-full flex flex-col items-center fixed bottom-0 left-0 z-1"},{children:s.jsxs("div",Object.assign({className:"relative flex flex-col max-w-[800px] w-full"},{children:[s.jsx("div",Object.assign({className:"absolute right-0 bottom-full"},{children:s.jsx("div",Object.assign({className:k.default("flex justify-end flex-col gap-2 pb-4 px-2","viewport"===B?"min-[767px]:items-end":"@[767px]/pickaxe-root:items-end")},{children:ve&&!O&&s.jsx(y.default,{data:(null==_?void 0:_.icebreakers)||[],onSend:ye})}))})),s.jsxs("div",Object.assign({className:k.default("flex flex-col gap-y-2 px-4 py-3","block"===T.formFieldStyle&&"shadow"),style:ce},{children:["idle"===L&&Y.length>0&&s.jsx("div",Object.assign({className:k.default("grid grid-cols-1","viewport"===B?"min-[765px]:grid-cols-2":"@[767px]/pickaxe-root:grid-cols-2")},{children:Y.map((e=>{var r,o,n;return s.jsx(t.Fragment,{children:"document"===e.type?s.jsxs("div",Object.assign({className:"relative gap-x-[10px] flex items-center px-2 h-[56px] border",style:{borderRadius:ce.borderRadius,borderColor:F.secondaryText+"50"}},{children:[s.jsx("div",Object.assign({className:"w-10 h-10 flex items-center justify-center shrink-0",style:{backgroundColor:F.accent,borderRadius:ce.borderRadius}},{children:Z?s.jsx(f.default,{className:"w-5 h-5 animate-spin",style:{color:F.accentText}}):s.jsx(b.default,{className:"w-5 h-5",style:{color:F.accentText}})})),s.jsxs("div",Object.assign({className:"flex flex-col justify-center truncate"},{children:[s.jsx("p",Object.assign({className:(k.default(de.b3),"font-medium truncate")},{children:e.name})),s.jsx("p",Object.assign({className:k.default(de.b4,"opacity-80 truncate")},{children:p.formatBytes(e.size)}))]})),s.jsx("button",Object.assign({type:"button",className:"absolute w-5 h-5 rounded-full -right-2 -top-2 flex items-center justify-center border outline-none disabled:cursor-default",style:{backgroundColor:F.accent,borderColor:ce.backgroundColor},disabled:Z||"idle"!==L,onClick:()=>se([])},{children:s.jsx(j.default,{className:"w-4 h-4",style:{color:F.accentText}})}))]})):"image"===e.type?s.jsxs("div",Object.assign({className:"relative h-[56px] w-[56px] bg-stone-100",style:{borderRadius:ce.borderRadius}},{children:["finished"===e.status?s.jsx("img",{style:{borderRadius:ce.borderRadius},className:"object-cover w-full h-full",src:`https://prod-pickaxe-assets.s3.us-west-2.amazonaws.com/documentinterrogation/${null===(r=e.documentId)||void 0===r?void 0:r.split("-")[2]}/${null===(o=e.documentId)||void 0===o?void 0:o.split("-")[1]}.${null===(n=e.documentId)||void 0===n?void 0:n.split("-")[2]}`,alt:""}):s.jsx("div",{className:"h-full w-full animate-pulse",style:{borderRadius:ce.borderRadius,backgroundColor:F.secondary}}),s.jsx("button",Object.assign({type:"button",className:"absolute w-5 h-5 rounded-full -right-2 -top-2 flex items-center justify-center border outline-none disabled:cursor-default",style:{backgroundColor:F.accent,borderColor:ce.backgroundColor},disabled:Z||"idle"!==L,onClick:()=>se([])},{children:s.jsx(j.default,{className:"w-4 h-4",style:{color:F.accentText}})}))]})):null},e.id)}))})),s.jsxs("div",Object.assign({className:"flex items-end gap-x-2"},{children:[s.jsx(w.default,{className:k.default(de.i1,"max-h-60 min-h-[27px] w-full border-transparent bg-transparent",!ue.length&&"max-h-6 overflow-hidden text-ellipsis whitespace-nowrap"),value:ue,placeholder:null!==(q=null==_?void 0:_.placeholdertext)&&void 0!==q?q:"What do you want to talk about?",onChange:e=>me(e),onKeyDown:e=>{"Enter"===e.key&&(e.shiftKey||(e.preventDefault(),Z||"idle"!==L||ye()))},onFocus:N,onBlur:C}),s.jsxs("div",Object.assign({className:"flex items-center gap-x-2"},{children:["enduserupload"===(null==_?void 0:_.documentuploadtype)&&s.jsxs("button",Object.assign({className:"outline-none disabled:cursor-default w-8 h-8 flex items-center justify-center rounded-full transition-colors duration-200 ease-in-out",style:{backgroundColor:be?F.accent+"10":void 0},disabled:Z||"idle"!==L,onClick:()=>{var e;return null===(e=ge.current)||void 0===e?void 0:e.click()}},je,{children:[s.jsx("input",{id:"file-upload",ref:ge,type:"file",accept:[...c.allowedFileMimeTypes,...ee?c.allowedImageMimeTypes:[]].join(", "),multiple:!1,hidden:!0,className:"hidden",onChange:s=>e.__awaiter(void 0,void 0,void 0,(function*(){yield te(Array.from(s.target.files||[])),s.target.value=""}))}),s.jsx(x.default,{className:"h-6 w-6 shrink-0 duration-200 transition-colors ease-in-out",style:{color:be?F.accent:F.accent+"80"}})]})),s.jsx("button",Object.assign({className:"outline-none disabled:cursor-default w-8 h-8 flex items-center justify-center rounded-full duration-200 transition-colors ease-in-out",style:{backgroundColor:(pe||ue.length||Y.length&&Y.every((e=>"finished"===e.status)))&&!$?F.accent:F.accent+"10"},disabled:Z||"idle"!==L,onClick:()=>ye()},xe,{children:s.jsx(v.default,{className:"h-6 w-6 shrink-0 duration-200 transition-colors ease-in-out",style:{color:(pe||ue.length||Y.length&&Y.every((e=>"finished"===e.status)))&&!$?F.accentText:F.accent+"80"}})}))]}))]}))]}))]}))}))};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),s=require("react"),t=require("../../../hooks/pickaxe/useDimensionContext.js"),r=require("./History/index.js"),i=require("./Input.js");exports.default=()=>{const{width:u,height:o}=t.useDimensionContext(),[n,c]=s.useState(!1);return e.jsxs("div",Object.assign({className:"flex flex-grow flex-col items-center"},{children:[e.jsx(r.default,{hideInfo:o<=545||u<=450||n,isInputFocused:n}),e.jsx(i.default,{isFocused:n,onFocus:()=>c(!0),onBlur:()=>c(!1)})]}))};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),i=require("react"),s=require("../../../hooks/pickaxe/usePickaxeContext.js"),t=require("../../../hooks/studio/useStyleFontSize.js"),r=require("./PickaxeIcon.js"),l=require("./PickaxeBranding.js"),a=require("../../../common/cn.js");exports.default=({className:o,iconClassName:c,onIconClick:n})=>{const{pickaxe:u,misc:d}=s.usePickaxeContext(),x=t.useStyleFontSize(),m=i.useMemo((()=>({title:(null==u?void 0:u.formtitle)||"",description:(null==u?void 0:u.formdescription)||""})),[u]);return e.jsxs("div",Object.assign({className:a.default("flex h-[56px] items-center justify-between gap-4",o)},{children:[e.jsxs("div",Object.assign({className:"flex items-center gap-4"},{children:[d.isProfileImage&&e.jsx(r.default,Object.assign({src:null==u?void 0:u.coverphoto,alt:`${null==u?void 0:u.formtitle}'s Profile Picture`,width:32,height:32,className:a.default("shrink-0 h-[32px] w-[32px] rounded-full",c,!!n&&"cursor-pointer")},n&&{onClick:n})),d.isTitle&&e.jsx("p",Object.assign({className:a.default(x.b1)},{children:m.title}))]})),!d.isWhiteLabel&&e.jsx(l.default,{animateHover:!0})]}))};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),i=require("react"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),i=require("react"),s=require("../../../hooks/pickaxe/usePickaxeContext.js"),t=require("../../../hooks/studio/useStyleFontSize.js"),r=require("./PickaxeMarkdown/Renderer.js"),o=require("./PickaxeIcon.js"),n=require("./PickaxeInfoModal.js"),c=require("./PickaxeMarkdown/index.js"),a=require("../../../common/cn.js");exports.default=({className:l,iconClassName:u,maxLines:d,onIconClick:x})=>{const{pickaxe:m,styles:j,colors:k,misc:p}=s.usePickaxeContext(),[f,h]=i.useState(!1),P=t.useStyleFontSize(),v=i.useMemo((()=>({title:(null==m?void 0:m.formtitle)||"",description:(null==m?void 0:m.formdescription)||""})),[m]);return e.jsxs("div",Object.assign({className:a.default("flex flex-col items-center",l)},{children:[f&&e.jsx(n.default,{isOpen:f,onChangeIsOpen:h}),p.isProfileImage&&e.jsx(o.default,Object.assign({src:null==m?void 0:m.coverphoto,alt:`${null==m?void 0:m.formtitle}'s Profile Picture`,width:72,height:72,className:a.default("h-[72px] w-[72px] rounded-full",u,!!x&&"cursor-pointer")},x&&{onClick:x})),p.isTitle&&!!v.title&&e.jsx("h2",Object.assign({className:a.default(P.h2,"mt-6 text-center font-semilight opacity-90",!d&&"line-clamp-2")},{children:null==m?void 0:m.formtitle})),p.isDescription&&!!v.description&&e.jsx(c.PickaxeMarkdown,Object.assign({theme:j.theme,accentColor:k.accent},{children:e.jsx(r.PickaxeMarkdownRenderer,Object.assign({className:"mt-2 text-center",value:v.description},d&&{maxLines:d},{onExpandClick:()=>h(!0)}))}))]}))};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_tslib.js"),t=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_tslib.js"),t=require("react/jsx-runtime"),s=require("../../hooks/pickaxe/usePickaxe.js"),r=require("react"),a=require("../../hooks/pickaxe/usePickaxeContext.js"),o=require("../../hooks/pickaxe/useResponseContext.js"),l=require("../../hooks/pickaxe/useDimensionContext.js"),n=require("../../common/utils.js"),i=require("./Addons/Scroll/Provider.js"),c=require("./Chat/index.js"),u=require("./Form/index.js"),f=require("../../common/cn.js"),d=require("../Core/Skeleton.js");function x(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(s){if("default"!==s){var r=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(t,s,r.get?r:{enumerable:!0,get:function(){return e[s]}})}})),t.default=e,Object.freeze(t)}exports.Pickaxe=({formId:p,className:m})=>{const{chatId:j,styles:h,colors:w,loadFont:k,responsiveBy:b,isFontLoaded:v,setFormId:g,setChatId:q,setPickaxe:O,setIsFontLoaded:P}=a.usePickaxeContext(),{setMessages:y,setResponse:C}=o.useResponseContext(),{setWidth:N,setHeight:R,setIsMobile:_}=l.useDimensionContext(),[F,I]=r.useState(!1),E=s.usePickaxe(),M=r.useRef(null);return r.useEffect((()=>{g(p)}),[p]),r.useEffect((()=>{if(!E.data)return;const e=E.data.chatflag;q(e?n.generateId(15):""),e?y([]):C(null),O(E.data),I(!0)}),[E.data]),r.useEffect((()=>{e.__awaiter(void 0,void 0,void 0,(function*(){"undefined"!=typeof window&&(v||k&&"Real Head Pro"!==h.font&&((yield Promise.resolve().then((function(){return x(require("webfontloader"))}))).default.load({google:{families:[h.font]}}),P(!0)))}))}),[h.font,k,v]),r.useEffect((()=>{if(!M.current)return;const e=new ResizeObserver((e=>{for(const t of e){const{width:e,height:s}=t.contentRect;N(e),R(s),_(e<768)}}));return e.observe(M.current),()=>{e.disconnect()}}),[M.current]),E.data?t.jsx("div",Object.assign({ref:M,className:f.default("relative @container/pickaxe-root flex flex-col flex-grow w-full h-full",m,"dark"===h.theme&&"dark"),style:Object.assign({backgroundColor:w.primary,color:w.text},h.font&&"Real Head Pro"!==h.font&&{fontFamily:h.font})},{children:F?t.jsx(t.Fragment,{children:j?t.jsx(i.default,{children:t.jsx(c.default,{})}):t.jsx(i.default,{children:t.jsx(u.default,{})})}):t.jsx("div",Object.assign({className:f.default("flex items-center flex-col w-full pt-12 px-4 pb-10","viewport"===b?"min-[767px]:pb-40":"@[767px]/pickaxe-root:pb-40")},{children:t.jsxs("div",Object.assign({className:"flex w-full items-center max-w-[700px] flex-col"},{children:[t.jsx(d.default,{className:"w-[72px] h-[72px]"}),t.jsx(d.default,{className:"h-[20px] mt-6 w-full"}),t.jsx(d.default,{className:"h-[20px] mt-2 w-full"}),t.jsx(d.default,{className:"h-[20px] mt-2 w-full max-w-[400px]"}),t.jsx("div",Object.assign({className:"flex flex-col gap-y-8 w-full mt-6"},{children:t.jsx(d.default,{className:f.default("w-full min-h-[48px]","viewport"===b?"min-[767px]:max-w-[176px]":"@[767px]/pickaxe-root:max-w-[176px]")})}))]}))}))})):null};
|
package/dist/cjs/prose.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.pxe-prose p{font-weight:350}.pxe-prose p:not(:only-child){margin-bottom:.75rem}.pxe-prose a{font-weight:600;text-decoration:underline;text-underline-offset:.2rem}.pxe-prose iframe{margin-bottom:1.5rem}.pxe-prose blockquote{margin-bottom:2.5rem;padding-bottom:.25rem;padding-left:1rem;padding-top:.25rem}.pxe-prose hr{margin-bottom:1.5rem}.pxe-prose .pxe-markdown-image,.pxe-prose .pxe-markdown-loom{margin-bottom:1.5rem;margin-top:1.5rem}.pxe-prose .pxe-markdown-loom,.pxe-prose .pxe-markdown-youtube{display:flex;justify-content:center;width:100%}.pxe-prose .pxe-markdown-youtube{margin-bottom:1.5rem;margin-top:1.5rem}.pxe-prose .pxe-markdown-code{margin-bottom:1.5rem}.pxe-prose ol{list-style-type:decimal}.pxe-prose ol,.pxe-prose ul{list-style-position:inside;margin-bottom:1.5rem;padding-left:1rem}.pxe-prose ul{list-style-type:disc}.pxe-prose li{margin:10px 10px 14px}.pxe-prose li>p{display:inline}.pxe-prose .pxe-markdown-table{margin-bottom:2.5rem;overflow:auto;position:relative}.pxe-prose table{font-size:.875rem;line-height:1.24rem;table-layout:fixed}.pxe-prose th{font-weight:600;text-align:left}.pxe-prose td,.pxe-prose th{padding:.75em 1em}.pxe-prose h1{font-size:2.25rem;line-height:2.5rem;margin-bottom:1.5rem}.pxe-prose h2{font-size:1.875rem;line-height:2.25rem;margin-bottom:1.5rem}.pxe-prose h3{font-size:1.5rem;line-height:2rem;margin-bottom:1.5rem}.pxe-prose h4{font-size:1.25rem}.pxe-prose h4,.pxe-prose h5{line-height:1.75rem;margin-bottom:1rem}.pxe-prose h5{font-size:1.125rem}.pxe-prose h2:not(:first-child)
|
|
1
|
+
.pxe-prose p{font-weight:350}.pxe-prose p:not(:only-child){margin-bottom:.75rem}.pxe-prose a{font-weight:600;text-decoration:underline;text-underline-offset:.2rem}.pxe-prose iframe{margin-bottom:1.5rem}.pxe-prose blockquote{margin-bottom:2.5rem;padding-bottom:.25rem;padding-left:1rem;padding-top:.25rem}.pxe-prose hr{margin-bottom:1.5rem}.pxe-prose .pxe-markdown-image,.pxe-prose .pxe-markdown-loom{margin-bottom:1.5rem;margin-top:1.5rem}.pxe-prose .pxe-markdown-loom,.pxe-prose .pxe-markdown-youtube{display:flex;justify-content:center;width:100%}.pxe-prose .pxe-markdown-youtube{margin-bottom:1.5rem;margin-top:1.5rem}.pxe-prose .pxe-markdown-code{margin-bottom:1.5rem}.pxe-prose ol{list-style-type:decimal}.pxe-prose ol,.pxe-prose ul{list-style-position:inside;margin-bottom:1.5rem;padding-left:1rem}.pxe-prose ul{list-style-type:disc}.pxe-prose li{margin:10px 10px 14px}.pxe-prose li>p{display:inline}.pxe-prose .pxe-markdown-table{margin-bottom:2.5rem;overflow:auto;position:relative}.pxe-prose table{font-size:.875rem;line-height:1.24rem;table-layout:fixed}.pxe-prose th{font-weight:600;text-align:left}.pxe-prose td,.pxe-prose th{padding:.75em 1em}.pxe-prose h1{font-size:2.25rem;line-height:2.5rem;margin-bottom:1.5rem}.pxe-prose h2{font-size:1.875rem;line-height:2.25rem;margin-bottom:1.5rem}.pxe-prose h3{font-size:1.5rem;line-height:2rem;margin-bottom:1.5rem}.pxe-prose h4{font-size:1.25rem}.pxe-prose h4,.pxe-prose h5{line-height:1.75rem;margin-bottom:1rem}.pxe-prose h5{font-size:1.125rem}.pxe-prose h2:not(:first-child){margin-top:2.5rem}.pxe-prose h3:not(:first-child),.pxe-prose h4:not(:first-child),.pxe-prose>pre:not(:first-child){margin-top:1rem}.pxe-prose .pxe-markdown-code{display:flex;flex-direction:column}.pxe-prose .pxe-markdown-code>div:first-child{background-color:#1d1f21;border-radius:.3em;display:flex;flex-direction:column;max-width:min-content;padding-top:1em;position:relative}.pxe-prose .pxe-markdown-code>div:first-child>div:first-child{display:flex;justify-content:flex-end;padding:0 1em}.pxe-prose .pxe-markdown-code>div:first-child>div:last-child{overflow:auto}.pxe-prose .pxe-action[data-action-id]:not(:nth-child(2)){margin-top:1rem}.pxe-prose .pxe-markdown-code-inline{background-color:#1d1f21;border-radius:.3em;color:#fff;font-size:10pt;padding:.15em .4em}.pxe-prose .pxe-animated-token{animation:fadeIn .3s ease-out forwards;display:inline-block;opacity:0}.pxe-link-previews{display:flex;flex-direction:column;gap:2rem}.pxe-prose>p:first-child>.pxe-markdown-image,.pxe-prose>p:first-child>.pxe-markdown-youtube{margin-top:0}@keyframes fadeIn{0%{opacity:0;transform:translateX(5px)}to{opacity:1;transform:translateX(0)}}
|
|
@@ -2,6 +2,7 @@ import type { ChatMessage } from "../../../../types/chat";
|
|
|
2
2
|
interface MessageProps {
|
|
3
3
|
index: number;
|
|
4
4
|
message: ChatMessage;
|
|
5
|
+
isIntroExpand?: boolean;
|
|
5
6
|
}
|
|
6
|
-
declare const Message: ({ index, message }: MessageProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
declare const Message: ({ index, message, isIntroExpand: _ }: MessageProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
8
|
export default Message;
|
|
@@ -1,2 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
interface HistoryProps {
|
|
2
|
+
hideInfo: boolean;
|
|
3
|
+
isInputFocused: boolean;
|
|
4
|
+
}
|
|
5
|
+
declare const History: ({ hideInfo, isInputFocused }: HistoryProps) => import("react/jsx-runtime").JSX.Element;
|
|
2
6
|
export default History;
|
|
@@ -1,2 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
interface InputProps {
|
|
2
|
+
isFocused: boolean;
|
|
3
|
+
onFocus: () => void;
|
|
4
|
+
onBlur: () => void;
|
|
5
|
+
}
|
|
6
|
+
declare const Input: ({ isFocused, onFocus, onBlur }: InputProps) => import("react/jsx-runtime").JSX.Element;
|
|
2
7
|
export default Input;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
interface PickaxeCompactHeadProps {
|
|
2
|
+
className?: string;
|
|
2
3
|
iconClassName?: string;
|
|
3
4
|
onIconClick?: () => void;
|
|
4
5
|
}
|
|
5
|
-
declare const PickaxeCompactHead: ({ iconClassName, onIconClick, }: PickaxeCompactHeadProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
declare const PickaxeCompactHead: ({ className, iconClassName, onIconClick, }: PickaxeCompactHeadProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
7
|
export default PickaxeCompactHead;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
interface PickaxeHeadProps {
|
|
2
|
+
className?: string;
|
|
2
3
|
iconClassName?: string;
|
|
3
4
|
maxLines?: number;
|
|
4
5
|
onIconClick?: () => void;
|
|
5
6
|
}
|
|
6
|
-
declare const PickaxeHead: ({ iconClassName, maxLines, onIconClick, }: PickaxeHeadProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
declare const PickaxeHead: ({ className, iconClassName, maxLines, onIconClick, }: PickaxeHeadProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
8
|
export default PickaxeHead;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import a from"../../common/cn.js";const s=({children:s,className:n,innerClassName:i,isLoaded:m=!1})=>e("div",Object.assign({className:a("rounded-sm",!m&&"animate-pulse bg-[#E5E7EB] dark:bg-[#1E1E1F]",m&&"animate-none",n)},{children:e("div",Object.assign({className:a("flex items-center",!m&&"opacity-0",i)},{children:s}))}));export{s as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__rest as e}from"../../../../_virtual/_tslib.js";import{jsx as
|
|
1
|
+
import{__rest as e}from"../../../../_virtual/_tslib.js";import{jsxs as o,jsx as r}from"react/jsx-runtime";import{useHover as t}from"../../../../hooks/core/useHover.js";import{usePickaxeContext as s}from"../../../../hooks/pickaxe/usePickaxeContext.js";import i from"../../../../common/cn.js";const a=({text:a,onSend:n})=>{const{colors:l,styles:c,forceMobile:x,responsiveBy:d}=s(),m=t(),{isHover:p}=m,u=e(m,["isHover"]);return o("div",Object.assign({className:i("relative text-sm group flex flex-grow cursor-pointer overflow-hidden font-semilight w-full select-none px-[1em] py-[9px] duration-200 transition-colors border w-full ease-in-out","viewport"===d?"min-[767px]:justify-end min-[767px]:max-w-max":"@[767px]/pickaxe-root:justify-end @[767px]/pickaxe-root:max-w-max",x&&"max-w-full"),onClick:()=>null==n?void 0:n(a),style:{background:p?l.secondary:"transparent",borderColor:l.secondaryText+"30",borderRadius:c.cornerRadius}},u,{children:[r("div",{className:"absolute inset-0 backdrop-blur-md z-0",style:{background:p?l.secondary:l.primary+"10",borderRadius:c.cornerRadius}}),r("p",Object.assign({className:i("line-clamp-2 duration-200 transition-colors ease-in-out relative","viewport"===d?"min-[767px]:text-right":"@[767px]/pickaxe-root:text-right",x&&"text-left"),style:{color:p?l.secondaryText:l.secondaryText+"60"}},{children:a}))]}))};export{a as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e}from"react/jsx-runtime";import
|
|
1
|
+
import{jsx as e,Fragment as r}from"react/jsx-runtime";import t from"./Breaker.js";const o=({data:o,onSend:a})=>e(r,{children:o.map(((r,o)=>e(t,{text:r,onSend:a},o)))});export{o as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,jsxs as s}from"react/jsx-runtime";import{
|
|
1
|
+
import{jsx as e,jsxs as s}from"react/jsx-runtime";import{Fragment as o}from"react";import{usePickaxeContext as t}from"../../../../hooks/pickaxe/usePickaxeContext.js";import{useStyleFontSize as a}from"../../../../hooks/studio/useStyleFontSize.js";import{PickaxeMarkdown as c}from"../../common/PickaxeMarkdown/index.js";import{PickaxeMarkdownRenderer as i}from"../../common/PickaxeMarkdown/Renderer.js";import n from"../../common/PickaxeIcon.js";import r from"./Document.js";import l from"../../common/PickaxeCopyButton.js";import m from"../../../../common/cn.js";const d=({index:d,message:p,isIntroExpand:x})=>{var h;const{formId:u,pickaxe:f,styles:g,colors:v,misc:j,responsiveBy:b,isNewChat:w}=t(),k=a(),N=null!==(h=null==f?void 0:f.chaticon)&&void 0!==h?h:`https://prod-pickaxe-assets.s3.us-west-2.amazonaws.com/chaticons/${u}.png`;return"assistant"===p.role?e("div",Object.assign({className:m("flex flex-col",0===d&&w&&"viewport"===b&&"min-[767px]:max-w-[80%]",0===d&&w&&"container"===b&&"@[767px]/pickaxe-root:max-w-[80%]")},{children:s("div",Object.assign({className:"flex gap-x-3"},{children:[j.isChatImage&&"NONE"!==N&&e(n,{src:N,alt:"Assistant",width:24,height:24,className:"my-3 h-6 w-6",textColor:v.text}),s("div",Object.assign({className:"flex flex-col"},{children:[e("div",Object.assign({className:m(k.b2,"chat-message pt-3")},{children:e(c,Object.assign({theme:g.theme,accentColor:v.accent,linkPreviews:!0,actions:!0},{children:e(i,{value:p.content})}))})),e("div",Object.assign({className:"mt-4 flex gap-3"},{children:e(l,{color:v.accent,text:p.content})}))]}))]}))})):"user"===p.role?e("div",Object.assign({className:m("flex gap-x-3 justify-self-end pl-9","viewport"===b?"min-[767px]:max-w-[80%] min-[767px]:pl-0":"@[767px]/pickaxe-root:max-w-[80%] @[767px]/pickaxe-root:pl-0")},{children:s("div",Object.assign({className:m(k.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"),style:{backgroundColor:v.secondary+"80",color:v.secondaryText,borderRadius:g.cornerRadius}},{children:[p.documentIds&&p.documentIds.length>0&&e("div",Object.assign({className:"flex flex-col items-end"},{children:p.documentIds.map((s=>e(o,{children:s.startsWith("IMAGE-")?e("div",Object.assign({className:"max-w-[300px]"},{children:e("img",{style:{borderRadius:g.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(r,{documentId:s})},s)))})),e(c,Object.assign({theme:g.theme,accentColor:v.accent},{children:e(i,{value:p.content})}))]}))})):e("div",{})};export{d as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{jsx as e,jsxs as a}from"react/jsx-runtime";import{useMemo as o}from"react";import{usePickaxeContext as s}from"../../../../hooks/pickaxe/usePickaxeContext.js";import{useResponseContext as t}from"../../../../hooks/pickaxe/useResponseContext.js";import{useScrollContext as i}from"../../Addons/Scroll/hooks/useScrollContext.js";import{useStyleFontSize as l}from"../../../../hooks/studio/useStyleFontSize.js";import{useConversation as r}from"../../../../hooks/pickaxe/useConversation.js";import n from"../../common/PickaxeIcon.js";import c from"../../../Core/ErrorAlert.js";import m from"../../Addons/Scroll/ScrollLockView.js";import d from"../../common/PickaxeHead.js";import p from"../../common/PickaxeCompactHead.js";import x from"../../common/PickaxeUpgradeCard.js";import f from"./Message.js";import u from"../../../../common/cn.js";import h from"../../common/PickaxeBranding.js";const g=({hideInfo:g,isInputFocused:j})=>{var v;const w=r(),b=l(),{pickaxe:k,colors:N,misc:C,isNewChat:y,isEmbed:O,setChatId:S}=s(),{scrollContainerRef:I}=i(),{messages:P,status:E,limitData:L,error:A}=t(),H=o((()=>!!w.data&&!(w.data.messages.length<=1)),[w.data]),z=o((()=>!g&&w.isSuccess&&y&&!H),[g,w.isSuccess,y,H]),F=o((()=>{var e,a;return!!P.length&&!(null!==(a=null===(e=null==P?void 0:P[P.length-1])||void 0===e?void 0:e.content)&&void 0!==a?a:"").trim()}),[P]);return e("div",Object.assign({ref:I,className:"flex w-full h-[calc(100dvh-74px)] flex-col items-center overflow-y-auto mb-12 pb-8"},{children:a("div",Object.assign({className:"relative flex flex-col items-center flex-grow w-full max-w-[800px] px-4"},{children:[(z||!O)&&!C.isWhiteLabel&&e(h,{className:u("absolute top-4 right-4",!z&&!O&&"top-2"),animateHover:!0}),e(d,{className:u("opacity-0 mt-[0%] transition-all duration-500 ease-in-out max-h-0 overflow-hidden max-w-[500px]",z&&"opacity-100 mt-[10%] max-h-[100%]"),iconClassName:"duration-300 hover:opacity-90",maxLines:2,onIconClick:()=>S("")}),O&&!w.isLoading&&e(p,{className:u("opacity-0 transition-all duration-500 ease-in-out h-0 w-full",!z&&"opacity-100 h-[56px]"),iconClassName:"duration-300 hover:opacity-90",onIconClick:()=>S("")}),e("div",Object.assign({className:u("flex flex-col mt-6 transition-all duration-300 ease-in-out w-full",O&&!w.isLoading&&!z&&"mt-0")},{children:w.isError?e("div",Object.assign({className:"flex w-full justify-center"},{children:a("p",Object.assign({className:u(b.b2,"text-center font-semibold")},{children:["Something went wrong. Please try again, or"," ",e("a",Object.assign({href:"mailto:info@pickaxeproject.com?subject=Help",target:"_blank",rel:"noreferrer"},{children:"contact us"}))," ","for help."]}))})):w.data?a("div",Object.assign({className:"flex flex-col w-full"},{children:[a("div",Object.assign({className:"grid grid-cols-1 gap-y-6 w-full"},{children:[w.data.messages.map(((a,o)=>e(f,Object.assign({index:o,message:a},0===o&&{isIntroExpand:j}),o))),P.map(((a,o)=>e(f,{index:w.data.messages.length+o,message:a},o))),"fetching"===E||F?a("div",Object.assign({className:"flex max-w-[80%] items-center gap-x-3"},{children:["NONE"!==(null==k?void 0:k.chaticon)&&e(n,{src:null!==(v=null==k?void 0:k.chaticon)&&void 0!==v?v:`https://prod-pickaxe-assets.s3.us-west-2.amazonaws.com/chaticons/${null==k?void 0:k.formid}.png`,alt:`${null==k?void 0:k.formtitle}'s Chat Icon`,width:24,height:24,className:"h-6 w-6",textColor:N.text}),e("div",Object.assign({className:"flex items-center gap-x-2 rounded px-4 py-4"},{children:Array.from({length:3}).map(((a,o)=>e("div",{className:u("h-1.5 w-1.5 animate-dot rounded-full",1===o&&"animate-dot-down"),style:{backgroundColor:N.secondaryText}},o)))}))]})):L?e("div",Object.assign({className:"flex max-w-[80%] items-center gap-x-3"},{children:e(x,{})})):A?e("div",Object.assign({className:"flex max-w-[80%] items-center gap-x-3"},{children:e(c,{error:A})})):null]})),e(m,{className:"w-full"})]})):null}))]}))}))};export{g as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__rest as e,__awaiter as
|
|
1
|
+
import{__rest as e,__awaiter as s}from"../../../_virtual/_tslib.js";import{jsx as t,jsxs as o}from"react/jsx-runtime";import{useState as r,useRef as n,useMemo as i,useEffect as l,Fragment as a}from"react";import{usePickaxeContext as d}from"../../../hooks/pickaxe/usePickaxeContext.js";import{useResponseContext as c}from"../../../hooks/pickaxe/useResponseContext.js";import{useStyleInput as u}from"../../../hooks/studio/useStyleInput.js";import{useStyleFontSize as m}from"../../../hooks/studio/useStyleFontSize.js";import{useConversation as p}from"../../../hooks/pickaxe/useConversation.js";import{useSubmit as f}from"../../../hooks/pickaxe/useSubmit.js";import{useSubmitResult as g}from"../../../hooks/pickaxe/useSubmitResult.js";import{allowedFileMimeTypes as h,allowedImageMimeTypes as b}from"../../../common/documents.js";import{streamer as v}from"../../../common/api/streamer.js";import{useDocument as x}from"../Addons/Document/hooks/useDocument.js";import{useScroll as j}from"../Addons/Scroll/hooks/useScroll.js";import{useHover as y}from"../../../hooks/core/useHover.js";import{formatBytes as w}from"../../../common/utils.js";import I from"../../Icons/attach-vertical.svg.js";import k from"../../Icons/spinner-lines.svg.js";import O from"../../Icons/file.svg.js";import N from"../../Icons/x.svg.js";import C from"../../Icons/arrow-right.svg.js";import R from"../Addons/IceBreaker/index.js";import S from"../../Core/Textarea.js";import A from"../../../common/error.js";import D from"../../../common/cn.js";const U=({isFocused:U,onFocus:E,onBlur:T})=>{var B;const{formId:F,chatId:H,userId:z,studioUserId:P,embedUserId:G,deploymentId:L,pickaxe:W,styles:$,colors:K,responsiveBy:X,isNewChat:_,setIsNewChat:M,setIsShowIceBreaker:q,onGenerateComplete:J}=d(),{messages:Q,status:V,limits:Y,isGenerating:Z,setMessages:ee,setStatus:se,setLimitData:te,setError:oe,setIsGenerating:re}=c(),{documents:ne,isUploading:ie,isImageUploadAllowed:le,upsertDocuments:ae,onFileUpload:de}=x(),{scrollStartSession:ce,scrollEndSession:ue,scrollToBottom:me}=j({auto:!0}),pe=p(),fe=f(),ge=g(),he=m(),be=u(),[ve,xe]=r(""),je=n(null),ye=y(),{isHover:we}=ye,Ie=e(ye,["isHover"]),ke=y(),{isHover:Oe}=ke,Ne=e(ke,["isHover"]),Ce=i((()=>{var e,s,t;return!!_&&(!!W&&(!pe.isLoading&&(!((null!==(s=null===(e=pe.data)||void 0===e?void 0:e.messages.length)&&void 0!==s?s:0)>1)&&!!(null===(t=W.icebreakers)||void 0===t?void 0:t.length))))}),[W,_,pe.data,pe.isLoading]),Re=e=>s(void 0,void 0,void 0,(function*(){try{if(ie||"idle"!==V||Z)return;const s=null!=e?e:ve;if(!s)return;xe(""),oe(""),te(null),re(!0),M(!1);const t=new Date,o="enduserupload"===(null==W?void 0:W.documentuploadtype),r=ne.filter((e=>"finished"===e.status&&!e.isInsertedAsRaw)),n=r.length?r[r.length-1].documentId:"";se("fetching"),ce(),me();const i=Array.from(Q);let l=[...i,{id:Q.length+1,role:"user",content:s}];ee(l),me();const{success:a,data:d,actionData:c,usedDocumentIds:u,endUserDocumentId:m,endUserImageId:p,rawUserInput:f,error:g}=yield fe.mutateAsync(Object.assign(Object.assign(Object.assign(Object.assign({formId:F,responseId:H,value:s},o&&n&&{documentId:n}),P&&{studioUserId:P}),G&&{embedUserId:G}),L&&{deploymentId:L}));if(!a)throw new Error(null!=g?g:"An error occurred, please try again.");const h=[];m&&h.push(m),p&&h.push(p),h.length>0&&(l=[...i,Object.assign({id:Q.length+1,role:"user",content:s},h&&{documentIds:h})],ee(l),me()),ae([]),me();const b=(yield v({formId:F,responseId:H,data:d,actionData:c})).body;if(!b)throw new Error("Streaming error");const x=b.getReader(),j=new TextDecoder,y=l.length;let w="",I=!0,k=!1;for(;I;){const{value:e,done:s}=yield x.read();I=!s;const t=j.decode(e);if(t.startsWith("[PXE-ERROR]"))throw new Error(t.replace("[PXE-ERROR]","").trim());if(w+=t.replace(/\u200B/g,""),w)k||(se("streaming"),k=!0),ee([...l.slice(0,y),{id:Q.length+1,role:"assistant",content:w}]);else if(!I&&!w)throw new Error("Server error")}const O=new Date;w&&(me(),yield ge.mutateAsync(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({formId:F,responseId:H,documentIds:u},z&&{userId:z}),P&&{studioUserId:P}),P&&(null==W?void 0:W.studioid)&&{studioId:W.studioid}),G&&{embedUserId:G}),L&&{deploymentId:L}),{messages:[Object.assign(Object.assign({role:"user",message:f},h&&{documentIds:h}),{sentAt:t}),{role:"assistant",message:w,sentAt:O}]})),se("idle"),null==J||J(H))}catch(e){let s=A(e)||"";s&&!s.includes("Unexpected token 'A',")||(s="Oops! We're experiencing high traffic at the moment. Please try again later.");const t=Object.entries(Y).find((([e])=>s.includes(e)));t?te(t[1]):oe(s),me()}finally{se("idle"),re(!1),ue()}}));return l((()=>{q(Ce)}),[Ce]),t("div",Object.assign({className:"px-4 pb-4 w-full flex flex-col items-center fixed bottom-0 left-0 z-1"},{children:o("div",Object.assign({className:"relative flex flex-col max-w-[800px] w-full"},{children:[t("div",Object.assign({className:"absolute right-0 bottom-full"},{children:t("div",Object.assign({className:D("flex justify-end flex-col gap-2 pb-4 px-2","viewport"===X?"min-[767px]:items-end":"@[767px]/pickaxe-root:items-end")},{children:Ce&&!U&&t(R,{data:(null==W?void 0:W.icebreakers)||[],onSend:Re})}))})),o("div",Object.assign({className:D("flex flex-col gap-y-2 px-4 py-3","block"===$.formFieldStyle&&"shadow"),style:be},{children:["idle"===V&&ne.length>0&&t("div",Object.assign({className:D("grid grid-cols-1","viewport"===X?"min-[765px]:grid-cols-2":"@[767px]/pickaxe-root:grid-cols-2")},{children:ne.map((e=>{var s,r,n;return t(a,{children:"document"===e.type?o("div",Object.assign({className:"relative gap-x-[10px] flex items-center px-2 h-[56px] border",style:{borderRadius:be.borderRadius,borderColor:K.secondaryText+"50"}},{children:[t("div",Object.assign({className:"w-10 h-10 flex items-center justify-center shrink-0",style:{backgroundColor:K.accent,borderRadius:be.borderRadius}},{children:ie?t(k,{className:"w-5 h-5 animate-spin",style:{color:K.accentText}}):t(O,{className:"w-5 h-5",style:{color:K.accentText}})})),o("div",Object.assign({className:"flex flex-col justify-center truncate"},{children:[t("p",Object.assign({className:(D(he.b3),"font-medium truncate")},{children:e.name})),t("p",Object.assign({className:D(he.b4,"opacity-80 truncate")},{children:w(e.size)}))]})),t("button",Object.assign({type:"button",className:"absolute w-5 h-5 rounded-full -right-2 -top-2 flex items-center justify-center border outline-none disabled:cursor-default",style:{backgroundColor:K.accent,borderColor:be.backgroundColor},disabled:ie||"idle"!==V,onClick:()=>ae([])},{children:t(N,{className:"w-4 h-4",style:{color:K.accentText}})}))]})):"image"===e.type?o("div",Object.assign({className:"relative h-[56px] w-[56px] bg-stone-100",style:{borderRadius:be.borderRadius}},{children:["finished"===e.status?t("img",{style:{borderRadius:be.borderRadius},className:"object-cover w-full h-full",src:`https://prod-pickaxe-assets.s3.us-west-2.amazonaws.com/documentinterrogation/${null===(s=e.documentId)||void 0===s?void 0:s.split("-")[2]}/${null===(r=e.documentId)||void 0===r?void 0:r.split("-")[1]}.${null===(n=e.documentId)||void 0===n?void 0:n.split("-")[2]}`,alt:""}):t("div",{className:"h-full w-full animate-pulse",style:{borderRadius:be.borderRadius,backgroundColor:K.secondary}}),t("button",Object.assign({type:"button",className:"absolute w-5 h-5 rounded-full -right-2 -top-2 flex items-center justify-center border outline-none disabled:cursor-default",style:{backgroundColor:K.accent,borderColor:be.backgroundColor},disabled:ie||"idle"!==V,onClick:()=>ae([])},{children:t(N,{className:"w-4 h-4",style:{color:K.accentText}})}))]})):null},e.id)}))})),o("div",Object.assign({className:"flex items-end gap-x-2"},{children:[t(S,{className:D(he.i1,"max-h-60 min-h-[27px] w-full border-transparent bg-transparent",!ve.length&&"max-h-6 overflow-hidden text-ellipsis whitespace-nowrap"),value:ve,placeholder:null!==(B=null==W?void 0:W.placeholdertext)&&void 0!==B?B:"What do you want to talk about?",onChange:e=>xe(e),onKeyDown:e=>{"Enter"===e.key&&(e.shiftKey||(e.preventDefault(),ie||"idle"!==V||Re()))},onFocus:E,onBlur:T}),o("div",Object.assign({className:"flex items-center gap-x-2"},{children:["enduserupload"===(null==W?void 0:W.documentuploadtype)&&o("button",Object.assign({className:"outline-none disabled:cursor-default w-8 h-8 flex items-center justify-center rounded-full transition-colors duration-200 ease-in-out",style:{backgroundColor:Oe?K.accent+"10":void 0},disabled:ie||"idle"!==V,onClick:()=>{var e;return null===(e=je.current)||void 0===e?void 0:e.click()}},Ne,{children:[t("input",{id:"file-upload",ref:je,type:"file",accept:[...h,...le?b:[]].join(", "),multiple:!1,hidden:!0,className:"hidden",onChange:e=>s(void 0,void 0,void 0,(function*(){yield de(Array.from(e.target.files||[])),e.target.value=""}))}),t(I,{className:"h-6 w-6 shrink-0 duration-200 transition-colors ease-in-out",style:{color:Oe?K.accent:K.accent+"80"}})]})),t("button",Object.assign({className:"outline-none disabled:cursor-default w-8 h-8 flex items-center justify-center rounded-full duration-200 transition-colors ease-in-out",style:{backgroundColor:(we||ve.length||ne.length&&ne.every((e=>"finished"===e.status)))&&!Z?K.accent:K.accent+"10"},disabled:ie||"idle"!==V,onClick:()=>Re()},Ie,{children:t(C,{className:"h-6 w-6 shrink-0 duration-200 transition-colors ease-in-out",style:{color:(we||ve.length||ne.length&&ne.every((e=>"finished"===e.status)))&&!Z?K.accentText:K.accent+"80"}})}))]}))]}))]}))]}))}))};export{U as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{jsxs as o,jsx as e}from"react/jsx-runtime";import{useState as t}from"react";import{useDimensionContext as r}from"../../../hooks/pickaxe/useDimensionContext.js";import s from"./History/index.js";import i from"./Input.js";const n=()=>{const{width:n,height:m}=r(),[c,f]=t(!1);return o("div",Object.assign({className:"flex flex-grow flex-col items-center"},{children:[e(s,{hideInfo:m<=545||n<=450||c,isInputFocused:c}),e(i,{isFocused:c,onFocus:()=>f(!0),onBlur:()=>f(!1)})]}))};export{n as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as e,jsx as
|
|
1
|
+
import{jsxs as e,jsx as i}from"react/jsx-runtime";import{useMemo as o}from"react";import{usePickaxeContext as t}from"../../../hooks/pickaxe/usePickaxeContext.js";import{useStyleFontSize as s}from"../../../hooks/studio/useStyleFontSize.js";import r from"./PickaxeIcon.js";import c from"./PickaxeBranding.js";import n from"../../../common/cn.js";const l=({className:l,iconClassName:a,onIconClick:m})=>{const{pickaxe:p,misc:d}=t(),f=s(),u=o((()=>({title:(null==p?void 0:p.formtitle)||"",description:(null==p?void 0:p.formdescription)||""})),[p]);return e("div",Object.assign({className:n("flex h-[56px] items-center justify-between gap-4",l)},{children:[e("div",Object.assign({className:"flex items-center gap-4"},{children:[d.isProfileImage&&i(r,Object.assign({src:null==p?void 0:p.coverphoto,alt:`${null==p?void 0:p.formtitle}'s Profile Picture`,width:32,height:32,className:n("shrink-0 h-[32px] w-[32px] rounded-full",a,!!m&&"cursor-pointer")},m&&{onClick:m})),d.isTitle&&i("p",Object.assign({className:n(f.b1)},{children:u.title}))]})),!d.isWhiteLabel&&i(c,{animateHover:!0})]}))};export{l as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as e,jsx as i}from"react/jsx-runtime";import{useState as o,useMemo as t}from"react";import{usePickaxeContext as s}from"../../../hooks/pickaxe/usePickaxeContext.js";import{useStyleFontSize as r}from"../../../hooks/studio/useStyleFontSize.js";import{PickaxeMarkdownRenderer as
|
|
1
|
+
import{jsxs as e,jsx as i}from"react/jsx-runtime";import{useState as o,useMemo as t}from"react";import{usePickaxeContext as s}from"../../../hooks/pickaxe/usePickaxeContext.js";import{useStyleFontSize as r}from"../../../hooks/studio/useStyleFontSize.js";import{PickaxeMarkdownRenderer as c}from"./PickaxeMarkdown/Renderer.js";import n from"./PickaxeIcon.js";import l from"./PickaxeInfoModal.js";import{PickaxeMarkdown as a}from"./PickaxeMarkdown/index.js";import m from"../../../common/cn.js";const p=({className:p,iconClassName:d,maxLines:f,onIconClick:x})=>{const{pickaxe:h,styles:u,colors:k,misc:j}=s(),[g,v]=o(!1),P=r(),C=t((()=>({title:(null==h?void 0:h.formtitle)||"",description:(null==h?void 0:h.formdescription)||""})),[h]);return e("div",Object.assign({className:m("flex flex-col items-center",p)},{children:[g&&i(l,{isOpen:g,onChangeIsOpen:v}),j.isProfileImage&&i(n,Object.assign({src:null==h?void 0:h.coverphoto,alt:`${null==h?void 0:h.formtitle}'s Profile Picture`,width:72,height:72,className:m("h-[72px] w-[72px] rounded-full",d,!!x&&"cursor-pointer")},x&&{onClick:x})),j.isTitle&&!!C.title&&i("h2",Object.assign({className:m(P.h2,"mt-6 text-center font-semilight opacity-90",!f&&"line-clamp-2")},{children:null==h?void 0:h.formtitle})),j.isDescription&&!!C.description&&i(a,Object.assign({theme:u.theme,accentColor:k.accent},{children:i(c,Object.assign({className:"mt-2 text-center",value:C.description},f&&{maxLines:f},{onExpandClick:()=>v(!0)}))}))]}))};export{p as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as
|
|
1
|
+
import{__awaiter as e}from"../../_virtual/_tslib.js";import{jsx as o,jsxs as t,Fragment as s}from"react/jsx-runtime";import{usePickaxe as r}from"../../hooks/pickaxe/usePickaxe.js";import{useState as i,useRef as l,useEffect as a}from"react";import{usePickaxeContext as n}from"../../hooks/pickaxe/usePickaxeContext.js";import{useResponseContext as c}from"../../hooks/pickaxe/useResponseContext.js";import{useDimensionContext as m}from"../../hooks/pickaxe/useDimensionContext.js";import{generateId as f}from"../../common/utils.js";import p from"./Addons/Scroll/Provider.js";import d from"./Chat/index.js";import x from"./Form/index.js";import u from"../../common/cn.js";import h from"../Core/Skeleton.js";const w=({formId:w,className:k})=>{const{chatId:j,styles:v,colors:b,loadFont:g,responsiveBy:N,isFontLoaded:y,setFormId:C,setChatId:F,setPickaxe:I,setIsFontLoaded:O}=n(),{setMessages:P,setResponse:R}=c(),{setWidth:H,setHeight:L,setIsMobile:M}=m(),[S,_]=i(!1),z=r(),A=l(null);return a((()=>{C(w)}),[w]),a((()=>{if(!z.data)return;const e=z.data.chatflag;F(e?f(15):""),e?P([]):R(null),I(z.data),_(!0)}),[z.data]),a((()=>{e(void 0,void 0,void 0,(function*(){"undefined"!=typeof window&&(y||g&&"Real Head Pro"!==v.font&&((yield import("webfontloader")).default.load({google:{families:[v.font]}}),O(!0)))}))}),[v.font,g,y]),a((()=>{if(!A.current)return;const e=new ResizeObserver((e=>{for(const o of e){const{width:e,height:t}=o.contentRect;H(e),L(t),M(e<768)}}));return e.observe(A.current),()=>{e.disconnect()}}),[A.current]),z.data?o("div",Object.assign({ref:A,className:u("relative @container/pickaxe-root flex flex-col flex-grow w-full h-full",k,"dark"===v.theme&&"dark"),style:Object.assign({backgroundColor:b.primary,color:b.text},v.font&&"Real Head Pro"!==v.font&&{fontFamily:v.font})},{children:S?o(s,{children:o(p,j?{children:o(d,{})}:{children:o(x,{})})}):o("div",Object.assign({className:u("flex items-center flex-col w-full pt-12 px-4 pb-10","viewport"===N?"min-[767px]:pb-40":"@[767px]/pickaxe-root:pb-40")},{children:t("div",Object.assign({className:"flex w-full items-center max-w-[700px] flex-col"},{children:[o(h,{className:"w-[72px] h-[72px]"}),o(h,{className:"h-[20px] mt-6 w-full"}),o(h,{className:"h-[20px] mt-2 w-full"}),o(h,{className:"h-[20px] mt-2 w-full max-w-[400px]"}),o("div",Object.assign({className:"flex flex-col gap-y-8 w-full mt-6"},{children:o(h,{className:u("w-full min-h-[48px]","viewport"===N?"min-[767px]:max-w-[176px]":"@[767px]/pickaxe-root:max-w-[176px]")})}))]}))}))})):null};export{w as Pickaxe};
|
package/dist/esm/prose.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.pxe-prose p{font-weight:350}.pxe-prose p:not(:only-child){margin-bottom:.75rem}.pxe-prose a{font-weight:600;text-decoration:underline;text-underline-offset:.2rem}.pxe-prose iframe{margin-bottom:1.5rem}.pxe-prose blockquote{margin-bottom:2.5rem;padding-bottom:.25rem;padding-left:1rem;padding-top:.25rem}.pxe-prose hr{margin-bottom:1.5rem}.pxe-prose .pxe-markdown-image,.pxe-prose .pxe-markdown-loom{margin-bottom:1.5rem;margin-top:1.5rem}.pxe-prose .pxe-markdown-loom,.pxe-prose .pxe-markdown-youtube{display:flex;justify-content:center;width:100%}.pxe-prose .pxe-markdown-youtube{margin-bottom:1.5rem;margin-top:1.5rem}.pxe-prose .pxe-markdown-code{margin-bottom:1.5rem}.pxe-prose ol{list-style-type:decimal}.pxe-prose ol,.pxe-prose ul{list-style-position:inside;margin-bottom:1.5rem;padding-left:1rem}.pxe-prose ul{list-style-type:disc}.pxe-prose li{margin:10px 10px 14px}.pxe-prose li>p{display:inline}.pxe-prose .pxe-markdown-table{margin-bottom:2.5rem;overflow:auto;position:relative}.pxe-prose table{font-size:.875rem;line-height:1.24rem;table-layout:fixed}.pxe-prose th{font-weight:600;text-align:left}.pxe-prose td,.pxe-prose th{padding:.75em 1em}.pxe-prose h1{font-size:2.25rem;line-height:2.5rem;margin-bottom:1.5rem}.pxe-prose h2{font-size:1.875rem;line-height:2.25rem;margin-bottom:1.5rem}.pxe-prose h3{font-size:1.5rem;line-height:2rem;margin-bottom:1.5rem}.pxe-prose h4{font-size:1.25rem}.pxe-prose h4,.pxe-prose h5{line-height:1.75rem;margin-bottom:1rem}.pxe-prose h5{font-size:1.125rem}.pxe-prose h2:not(:first-child)
|
|
1
|
+
.pxe-prose p{font-weight:350}.pxe-prose p:not(:only-child){margin-bottom:.75rem}.pxe-prose a{font-weight:600;text-decoration:underline;text-underline-offset:.2rem}.pxe-prose iframe{margin-bottom:1.5rem}.pxe-prose blockquote{margin-bottom:2.5rem;padding-bottom:.25rem;padding-left:1rem;padding-top:.25rem}.pxe-prose hr{margin-bottom:1.5rem}.pxe-prose .pxe-markdown-image,.pxe-prose .pxe-markdown-loom{margin-bottom:1.5rem;margin-top:1.5rem}.pxe-prose .pxe-markdown-loom,.pxe-prose .pxe-markdown-youtube{display:flex;justify-content:center;width:100%}.pxe-prose .pxe-markdown-youtube{margin-bottom:1.5rem;margin-top:1.5rem}.pxe-prose .pxe-markdown-code{margin-bottom:1.5rem}.pxe-prose ol{list-style-type:decimal}.pxe-prose ol,.pxe-prose ul{list-style-position:inside;margin-bottom:1.5rem;padding-left:1rem}.pxe-prose ul{list-style-type:disc}.pxe-prose li{margin:10px 10px 14px}.pxe-prose li>p{display:inline}.pxe-prose .pxe-markdown-table{margin-bottom:2.5rem;overflow:auto;position:relative}.pxe-prose table{font-size:.875rem;line-height:1.24rem;table-layout:fixed}.pxe-prose th{font-weight:600;text-align:left}.pxe-prose td,.pxe-prose th{padding:.75em 1em}.pxe-prose h1{font-size:2.25rem;line-height:2.5rem;margin-bottom:1.5rem}.pxe-prose h2{font-size:1.875rem;line-height:2.25rem;margin-bottom:1.5rem}.pxe-prose h3{font-size:1.5rem;line-height:2rem;margin-bottom:1.5rem}.pxe-prose h4{font-size:1.25rem}.pxe-prose h4,.pxe-prose h5{line-height:1.75rem;margin-bottom:1rem}.pxe-prose h5{font-size:1.125rem}.pxe-prose h2:not(:first-child){margin-top:2.5rem}.pxe-prose h3:not(:first-child),.pxe-prose h4:not(:first-child),.pxe-prose>pre:not(:first-child){margin-top:1rem}.pxe-prose .pxe-markdown-code{display:flex;flex-direction:column}.pxe-prose .pxe-markdown-code>div:first-child{background-color:#1d1f21;border-radius:.3em;display:flex;flex-direction:column;max-width:min-content;padding-top:1em;position:relative}.pxe-prose .pxe-markdown-code>div:first-child>div:first-child{display:flex;justify-content:flex-end;padding:0 1em}.pxe-prose .pxe-markdown-code>div:first-child>div:last-child{overflow:auto}.pxe-prose .pxe-action[data-action-id]:not(:nth-child(2)){margin-top:1rem}.pxe-prose .pxe-markdown-code-inline{background-color:#1d1f21;border-radius:.3em;color:#fff;font-size:10pt;padding:.15em .4em}.pxe-prose .pxe-animated-token{animation:fadeIn .3s ease-out forwards;display:inline-block;opacity:0}.pxe-link-previews{display:flex;flex-direction:column;gap:2rem}.pxe-prose>p:first-child>.pxe-markdown-image,.pxe-prose>p:first-child>.pxe-markdown-youtube{margin-top:0}@keyframes fadeIn{0%{opacity:0;transform:translateX(5px)}to{opacity:1;transform:translateX(0)}}
|
|
@@ -2,6 +2,7 @@ import type { ChatMessage } from "../../../../types/chat";
|
|
|
2
2
|
interface MessageProps {
|
|
3
3
|
index: number;
|
|
4
4
|
message: ChatMessage;
|
|
5
|
+
isIntroExpand?: boolean;
|
|
5
6
|
}
|
|
6
|
-
declare const Message: ({ index, message }: MessageProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
declare const Message: ({ index, message, isIntroExpand: _ }: MessageProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
8
|
export default Message;
|
|
@@ -1,2 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
interface HistoryProps {
|
|
2
|
+
hideInfo: boolean;
|
|
3
|
+
isInputFocused: boolean;
|
|
4
|
+
}
|
|
5
|
+
declare const History: ({ hideInfo, isInputFocused }: HistoryProps) => import("react/jsx-runtime").JSX.Element;
|
|
2
6
|
export default History;
|
|
@@ -1,2 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
interface InputProps {
|
|
2
|
+
isFocused: boolean;
|
|
3
|
+
onFocus: () => void;
|
|
4
|
+
onBlur: () => void;
|
|
5
|
+
}
|
|
6
|
+
declare const Input: ({ isFocused, onFocus, onBlur }: InputProps) => import("react/jsx-runtime").JSX.Element;
|
|
2
7
|
export default Input;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
interface PickaxeCompactHeadProps {
|
|
2
|
+
className?: string;
|
|
2
3
|
iconClassName?: string;
|
|
3
4
|
onIconClick?: () => void;
|
|
4
5
|
}
|
|
5
|
-
declare const PickaxeCompactHead: ({ iconClassName, onIconClick, }: PickaxeCompactHeadProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
declare const PickaxeCompactHead: ({ className, iconClassName, onIconClick, }: PickaxeCompactHeadProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
7
|
export default PickaxeCompactHead;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
interface PickaxeHeadProps {
|
|
2
|
+
className?: string;
|
|
2
3
|
iconClassName?: string;
|
|
3
4
|
maxLines?: number;
|
|
4
5
|
onIconClick?: () => void;
|
|
5
6
|
}
|
|
6
|
-
declare const PickaxeHead: ({ iconClassName, maxLines, onIconClick, }: PickaxeHeadProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
declare const PickaxeHead: ({ className, iconClassName, maxLines, onIconClick, }: PickaxeHeadProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
8
|
export default PickaxeHead;
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("react"),l=require("react-virtualized-auto-sizer"),a=require("../../common/cn.js");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=t(l);const o=r.forwardRef((({id:r,className:l,innerClassName:t,children:o,variant:c="height",hideScrollbar:i,inner:d},u)=>e.jsx(s.default,Object.assign({className:a.default("flex-grow",l)},{children:({width:l,height:s})=>e.jsx("div",Object.assign({},r&&{id:r},{ref:u,className:a.default("flex flex-col overflow-y-auto overflow-x-hidden scroll-smooth scrollbar scrollbar-thumb-black/50 scrollbar-thumb-rounded-full scrollbar-w-[4px] scrollbar-h-[4px] dark:scrollbar-thumb-black/60",t,i&&"no-scrollbar"),style:{width:l,[c]:s}},d,{children:o}))}))));o.displayName="ScrollArea",exports.default=o;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react");exports.useDebounce=(r,t)=>{const u=e.useRef(null);return e.useCallback(((...e)=>{u.current&&clearTimeout(u.current),u.current=setTimeout((()=>r(...e)),t)}),[r,t])};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{jsx as r}from"react/jsx-runtime";import{forwardRef as l}from"react";import a from"react-virtualized-auto-sizer";import o from"../../common/cn.js";const e=l((({id:l,className:e,innerClassName:s,children:c,variant:i="height",hideScrollbar:t,inner:m},d)=>r(a,Object.assign({className:o("flex-grow",e)},{children:({width:a,height:e})=>r("div",Object.assign({},l&&{id:l},{ref:d,className:o("flex flex-col overflow-y-auto overflow-x-hidden scroll-smooth scrollbar scrollbar-thumb-black/50 scrollbar-thumb-rounded-full scrollbar-w-[4px] scrollbar-h-[4px] dark:scrollbar-thumb-black/60",s,t&&"no-scrollbar"),style:{width:a,[i]:e}},m,{children:c}))}))));e.displayName="ScrollArea";export{e as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{useRef as r,useCallback as t}from"react";const e=(e,c)=>{const n=r(null);return t(((...r)=>{n.current&&clearTimeout(n.current),n.current=setTimeout((()=>e(...r)),c)}),[e,c])};export{e as useDebounce};
|