@pickaxeproject/react 0.0.69 → 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.
@@ -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
- 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 d from"../../Addons/Scroll/ScrollLockView.js";import m from"../../common/PickaxeHead.js";import p from"../../common/PickaxeInfoModal.js";import x from"../../common/PickaxeUpgradeCard.js";import f from"./Message.js";import g 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:g("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")},{children:s(m,{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:g(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:g("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(f,{index:a,message:e},a))),N.map(((e,a)=>s(f,{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(d,{className:"w-full"})]}))}))]}))};export{u as default};
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};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pickaxeproject/react",
3
- "version": "0.0.69",
3
+ "version": "0.0.70",
4
4
  "description": "Client utility library for Pickaxe",
5
5
  "repository": {
6
6
  "type": "git",