@pickaxeproject/react 0.0.68 → 0.0.70
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/Pickaxe/Chat/History/index.js +1 -1
- package/dist/cjs/components/Pickaxe/common/PickaxeMarkdown/Custom/Iframe/index.js +1 -1
- package/dist/cjs/components/Pickaxe/common/PickaxeMarkdown/Custom/P/index.js +1 -1
- package/dist/cjs/components/Pickaxe/common/PickaxeMarkdown/Renderer.js +1 -1
- package/dist/esm/components/Pickaxe/Chat/History/index.js +1 -1
- package/dist/esm/components/Pickaxe/common/PickaxeMarkdown/Custom/Iframe/index.js +1 -1
- package/dist/esm/components/Pickaxe/common/PickaxeMarkdown/Custom/P/index.js +1 -1
- package/dist/esm/components/Pickaxe/common/PickaxeMarkdown/Renderer.js +1 -1
- package/package.json +1 -1
|
@@ -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"),r=require("../../../../hooks/studio/useStyleFontSize.js"),l=require("../../../../hooks/pickaxe/useConversation.js"),o=require("../../common/PickaxeIcon.js"),i=require("../../../Core/ErrorAlert.js"),n=require("../../Addons/Scroll/ScrollLockView.js"),c=require("../../common/PickaxeHead.js"),d=require("../../common/PickaxeInfoModal.js"),x=require("../../common/PickaxeUpgradeCard.js"),u=require("./Message.js"),m=require("../../../../common/cn.js");exports.default=()=>{var j;const p=l.useConversation(),g=r.useStyleFontSize(),{pickaxe:f,styles:h,colors:k,responsiveBy:E,isNewChat:b,setChatId:v}=a.usePickaxeContext(),{messages:w,status:y,limitData:N,error:C}=t.useResponseContext(),[O,q]=s.useState(!1),S=s.useMemo((()=>!!p.data&&!(p.data.messages.length<=1)),[p.data]),F=s.useMemo((()=>p.isSuccess&&b&&!S),[p.isSuccess,b,S]);return e.jsxs("div",Object.assign({className:"relative flex flex-grow flex-col justify-end"},{children:[O&&e.jsx(d.default,{isOpen:O,onChangeIsOpen:q}),e.jsx("div",Object.assign({className:m.default("absolute left-1/2 top-5 flex w-full max-w-[400px] -translate-x-1/2 -translate-y-1/3 transform flex-col items-center px-4 opacity-0 duration-300",F&&"top-1/3 opacity-100")},{children:e.jsx(c.default,{iconClassName:"duration-300 hover:opacity-90",onIconClick:()=>v("")})})),e.jsx("div",Object.assign({className:"flex w-full justify-center"},{children:p.isLoading?e.jsxs("div",Object.assign({className:"grid w-full max-w-[800px] grid-cols-1 gap-y-6 px-6 pt-10"},{children:[e.jsx("div",{className:"h-10 w-[70%] animate-pulse justify-self-end rounded bg-[#E5E7EB] dark:bg-[#1E1E1F]",style:{backgroundColor:"dark"===h.theme?"#1E1E1F":"#E5E7EB"}}),e.jsx("div",{className:"h-[150px] w-[70%] animate-pulse rounded bg-[#E5E7EB] dark:bg-[#1E1E1F]",style:{backgroundColor:"dark"===h.theme?"#1E1E1F":"#E5E7EB"}}),e.jsx("div",{className:"h-10 w-[50%] animate-pulse justify-self-end rounded bg-[#E5E7EB] dark:bg-[#1E1E1F]",style:{backgroundColor:"dark"===h.theme?"#1E1E1F":"#E5E7EB"}})]})):p.isError?e.jsx("div",Object.assign({className:"flex w-full max-w-[800px] justify-center pt-10"},{children:e.jsxs("p",Object.assign({className:m.default(g.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."]}))})):e.jsxs("div",Object.assign({className:"flex flex-col w-full"},{children:[e.jsxs("div",Object.assign({className:m.default("relative grid w-full max-w-[800px] grid-cols-1 gap-y-6 px-4 pt-6","viewport"===E?"min-[767px]:pt-10":"@[767px]/pickaxe-root:pt-10")},{children:[p.data.messages.map(((s,a)=>e.jsx(u.default,{index:a,message:s},a))),w.map(((s,a)=>e.jsx(u.default,{index:p.data.messages.length+a,message:s},a))),"fetching"===y?e.jsxs("div",Object.assign({className:"flex max-w-[80%] items-center gap-x-3"},{children:["NONE"!==(null==f?void 0:f.chaticon)&&e.jsx(o.default,{src:null!==(j=null==f?void 0:f.chaticon)&&void 0!==j?j:`https://prod-pickaxe-assets.s3.us-west-2.amazonaws.com/chaticons/${null==f?void 0:f.formid}.png`,alt:`${null==f?void 0:f.formtitle}'s Chat Icon`,width:24,height:24,className:"h-6 w-6",textColor:k.text}),e.jsxs("div",Object.assign({className:"flex items-center gap-x-2 rounded px-4 py-4",style:{backgroundColor:k.secondary+"80",color:k.secondaryText}},{children:[e.jsx("div",{className:"h-1.5 w-1.5 animate-dot rounded-full",style:{backgroundColor:k.secondaryText}}),e.jsx("div",{className:"h-1.5 w-1.5 animate-dot-down rounded-full",style:{backgroundColor:k.secondaryText}}),e.jsx("div",{className:"h-1.5 w-1.5 animate-dot rounded-full",style:{backgroundColor:k.secondaryText}})]}))]})):N?e.jsx("div",Object.assign({className:"flex max-w-[80%] items-center gap-x-3"},{children:e.jsx(x.default,{})})):C?e.jsx("div",Object.assign({className:"flex max-w-[80%] items-center gap-x-3"},{children:e.jsx(i.default,{error:C})})):null]})),e.jsx(n.default,{className:"w-full"})]}))}))]}))};
|
|
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"),r=require("../../../../hooks/studio/useStyleFontSize.js"),l=require("../../../../hooks/pickaxe/useConversation.js"),o=require("../../common/PickaxeIcon.js"),i=require("../../../Core/ErrorAlert.js"),n=require("../../Addons/Scroll/ScrollLockView.js"),c=require("../../common/PickaxeHead.js"),d=require("../../common/PickaxeInfoModal.js"),x=require("../../common/PickaxeUpgradeCard.js"),u=require("./Message.js"),m=require("../../../../common/cn.js");exports.default=()=>{var j;const p=l.useConversation(),g=r.useStyleFontSize(),{pickaxe:f,styles:h,colors:k,responsiveBy:E,isNewChat:b,setChatId:v}=a.usePickaxeContext(),{messages:w,status:y,limitData:N,error:C}=t.useResponseContext(),[O,q]=s.useState(!1),S=s.useMemo((()=>!!p.data&&!(p.data.messages.length<=1)),[p.data]),F=s.useMemo((()=>p.isSuccess&&b&&!S),[p.isSuccess,b,S]);return e.jsxs("div",Object.assign({className:"relative flex flex-grow flex-col justify-end"},{children:[O&&e.jsx(d.default,{isOpen:O,onChangeIsOpen:q}),e.jsx("div",Object.assign({className:m.default("absolute left-1/2 top-5 flex w-full max-w-[400px] -translate-x-1/2 -translate-y-1/3 transform flex-col items-center px-4 opacity-0 duration-300",F&&"top-1/3 opacity-100 [@media(max-height:630px)]:top-5 [@media(max-height:630px)]:opacity-0")},{children:e.jsx(c.default,{iconClassName:"duration-300 hover:opacity-90",onIconClick:()=>v("")})})),e.jsx("div",Object.assign({className:"flex w-full justify-center"},{children:p.isLoading?e.jsxs("div",Object.assign({className:"grid w-full max-w-[800px] grid-cols-1 gap-y-6 px-6 pt-10"},{children:[e.jsx("div",{className:"h-10 w-[70%] animate-pulse justify-self-end rounded bg-[#E5E7EB] dark:bg-[#1E1E1F]",style:{backgroundColor:"dark"===h.theme?"#1E1E1F":"#E5E7EB"}}),e.jsx("div",{className:"h-[150px] w-[70%] animate-pulse rounded bg-[#E5E7EB] dark:bg-[#1E1E1F]",style:{backgroundColor:"dark"===h.theme?"#1E1E1F":"#E5E7EB"}}),e.jsx("div",{className:"h-10 w-[50%] animate-pulse justify-self-end rounded bg-[#E5E7EB] dark:bg-[#1E1E1F]",style:{backgroundColor:"dark"===h.theme?"#1E1E1F":"#E5E7EB"}})]})):p.isError?e.jsx("div",Object.assign({className:"flex w-full max-w-[800px] justify-center pt-10"},{children:e.jsxs("p",Object.assign({className:m.default(g.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."]}))})):e.jsxs("div",Object.assign({className:"flex flex-col w-full"},{children:[e.jsxs("div",Object.assign({className:m.default("relative grid w-full max-w-[800px] grid-cols-1 gap-y-6 px-4 pt-6","viewport"===E?"min-[767px]:pt-10":"@[767px]/pickaxe-root:pt-10")},{children:[p.data.messages.map(((s,a)=>e.jsx(u.default,{index:a,message:s},a))),w.map(((s,a)=>e.jsx(u.default,{index:p.data.messages.length+a,message:s},a))),"fetching"===y?e.jsxs("div",Object.assign({className:"flex max-w-[80%] items-center gap-x-3"},{children:["NONE"!==(null==f?void 0:f.chaticon)&&e.jsx(o.default,{src:null!==(j=null==f?void 0:f.chaticon)&&void 0!==j?j:`https://prod-pickaxe-assets.s3.us-west-2.amazonaws.com/chaticons/${null==f?void 0:f.formid}.png`,alt:`${null==f?void 0:f.formtitle}'s Chat Icon`,width:24,height:24,className:"h-6 w-6",textColor:k.text}),e.jsxs("div",Object.assign({className:"flex items-center gap-x-2 rounded px-4 py-4",style:{backgroundColor:k.secondary+"80",color:k.secondaryText}},{children:[e.jsx("div",{className:"h-1.5 w-1.5 animate-dot rounded-full",style:{backgroundColor:k.secondaryText}}),e.jsx("div",{className:"h-1.5 w-1.5 animate-dot-down rounded-full",style:{backgroundColor:k.secondaryText}}),e.jsx("div",{className:"h-1.5 w-1.5 animate-dot rounded-full",style:{backgroundColor:k.secondaryText}})]}))]})):N?e.jsx("div",Object.assign({className:"flex max-w-[80%] items-center gap-x-3"},{children:e.jsx(x.default,{})})):C?e.jsx("div",Object.assign({className:"flex max-w-[80%] items-center gap-x-3"},{children:e.jsx(i.default,{error:C})})):null]})),e.jsx(n.default,{className:"w-full"})]}))}))]}))};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../../../../_virtual/_tslib.js"),r=require("react/jsx-runtime");exports.default=t=>{var{node:i,title:l="Random Iframe",children:s}=t,
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../../../../_virtual/_tslib.js"),r=require("react/jsx-runtime");exports.default=t=>{var{node:i,title:l="Random Iframe",children:s,style:a}=t,n=e.__rest(t,["node","title","children","style"]);return r.jsx("iframe",Object.assign({title:l,style:Object.assign({borderRadius:"8px",width:"100%",marginBottom:"1.5rem"},a),allowFullScreen:!0},n,{children:s}))};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("../../hooks/usePickaxeMarkdownContext.js"),s=require("../common/Action.js");exports.default=({node:i,children:n})=>{const{actions:r}=t.usePickaxeMarkdownContext(),l="string"==typeof n&&n.match(/(?:https?:\/\/)?(?:www\.)?(?:youtube\.com\/watch\?v=|youtu\.be\/)([\w-]+)/i);if(l&&(null==l?void 0:l[1]))return e.jsx("div",Object.assign({style:{display:"flex",width:"100%",justifyContent:"center"}},{children:e.jsx("iframe",Object.assign({title:"youtube-embed",src:`https://www.youtube.com/embed/${l[1]}`,style:{width:"100%",maxWidth:"560px",minHeight:"315px"},allowFullScreen:!0},{children:"Iframe not supported, use a different browser."}))}));if(r&&"string"==typeof n&&n.includes("pickaxe")&&(n.includes("/api/fn/result")||n.includes("/api/function_call_results"))){const t=n.replace(/https:\/\/\S*(\/api\/fn\/result|\/api\/function_call_results)\S*/g,""),i=n.match(/https:\/\/\S*(\/api\/fn\/result|\/api\/function_call_results)\S*/g);return e.jsxs("div",Object.assign({className:"flex flex-col"},{children:[e.jsx("p",Object.assign({style:{fontWeight:350}},{children:t})),e.jsx(s.default,{jobUrl:(null==i?void 0:i[0])||""})]}))}return e.jsx("p",Object.assign({style:{fontWeight:350}},{children:n}))};
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("../../hooks/usePickaxeMarkdownContext.js"),s=require("../common/Action.js");exports.default=({node:i,children:n})=>{const{actions:r}=t.usePickaxeMarkdownContext(),l="string"==typeof n&&n.match(/(?:https?:\/\/)?(?:www\.)?(?:youtube\.com\/watch\?v=|youtu\.be\/)([\w-]+)/i);if(l&&(null==l?void 0:l[1]))return e.jsx("div",Object.assign({style:{display:"flex",width:"100%",justifyContent:"center"}},{children:e.jsx("iframe",Object.assign({title:"youtube-embed",src:`https://www.youtube.com/embed/${l[1]}`,style:{width:"100%",maxWidth:"560px",minHeight:"315px"},allowFullScreen:!0},{children:"Iframe not supported, use a different browser."}))}));if(r&&"string"==typeof n&&n.includes("pickaxe")&&(n.includes("/api/fn/result")||n.includes("/api/function_call_results"))){const t=n.replace(/https:\/\/\S*(\/api\/fn\/result|\/api\/function_call_results)\S*/g,""),i=n.match(/https:\/\/\S*(\/api\/fn\/result|\/api\/function_call_results)\S*/g);return e.jsxs("div",Object.assign({className:"flex flex-col"},{children:[e.jsx("p",Object.assign({style:{fontWeight:350,marginBottom:"0.75rem"}},{children:t})),e.jsx(s.default,{jobUrl:(null==i?void 0:i[0])||""})]}))}return e.jsx("p",Object.assign({style:{fontWeight:350,marginBottom:"0.75rem"}},{children:n}))};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../../_virtual/_tslib.js"),r=require("react/jsx-runtime"),i=require("react"),t=require("./hooks/usePickaxeMarkdownContext.js"),n=require("react-markdown"),s=require("remark-gfm"),l=require("remark-math"),a=require("rehype-katex"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../../_virtual/_tslib.js"),r=require("react/jsx-runtime"),i=require("react"),t=require("./hooks/usePickaxeMarkdownContext.js"),n=require("react-markdown"),s=require("remark-gfm"),l=require("remark-math"),a=require("rehype-katex"),o=require("rehype-raw"),d=require("./Custom/A/index.js"),m=require("./Custom/P/index.js"),c=require("./Custom/Img/index.js"),u=require("./Custom/Iframe/index.js"),h=require("./Custom/Code/index.js"),g=require("./Custom/common/LinkPreview.js"),j=require("./Custom/common/TextModal.js");function x(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var p=x(n),f=x(s),b=x(l),y=x(a),k=x(o);exports.PickaxeMarkdownRenderer=({className:n,style:s,value:l,recursion:a=!1,children:o,maxChar:x})=>{const{theme:O,accentColor:q,websiteMetadatas:v}=t.usePickaxeMarkdownContext(),[C,B]=i.useState(!1),D=i.useRef(null),S=i.useMemo((()=>{if(!l)return"";let e=l;return e=l.replace(/<!--[\s\S]*?-->/g,""),e=l.replace(/\u200B/g,""),x&&(e=e.slice(0,x)),e}),[l,x]),w={h1:({node:e,children:i})=>r.jsx("h1",Object.assign({style:{fontSize:"2.25rem",lineHeight:"2.5rem",marginBottom:"1.5rem"}},{children:i})),h2:({node:e,children:i})=>r.jsx("h2",Object.assign({style:{fontSize:"1.875rem",lineHeight:"2.25rem",marginBottom:"0.75rem"}},{children:i})),h3:({node:e,children:i})=>r.jsx("h3",Object.assign({style:{fontSize:"1.5rem",lineHeight:"2rem",marginBottom:"0.5rem"}},{children:i})),h4:({node:e,children:i})=>r.jsx("h4",Object.assign({className:"mt-2",style:{fontSize:"1.25rem",lineHeight:"1.75rem",marginBottom:"0.5rem"}},{children:i})),h5:({node:e,children:i})=>r.jsx("h5",Object.assign({style:{fontSize:"1.125rem",lineHeight:"1.75rem",marginBottom:"0.5rem"}},{children:i})),p:m.default,a:d.default,ol:({node:e,children:i})=>r.jsx("ol",Object.assign({style:{listStyleType:"decimal",listStylePosition:"inside",paddingLeft:"1.5rem",marginBottom:"1.5rem"}},{children:i})),ul:({node:e,children:i})=>r.jsx("ul",Object.assign({style:{listStyleType:"disc",listStylePosition:"inside",paddingLeft:"1.5rem",marginBottom:"1.5rem"}},{children:i})),li:({node:e,children:i})=>r.jsx("li",{children:i}),table:({children:e})=>r.jsx("div",Object.assign({style:{position:"relative",overflow:"auto",marginBottom:"1.5rem"}},{children:r.jsx("table",Object.assign({style:{tableLayout:"fixed",fontSize:"0.875rem",lineHeight:"1.24rem"}},{children:e}))})),th:({node:e,children:i})=>r.jsx("th",Object.assign({style:{padding:"0.75em 1em",fontWeight:600,textAlign:"left"}},{children:i})),tr:({node:e,children:i})=>r.jsx("tr",Object.assign({style:{border:"dark"===O?"1px solid #30363D":"1px solid #D0D7DE"}},{children:i})),td:({node:e,children:i})=>r.jsx("td",Object.assign({style:{padding:"0.75em 1em"}},{children:i})),code:h.default,blockquote:({node:e,children:i})=>r.jsx("blockquote",Object.assign({style:{lineHeight:"15px",borderLeft:"dark"===O?"4px solid #30363D":"4px solid #D0D7DE",color:"dark"===O?"#8B8B8B":"#656D76",paddingLeft:"1rem",marginBottom:"1rem"}},{children:i})),img:c.default,iframe:u.default,hr:()=>r.jsx("hr",{style:{border:0,borderTop:"dark"===O?"1px solid #30363D":"1px solid #D0D7DE",marginBottom:"1.5rem"}}),span:i=>{var{node:t,children:n}=i,s=e.__rest(i,["node","children"]);return"intro-msg-expand-btn"===s.className?r.jsx("span",Object.assign({},s,{style:{display:"inline",fontWeight:500,color:q,cursor:"pointer"},onClick:()=>B(!0)},{children:n})):r.jsx("span",Object.assign({},s,{children:n}))}};return r.jsxs("div",Object.assign({className:"pxe-markdown",ref:D,style:Object.assign({position:"relative",overflowWrap:"break-word",display:"grid",gridTemplateColumns:"repeat(1, minmax(0, 1fr))",gap:".625rem"},s)},{children:[C&&r.jsx(j.default,{value:S,isOpen:C,onChangeIsOpen:B}),r.jsx(p.default,Object.assign({},n&&{className:n},{components:w,remarkPlugins:[f.default,b.default],rehypePlugins:[y.default,k.default]},{children:`${S}${!a&&v.length>0?"\n\n---":""}${"number"==typeof x&&S.length>=x?'<span class="intro-msg-expand-btn">...</span>':""}`})),!a&&v.length>0&&r.jsx("div",Object.assign({style:{display:"flex",flexDirection:"column",gap:"2rem",marginTop:"2rem"}},{children:v.map(((e,i)=>r.jsx(g.default,{data:e},i)))})),o]}))};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as e,jsx as s}from"react/jsx-runtime";import{useState as a,useMemo as o}from"react";import{usePickaxeContext as t}from"../../../../hooks/pickaxe/usePickaxeContext.js";import{useResponseContext as r}from"../../../../hooks/pickaxe/useResponseContext.js";import{useStyleFontSize as i}from"../../../../hooks/studio/useStyleFontSize.js";import{useConversation as l}from"../../../../hooks/pickaxe/useConversation.js";import c from"../../common/PickaxeIcon.js";import n from"../../../Core/ErrorAlert.js";import
|
|
1
|
+
import{jsxs as e,jsx as s}from"react/jsx-runtime";import{useState as a,useMemo as o}from"react";import{usePickaxeContext as t}from"../../../../hooks/pickaxe/usePickaxeContext.js";import{useResponseContext as r}from"../../../../hooks/pickaxe/useResponseContext.js";import{useStyleFontSize as i}from"../../../../hooks/studio/useStyleFontSize.js";import{useConversation as l}from"../../../../hooks/pickaxe/useConversation.js";import c from"../../common/PickaxeIcon.js";import n from"../../../Core/ErrorAlert.js";import m from"../../Addons/Scroll/ScrollLockView.js";import d from"../../common/PickaxeHead.js";import p from"../../common/PickaxeInfoModal.js";import x from"../../common/PickaxeUpgradeCard.js";import g from"./Message.js";import f from"../../../../common/cn.js";const u=()=>{var u;const h=l(),j=i(),{pickaxe:E,styles:k,colors:b,responsiveBy:w,isNewChat:v,setChatId:y}=t(),{messages:N,status:C,limitData:O,error:B}=r(),[F,S]=a(!1),I=o((()=>!!h.data&&!(h.data.messages.length<=1)),[h.data]),P=o((()=>h.isSuccess&&v&&!I),[h.isSuccess,v,I]);return e("div",Object.assign({className:"relative flex flex-grow flex-col justify-end"},{children:[F&&s(p,{isOpen:F,onChangeIsOpen:S}),s("div",Object.assign({className:f("absolute left-1/2 top-5 flex w-full max-w-[400px] -translate-x-1/2 -translate-y-1/3 transform flex-col items-center px-4 opacity-0 duration-300",P&&"top-1/3 opacity-100 [@media(max-height:630px)]:top-5 [@media(max-height:630px)]:opacity-0")},{children:s(d,{iconClassName:"duration-300 hover:opacity-90",onIconClick:()=>y("")})})),s("div",Object.assign({className:"flex w-full justify-center"},{children:h.isLoading?e("div",Object.assign({className:"grid w-full max-w-[800px] grid-cols-1 gap-y-6 px-6 pt-10"},{children:[s("div",{className:"h-10 w-[70%] animate-pulse justify-self-end rounded bg-[#E5E7EB] dark:bg-[#1E1E1F]",style:{backgroundColor:"dark"===k.theme?"#1E1E1F":"#E5E7EB"}}),s("div",{className:"h-[150px] w-[70%] animate-pulse rounded bg-[#E5E7EB] dark:bg-[#1E1E1F]",style:{backgroundColor:"dark"===k.theme?"#1E1E1F":"#E5E7EB"}}),s("div",{className:"h-10 w-[50%] animate-pulse justify-self-end rounded bg-[#E5E7EB] dark:bg-[#1E1E1F]",style:{backgroundColor:"dark"===k.theme?"#1E1E1F":"#E5E7EB"}})]})):h.isError?s("div",Object.assign({className:"flex w-full max-w-[800px] justify-center pt-10"},{children:e("p",Object.assign({className:f(j.b2,"text-center font-semibold")},{children:["Something went wrong. Please try again, or"," ",s("a",Object.assign({href:"mailto:info@pickaxeproject.com?subject=Help",target:"_blank",rel:"noreferrer"},{children:"contact us"}))," ","for help."]}))})):e("div",Object.assign({className:"flex flex-col w-full"},{children:[e("div",Object.assign({className:f("relative grid w-full max-w-[800px] grid-cols-1 gap-y-6 px-4 pt-6","viewport"===w?"min-[767px]:pt-10":"@[767px]/pickaxe-root:pt-10")},{children:[h.data.messages.map(((e,a)=>s(g,{index:a,message:e},a))),N.map(((e,a)=>s(g,{index:h.data.messages.length+a,message:e},a))),"fetching"===C?e("div",Object.assign({className:"flex max-w-[80%] items-center gap-x-3"},{children:["NONE"!==(null==E?void 0:E.chaticon)&&s(c,{src:null!==(u=null==E?void 0:E.chaticon)&&void 0!==u?u:`https://prod-pickaxe-assets.s3.us-west-2.amazonaws.com/chaticons/${null==E?void 0:E.formid}.png`,alt:`${null==E?void 0:E.formtitle}'s Chat Icon`,width:24,height:24,className:"h-6 w-6",textColor:b.text}),e("div",Object.assign({className:"flex items-center gap-x-2 rounded px-4 py-4",style:{backgroundColor:b.secondary+"80",color:b.secondaryText}},{children:[s("div",{className:"h-1.5 w-1.5 animate-dot rounded-full",style:{backgroundColor:b.secondaryText}}),s("div",{className:"h-1.5 w-1.5 animate-dot-down rounded-full",style:{backgroundColor:b.secondaryText}}),s("div",{className:"h-1.5 w-1.5 animate-dot rounded-full",style:{backgroundColor:b.secondaryText}})]}))]})):O?s("div",Object.assign({className:"flex max-w-[80%] items-center gap-x-3"},{children:s(x,{})})):B?s("div",Object.assign({className:"flex max-w-[80%] items-center gap-x-3"},{children:s(n,{error:B})})):null]})),s(m,{className:"w-full"})]}))}))]}))};export{u as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__rest as e}from"../../../../../../_virtual/_tslib.js";import{jsx as t}from"react/jsx-runtime";const r=r=>{var{node:i,title:l="Random Iframe",children:a}=r,
|
|
1
|
+
import{__rest as e}from"../../../../../../_virtual/_tslib.js";import{jsx as t}from"react/jsx-runtime";const r=r=>{var{node:i,title:l="Random Iframe",children:a,style:n}=r,o=e(r,["node","title","children","style"]);return t("iframe",Object.assign({title:l,style:Object.assign({borderRadius:"8px",width:"100%",marginBottom:"1.5rem"},n),allowFullScreen:!0},o,{children:a}))};export{r as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as t,jsxs as e}from"react/jsx-runtime";import{usePickaxeMarkdownContext as i}from"../../hooks/usePickaxeMarkdownContext.js";import
|
|
1
|
+
import{jsx as t,jsxs as e}from"react/jsx-runtime";import{usePickaxeMarkdownContext as i}from"../../hooks/usePickaxeMarkdownContext.js";import n from"../common/Action.js";const s=({node:s,children:o})=>{const{actions:r}=i(),l="string"==typeof o&&o.match(/(?:https?:\/\/)?(?:www\.)?(?:youtube\.com\/watch\?v=|youtu\.be\/)([\w-]+)/i);if(l&&(null==l?void 0:l[1]))return t("div",Object.assign({style:{display:"flex",width:"100%",justifyContent:"center"}},{children:t("iframe",Object.assign({title:"youtube-embed",src:`https://www.youtube.com/embed/${l[1]}`,style:{width:"100%",maxWidth:"560px",minHeight:"315px"},allowFullScreen:!0},{children:"Iframe not supported, use a different browser."}))}));if(r&&"string"==typeof o&&o.includes("pickaxe")&&(o.includes("/api/fn/result")||o.includes("/api/function_call_results"))){const i=o.replace(/https:\/\/\S*(\/api\/fn\/result|\/api\/function_call_results)\S*/g,""),s=o.match(/https:\/\/\S*(\/api\/fn\/result|\/api\/function_call_results)\S*/g);return e("div",Object.assign({className:"flex flex-col"},{children:[t("p",Object.assign({style:{fontWeight:350,marginBottom:"0.75rem"}},{children:i})),t(n,{jobUrl:(null==s?void 0:s[0])||""})]}))}return t("p",Object.assign({style:{fontWeight:350,marginBottom:"0.75rem"}},{children:o}))};export{s as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__rest as e}from"../../../../_virtual/_tslib.js";import{jsxs as r,jsx as i}from"react/jsx-runtime";import{useState as t,useRef as n,useMemo as o}from"react";import{usePickaxeMarkdownContext as s}from"./hooks/usePickaxeMarkdownContext.js";import l from"react-markdown";import m from"remark-gfm";import a from"remark-math";import d from"rehype-katex";import c from"rehype-raw";import h from"./Custom/A/index.js";import p from"./Custom/P/index.js";import g from"./Custom/Img/index.js";import f from"./Custom/Iframe/index.js";import b from"./Custom/Code/index.js";import y from"./Custom/common/LinkPreview.js";import u from"./Custom/common/TextModal.js";const j=({className:j,style:x,value:O,recursion:k=!1,children:
|
|
1
|
+
import{__rest as e}from"../../../../_virtual/_tslib.js";import{jsxs as r,jsx as i}from"react/jsx-runtime";import{useState as t,useRef as n,useMemo as o}from"react";import{usePickaxeMarkdownContext as s}from"./hooks/usePickaxeMarkdownContext.js";import l from"react-markdown";import m from"remark-gfm";import a from"remark-math";import d from"rehype-katex";import c from"rehype-raw";import h from"./Custom/A/index.js";import p from"./Custom/P/index.js";import g from"./Custom/Img/index.js";import f from"./Custom/Iframe/index.js";import b from"./Custom/Code/index.js";import y from"./Custom/common/LinkPreview.js";import u from"./Custom/common/TextModal.js";const j=({className:j,style:x,value:O,recursion:k=!1,children:B,maxChar:C})=>{const{theme:D,accentColor:v,websiteMetadatas:S}=s(),[w,H]=t(!1),P=n(null),z=o((()=>{if(!O)return"";let e=O;return e=O.replace(/<!--[\s\S]*?-->/g,""),e=O.replace(/\u200B/g,""),C&&(e=e.slice(0,C)),e}),[O,C]),L={h1:({node:e,children:r})=>i("h1",Object.assign({style:{fontSize:"2.25rem",lineHeight:"2.5rem",marginBottom:"1.5rem"}},{children:r})),h2:({node:e,children:r})=>i("h2",Object.assign({style:{fontSize:"1.875rem",lineHeight:"2.25rem",marginBottom:"0.75rem"}},{children:r})),h3:({node:e,children:r})=>i("h3",Object.assign({style:{fontSize:"1.5rem",lineHeight:"2rem",marginBottom:"0.5rem"}},{children:r})),h4:({node:e,children:r})=>i("h4",Object.assign({className:"mt-2",style:{fontSize:"1.25rem",lineHeight:"1.75rem",marginBottom:"0.5rem"}},{children:r})),h5:({node:e,children:r})=>i("h5",Object.assign({style:{fontSize:"1.125rem",lineHeight:"1.75rem",marginBottom:"0.5rem"}},{children:r})),p:p,a:h,ol:({node:e,children:r})=>i("ol",Object.assign({style:{listStyleType:"decimal",listStylePosition:"inside",paddingLeft:"1.5rem",marginBottom:"1.5rem"}},{children:r})),ul:({node:e,children:r})=>i("ul",Object.assign({style:{listStyleType:"disc",listStylePosition:"inside",paddingLeft:"1.5rem",marginBottom:"1.5rem"}},{children:r})),li:({node:e,children:r})=>i("li",{children:r}),table:({children:e})=>i("div",Object.assign({style:{position:"relative",overflow:"auto",marginBottom:"1.5rem"}},{children:i("table",Object.assign({style:{tableLayout:"fixed",fontSize:"0.875rem",lineHeight:"1.24rem"}},{children:e}))})),th:({node:e,children:r})=>i("th",Object.assign({style:{padding:"0.75em 1em",fontWeight:600,textAlign:"left"}},{children:r})),tr:({node:e,children:r})=>i("tr",Object.assign({style:{border:"dark"===D?"1px solid #30363D":"1px solid #D0D7DE"}},{children:r})),td:({node:e,children:r})=>i("td",Object.assign({style:{padding:"0.75em 1em"}},{children:r})),code:b,blockquote:({node:e,children:r})=>i("blockquote",Object.assign({style:{lineHeight:"15px",borderLeft:"dark"===D?"4px solid #30363D":"4px solid #D0D7DE",color:"dark"===D?"#8B8B8B":"#656D76",paddingLeft:"1rem",marginBottom:"1rem"}},{children:r})),img:g,iframe:f,hr:()=>i("hr",{style:{border:0,borderTop:"dark"===D?"1px solid #30363D":"1px solid #D0D7DE",marginBottom:"1.5rem"}}),span:r=>{var{node:t,children:n}=r,o=e(r,["node","children"]);return"intro-msg-expand-btn"===o.className?i("span",Object.assign({},o,{style:{display:"inline",fontWeight:500,color:v,cursor:"pointer"},onClick:()=>H(!0)},{children:n})):i("span",Object.assign({},o,{children:n}))}};return r("div",Object.assign({className:"pxe-markdown",ref:P,style:Object.assign({position:"relative",overflowWrap:"break-word",display:"grid",gridTemplateColumns:"repeat(1, minmax(0, 1fr))",gap:".625rem"},x)},{children:[w&&i(u,{value:z,isOpen:w,onChangeIsOpen:H}),i(l,Object.assign({},j&&{className:j},{components:L,remarkPlugins:[m,a],rehypePlugins:[d,c]},{children:`${z}${!k&&S.length>0?"\n\n---":""}${"number"==typeof C&&z.length>=C?'<span class="intro-msg-expand-btn">...</span>':""}`})),!k&&S.length>0&&i("div",Object.assign({style:{display:"flex",flexDirection:"column",gap:"2rem",marginTop:"2rem"}},{children:S.map(((e,r)=>i(y,{data:e},r)))})),B]}))};export{j as PickaxeMarkdownRenderer};
|