@pickaxeproject/react 0.0.58 → 0.0.60

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.
Files changed (77) hide show
  1. package/dist/cjs/components/Core/Button.js +1 -1
  2. package/dist/cjs/components/Core/ErrorAlert.js +1 -1
  3. package/dist/cjs/components/Core/Tooltip.js +1 -1
  4. package/dist/cjs/components/Icons/arrow-up-right.svg.js +1 -0
  5. package/dist/cjs/components/Icons/eye.svg.js +1 -0
  6. package/dist/cjs/components/Pickaxe/Addons/Document/List.js +1 -1
  7. package/dist/cjs/components/Pickaxe/Addons/IceBreaker/Breaker.js +1 -1
  8. package/dist/cjs/components/Pickaxe/Chat/History/Message.js +1 -1
  9. package/dist/cjs/components/Pickaxe/Chat/History/index.js +1 -1
  10. package/dist/cjs/components/Pickaxe/Chat/Input.js +1 -1
  11. package/dist/cjs/components/Pickaxe/Form/Head.js +1 -1
  12. package/dist/cjs/components/Pickaxe/Form/History/Item.js +1 -1
  13. package/dist/cjs/components/Pickaxe/Form/History/Response.js +1 -1
  14. package/dist/cjs/components/Pickaxe/Form/Questions/Checkbox.js +1 -1
  15. package/dist/cjs/components/Pickaxe/Form/Questions/Document.js +1 -1
  16. package/dist/cjs/components/Pickaxe/Form/Questions/Input.js +1 -1
  17. package/dist/cjs/components/Pickaxe/Form/Questions/Option.js +1 -1
  18. package/dist/cjs/components/Pickaxe/common/PickaxeBranding.js +1 -1
  19. package/dist/cjs/components/Pickaxe/common/PickaxeButton.js +1 -1
  20. package/dist/cjs/components/Pickaxe/common/PickaxeInfoModal.js +1 -1
  21. package/dist/cjs/components/Pickaxe/common/PickaxeMarkdown/Custom/A/index.js +1 -1
  22. package/dist/cjs/components/Pickaxe/common/PickaxeMarkdown/Custom/Img/ImgModal.js +1 -1
  23. package/dist/cjs/components/Pickaxe/common/PickaxeMarkdown/Custom/P/index.js +1 -1
  24. package/dist/cjs/components/Pickaxe/common/PickaxeMarkdown/Custom/common/Audio.js +1 -0
  25. package/dist/cjs/components/Pickaxe/common/PickaxeMarkdown/Custom/common/Html/HtmlModal.js +1 -0
  26. package/dist/cjs/components/Pickaxe/common/PickaxeMarkdown/Custom/common/Html/index.js +1 -0
  27. package/dist/cjs/components/Pickaxe/common/PickaxeMarkdown/Custom/common/Modal/Body.js +1 -0
  28. package/dist/cjs/components/Pickaxe/common/PickaxeMarkdown/Custom/common/Modal/index.js +1 -0
  29. package/dist/cjs/components/Pickaxe/common/PickaxeMarkdown/Renderer.js +1 -1
  30. package/dist/cjs/components/Pickaxe/common/PickaxeUpgradeCard.js +1 -1
  31. package/dist/cjs/hooks/studio/useStyleFontSize.js +1 -1
  32. package/dist/cjs/src/components/Pickaxe/common/PickaxeMarkdown/Custom/common/Audio.d.ts +5 -0
  33. package/dist/cjs/src/components/Pickaxe/common/PickaxeMarkdown/Custom/common/Html/HtmlModal.d.ts +7 -0
  34. package/dist/cjs/src/components/Pickaxe/common/PickaxeMarkdown/Custom/common/Html/index.d.ts +5 -0
  35. package/dist/cjs/src/components/Pickaxe/common/PickaxeMarkdown/Custom/common/Modal/Body.d.ts +6 -0
  36. package/dist/cjs/src/components/Pickaxe/common/PickaxeMarkdown/Custom/common/Modal/CloseButton.d.ts +9 -0
  37. package/dist/cjs/src/components/Pickaxe/common/PickaxeMarkdown/Custom/common/Modal/index.d.ts +15 -0
  38. package/dist/cjs/src/hooks/studio/useStyleFontSize.d.ts +3 -3
  39. package/dist/esm/components/Core/Button.js +1 -1
  40. package/dist/esm/components/Core/ErrorAlert.js +1 -1
  41. package/dist/esm/components/Core/Tooltip.js +1 -1
  42. package/dist/esm/components/Icons/arrow-up-right.svg.js +1 -0
  43. package/dist/esm/components/Icons/eye.svg.js +1 -0
  44. package/dist/esm/components/Pickaxe/Addons/Document/List.js +1 -1
  45. package/dist/esm/components/Pickaxe/Addons/IceBreaker/Breaker.js +1 -1
  46. package/dist/esm/components/Pickaxe/Chat/History/Message.js +1 -1
  47. package/dist/esm/components/Pickaxe/Chat/History/index.js +1 -1
  48. package/dist/esm/components/Pickaxe/Chat/Input.js +1 -1
  49. package/dist/esm/components/Pickaxe/Form/Head.js +1 -1
  50. package/dist/esm/components/Pickaxe/Form/History/Item.js +1 -1
  51. package/dist/esm/components/Pickaxe/Form/History/Response.js +1 -1
  52. package/dist/esm/components/Pickaxe/Form/Questions/Checkbox.js +1 -1
  53. package/dist/esm/components/Pickaxe/Form/Questions/Document.js +1 -1
  54. package/dist/esm/components/Pickaxe/Form/Questions/Input.js +1 -1
  55. package/dist/esm/components/Pickaxe/Form/Questions/Option.js +1 -1
  56. package/dist/esm/components/Pickaxe/common/PickaxeBranding.js +1 -1
  57. package/dist/esm/components/Pickaxe/common/PickaxeButton.js +1 -1
  58. package/dist/esm/components/Pickaxe/common/PickaxeInfoModal.js +1 -1
  59. package/dist/esm/components/Pickaxe/common/PickaxeMarkdown/Custom/A/index.js +1 -1
  60. package/dist/esm/components/Pickaxe/common/PickaxeMarkdown/Custom/Img/ImgModal.js +1 -1
  61. package/dist/esm/components/Pickaxe/common/PickaxeMarkdown/Custom/P/index.js +1 -1
  62. package/dist/esm/components/Pickaxe/common/PickaxeMarkdown/Custom/common/Audio.js +1 -0
  63. package/dist/esm/components/Pickaxe/common/PickaxeMarkdown/Custom/common/Html/HtmlModal.js +1 -0
  64. package/dist/esm/components/Pickaxe/common/PickaxeMarkdown/Custom/common/Html/index.js +1 -0
  65. package/dist/esm/components/Pickaxe/common/PickaxeMarkdown/Custom/common/Modal/Body.js +1 -0
  66. package/dist/esm/components/Pickaxe/common/PickaxeMarkdown/Custom/common/Modal/index.js +1 -0
  67. package/dist/esm/components/Pickaxe/common/PickaxeMarkdown/Renderer.js +1 -1
  68. package/dist/esm/components/Pickaxe/common/PickaxeUpgradeCard.js +1 -1
  69. package/dist/esm/hooks/studio/useStyleFontSize.js +1 -1
  70. package/dist/esm/src/components/Pickaxe/common/PickaxeMarkdown/Custom/common/Audio.d.ts +5 -0
  71. package/dist/esm/src/components/Pickaxe/common/PickaxeMarkdown/Custom/common/Html/HtmlModal.d.ts +7 -0
  72. package/dist/esm/src/components/Pickaxe/common/PickaxeMarkdown/Custom/common/Html/index.d.ts +5 -0
  73. package/dist/esm/src/components/Pickaxe/common/PickaxeMarkdown/Custom/common/Modal/Body.d.ts +6 -0
  74. package/dist/esm/src/components/Pickaxe/common/PickaxeMarkdown/Custom/common/Modal/CloseButton.d.ts +9 -0
  75. package/dist/esm/src/components/Pickaxe/common/PickaxeMarkdown/Custom/common/Modal/index.d.ts +15 -0
  76. package/dist/esm/src/hooks/studio/useStyleFontSize.d.ts +3 -3
  77. package/package.json +1 -1
@@ -1 +1 @@
1
- import{__rest as e}from"../../_virtual/_tslib.js";import{jsxs as t,Fragment as n,jsx as i}from"react/jsx-runtime";import{forwardRef as o,useMemo as r}from"react";import a from"../../common/cn.js";const s=o(((o,s)=>{var{style:l,variant:c="primary",className:d,loadingText:m="Loading",isDisabled:p=!1,isLoading:u=!1}=o,x=e(o,["style","variant","className","loadingText","isDisabled","isLoading"]);const b=r((()=>p||u?{"aria-disabled":!0,disabled:!0,style:Object.assign({cursor:"not-allowed",opacity:.5},l),onClick:e=>{e.preventDefault()}}:{style:l}),[l,p,u]),y=r((()=>u?Array.isArray(x.children)&&x.children.length>1?{children:t(n,{children:[x.children[0],m]})}:{children:m}:{}),[u,m]);return i("button",Object.assign({ref:s,className:a("primary"===c&&"flex min-h-[36px] select-none items-center justify-center gap-x-2 rounded-sm border-2 border-c-blue bg-c-blue px-4 text-sm font-semibold text-white outline-none duration-300 hover:opacity-70 active:opacity-100","secondary"===c&&"flex min-h-[36px] select-none items-center justify-center gap-x-2 rounded-sm bg-c-light-blue p-1 px-4 text-sm font-semibold text-c-blue outline-none duration-300 hover:opacity-70 active:opacity-100","outline"===c&&"flex min-h-[36px] select-none items-center justify-center gap-x-2 rounded-sm border-2 border-c-blue p-1 px-4 text-sm font-semibold text-c-blue outline-none duration-300 hover:opacity-70 active:opacity-100","transparent"===c&&"flex min-h-[36px] select-none items-center justify-center gap-x-2 rounded-sm border-2 border-transparent bg-transparent px-4 py-1 text-sm font-semibold text-c-blue outline-none duration-300 hover:opacity-70 active:opacity-100","transparent-text"===c&&"flex select-none items-center justify-center gap-x-2 text-sm font-semibold text-c-blue outline-none duration-300 hover:opacity-70 active:opacity-100","menu-item"===c&&"flex w-full select-none items-center gap-2 px-4 py-2 text-left text-sm font-semilight outline-none duration-300 hover:opacity-70 active:opacity-100",d)},x,b,y))}));s.displayName="Button";export{s as default};
1
+ import{__rest as e}from"../../_virtual/_tslib.js";import{jsxs as t,Fragment as n,jsx as i}from"react/jsx-runtime";import{forwardRef as o,useMemo as r}from"react";import a from"../../common/cn.js";const l=o(((o,l)=>{var{style:c,variant:s="primary",className:d,loadingText:p="Loading",isDisabled:u=!1,isLoading:m=!1}=o,x=e(o,["style","variant","className","loadingText","isDisabled","isLoading"]);const b=r((()=>u||m?{"aria-disabled":!0,disabled:!0,style:Object.assign({cursor:"not-allowed",opacity:.5},c),onClick:e=>{e.preventDefault()}}:{style:c}),[c,u,m]),y=r((()=>m?Array.isArray(x.children)&&x.children.length>1?{children:t(n,{children:[x.children[0],p]})}:{children:p}:{}),[m,p]);return i("button",Object.assign({ref:l,className:a("primary"===s&&"flex min-h-[36px] select-none items-center justify-center gap-x-2 rounded-sm border-2 border-c-blue bg-c-blue px-4 font-semibold text-white outline-none duration-300 hover:opacity-70 active:opacity-100","secondary"===s&&"flex min-h-[36px] select-none items-center justify-center gap-x-2 rounded-sm bg-c-light-blue p-1 px-4 font-semibold text-c-blue outline-none duration-300 hover:opacity-70 active:opacity-100","outline"===s&&"flex min-h-[36px] select-none items-center justify-center gap-x-2 rounded-sm border-2 border-c-blue p-1 px-4 font-semibold text-c-blue outline-none duration-300 hover:opacity-70 active:opacity-100","transparent"===s&&"flex min-h-[36px] select-none items-center justify-center gap-x-2 rounded-sm border-2 border-transparent bg-transparent px-4 py-1 font-semibold text-c-blue outline-none duration-300 hover:opacity-70 active:opacity-100","transparent-text"===s&&"flex select-none items-center justify-center gap-x-2 font-semibold text-c-blue outline-none duration-300 hover:opacity-70 active:opacity-100","menu-item"===s&&"flex w-full select-none items-center gap-2 px-4 py-2 text-left font-semilight outline-none duration-300 hover:opacity-70 active:opacity-100",d)},x,b,y))}));l.displayName="Button";export{l as default};
@@ -1 +1 @@
1
- import{jsxs as e,jsx as s}from"react/jsx-runtime";import m from"../Icons/circle-exclamation.svg.js";import r from"./HtmlRenderer.js";import t from"../../common/cn.js";const a=({error:a,className:o,iconClassName:l,htmlClassName:c})=>a?e("div",Object.assign({className:t("flex items-center gap-2 text-red-500",o)},{children:[s(m,{className:t("h-5 w-5 shrink-0",l)}),s(r,{className:t("text-sm font-semibold",c),html:a})]})):null;export{a as default};
1
+ import{jsxs as s,jsx as e}from"react/jsx-runtime";import{useStyleFontSize as m}from"../../hooks/studio/useStyleFontSize.js";import o from"../Icons/circle-exclamation.svg.js";import r from"./HtmlRenderer.js";import t from"../../common/cn.js";const a=({error:a,className:l,iconClassName:c,htmlClassName:i})=>{const n=m();return a?s("div",Object.assign({className:t("flex items-center gap-2 text-red-500",l)},{children:[e(o,{className:t("h-5 w-5 shrink-0",c)}),e(r,{className:t(n.b3,"font-semibold",i),html:a})]})):null};export{a as default};
@@ -1 +1 @@
1
- import{jsxs as e,jsx as i}from"react/jsx-runtime";import t from"../Icons/circle-info.svg.js";import o from"./Menu/index.js";import r from"./Menu/Button.js";import n from"./Menu/List.js";import s from"../../common/cn.js";const a=({id:a,label:c="",icon:l=t,className:m,contentClassName:p,size:d=20,width:h="300px",border:g,align:u="right-start"})=>e(o,Object.assign({id:a},{children:[i(r,{children:i(l,{className:s("shrink-0 cursor-help outline-none duration-300 hover:opacity-80 hover:duration-200",m),style:{width:d,height:d},onClick:e=>e.stopPropagation()})}),i(n,Object.assign({width:h,align:u,className:s("p-6",p)},g&&{border:g},{children:"string"==typeof c?i("div",Object.assign({className:"select-none px-2 py-1 text-[13px]"},{children:i("p",{children:c})})):c}))]}));export{a as default};
1
+ import{jsxs as o,jsx as e}from"react/jsx-runtime";import{useStyleFontSize as i}from"../../hooks/studio/useStyleFontSize.js";import t from"../Icons/circle-info.svg.js";import r from"./Menu/index.js";import s from"./Menu/Button.js";import n from"./Menu/List.js";import c from"../../common/cn.js";const a=({id:a,label:l="",icon:m=t,className:d,contentClassName:p,size:h=20,width:u="300px",border:f,align:g="right-start"})=>{const j=i();return o(r,Object.assign({id:a},{children:[e(s,{children:e(m,{className:c("shrink-0 cursor-help outline-none duration-300 hover:opacity-80 hover:duration-200",d),style:{width:h,height:h},onClick:o=>o.stopPropagation()})}),e(n,Object.assign({width:u,align:g,className:c("p-6",p)},f&&{border:f},{children:"string"==typeof l?e("div",Object.assign({className:c(j.b3,"select-none px-2 py-1")},{children:e("p",{children:l})})):l}))]}))};export{a as default};
@@ -0,0 +1 @@
1
+ import*as r from"react";var e;function t(){return t=Object.assign?Object.assign.bind():function(r){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var n in t)({}).hasOwnProperty.call(t,n)&&(r[n]=t[n])}return r},t.apply(null,arguments)}var n=n=>r.createElement("svg",t({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},n),e||(e=r.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M7 17 17 7M7 7h10v10"})));export{n as default};
@@ -0,0 +1 @@
1
+ import*as r from"react";var e,t;function n(){return n=Object.assign?Object.assign.bind():function(r){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var n in t)({}).hasOwnProperty.call(t,n)&&(r[n]=t[n])}return r},n.apply(null,arguments)}var o=o=>r.createElement("svg",n({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},o),e||(e=r.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M1 12.5s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8"})),t||(t=r.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 15.5a3 3 0 1 0 0-6 3 3 0 0 0 0 6"})));export{o as default};
@@ -1 +1 @@
1
- import{jsx as e,jsxs as o}from"react/jsx-runtime";import{useCallback as t}from"react";import{useDocumentContext as r}from"./hooks/useDocumentContext.js";import{AnimatePresence as s,motion as i}from"framer-motion";import a from"../../../Icons/document.svg.js";import n from"../../../Icons/link.svg.js";import c from"../../../Icons/youtube.svg.js";import m from"../../../Icons/trash.svg.js";import l from"../../../Icons/spinner-lines.svg.js";import p from"../../../Core/Tooltip.js";import d from"../../../../common/cn.js";const u=({className:u})=>{const{documents:h,isShowList:f,setDocuments:g}=r(),v=t((e=>e.length>85?`${e.slice(0,25)}...${e.slice(-10)}`:e),[]);return e(s,{children:f&&e(i.div,Object.assign({className:d("flex w-full flex-col gap-1",u),initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.3}},{children:h.filter((e=>!e.isInsertedAsRaw)).map((({type:t,name:r,status:s,error:i},d)=>o("div",Object.assign({className:"group flex cursor-pointer justify-between gap-2 rounded-sm border border-transparent bg-white px-3 py-2 hover:border-[#E8EDF2] hover:shadow-sm hover:duration-300"},{children:[o("div",Object.assign({className:"flex items-center gap-2"},{children:["uploading"===s?e(l,{className:"h-6 w-6 shrink-0 animate-spin text-c-dark-gray"}):"failed"===s?e(p,{id:`document-upload-failed-${d}`,label:null!=i?i:"Upload failed. Please try again.",className:"text-c-red"}):e("website"===t?n:"youtube"===t?c:a,{className:"h-6 w-6 shrink-0 text-c-dark-gray"}),e("p",Object.assign({className:"line-clamp-1 text-[14px] font-semilight opacity-70"},{children:v(r)}))]})),e("button",Object.assign({className:"opacity-0 outline-none group-hover:opacity-100 group-hover:duration-300",onClick:()=>{return e=d,void g((o=>o.filter(((o,t)=>t!==e))));var e}},{children:e(m,{className:"h-6 w-6 shrink-0 text-c-dark-gray hover:opacity-80 hover:duration-300"})}))]}),d)))}))})};export{u as default};
1
+ import{jsx as e,jsxs as o}from"react/jsx-runtime";import{useCallback as t}from"react";import{useDocumentContext as r}from"./hooks/useDocumentContext.js";import{useStyleFontSize as s}from"../../../../hooks/studio/useStyleFontSize.js";import{AnimatePresence as i,motion as a}from"framer-motion";import n from"../../../Icons/document.svg.js";import c from"../../../Icons/link.svg.js";import m from"../../../Icons/youtube.svg.js";import l from"../../../Icons/trash.svg.js";import p from"../../../Icons/spinner-lines.svg.js";import d from"../../../Core/Tooltip.js";import u from"../../../../common/cn.js";const h=({className:h})=>{const f=s(),{documents:g,isShowList:v,setDocuments:y}=r(),b=t((e=>e.length>85?`${e.slice(0,25)}...${e.slice(-10)}`:e),[]);return e(i,{children:v&&e(a.div,Object.assign({className:u("flex w-full flex-col gap-1",h),initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.3}},{children:g.filter((e=>!e.isInsertedAsRaw)).map((({type:t,name:r,status:s,error:i},a)=>o("div",Object.assign({className:"group flex cursor-pointer justify-between gap-2 rounded-sm border border-transparent bg-white px-3 py-2 hover:border-[#E8EDF2] hover:shadow-sm hover:duration-300"},{children:[o("div",Object.assign({className:"flex items-center gap-2"},{children:["uploading"===s?e(p,{className:"h-6 w-6 shrink-0 animate-spin text-c-dark-gray"}):"failed"===s?e(d,{id:`document-upload-failed-${a}`,label:null!=i?i:"Upload failed. Please try again.",className:"text-c-red"}):e("website"===t?c:"youtube"===t?m:n,{className:"h-6 w-6 shrink-0 text-c-dark-gray"}),e("p",Object.assign({className:u(f.b2,"line-clamp-1 font-semilight opacity-70")},{children:b(r)}))]})),e("button",Object.assign({className:"opacity-0 outline-none group-hover:opacity-100 group-hover:duration-300",onClick:()=>{return e=a,void y((o=>o.filter(((o,t)=>t!==e))));var e}},{children:e(l,{className:"h-6 w-6 shrink-0 text-c-dark-gray hover:opacity-80 hover:duration-300"})}))]}),a)))}))})};export{h as default};
@@ -1 +1 @@
1
- import{__rest as o}from"../../../../_virtual/_tslib.js";import{jsx as e}from"react/jsx-runtime";import{useHover as s}from"../../../../hooks/core/useHover.js";import t from"../../../../common/cn.js";const r=({text:r="",style:i,isMobile:n,onSend:l})=>{const c=s(),{isHover:a}=c,m=o(c,["isHover"]);return e("div",Object.assign({className:t("relative top-0 flex flex-grow cursor-pointer select-none rounded bg-white px-[1em] py-[9px] text-[12px] font-semilight shadow [transition:box-shadow_0.2s_ease-in-out,color_0.2s_ease-in-out,top_0.2s_ease] hover:top-[-2px] hover:shadow-md",n&&"min-w-[196px]"),onClick:()=>null==l?void 0:l(r)},i&&{style:Object.assign(Object.assign({},i),!a&&i.color&&{color:i.color+"80"})},m,{children:e("p",Object.assign({className:"line-clamp-3"},{children:r}))}))};export{r as default};
1
+ import{__rest as o}from"../../../../_virtual/_tslib.js";import{jsx as e}from"react/jsx-runtime";import{useHover as s}from"../../../../hooks/core/useHover.js";import{useStyleFontSize as t}from"../../../../hooks/studio/useStyleFontSize.js";import r from"../../../../common/cn.js";const i=({text:i="",style:n,isMobile:l,onSend:c})=>{const a=s(),{isHover:m}=a,p=o(a,["isHover"]),d=t();return e("div",Object.assign({className:r(d.b4,"relative top-0 flex flex-grow cursor-pointer select-none rounded bg-white px-[1em] py-[9px] font-semilight shadow [transition:box-shadow_0.2s_ease-in-out,color_0.2s_ease-in-out,top_0.2s_ease] hover:top-[-2px] hover:shadow-md",l&&"min-w-[196px]"),onClick:()=>null==c?void 0:c(i)},n&&{style:Object.assign(Object.assign({},n),!m&&n.color&&{color:n.color+"80"})},p,{children:e("p",Object.assign({className:"line-clamp-3"},{children:i}))}))};export{i as default};
@@ -1 +1 @@
1
- import{jsx as e,jsxs as o}from"react/jsx-runtime";import{usePickaxeContext as s}from"../../../../hooks/pickaxe/usePickaxeContext.js";import{PickaxeMarkdown as a}from"../../common/PickaxeMarkdown/index.js";import{PickaxeMarkdownRenderer as c}from"../../common/PickaxeMarkdown/Renderer.js";import t from"../../common/PickaxeIcon.js";import r from"../../common/PickaxeCopyButton.js";import i from"../../../../common/cn.js";const n=({message:n})=>{var l;const{formId:m,pickaxe:x,styles:d,colors:p,misc:h,responsiveBy:f}=s(),v=null!==(l=null==x?void 0:x.chaticon)&&void 0!==l?l:`https://prod-pickaxe-assets.s3.us-west-2.amazonaws.com/chaticons/${m}.png`;return"assistant"===n.role?e("div",Object.assign({className:i("flex flex-col","viewport"===f?"min-[767px]:max-w-[80%]":"@[767px]/pickaxe-root:max-w-[80%]")},{children:o("div",Object.assign({className:"flex gap-x-3"},{children:[h.isChatImage&&"NONE"!==v&&e(t,{src:v,alt:"Assistant",width:24,height:24,className:"my-3 h-6 w-6",textColor:p.text}),o("div",Object.assign({className:"flex flex-col"},{children:[e("div",Object.assign({className:"chat-message overflow-x-auto overflow-y-hidden rounded px-4 py-3 scrollbar-thin scrollbar-track-white scrollbar-thumb-[#4A4A4B]",style:{backgroundColor:p.secondary+"80",color:p.secondaryText}},{children:e(a,Object.assign({theme:d.theme,accentColor:p.accent,linkPreviews:!0,actions:!0},{children:e(c,{value:n.content})}))})),e("div",Object.assign({className:"mb-2 ml-2 mt-4 flex gap-3"},{children:e(r,{color:p.accent,text:n.content})}))]}))]}))})):"user"===n.role?e("div",Object.assign({className:i("flex gap-x-3 justify-self-end pl-9","viewport"===f?"min-[767px]:max-w-[80%] min-[767px]:pl-0":"@[767px]/pickaxe-root:max-w-[80%] @[767px]/pickaxe-root:pl-0")},{children:e("div",Object.assign({className:"overflow-x-auto overflow-y-hidden rounded px-4 py-3 scrollbar-thin scrollbar-track-white scrollbar-thumb-[#4A4A4B]"},{children:e(a,Object.assign({theme:d.theme,accentColor:p.accent},{children:e(c,{value:n.content})}))}))})):e("div",{})};export{n as default};
1
+ import{jsx as e,jsxs as o}from"react/jsx-runtime";import{usePickaxeContext as s}from"../../../../hooks/pickaxe/usePickaxeContext.js";import{useStyleFontSize as t}from"../../../../hooks/studio/useStyleFontSize.js";import{PickaxeMarkdown as a}from"../../common/PickaxeMarkdown/index.js";import{PickaxeMarkdownRenderer as c}from"../../common/PickaxeMarkdown/Renderer.js";import r from"../../common/PickaxeIcon.js";import i from"../../common/PickaxeCopyButton.js";import n from"../../../../common/cn.js";const l=({message:l})=>{var m;const{formId:x,pickaxe:d,styles:p,colors:h,misc:f,responsiveBy:b}=s(),u=t(),v=null!==(m=null==d?void 0:d.chaticon)&&void 0!==m?m:`https://prod-pickaxe-assets.s3.us-west-2.amazonaws.com/chaticons/${x}.png`;return"assistant"===l.role?e("div",Object.assign({className:n("flex flex-col","viewport"===b?"min-[767px]:max-w-[80%]":"@[767px]/pickaxe-root:max-w-[80%]")},{children:o("div",Object.assign({className:"flex gap-x-3"},{children:[f.isChatImage&&"NONE"!==v&&e(r,{src:v,alt:"Assistant",width:24,height:24,className:"my-3 h-6 w-6",textColor:h.text}),o("div",Object.assign({className:"flex flex-col"},{children:[e("div",Object.assign({className:n(u.b2,"chat-message overflow-x-auto overflow-y-hidden rounded px-4 py-3 scrollbar-thin scrollbar-track-white scrollbar-thumb-[#4A4A4B]"),style:{backgroundColor:h.secondary+"80",color:h.secondaryText}},{children:e(a,Object.assign({theme:p.theme,accentColor:h.accent,linkPreviews:!0,actions:!0},{children:e(c,{value:l.content})}))})),e("div",Object.assign({className:"mb-2 ml-2 mt-4 flex gap-3"},{children:e(i,{color:h.accent,text:l.content})}))]}))]}))})):"user"===l.role?e("div",Object.assign({className:n("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:e("div",Object.assign({className:n(u.b2,"overflow-x-auto overflow-y-hidden rounded px-4 py-3 scrollbar-thin scrollbar-track-white scrollbar-thumb-[#4A4A4B]")},{children:e(a,Object.assign({theme:p.theme,accentColor:h.accent},{children:e(c,{value:l.content})}))}))})):e("div",{})};export{l as default};
@@ -1 +1 @@
1
- import{jsxs as e,jsx as s}from"react/jsx-runtime";import{useState as t,useMemo as o}from"react";import{usePickaxeContext as a}from"../../../../hooks/pickaxe/usePickaxeContext.js";import{useResponseContext as i}from"../../../../hooks/pickaxe/useResponseContext.js";import{useStyleFontSize as l}from"../../../../hooks/studio/useStyleFontSize.js";import{useConversation as c}from"../../../../hooks/pickaxe/useConversation.js";import r from"../../../Icons/circle-info.svg.js";import n from"../../common/PickaxeIcon.js";import m from"../../../Core/ErrorAlert.js";import d from"../../Addons/Scroll/ScrollLockView.js";import p from"../../common/PickaxeInfoModal.js";import x from"../../common/PickaxeUpgradeCard.js";import u from"./Message.js";import f from"../../../../common/cn.js";const g=()=>{var g,h;const{pickaxe:v,styles:b,colors:j,misc:w,responsiveBy:y,isNewChat:k,setChatId:E}=a(),{messages:N,status:O,limitData:C,error:P}=i(),B=c(),[F,I]=t(!1),S=l({type:"b1"}),T=o((()=>!!B.data&&!(B.data.messages.length<=1)),[B.data]),$=o((()=>B.isSuccess&&k&&!T),[B.isSuccess,k,T]);return e("div",Object.assign({className:"relative flex flex-grow flex-col justify-end"},{children:[F&&s(p,{isOpen:F,onChangeIsOpen:I}),e("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",$&&"top-1/3 opacity-100")},{children:[w.isProfileImage&&s("button",Object.assign({className:"duration-300 hover:opacity-90 active:opacity-100 outline-none",onClick:()=>E("")},{children:s(n,{src:null==v?void 0:v.coverphoto,alt:`${null==v?void 0:v.formtitle}'s Profile Picture`,width:90,height:90,className:"h-[90px] w-[90px] rounded-full"})})),e("div",Object.assign({className:"flex flex-col items-center"},{children:[w.isTitle&&e("h2",Object.assign({className:f("mt-6 text-center font-semibold opacity-70","viewport"===y?"min-[767px]:text-lg":"@[767px]/pickaxe-root:text-lg")},{children:[`${null==v?void 0:v.formtitle.slice(0,130)}${(null!==(g=null==v?void 0:v.formtitle)&&void 0!==g?g:"").length>130?"...":""}`,s("button",Object.assign({className:"ml-2 inline-block outline-none hover:opacity-70 hover:duration-300 active:opacity-100",onClick:()=>I(!0)},{children:s(r,{className:"h-5 w-5 shrink-0",style:{color:j.accent}})}))]})),w.isDescription&&s("p",Object.assign({className:S("mt-2 line-clamp-3 whitespace-pre-line max-w-[600px] text-center font-semilight opacity-70")},{children:null==v?void 0:v.formdescription}))]}))]})),s("div",Object.assign({className:"flex w-full justify-center"},{children:B.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"===b.theme?"#1E1E1F":"#E5E7EB"}}),s("div",{className:"h-[150px] w-[70%] animate-pulse rounded bg-[#E5E7EB] dark:bg-[#1E1E1F]",style:{backgroundColor:"dark"===b.theme?"#1E1E1F":"#E5E7EB"}}),s("div",{className:"h-10 w-[50%] animate-pulse justify-self-end rounded bg-[#E5E7EB] dark:bg-[#1E1E1F]",style:{backgroundColor:"dark"===b.theme?"#1E1E1F":"#E5E7EB"}})]})):B.isError?s("div",Object.assign({className:"flex w-full max-w-[800px] justify-center pt-10"},{children:e("p",Object.assign({className:"text-center text-xl font-semibold"},{children:["Something went wrong. Please try again, or"," ",s("a",Object.assign({href:"mailto:info@pickaxeproject.com?subject=Help"},{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"===y?"min-[767px]:pt-10":"@[767px]/pickaxe-root:pt-10")},{children:[B.data.messages.map(((e,t)=>s(u,{message:e},t))),N.map(((e,t)=>s(u,{message:e},t))),"fetching"===O?e("div",Object.assign({className:"flex max-w-[80%] items-center gap-x-3"},{children:["NONE"!==(null==v?void 0:v.chaticon)&&s(n,{src:null!==(h=null==v?void 0:v.chaticon)&&void 0!==h?h:`https://prod-pickaxe-assets.s3.us-west-2.amazonaws.com/chaticons/${null==v?void 0:v.formid}.png`,alt:`${null==v?void 0:v.formtitle}'s Chat Icon`,width:24,height:24,className:"h-6 w-6",textColor:j.text}),e("div",Object.assign({className:"flex items-center gap-x-2 rounded px-4 py-4",style:{backgroundColor:j.secondary+"80",color:j.secondaryText}},{children:[s("div",{className:"h-1.5 w-1.5 animate-dot rounded-full",style:{backgroundColor:j.secondaryText}}),s("div",{className:"h-1.5 w-1.5 animate-dot-down rounded-full",style:{backgroundColor:j.secondaryText}}),s("div",{className:"h-1.5 w-1.5 animate-dot rounded-full",style:{backgroundColor:j.secondaryText}})]}))]})):C?s("div",Object.assign({className:"flex max-w-[80%] items-center gap-x-3"},{children:s(x,{})})):P?s("div",Object.assign({className:"flex max-w-[80%] items-center gap-x-3"},{children:s(m,{error:P})})):null]})),s(d,{className:"w-full"})]}))}))]}))};export{g as default};
1
+ import{jsxs as e,jsx as s}from"react/jsx-runtime";import{useState as t,useMemo as a}from"react";import{usePickaxeContext as o}from"../../../../hooks/pickaxe/usePickaxeContext.js";import{useResponseContext as i}from"../../../../hooks/pickaxe/useResponseContext.js";import{useStyleFontSize as l}from"../../../../hooks/studio/useStyleFontSize.js";import{useConversation as c}from"../../../../hooks/pickaxe/useConversation.js";import r from"../../../Icons/circle-info.svg.js";import n from"../../common/PickaxeIcon.js";import m from"../../../Core/ErrorAlert.js";import d from"../../Addons/Scroll/ScrollLockView.js";import p from"../../common/PickaxeInfoModal.js";import u from"../../common/PickaxeUpgradeCard.js";import f from"./Message.js";import x from"../../../../common/cn.js";const g=()=>{var g,h;const{pickaxe:v,styles:b,colors:j,misc:w,responsiveBy:y,isNewChat:k,setChatId:E}=o(),{messages:N,status:O,limitData:C,error:P}=i(),B=c(),F=l(),[I,S]=t(!1),T=a((()=>!!B.data&&!(B.data.messages.length<=1)),[B.data]),$=a((()=>B.isSuccess&&k&&!T),[B.isSuccess,k,T]);return e("div",Object.assign({className:"relative flex flex-grow flex-col justify-end"},{children:[I&&s(p,{isOpen:I,onChangeIsOpen:S}),e("div",Object.assign({className:x("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",$&&"top-1/3 opacity-100")},{children:[w.isProfileImage&&s("button",Object.assign({className:"duration-300 hover:opacity-90 active:opacity-100 outline-none",onClick:()=>E("")},{children:s(n,{src:null==v?void 0:v.coverphoto,alt:`${null==v?void 0:v.formtitle}'s Profile Picture`,width:90,height:90,className:"h-[90px] w-[90px] rounded-full"})})),e("div",Object.assign({className:"flex flex-col items-center"},{children:[w.isTitle&&e("h2",Object.assign({className:x(F.h2,"mt-6 text-center font-semilight opacity-70")},{children:[`${null==v?void 0:v.formtitle.slice(0,130)}${(null!==(g=null==v?void 0:v.formtitle)&&void 0!==g?g:"").length>130?"...":""}`,s("button",Object.assign({className:"ml-2 inline-block outline-none hover:opacity-70 hover:duration-300 active:opacity-100",onClick:()=>S(!0)},{children:s(r,{className:"h-5 w-5 shrink-0",style:{color:j.accent}})}))]})),w.isDescription&&s("p",Object.assign({className:x(F.b1,"mt-2 line-clamp-3 whitespace-pre-line max-w-[600px] text-center font-semilight opacity-70")},{children:null==v?void 0:v.formdescription}))]}))]})),s("div",Object.assign({className:"flex w-full justify-center"},{children:B.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"===b.theme?"#1E1E1F":"#E5E7EB"}}),s("div",{className:"h-[150px] w-[70%] animate-pulse rounded bg-[#E5E7EB] dark:bg-[#1E1E1F]",style:{backgroundColor:"dark"===b.theme?"#1E1E1F":"#E5E7EB"}}),s("div",{className:"h-10 w-[50%] animate-pulse justify-self-end rounded bg-[#E5E7EB] dark:bg-[#1E1E1F]",style:{backgroundColor:"dark"===b.theme?"#1E1E1F":"#E5E7EB"}})]})):B.isError?s("div",Object.assign({className:"flex w-full max-w-[800px] justify-center pt-10"},{children:e("p",Object.assign({className:x(F.b2,"text-center font-semibold")},{children:["Something went wrong. Please try again, or"," ",s("a",Object.assign({href:"mailto:info@pickaxeproject.com?subject=Help"},{children:"contact us"}))," ","for help."]}))})):e("div",Object.assign({className:"flex flex-col w-full"},{children:[e("div",Object.assign({className:x("relative grid w-full max-w-[800px] grid-cols-1 gap-y-6 px-4 pt-6","viewport"===y?"min-[767px]:pt-10":"@[767px]/pickaxe-root:pt-10")},{children:[B.data.messages.map(((e,t)=>s(f,{message:e},t))),N.map(((e,t)=>s(f,{message:e},t))),"fetching"===O?e("div",Object.assign({className:"flex max-w-[80%] items-center gap-x-3"},{children:["NONE"!==(null==v?void 0:v.chaticon)&&s(n,{src:null!==(h=null==v?void 0:v.chaticon)&&void 0!==h?h:`https://prod-pickaxe-assets.s3.us-west-2.amazonaws.com/chaticons/${null==v?void 0:v.formid}.png`,alt:`${null==v?void 0:v.formtitle}'s Chat Icon`,width:24,height:24,className:"h-6 w-6",textColor:j.text}),e("div",Object.assign({className:"flex items-center gap-x-2 rounded px-4 py-4",style:{backgroundColor:j.secondary+"80",color:j.secondaryText}},{children:[s("div",{className:"h-1.5 w-1.5 animate-dot rounded-full",style:{backgroundColor:j.secondaryText}}),s("div",{className:"h-1.5 w-1.5 animate-dot-down rounded-full",style:{backgroundColor:j.secondaryText}}),s("div",{className:"h-1.5 w-1.5 animate-dot rounded-full",style:{backgroundColor:j.secondaryText}})]}))]})):C?s("div",Object.assign({className:"flex max-w-[80%] items-center gap-x-3"},{children:s(u,{})})):P?s("div",Object.assign({className:"flex max-w-[80%] items-center gap-x-3"},{children:s(m,{error:P})})):null]})),s(d,{className:"w-full"})]}))}))]}))};export{g as default};
@@ -1 +1 @@
1
- import{__awaiter as e}from"../../../_virtual/_tslib.js";import{jsxs as t,jsx as o}from"react/jsx-runtime";import{useState as s,useRef as r,useMemo as i,useEffect as n}from"react";import{useMediaQuery as a}from"../../../hooks/core/useMediaQuery.js";import{usePickaxeContext as l}from"../../../hooks/pickaxe/usePickaxeContext.js";import{useResponseContext as d}from"../../../hooks/pickaxe/useResponseContext.js";import{useStyleInput as c}from"../../../hooks/studio/useStyleInput.js";import{useStyleFontSize as m}from"../../../hooks/studio/useStyleFontSize.js";import{useConversation as u}from"../../../hooks/pickaxe/useConversation.js";import{useSubmit as p}from"../../../hooks/pickaxe/useSubmit.js";import{useSubmitResult as f}from"../../../hooks/pickaxe/useSubmitResult.js";import{useDocument as h}from"../Addons/Document/hooks/useDocument.js";import{useScroll as g}from"../Addons/Scroll/hooks/useScroll.js";import{allowedFileMimeTypes as b,allowedImageMimeTypes as x}from"../../../common/documents.js";import{streamer as v}from"../../../common/api/streamer.js";import y from"../../../node_modules/.pnpm/react-textarea-autosize@8.5.7_@types_react@18.3.18_react@18.3.1/node_modules/react-textarea-autosize/dist/react-textarea-autosize.esm.js";import j from"../../Icons/attach.svg.js";import I from"../../Icons/send.svg.js";import k from"../common/PickaxeBranding.js";import w from"../Addons/IceBreaker/index.js";import O from"../../../common/error.js";import S from"../../../common/cn.js";const D=()=>{var D;const{formId:A,chatId:N,userId:C,studioUserId:U,deploymentId:E,pickaxe:_,colors:B,misc:z,responsiveBy:R,isNewChat:L,forceMobile:M,setIsNewChat:F,setIsShowIceBreaker:P,onGenerateComplete:T}=l(),{messages:W,status:G,limits:K,setMessages:H,setStatus:Q,setLimitData:q,setError:J,setIsGenerating:V}=d(),{documents:X,isUploading:Y,isImageUploadAllowed:Z,upsertDocuments:$,onFileUpload:ee,onEditDocumentByDocId:te}=h(),{scrollStartSession:oe,scrollEndSession:se,scrollToBottom:re}=g({auto:!0}),ie=u(),ne=p(),ae=f(),[le,de]=s(""),ce=r(null),[me]=a("(max-width: 767px)"),ue=c(),pe=m({type:"b2"}),fe=i((()=>{var e,t,o;return!!L&&(!!_&&(!ie.isLoading&&(!((null!==(t=null===(e=ie.data)||void 0===e?void 0:e.messages.length)&&void 0!==t?t:0)>1)&&!!(null===(o=_.icebreakers)||void 0===o?void 0:o.length))))}),[_,L,ie.data,ie.isLoading]);n((()=>{P(fe)}),[fe]);const he=t=>e(void 0,void 0,void 0,(function*(){try{if(Y||"idle"!==G)return;const e=null!=t?t:le;if(!e)return;de(""),J(""),q(null),V(!0),F(!1);const o=new Date,s="enduserupload"===(null==_?void 0:_.documentuploadtype),r=X.filter((e=>"finished"===e.status&&!e.isInsertedAsRaw)),i=r.length?r[r.length-1].documentId:"";Q("fetching"),oe(),re();const n=[...W,{id:W.length+1,role:"user",content:e}];H(n),re();const{success:a,data:l,usedDocumentIds:d,newDocumentId:c,newDocumentName:m,rawUserInput:u,isInsertedFile:p,error:f}=yield ne.mutateAsync(Object.assign(Object.assign(Object.assign({formId:A,responseId:N,value:e},s&&i&&{documentId:i}),U&&{studioUserId:U}),E&&{deploymentId:E}));if(!a)throw new Error(null!=f?f:"An error occurred, please try again.");re(),p&&i&&te({documentId:i,isInsertedAsRaw:!0}),c&&m&&$([{type:"website",id:m,name:m,status:"finished",documentId:c}]),re();const h=(yield v({formId:A,responseId:N,data:l})).body;if(!h)throw new Error("Streaming error");const g=h.getReader(),b=new TextDecoder,x=n.length;let y="",j=!0,I=!1;for(;j;){const{value:e,done:t}=yield g.read();j=!t;if(y+=b.decode(e),y)H([...n.slice(0,x),{id:W.length+1,role:"assistant",content:y}]),I||(Q("streaming"),I=!0);else if(!j&&!y)throw new Error("Server error")}const k=new Date;y&&(re(),Q("idle"),yield ae.mutateAsync(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({formId:A,responseId:N,documentIds:d},C&&{userId:C}),U&&{studioUserId:U}),U&&(null==_?void 0:_.studioid)&&{studioId:_.studioid}),E&&{deploymentId:E}),{messages:[{role:"user",message:u,sentAt:o},{role:"assistant",message:y,sentAt:k}]})),null==T||T(N))}catch(e){let t=O(e)||"";t&&!t.includes("Unexpected token 'A',")||(t="Oops! We're experiencing high traffic at the moment. Please try again later.");const o=Object.entries(K).find((([e])=>t.includes(e)));o?q(o[1]):J(t),re()}finally{Q("idle"),V(!1),se()}}));return t("div",Object.assign({className:S("fixed flex w-full flex-col bottom-0 left-0","viewport"===R?"min-[767px]:relative min-[767px]:bottom-auto min-[767px]:left-auto":"absolute @[767px]/pickaxe-root:relative @[767px]/pickaxe-root:bottom-auto @[767px]/pickaxe-root:left-auto")},{children:[!z.isWhiteLabel&&o("div",Object.assign({className:"flex justify-end pr-3"},{children:o(k,{animateHover:!0})})),fe&&o(w,{data:(null==_?void 0:_.icebreakers)||[],style:{backgroundColor:B.secondary,color:B.secondaryText},isMobile:M||me,onSend:he}),t("div",Object.assign({style:ue,className:"flex min-h-[56px] items-end gap-x-2 px-4 py-3 pb-[15px] shadow"},{children:["enduserupload"===(null==_?void 0:_.documentuploadtype)&&t("div",Object.assign({className:"tooltip"},{children:[o("input",{id:"file-upload",ref:ce,type:"file",accept:[...b,...Z?x:[]].join(", "),multiple:!0,hidden:!0,className:"hidden",onChange:t=>e(void 0,void 0,void 0,(function*(){yield ee(Array.from(t.target.files||[])),t.target.value=""}))}),o("button",Object.assign({className:"flex items-center disabled:cursor-wait disabled:opacity-50",disabled:Y,onClick:()=>{var e;return null===(e=ce.current)||void 0===e?void 0:e.click()}},{children:o(j,{className:"h-6 w-6 shrink-0 stroke-2",style:{color:B.accent}})}))]})),o(y,{className:S(pe("max-h-60 w-full resize-none border-transparent bg-transparent outline-none ring-0 scrollbar scrollbar-thin placeholder:font-semilight"),!le.length&&"max-h-6 overflow-hidden text-ellipsis whitespace-nowrap"),value:le,placeholder:null!==(D=null==_?void 0:_.placeholdertext)&&void 0!==D?D:"What do you want to talk about?",onChange:e=>de(e.target.value),onKeyDown:e=>{"Enter"===e.key&&(e.shiftKey||(e.preventDefault(),Y||"idle"!==G||he()))}}),o("button",Object.assign({className:"outline-none disabled:cursor-default disabled:opacity-50",disabled:Y||"idle"!==G,onClick:()=>he()},{children:o(I,{className:"h-6 w-6 shrink-0 stroke-2",style:{color:B.accent}})}))]}))]}))};export{D as default};
1
+ import{__awaiter as e}from"../../../_virtual/_tslib.js";import{jsxs as t,jsx as o}from"react/jsx-runtime";import{useState as s,useRef as r,useMemo as i,useEffect as n}from"react";import{useMediaQuery as a}from"../../../hooks/core/useMediaQuery.js";import{usePickaxeContext as l}from"../../../hooks/pickaxe/usePickaxeContext.js";import{useResponseContext as d}from"../../../hooks/pickaxe/useResponseContext.js";import{useStyleInput as c}from"../../../hooks/studio/useStyleInput.js";import{useStyleFontSize as m}from"../../../hooks/studio/useStyleFontSize.js";import{useConversation as u}from"../../../hooks/pickaxe/useConversation.js";import{useSubmit as p}from"../../../hooks/pickaxe/useSubmit.js";import{useSubmitResult as f}from"../../../hooks/pickaxe/useSubmitResult.js";import{useDocument as h}from"../Addons/Document/hooks/useDocument.js";import{useScroll as g}from"../Addons/Scroll/hooks/useScroll.js";import{allowedFileMimeTypes as b,allowedImageMimeTypes as x}from"../../../common/documents.js";import{streamer as v}from"../../../common/api/streamer.js";import y from"../../../node_modules/.pnpm/react-textarea-autosize@8.5.7_@types_react@18.3.18_react@18.3.1/node_modules/react-textarea-autosize/dist/react-textarea-autosize.esm.js";import j from"../../Icons/attach.svg.js";import I from"../../Icons/send.svg.js";import k from"../common/PickaxeBranding.js";import w from"../Addons/IceBreaker/index.js";import O from"../../../common/error.js";import S from"../../../common/cn.js";const D=()=>{var D;const{formId:A,chatId:N,userId:C,studioUserId:U,deploymentId:E,pickaxe:_,colors:B,misc:z,responsiveBy:R,isNewChat:L,forceMobile:M,setIsNewChat:F,setIsShowIceBreaker:P,onGenerateComplete:T}=l(),{messages:W,status:G,limits:K,setMessages:H,setStatus:Q,setLimitData:q,setError:J,setIsGenerating:V}=d(),{documents:X,isUploading:Y,isImageUploadAllowed:Z,upsertDocuments:$,onFileUpload:ee,onEditDocumentByDocId:te}=h(),{scrollStartSession:oe,scrollEndSession:se,scrollToBottom:re}=g({auto:!0}),ie=u(),ne=p(),ae=f(),le=m(),[de,ce]=s(""),me=r(null),[ue]=a("(max-width: 767px)"),pe=c(),fe=i((()=>{var e,t,o;return!!L&&(!!_&&(!ie.isLoading&&(!((null!==(t=null===(e=ie.data)||void 0===e?void 0:e.messages.length)&&void 0!==t?t:0)>1)&&!!(null===(o=_.icebreakers)||void 0===o?void 0:o.length))))}),[_,L,ie.data,ie.isLoading]);n((()=>{P(fe)}),[fe]);const he=t=>e(void 0,void 0,void 0,(function*(){try{if(Y||"idle"!==G)return;const e=null!=t?t:de;if(!e)return;ce(""),J(""),q(null),V(!0),F(!1);const o=new Date,s="enduserupload"===(null==_?void 0:_.documentuploadtype),r=X.filter((e=>"finished"===e.status&&!e.isInsertedAsRaw)),i=r.length?r[r.length-1].documentId:"";Q("fetching"),oe(),re();const n=[...W,{id:W.length+1,role:"user",content:e}];H(n),re();const{success:a,data:l,usedDocumentIds:d,newDocumentId:c,newDocumentName:m,rawUserInput:u,isInsertedFile:p,error:f}=yield ne.mutateAsync(Object.assign(Object.assign(Object.assign({formId:A,responseId:N,value:e},s&&i&&{documentId:i}),U&&{studioUserId:U}),E&&{deploymentId:E}));if(!a)throw new Error(null!=f?f:"An error occurred, please try again.");re(),p&&i&&te({documentId:i,isInsertedAsRaw:!0}),c&&m&&$([{type:"website",id:m,name:m,status:"finished",documentId:c}]),re();const h=(yield v({formId:A,responseId:N,data:l})).body;if(!h)throw new Error("Streaming error");const g=h.getReader(),b=new TextDecoder,x=n.length;let y="",j=!0,I=!1;for(;j;){const{value:e,done:t}=yield g.read();j=!t;if(y+=b.decode(e),y)H([...n.slice(0,x),{id:W.length+1,role:"assistant",content:y}]),I||(Q("streaming"),I=!0);else if(!j&&!y)throw new Error("Server error")}const k=new Date;y&&(re(),Q("idle"),yield ae.mutateAsync(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({formId:A,responseId:N,documentIds:d},C&&{userId:C}),U&&{studioUserId:U}),U&&(null==_?void 0:_.studioid)&&{studioId:_.studioid}),E&&{deploymentId:E}),{messages:[{role:"user",message:u,sentAt:o},{role:"assistant",message:y,sentAt:k}]})),null==T||T(N))}catch(e){let t=O(e)||"";t&&!t.includes("Unexpected token 'A',")||(t="Oops! We're experiencing high traffic at the moment. Please try again later.");const o=Object.entries(K).find((([e])=>t.includes(e)));o?q(o[1]):J(t),re()}finally{Q("idle"),V(!1),se()}}));return t("div",Object.assign({className:S("fixed flex w-full flex-col bottom-0 left-0","viewport"===R?"min-[767px]:relative min-[767px]:bottom-auto min-[767px]:left-auto":"absolute @[767px]/pickaxe-root:relative @[767px]/pickaxe-root:bottom-auto @[767px]/pickaxe-root:left-auto")},{children:[!z.isWhiteLabel&&o("div",Object.assign({className:"flex justify-end pr-3"},{children:o(k,{animateHover:!0})})),fe&&o(w,{data:(null==_?void 0:_.icebreakers)||[],style:{backgroundColor:B.secondary,color:B.secondaryText},isMobile:M||ue,onSend:he}),t("div",Object.assign({style:pe,className:"flex min-h-[56px] items-end gap-x-2 px-4 py-3 pb-[15px] shadow"},{children:["enduserupload"===(null==_?void 0:_.documentuploadtype)&&t("div",Object.assign({className:"tooltip"},{children:[o("input",{id:"file-upload",ref:me,type:"file",accept:[...b,...Z?x:[]].join(", "),multiple:!0,hidden:!0,className:"hidden",onChange:t=>e(void 0,void 0,void 0,(function*(){yield ee(Array.from(t.target.files||[])),t.target.value=""}))}),o("button",Object.assign({className:"flex items-center disabled:cursor-wait disabled:opacity-50",disabled:Y,onClick:()=>{var e;return null===(e=me.current)||void 0===e?void 0:e.click()}},{children:o(j,{className:"h-6 w-6 shrink-0 stroke-2",style:{color:B.accent}})}))]})),o(y,{className:S(le.b2,"max-h-60 w-full resize-none border-transparent bg-transparent outline-none ring-0 scrollbar scrollbar-thin placeholder:font-semilight",!de.length&&"max-h-6 overflow-hidden text-ellipsis whitespace-nowrap"),value:de,placeholder:null!==(D=null==_?void 0:_.placeholdertext)&&void 0!==D?D:"What do you want to talk about?",onChange:e=>ce(e.target.value),onKeyDown:e=>{"Enter"===e.key&&(e.shiftKey||(e.preventDefault(),Y||"idle"!==G||he()))}}),o("button",Object.assign({className:"outline-none disabled:cursor-default disabled:opacity-50",disabled:Y||"idle"!==G,onClick:()=>he()},{children:o(I,{className:"h-6 w-6 shrink-0 stroke-2",style:{color:B.accent}})}))]}))]}))};export{D as default};
@@ -1 +1 @@
1
- import{jsxs as e,jsx as o}from"react/jsx-runtime";import{useState as i}from"react";import{usePickaxeContext as t}from"../../../hooks/pickaxe/usePickaxeContext.js";import{useStyleFontSize as s}from"../../../hooks/studio/useStyleFontSize.js";import c from"../../Icons/circle-info.svg.js";import n from"../common/PickaxeIcon.js";import l from"../common/PickaxeInfoModal.js";import r from"../../../common/cn.js";const m=()=>{var m;const{pickaxe:a,colors:p,misc:x,responsiveBy:f}=t(),[d,h]=i(!1),u=s({type:"b1"});return e("div",Object.assign({className:"flex flex-col items-center"},{children:[d&&o(l,{isOpen:d,onChangeIsOpen:h}),x.isProfileImage&&o(n,{src:null==a?void 0:a.coverphoto,alt:`${null==a?void 0:a.formtitle}'s Profile Picture`,width:90,height:90,className:"h-[90px] w-[90px] rounded-full"}),x.isTitle&&e("h2",Object.assign({className:r("mt-6 text-center font-semibold opacity-70","viewport"===f?"min-[767px]:text-[18px]":"@[767px]/pickaxe-root:text-[18px]")},{children:[`${null==a?void 0:a.formtitle.slice(0,130)}${(null!==(m=null==a?void 0:a.formtitle)&&void 0!==m?m:"").length>130?"...":""}`,o("button",Object.assign({className:"ml-2 inline-block outline-none hover:opacity-70 hover:duration-300 active:opacity-100",onClick:()=>h(!0)},{children:o(c,{className:"h-5 w-5 shrink-0",style:{color:p.accent}})}))]})),x.isDescription&&o("p",Object.assign({className:u("mt-2 max-w-[600px] line-clamp-3 whitespace-pre-line text-center font-semilight opacity-70")},{children:null==a?void 0:a.formdescription}))]}))};export{m as default};
1
+ import{jsxs as e,jsx as o}from"react/jsx-runtime";import{useState as i}from"react";import{usePickaxeContext as t}from"../../../hooks/pickaxe/usePickaxeContext.js";import{useStyleFontSize as c}from"../../../hooks/studio/useStyleFontSize.js";import s from"../../Icons/circle-info.svg.js";import l from"../common/PickaxeIcon.js";import n from"../common/PickaxeInfoModal.js";import r from"../../../common/cn.js";const m=()=>{var m;const{pickaxe:a,colors:p,misc:f}=t(),h=c(),[d,u]=i(!1);return e("div",Object.assign({className:"flex flex-col items-center"},{children:[d&&o(n,{isOpen:d,onChangeIsOpen:u}),f.isProfileImage&&o(l,{src:null==a?void 0:a.coverphoto,alt:`${null==a?void 0:a.formtitle}'s Profile Picture`,width:90,height:90,className:"h-[90px] w-[90px] rounded-full"}),f.isTitle&&e("h2",Object.assign({className:r(h.h2,"mt-6 text-center font-semilight opacity-70")},{children:[`${null==a?void 0:a.formtitle.slice(0,130)}${(null!==(m=null==a?void 0:a.formtitle)&&void 0!==m?m:"").length>130?"...":""}`,o("button",Object.assign({className:"ml-2 inline-block outline-none hover:opacity-70 hover:duration-300 active:opacity-100",onClick:()=>u(!0)},{children:o(s,{className:"h-5 w-5 shrink-0",style:{color:p.accent}})}))]})),f.isDescription&&o("p",Object.assign({className:r(h.b1,"mt-2 max-w-[600px] line-clamp-3 whitespace-pre-line text-center font-semilight opacity-70")},{children:null==a?void 0:a.formdescription}))]}))};export{m as default};
@@ -1 +1 @@
1
- import{jsxs as e,jsx as s}from"react/jsx-runtime";import{useMemo as o}from"react";import{usePickaxeContext as t}from"../../../../hooks/pickaxe/usePickaxeContext.js";import{format as a}from"date-fns";import{PickaxeMarkdown as i}from"../../common/PickaxeMarkdown/index.js";import{PickaxeMarkdownRenderer as n}from"../../common/PickaxeMarkdown/Renderer.js";import l from"../../../Icons/message-square-notes.svg.js";import r from"../../../Icons/visitor.svg.js";import c from"../../common/PickaxeIcon.js";import d from"../../common/PickaxeSimpleButton.js";import m from"../../common/PickaxeCopyButton.js";const p=({item:p})=>{const{pickaxe:h,styles:f,colors:x,misc:u,setChatId:g,setIsNewChat:v}=t(),b=o((()=>a(p.createdAt,"hh:mm a MMM dd, yy")),[p]),y=o((()=>p&&p.messages?p.messages.length:0),[p]),j=o((()=>{var e,s,o,t;if("form"===p.type){return(null!==(e=p.questions)&&void 0!==e?e:[]).map((e=>`<div style="display: flex; flex-direction: column; margin-bottom: 1em;">\n <p style="font-weight: 500;">${e.question}</p>\n <p>${e.answer||"n/a"}</p>\n</div>`)).join("")}return null!==(t=null===(o=null===(s=p.messages)||void 0===s?void 0:s[0])||void 0===o?void 0:o.message)&&void 0!==t?t:""}),[p]),k=o((()=>{var e,s,o,t;return"form"===p.type?null!==(e=p.questionResponse)&&void 0!==e?e:"":null!==(t=null===(o=null===(s=p.messages)||void 0===s?void 0:s[1])||void 0===o?void 0:o.message)&&void 0!==t?t:""}),[p]);return e("div",Object.assign({className:"flex flex-col shadow-black transition duration-300 hover:shadow"},{children:[e("div",Object.assign({className:"flex gap-x-3 overflow-hidden px-4 py-5",style:{backgroundColor:x.primary,color:x.text}},{children:[s("div",Object.assign({className:"shrink-0 pt-1"},{children:s(r,{className:"h-6 w-6"})})),e("div",Object.assign({className:"flex flex-col gap-y-1 overflow-x-auto pb-1.5 scrollbar-track-gray-100 scrollbar-thumb-[#4A4A4B] lg:max-w-[520px] lg:scrollbar-thin"},{children:[s("input",{id:`${p.responseId}-input`,type:"checkbox",className:"peer hidden",defaultChecked:j.length<280}),s("div",{className:"danger-html hidden flex-col peer-checked:flex",dangerouslySetInnerHTML:{__html:j}}),s("label",Object.assign({htmlFor:`${p.responseId}-input`,className:"mt-1 flex shrink-0 whitespace-nowrap text-sm font-semibold peer-checked:hidden hover:cursor-pointer",style:{color:x.accent}},{children:"See input"})),s("label",Object.assign({htmlFor:`${p.responseId}-input`,className:"hidden shrink-0 whitespace-nowrap text-sm font-semibold peer-checked:flex hover:cursor-pointer",style:{color:x.accent}},{children:"Hide input"}))]}))]})),e("div",Object.assign({className:"flex gap-x-3 px-4 py-5",style:{backgroundColor:x.secondary,color:x.secondaryText}},{children:[u.isChatImage&&s(c,{src:null==h?void 0:h.chaticon,alt:`${null==h?void 0:h.formtitle}'s Chat Icon`,width:24,height:24,className:"h-6 w-6 pt-1",textColor:x.secondaryText}),e("div",Object.assign({className:"flex w-full flex-col gap-y-2 overflow-hidden"},{children:[s(i,Object.assign({theme:f.theme,accentColor:x.accent,linkPreviews:!0,actions:!0},{children:s(n,{className:"overflow-x-auto pb-2 font-semilight opacity-90 scrollbar scrollbar-thin",value:k})})),e("div",Object.assign({className:"flex flex-wrap items-center justify-between gap-x-3 gap-y-1"},{children:[e("div",Object.assign({className:"flex items-center gap-3"},{children:[(null==h?void 0:h.enablechatresponses)&&e(d,Object.assign({color:x.accent,onClick:()=>{return e=p.responseId,v(!1),void g(e);var e}},{children:[s(l,{className:"h-4 w-4 shrink-0"}),s("p",Object.assign({className:"text-sm font-semibold"},{children:y+1}))]})),s(m,{color:x.accent,text:k})]})),s("div",Object.assign({className:"flex shrink-0 grow justify-end"},{children:s("p",Object.assign({className:"text-sm font-semibold uppercase opacity-30"},{children:b}))}))]}))]}))]}))]}))};export{p as default};
1
+ import{jsxs as e,jsx as s}from"react/jsx-runtime";import{useMemo as o}from"react";import{usePickaxeContext as i}from"../../../../hooks/pickaxe/usePickaxeContext.js";import{useStyleFontSize as t}from"../../../../hooks/studio/useStyleFontSize.js";import{format as n}from"date-fns";import{PickaxeMarkdown as a}from"../../common/PickaxeMarkdown/index.js";import{PickaxeMarkdownRenderer as r}from"../../common/PickaxeMarkdown/Renderer.js";import l from"../../../Icons/message-square-notes.svg.js";import c from"../../../Icons/visitor.svg.js";import m from"../../common/PickaxeIcon.js";import d from"../../common/PickaxeSimpleButton.js";import p from"../../common/PickaxeCopyButton.js";import h from"../../../../common/cn.js";const f=({item:f})=>{const{pickaxe:u,styles:g,colors:x,misc:v,setChatId:b,setIsNewChat:y}=i(),j=t(),k=o((()=>n(f.createdAt,"hh:mm a MMM dd, yy")),[f]),w=o((()=>f&&f.messages?f.messages.length:0),[f]),N=o((()=>{var e,s,o,i;if("form"===f.type){return(null!==(e=f.questions)&&void 0!==e?e:[]).map((e=>`<div style="display: flex; flex-direction: column; margin-bottom: 1em;">\n <p style="font-weight: 500;">${e.question}</p>\n <p>${e.answer||"n/a"}</p>\n</div>`)).join("")}return null!==(i=null===(o=null===(s=f.messages)||void 0===s?void 0:s[0])||void 0===o?void 0:o.message)&&void 0!==i?i:""}),[f]),O=o((()=>{var e,s,o,i;return"form"===f.type?null!==(e=f.questionResponse)&&void 0!==e?e:"":null!==(i=null===(o=null===(s=f.messages)||void 0===s?void 0:s[1])||void 0===o?void 0:o.message)&&void 0!==i?i:""}),[f]);return e("div",Object.assign({className:"flex flex-col shadow-black transition duration-300 hover:shadow"},{children:[e("div",Object.assign({className:"flex gap-x-3 overflow-hidden px-4 py-5",style:{backgroundColor:x.primary,color:x.text}},{children:[s("div",Object.assign({className:"shrink-0 pt-1"},{children:s(c,{className:"h-6 w-6"})})),e("div",Object.assign({className:"flex flex-col gap-y-1 overflow-x-auto pb-1.5 scrollbar-track-gray-100 scrollbar-thumb-[#4A4A4B] lg:max-w-[520px] lg:scrollbar-thin"},{children:[s("input",{id:`${f.responseId}-input`,type:"checkbox",className:"peer hidden",defaultChecked:N.length<280}),s("div",{className:"danger-html hidden flex-col peer-checked:flex",dangerouslySetInnerHTML:{__html:N}}),s("label",Object.assign({htmlFor:`${f.responseId}-input`,className:h(j.b3,"mt-1 flex shrink-0 whitespace-nowrap font-semibold peer-checked:hidden hover:cursor-pointer"),style:{color:x.accent}},{children:"See input"})),s("label",Object.assign({htmlFor:`${f.responseId}-input`,className:h(j.b3,"hidden shrink-0 whitespace-nowrap font-semibold peer-checked:flex hover:cursor-pointer"),style:{color:x.accent}},{children:"Hide input"}))]}))]})),e("div",Object.assign({className:"flex gap-x-3 px-4 py-5",style:{backgroundColor:x.secondary,color:x.secondaryText}},{children:[v.isChatImage&&s(m,{src:null==u?void 0:u.chaticon,alt:`${null==u?void 0:u.formtitle}'s Chat Icon`,width:24,height:24,className:"h-6 w-6 pt-1",textColor:x.secondaryText}),e("div",Object.assign({className:"flex w-full flex-col gap-y-2 overflow-hidden"},{children:[s(a,Object.assign({theme:g.theme,accentColor:x.accent,linkPreviews:!0,actions:!0},{children:s(r,{className:"overflow-x-auto pb-2 font-semilight opacity-90 scrollbar scrollbar-thin",value:O})})),e("div",Object.assign({className:"flex flex-wrap items-center justify-between gap-x-3 gap-y-1"},{children:[e("div",Object.assign({className:"flex items-center gap-3"},{children:[(null==u?void 0:u.enablechatresponses)&&e(d,Object.assign({color:x.accent,onClick:()=>{return e=f.responseId,y(!1),void b(e);var e}},{children:[s(l,{className:"h-4 w-4 shrink-0"}),s("p",Object.assign({className:h(j.b3,"font-semibold")},{children:w+1}))]})),s(p,{color:x.accent,text:O})]})),s("div",Object.assign({className:"flex shrink-0 grow justify-end"},{children:s("p",Object.assign({className:h(j.b3,"font-semibold uppercase opacity-30")},{children:k}))}))]}))]}))]}))]}))};export{f as default};
@@ -1 +1 @@
1
- import{jsxs as e,jsx as s}from"react/jsx-runtime";import{useMemo as o}from"react";import{usePickaxeContext as t}from"../../../../hooks/pickaxe/usePickaxeContext.js";import{useResponseContext as r}from"../../../../hooks/pickaxe/useResponseContext.js";import{useScrollContext as n}from"../../Addons/Scroll/hooks/useScrollContext.js";import{format as l}from"date-fns";import{PickaxeMarkdown as a}from"../../common/PickaxeMarkdown/index.js";import{PickaxeMarkdownRenderer as c}from"../../common/PickaxeMarkdown/Renderer.js";import i from"../../../Icons/message-square-notes.svg.js";import m from"../../../Icons/visitor.svg.js";import d from"../../common/PickaxeIcon.js";import p from"../../common/PickaxeSimpleButton.js";import h from"../../common/PickaxeCopyButton.js";import f from"../../Addons/Scroll/ScrollLockView.js";const x=()=>{var x;const{pickaxe:u,styles:g,colors:b,misc:v,setChatId:j,setIsNewChat:k}=t(),{response:w}=r(),{scrollTargetRef:y,scrollContainerRef:N}=n(),C=o((()=>l(w?w.createdAt:new Date,"hh:mm a MMM dd, yy")),[w]),O=o((()=>{var e;if(!w)return"";return(null!==(e=w.questions)&&void 0!==e?e:[]).map((e=>`<div style="display: flex; flex-direction: column; margin-bottom: 1em;">\n <p style="font-weight: 500;">${e.question}</p>\n <p>${e.answer||"n/a"}</p>\n</div>`)).join("")}),[w]);return w?e("div",Object.assign({ref:y,className:"flex flex-col shadow-black transition duration-300 hover:shadow"},{children:[e("div",Object.assign({className:"flex gap-x-3 overflow-hidden px-4 py-5",style:{backgroundColor:b.primary,color:b.text}},{children:[s("div",Object.assign({className:"shrink-0 pt-1"},{children:s(m,{className:"h-6 w-6"})})),e("div",Object.assign({className:"flex flex-col gap-y-1 overflow-x-auto pb-[6px] scrollbar scrollbar-thin"},{children:[s("input",{id:`${w.responseId}-input`,type:"checkbox",className:"peer hidden",defaultChecked:O.length<280}),s("div",{className:"danger-html hidden flex-col opacity-50 peer-checked:flex",dangerouslySetInnerHTML:{__html:O}}),s("label",Object.assign({htmlFor:`${w.responseId}-input`,className:"mt-1 flex shrink-0 whitespace-nowrap text-sm font-semibold text-[#228DD7] peer-checked:hidden hover:cursor-pointer",style:{color:b.accent}},{children:"See input"})),s("label",Object.assign({htmlFor:`${w.responseId}-input`,className:"hidden shrink-0 whitespace-nowrap text-sm font-semibold text-[#228DD7] peer-checked:flex hover:cursor-pointer",style:{color:b.accent}},{children:"Hide input"}))]}))]})),e("div",Object.assign({className:"flex gap-x-3 px-4 py-5",style:{backgroundColor:b.secondary,color:b.secondaryText}},{children:[v.isChatImage&&s(d,{src:null==u?void 0:u.chaticon,alt:`${null==u?void 0:u.formtitle}'s Chat Icon`,width:24,height:24,className:"h-6 w-6 pt-1",textColor:b.secondaryText}),e("div",Object.assign({ref:N,className:"flex w-full flex-col gap-y-2 overflow-hidden"},{children:[s(a,Object.assign({theme:g.theme,accentColor:b.accent,linkPreviews:!0,actions:!0},{children:s(c,{className:"overflow-x-auto pb-2 font-semilight opacity-90 scrollbar scrollbar-thin",value:w.questionResponse})})),e("div",Object.assign({className:"flex flex-wrap items-center justify-between gap-x-3 gap-y-1"},{children:[e("div",Object.assign({className:"flex items-center gap-3"},{children:[(null==u?void 0:u.enablechatresponses)&&e(p,Object.assign({color:b.accent,onClick:()=>{return e=w.responseId,k(!1),void j(e);var e}},{children:[s(i,{className:"h-4 w-4 shrink-0"}),s("p",Object.assign({className:"text-sm font-semibold"},{children:w.messages.length+1}))]})),s(h,{color:b.accent,text:null!==(x=w.questionResponse)&&void 0!==x?x:""})]})),s("div",Object.assign({className:"flex shrink-0 grow justify-end"},{children:s("p",Object.assign({className:"text-sm font-semibold uppercase opacity-30"},{children:C}))}))]}))]}))]})),s(f,{className:"w-full"})]})):null};export{x as default};
1
+ import{jsxs as e,jsx as s}from"react/jsx-runtime";import{useMemo as o}from"react";import{usePickaxeContext as t}from"../../../../hooks/pickaxe/usePickaxeContext.js";import{useResponseContext as r}from"../../../../hooks/pickaxe/useResponseContext.js";import{useScrollContext as n}from"../../Addons/Scroll/hooks/useScrollContext.js";import{useStyleFontSize as i}from"../../../../hooks/studio/useStyleFontSize.js";import{format as l}from"date-fns";import{PickaxeMarkdown as c}from"../../common/PickaxeMarkdown/index.js";import{PickaxeMarkdownRenderer as a}from"../../common/PickaxeMarkdown/Renderer.js";import m from"../../../Icons/message-square-notes.svg.js";import d from"../../../Icons/visitor.svg.js";import p from"../../common/PickaxeIcon.js";import h from"../../common/PickaxeSimpleButton.js";import f from"../../common/PickaxeCopyButton.js";import x from"../../Addons/Scroll/ScrollLockView.js";import u from"../../../../common/cn.js";const g=()=>{var g;const{pickaxe:b,styles:v,colors:j,misc:k,setChatId:y,setIsNewChat:w}=t(),{response:N}=r(),{scrollTargetRef:C,scrollContainerRef:O}=n(),I=i(),S=o((()=>l(N?N.createdAt:new Date,"hh:mm a MMM dd, yy")),[N]),P=o((()=>{var e;if(!N)return"";return(null!==(e=N.questions)&&void 0!==e?e:[]).map((e=>`<div style="display: flex; flex-direction: column; margin-bottom: 1em;">\n <p style="font-weight: 500;">${e.question}</p>\n <p>${e.answer||"n/a"}</p>\n</div>`)).join("")}),[N]);return N?e("div",Object.assign({ref:C,className:"flex flex-col shadow-black transition duration-300 hover:shadow"},{children:[e("div",Object.assign({className:"flex gap-x-3 overflow-hidden px-4 py-5",style:{backgroundColor:j.primary,color:j.text}},{children:[s("div",Object.assign({className:"shrink-0 pt-1"},{children:s(d,{className:"h-6 w-6"})})),e("div",Object.assign({className:"flex flex-col gap-y-1 overflow-x-auto pb-[6px] scrollbar scrollbar-thin"},{children:[s("input",{id:`${N.responseId}-input`,type:"checkbox",className:"peer hidden",defaultChecked:P.length<280}),s("div",{className:"danger-html hidden flex-col opacity-50 peer-checked:flex",dangerouslySetInnerHTML:{__html:P}}),s("label",Object.assign({htmlFor:`${N.responseId}-input`,className:u(I.b3,"mt-1 flex shrink-0 whitespace-nowrap font-semibold text-[#228DD7] peer-checked:hidden hover:cursor-pointer"),style:{color:j.accent}},{children:"See input"})),s("label",Object.assign({htmlFor:`${N.responseId}-input`,className:u(I.b3,"hidden shrink-0 whitespace-nowrap font-semibold text-[#228DD7] peer-checked:flex hover:cursor-pointer"),style:{color:j.accent}},{children:"Hide input"}))]}))]})),e("div",Object.assign({className:"flex gap-x-3 px-4 py-5",style:{backgroundColor:j.secondary,color:j.secondaryText}},{children:[k.isChatImage&&s(p,{src:null==b?void 0:b.chaticon,alt:`${null==b?void 0:b.formtitle}'s Chat Icon`,width:24,height:24,className:"h-6 w-6 pt-1",textColor:j.secondaryText}),e("div",Object.assign({ref:O,className:"flex w-full flex-col gap-y-2 overflow-hidden"},{children:[s(c,Object.assign({theme:v.theme,accentColor:j.accent,linkPreviews:!0,actions:!0},{children:s(a,{className:"overflow-x-auto pb-2 font-semilight opacity-90 scrollbar scrollbar-thin",value:N.questionResponse})})),e("div",Object.assign({className:"flex flex-wrap items-center justify-between gap-x-3 gap-y-1"},{children:[e("div",Object.assign({className:"flex items-center gap-3"},{children:[(null==b?void 0:b.enablechatresponses)&&e(h,Object.assign({color:j.accent,onClick:()=>{return e=N.responseId,w(!1),void y(e);var e}},{children:[s(m,{className:"h-4 w-4 shrink-0"}),s("p",Object.assign({className:u(I.b3,"font-semibold")},{children:N.messages.length+1}))]})),s(f,{color:j.accent,text:null!==(g=N.questionResponse)&&void 0!==g?g:""})]})),s("div",Object.assign({className:"flex shrink-0 grow justify-end"},{children:s("p",Object.assign({className:u(I.b3,"font-semibold uppercase opacity-30")},{children:S}))}))]}))]}))]})),s(x,{className:"w-full"})]})):null};export{g as default};
@@ -1 +1 @@
1
- import{jsxs as e,jsx as s}from"react/jsx-runtime";import{usePickaxeContext as t}from"../../../../hooks/pickaxe/usePickaxeContext.js";import{useResponseContext as i}from"../../../../hooks/pickaxe/useResponseContext.js";import n from"./Dropdown.js";const a=({field:a,update:c})=>{const{colors:r}=t(),{setError:o}=i(),l=e=>(a.input?a.input.split("&#44;"):[]).includes(e);return e("div",Object.assign({className:"flex flex-col gap-y-3"},{children:[e("div",Object.assign({className:"flex items-center gap-2"},{children:[s("p",Object.assign({className:"text-sm font-semibold opacity-70"},{children:a.main})),a.isRequired&&s("span",Object.assign({className:"select-none font-semibold",style:{color:r.error}},{children:"*"}))]})),s(n,Object.assign({id:a.id.replace(/[^A-Za-z]+/g,""),value:a.input.replace(/&#44;/g,", "),placeholder:"Select option(s)",closeOnSelect:!1,maxToken:a.maxLength,isDropdown:a.isDropdown},{children:s("div",Object.assign({className:"flex flex-col items-start gap-y-3"},{children:a.example.split("S3P32X").map(((t,i)=>e("div",Object.assign({className:"flex items-center gap-x-2 hover:cursor-pointer",onClick:()=>(e=>{o("");const s=a.input?a.input.split("&#44;"):[],t=new Set(s);l(e)&&t.has(e)?t.delete(e):l(e)||t.has(e)||t.add(e);const i=Array.from(t).filter((e=>""!==e.trim()));c(Object.assign(Object.assign({},a),{input:i.join("&#44;")}))})(t)},{children:[s("div",Object.assign({className:"flex h-6 w-6 shrink-0 items-center justify-center border-2 border-black bg-white"},{children:l(t)&&s("div",{className:"h-4 w-4",style:{backgroundColor:r.accent}})})),s("p",Object.assign({className:"select-none max-lg:text-sm"},{children:t}))]}),i)))}))}))]}))};export{a as default};
1
+ import{jsxs as e,jsx as s}from"react/jsx-runtime";import{usePickaxeContext as t}from"../../../../hooks/pickaxe/usePickaxeContext.js";import{useResponseContext as i}from"../../../../hooks/pickaxe/useResponseContext.js";import{useStyleFontSize as o}from"../../../../hooks/studio/useStyleFontSize.js";import n from"./Dropdown.js";import c from"../../../../common/cn.js";const r=({field:r,update:a})=>{const{colors:l}=t(),p=o(),{setError:m}=i(),d=e=>(r.input?r.input.split("&#44;"):[]).includes(e);return e("div",Object.assign({className:"flex flex-col gap-y-3"},{children:[e("div",Object.assign({className:"flex items-center gap-2"},{children:[s("p",Object.assign({className:c(p.b3,"font-semibold opacity-70")},{children:r.main})),r.isRequired&&s("span",Object.assign({className:"select-none font-semibold",style:{color:l.error}},{children:"*"}))]})),s(n,Object.assign({id:r.id.replace(/[^A-Za-z]+/g,""),value:r.input.replace(/&#44;/g,", "),placeholder:"Select option(s)",closeOnSelect:!1,maxToken:r.maxLength,isDropdown:r.isDropdown},{children:s("div",Object.assign({className:"flex flex-col items-start gap-y-3"},{children:r.example.split("S3P32X").map(((t,i)=>e("div",Object.assign({className:"flex items-center gap-x-2 hover:cursor-pointer",onClick:()=>(e=>{m("");const s=r.input?r.input.split("&#44;"):[],t=new Set(s);d(e)&&t.has(e)?t.delete(e):d(e)||t.has(e)||t.add(e);const i=Array.from(t).filter((e=>""!==e.trim()));a(Object.assign(Object.assign({},r),{input:i.join("&#44;")}))})(t)},{children:[s("div",Object.assign({className:"flex h-6 w-6 shrink-0 items-center justify-center border-2 border-black bg-white"},{children:d(t)&&s("div",{className:"h-4 w-4",style:{backgroundColor:l.accent}})})),s("p",Object.assign({className:c(p.b2,"select-none")},{children:t}))]}),i)))}))}))]}))};export{r as default};
@@ -1 +1 @@
1
- import{__awaiter as e}from"../../../../_virtual/_tslib.js";import{jsxs as s,jsx as o,Fragment as t}from"react/jsx-runtime";import{useState as i,useRef as n}from"react";import{usePickaxeContext as a}from"../../../../hooks/pickaxe/usePickaxeContext.js";import{useStyleInput as r}from"../../../../hooks/studio/useStyleInput.js";import{useStyleFontSize as l}from"../../../../hooks/studio/useStyleFontSize.js";import{useDocument as c}from"../../Addons/Document/hooks/useDocument.js";import{allowedFileMimeTypes as d,allowedImageMimeTypes as m}from"../../../../common/documents.js";import p from"../../../Icons/attach.svg.js";import u from"../../../Icons/check.svg.js";import f from"../../../Icons/x.svg.js";import b from"../../../Core/ErrorAlert.js";import h from"../../Addons/Document/List.js";import g from"../../../../common/cn.js";const j=({field:j,update:v})=>{const{colors:y}=a(),{documentError:k,websiteLink:N,isUploading:x,isImageUploadAllowed:w,setDocumentError:O,setWebsiteLink:C,onFileUpload:D,onWebsiteUpload:A}=c({onQuestionChange:e=>{v(Object.assign(Object.assign({},j),e))}}),[I,E]=i(!1),U=n(null),F=r(),L=l({type:"b1"});return s("div",Object.assign({className:"flex flex-col gap-y-1"},{children:[s("div",Object.assign({className:"flex flex-col gap-y-2"},{children:[s("div",Object.assign({className:"flex items-center gap-2"},{children:[o("p",Object.assign({className:"text-sm font-semibold opacity-70"},{children:j.main})),j.isRequired&&o("span",Object.assign({className:"select-none font-semibold",style:{color:y.error}},{children:"*"}))]})),s("div",Object.assign({className:"flex flex-col gap-y-2"},{children:[o("input",{ref:U,type:"file",accept:[...d,...w?m:[]].join(", "),id:j.id,hidden:!0,className:"hidden",onChange:s=>e(void 0,void 0,void 0,(function*(){yield D(Array.from(s.target.files||[])),s.target.value=""})),disabled:x}),s("div",Object.assign({className:g(L("flex items-center justify-between rounded-sm border border-transparent bg-white py-3 pl-4 pr-3 duration-300 ease-in-out transition-all shadow hover:shadow-none"),I&&"shadow"),style:F},{children:[o("input",{type:"text",value:N,className:"w-full outline-none bg-transparent placeholder:font-semilight",placeholder:"Paste a website/video link or drag a file",onChange:e=>C(e.target.value),onDrop:s=>e(void 0,void 0,void 0,(function*(){s.preventDefault(),yield D(Array.from(s.dataTransfer.files||[]))})),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),A(N))},onFocus:()=>E(!0),onBlur:()=>E(!1)}),o("div",Object.assign({className:"flex items-center gap-3 pl-4"},{children:N.length>0?s(t,{children:[o("button",Object.assign({className:"outline-none disabled:cursor-wait disabled:opacity-80",disabled:x,onClick:()=>A(N)},{children:o(u,{className:"h-5 w-5 shrink-0",style:{color:y.accent}})})),o("button",Object.assign({className:"outline-none disabled:cursor-wait disabled:opacity-80",disabled:x,onClick:()=>{C(""),O("")}},{children:o(f,{className:"h-6 w-6 shrink-0",style:{color:y.accent}})}))]}):o("button",Object.assign({className:"outline-none disabled:cursor-wait disabled:opacity-80",disabled:x,onClick:()=>{var e;null===(e=U.current)||void 0===e||e.click()}},{children:o(p,{className:"h-6 w-6 shrink-0",style:{color:y.accent}})}))}))]}))]}))]})),o(h,{className:"mt-2"}),k&&o(b,{error:k,className:"mt-3"})]}))};export{j as default};
1
+ import{__awaiter as e}from"../../../../_virtual/_tslib.js";import{jsxs as s,jsx as o,Fragment as t}from"react/jsx-runtime";import{useState as i,useRef as n}from"react";import{usePickaxeContext as a}from"../../../../hooks/pickaxe/usePickaxeContext.js";import{useStyleInput as r}from"../../../../hooks/studio/useStyleInput.js";import{useStyleFontSize as l}from"../../../../hooks/studio/useStyleFontSize.js";import{useDocument as c}from"../../Addons/Document/hooks/useDocument.js";import{allowedFileMimeTypes as d,allowedImageMimeTypes as m}from"../../../../common/documents.js";import p from"../../../Icons/attach.svg.js";import u from"../../../Icons/check.svg.js";import f from"../../../Icons/x.svg.js";import b from"../../../Core/ErrorAlert.js";import h from"../../Addons/Document/List.js";import g from"../../../../common/cn.js";const j=({field:j,update:v})=>{const y=l(),{colors:k}=a(),{documentError:N,websiteLink:w,isUploading:x,isImageUploadAllowed:O,setDocumentError:C,setWebsiteLink:D,onFileUpload:A,onWebsiteUpload:I}=c({onQuestionChange:e=>{v(Object.assign(Object.assign({},j),e))}}),[E,U]=i(!1),F=n(null),L=r();return s("div",Object.assign({className:"flex flex-col gap-y-1"},{children:[s("div",Object.assign({className:"flex flex-col gap-y-2"},{children:[s("div",Object.assign({className:"flex items-center gap-2"},{children:[o("p",Object.assign({className:g(y.b3,"font-semibold opacity-70")},{children:j.main})),j.isRequired&&o("span",Object.assign({className:"select-none font-semibold",style:{color:k.error}},{children:"*"}))]})),s("div",Object.assign({className:"flex flex-col gap-y-2"},{children:[o("input",{ref:F,type:"file",accept:[...d,...O?m:[]].join(", "),id:j.id,hidden:!0,className:"hidden",onChange:s=>e(void 0,void 0,void 0,(function*(){yield A(Array.from(s.target.files||[])),s.target.value=""})),disabled:x}),s("div",Object.assign({className:g("flex items-center justify-between rounded-sm border border-transparent bg-white py-3 pl-4 pr-3 duration-300 ease-in-out transition-all shadow hover:shadow-none",E&&"shadow"),style:L},{children:[o("input",{type:"text",value:w,className:g(y.b2,"w-full outline-none bg-transparent placeholder:font-semilight"),placeholder:"Paste a website/video link or drag a file",onChange:e=>D(e.target.value),onDrop:s=>e(void 0,void 0,void 0,(function*(){s.preventDefault(),yield A(Array.from(s.dataTransfer.files||[]))})),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),I(w))},onFocus:()=>U(!0),onBlur:()=>U(!1)}),o("div",Object.assign({className:"flex items-center gap-3 pl-4"},{children:w.length>0?s(t,{children:[o("button",Object.assign({className:"outline-none disabled:cursor-wait disabled:opacity-80",disabled:x,onClick:()=>I(w)},{children:o(u,{className:"h-5 w-5 shrink-0",style:{color:k.accent}})})),o("button",Object.assign({className:"outline-none disabled:cursor-wait disabled:opacity-80",disabled:x,onClick:()=>{D(""),C("")}},{children:o(f,{className:"h-6 w-6 shrink-0",style:{color:k.accent}})}))]}):o("button",Object.assign({className:"outline-none disabled:cursor-wait disabled:opacity-80",disabled:x,onClick:()=>{var e;null===(e=F.current)||void 0===e||e.click()}},{children:o(p,{className:"h-6 w-6 shrink-0",style:{color:k.accent}})}))}))]}))]}))]})),o(h,{className:"mt-2"}),N&&o(b,{error:N,className:"mt-3"})]}))};export{j as default};
@@ -1 +1 @@
1
- import{jsxs as e,jsx as o}from"react/jsx-runtime";import{useState as t}from"react";import{usePickaxeContext as s}from"../../../../hooks/pickaxe/usePickaxeContext.js";import{useResponseContext as r}from"../../../../hooks/pickaxe/useResponseContext.js";import{useStyleInput as a}from"../../../../hooks/studio/useStyleInput.js";import{useStyleFontSize as n}from"../../../../hooks/studio/useStyleFontSize.js";import{encode as i}from"@nem035/gpt-3-encoder";import c from"../../../Core/Textarea.js";import l from"../../../../common/cn.js";const m=({field:m,update:p})=>{const{colors:d}=s(),{setError:h}=r(),[x,g]=t(!1),u=a(),f=n({type:"b3"});return e("div",Object.assign({className:"group relative flex flex-col gap-y-1"},{children:[e("div",Object.assign({className:"flex flex-col gap-y-2"},{children:[e("div",Object.assign({className:"flex items-center gap-2"},{children:[o("p",Object.assign({className:"text-sm font-semibold opacity-70"},{children:m.main})),m.isRequired&&o("span",Object.assign({className:"select-none font-semibold",style:{color:d.error}},{children:"*"}))]})),o(c,{className:l(f("rounded-sm border border-transparent px-4 py-3 duration-300 ease-in-out transition-all shadow hover:shadow-none"),m.maxLength<10&&"max-w-[400px]"),style:u,placeholder:m.example,rows:m.maxLength>500?3:1,value:m.input,tabIndex:m.order,onChange:e=>{h("");const o=i(e).length;p(Object.assign(Object.assign({},m),{input:e,length:o}))},onFocus:()=>g(!0),onBlur:()=>g(!1)})]})),o("div",Object.assign({className:"pointer-events-none absolute bottom-0 right-0 p-1 px-2"},{children:e("p",Object.assign({className:l("text-[14px] font-semibold opacity-20 opacity-0 group-hover:opacity-100 group-hover:duration-200",m.length>m.maxLength&&"text-c-red opacity-100",x&&"opacity-100")},{children:[m.length,"/",m.maxLength]}))}))]}))};export{m as default};
1
+ import{jsxs as e,jsx as o}from"react/jsx-runtime";import{useState as t}from"react";import{usePickaxeContext as s}from"../../../../hooks/pickaxe/usePickaxeContext.js";import{useResponseContext as r}from"../../../../hooks/pickaxe/useResponseContext.js";import{useStyleInput as a}from"../../../../hooks/studio/useStyleInput.js";import{useStyleFontSize as n}from"../../../../hooks/studio/useStyleFontSize.js";import{encode as i}from"@nem035/gpt-3-encoder";import c from"../../../Core/Textarea.js";import l from"../../../../common/cn.js";const m=({field:m,update:p})=>{const{colors:d}=s(),h=n(),{setError:g}=r(),[u,x]=t(!1),b=a();return e("div",Object.assign({className:"group relative flex flex-col gap-y-1"},{children:[e("div",Object.assign({className:"flex flex-col gap-y-2"},{children:[e("div",Object.assign({className:"flex items-center gap-2"},{children:[o("p",Object.assign({className:l(h.b3,"font-semibold opacity-70")},{children:m.main})),m.isRequired&&o("span",Object.assign({className:"select-none font-semibold",style:{color:d.error}},{children:"*"}))]})),o(c,{className:l(h.b2,"rounded-sm border border-transparent px-4 py-3 duration-300 ease-in-out transition-all shadow hover:shadow-none",m.maxLength<10&&"max-w-[400px]"),style:b,placeholder:m.example,rows:m.maxLength>500?3:1,value:m.input,tabIndex:m.order,onChange:e=>{g("");const o=i(e).length;p(Object.assign(Object.assign({},m),{input:e,length:o}))},onFocus:()=>x(!0),onBlur:()=>x(!1)})]})),o("div",Object.assign({className:"pointer-events-none absolute bottom-0 right-0 p-1 px-2"},{children:e("p",Object.assign({className:l(h.b4,"font-semibold opacity-20 opacity-0 group-hover:opacity-100 group-hover:duration-200",m.length>m.maxLength&&"text-c-red opacity-100",u&&"opacity-100")},{children:[m.length,"/",m.maxLength]}))}))]}))};export{m as default};
@@ -1 +1 @@
1
- import{jsxs as e,jsx as s}from"react/jsx-runtime";import{usePickaxeContext as t}from"../../../../hooks/pickaxe/usePickaxeContext.js";import{useResponseContext as i}from"../../../../hooks/pickaxe/useResponseContext.js";import a from"./Dropdown.js";const n=({field:n,update:c})=>{const{colors:r}=t(),{setError:o}=i();return e("div",Object.assign({className:"flex flex-col gap-y-3"},{children:[e("div",Object.assign({className:"flex items-center gap-2"},{children:[s("p",Object.assign({className:"text-sm font-semibold opacity-70"},{children:n.main})),n.isRequired&&s("span",Object.assign({className:"select-none font-semibold",style:{color:r.error}},{children:"*"}))]})),s(a,Object.assign({id:n.id.replace(/[^A-Za-z]+/g,""),value:n.input,placeholder:"Select an option",closeOnSelect:!1,maxToken:n.maxLength,isDropdown:n.isDropdown},{children:s("div",Object.assign({className:"flex flex-col items-start gap-y-3"},{children:n.example.split("S3P32X").map(((t,i)=>e("div",Object.assign({className:"flex items-center gap-x-2 hover:cursor-pointer",onClick:()=>{return e=t,o(""),void c(Object.assign(Object.assign({},n),{input:e}));var e}},{children:[s("div",Object.assign({className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-full border-2 border-black bg-white"},{children:n.input===t&&s("div",{className:"h-4 w-4 rounded-full",style:{backgroundColor:r.accent}})})),s("p",Object.assign({className:"select-none max-lg:text-sm"},{children:t}))]}),i)))}))}))]}))};export{n as default};
1
+ import{jsxs as e,jsx as s}from"react/jsx-runtime";import{usePickaxeContext as o}from"../../../../hooks/pickaxe/usePickaxeContext.js";import{useResponseContext as i}from"../../../../hooks/pickaxe/useResponseContext.js";import{useStyleFontSize as t}from"../../../../hooks/studio/useStyleFontSize.js";import n from"./Dropdown.js";import r from"../../../../common/cn.js";const c=({field:c,update:a})=>{const{colors:l}=o(),d=t(),{setError:m}=i();return e("div",Object.assign({className:"flex flex-col gap-y-3"},{children:[e("div",Object.assign({className:"flex items-center gap-2"},{children:[s("p",Object.assign({className:r(d.b3,"font-semibold opacity-70")},{children:c.main})),c.isRequired&&s("span",Object.assign({className:"select-none font-semibold",style:{color:l.error}},{children:"*"}))]})),s(n,Object.assign({id:c.id.replace(/[^A-Za-z]+/g,""),value:c.input,placeholder:"Select an option",closeOnSelect:!1,maxToken:c.maxLength,isDropdown:c.isDropdown},{children:s("div",Object.assign({className:"flex flex-col items-start gap-y-3"},{children:c.example.split("S3P32X").map(((o,i)=>e("div",Object.assign({className:"flex items-center gap-x-2 hover:cursor-pointer",onClick:()=>{return e=o,m(""),void a(Object.assign(Object.assign({},c),{input:e}));var e}},{children:[s("div",Object.assign({className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-full border-2 border-black bg-white"},{children:c.input===o&&s("div",{className:"h-4 w-4 rounded-full",style:{backgroundColor:l.accent}})})),s("p",Object.assign({className:r(d.b2,"select-none")},{children:o}))]}),i)))}))}))]}))};export{c as default};
@@ -1 +1 @@
1
- import{jsxs as e,jsx as s}from"react/jsx-runtime";import{usePickaxeContext as a}from"../../../hooks/pickaxe/usePickaxeContext.js";import{motion as o}from"framer-motion";import i from"../../Icons/pickaxe.svg.js";import r from"../../../common/cn.js";const t=({className:t,animateHover:c=!0})=>{const{pickaxe:n,misc:m}=a();return!n||m.isWhiteLabel?null:e(o.a,Object.assign({href:`https://${process.env.NEXT_PUBLIC_PICKAXE_DOMAIN}`,className:r("flex items-center gap-2 select-none overflow-hidden px-2 py-1 rounded",t)},c&&{initial:{scale:1},whileHover:{scale:1.05},whileTap:{scale:.95}},{children:[s(i,{className:"h-3.5 w-3.5 shrink-0"}),s("span",Object.assign({className:"text-xs opacity-50"},{children:"Powered by Pickaxe"}))]}))};export{t as default};
1
+ import{jsxs as e,jsx as s}from"react/jsx-runtime";import{usePickaxeContext as o}from"../../../hooks/pickaxe/usePickaxeContext.js";import{useStyleFontSize as i}from"../../../hooks/studio/useStyleFontSize.js";import{motion as a}from"framer-motion";import r from"../../Icons/pickaxe.svg.js";import t from"../../../common/cn.js";const c=({className:c,animateHover:n=!0})=>{const{pickaxe:m,misc:l}=o(),p=i();return!m||l.isWhiteLabel?null:e(a.a,Object.assign({href:`https://${process.env.NEXT_PUBLIC_PICKAXE_DOMAIN}`,className:t("flex items-center gap-2 select-none overflow-hidden px-2 py-1 rounded",c)},n&&{initial:{scale:1},whileHover:{scale:1.05},whileTap:{scale:.95}},{children:[s(r,{className:"h-3.5 w-3.5 shrink-0"}),s("span",Object.assign({className:t(p.b4,"opacity-50")},{children:"Powered by Pickaxe"}))]}))};export{c as default};
@@ -1 +1 @@
1
- import{__rest as t}from"../../../_virtual/_tslib.js";import{jsx as o}from"react/jsx-runtime";import{usePickaxeContext as r}from"../../../hooks/pickaxe/usePickaxeContext.js";import{useStyleButton as s}from"../../../hooks/studio/useStyleButton.js";import{useStyleFontSize as e}from"../../../hooks/studio/useStyleFontSize.js";import a from"../../Core/Button.js";import i from"../../../common/cn.js";const m=m=>{var{variant:n,className:c}=m,p=t(m,["variant","className"]);const{styles:l}=r(),u=s({variant:n}),y=e({type:"l2"});return o(a,Object.assign({variant:n,className:i(y(),"min-h-[48px]",c,("primary"===n||"secondary"===n)&&"hover:opacity-90","outlined"===l.btnStyle&&"hover:opacity-70"),style:u},p))};export{m as default};
1
+ import{__rest as t}from"../../../_virtual/_tslib.js";import{jsx as o}from"react/jsx-runtime";import{usePickaxeContext as r}from"../../../hooks/pickaxe/usePickaxeContext.js";import{useStyleButton as s}from"../../../hooks/studio/useStyleButton.js";import{useStyleFontSize as a}from"../../../hooks/studio/useStyleFontSize.js";import e from"../../Core/Button.js";import i from"../../../common/cn.js";const m=m=>{var{variant:n,className:c}=m,l=t(m,["variant","className"]);const{styles:p}=r(),u=s({variant:n}),y=a();return o(e,Object.assign({variant:n,className:i(y.l2,"min-h-[48px]",c,("primary"===n||"secondary"===n)&&"hover:opacity-90","outlined"===p.btnStyle&&"hover:opacity-70"),style:u},l))};export{m as default};
@@ -1 +1 @@
1
- import{jsx as e,jsxs as o}from"react/jsx-runtime";import{usePickaxeContext as t}from"../../../hooks/pickaxe/usePickaxeContext.js";import{useStyleFontSize as i}from"../../../hooks/studio/useStyleFontSize.js";import s from"../../Icons/x.svg.js";import r from"../../Core/Modal/index.js";import l from"../../Core/Modal/Body.js";import c from"./PickaxeIcon.js";import n from"./PickaxeSimpleButton.js";import a from"../../../common/cn.js";const m=({isOpen:m,onChangeIsOpen:p})=>{const{pickaxe:x,colors:d,misc:f,responsiveBy:h}=t(),j=i({type:"b1"});return e(r,Object.assign({isOpen:m,onChange:p},{children:o(l,Object.assign({className:"relative flex flex-col px-8 pt-[26px] pb-8 w-full min-[767px]:max-w-[480px] max-[767px]:border-0",style:{backgroundColor:d.primary,color:d.text,borderColor:d.text+"4D"},avoidOverflow:!0},{children:[e("div",Object.assign({className:"flex items-start justify-end gap-4"},{children:e(n,Object.assign({color:d.text,onClick:()=>p(!1)},{children:e(s,{className:"h-6 w-6 shrink-0"})}))})),e("div",Object.assign({className:"mt-6 flex flex-col items-center"},{children:o("div",Object.assign({className:"flex w-full max-w-[360px] flex-col items-center text-center"},{children:[f.isProfileImage&&e(c,{src:null==x?void 0:x.coverphoto,alt:`${null==x?void 0:x.formtitle}'s Profile Picture`,width:90,height:90,className:"h-[90px] w-[90px] rounded-full"}),e("h2",Object.assign({className:a("mt-6 text-center font-semibold opacity-70","viewport"===h?"min-[767px]:text-[18px]":"@[767px]/pickaxe-root:text-[18px]")},{children:null==x?void 0:x.formtitle})),e("p",Object.assign({className:j("mt-4 font-semilight opacity-70")},{children:null==x?void 0:x.formdescription}))]}))}))]}))}))};export{m as default};
1
+ import{jsx as e,jsxs as o}from"react/jsx-runtime";import{usePickaxeContext as t}from"../../../hooks/pickaxe/usePickaxeContext.js";import{useStyleFontSize as i}from"../../../hooks/studio/useStyleFontSize.js";import s from"../../Icons/x.svg.js";import r from"../../Core/Modal/index.js";import l from"../../Core/Modal/Body.js";import c from"./PickaxeIcon.js";import n from"./PickaxeSimpleButton.js";import a from"../../../common/cn.js";const m=({isOpen:m,onChangeIsOpen:p})=>{const{pickaxe:x,colors:d,misc:f}=t(),h=i();return e(r,Object.assign({isOpen:m,onChange:p},{children:o(l,Object.assign({className:"relative flex flex-col px-8 pt-[26px] pb-8 w-full min-[767px]:max-w-[480px] max-[767px]:border-0",style:{backgroundColor:d.primary,color:d.text,borderColor:d.text+"4D"},avoidOverflow:!0},{children:[e("div",Object.assign({className:"flex items-start justify-end gap-4"},{children:e(n,Object.assign({color:d.text,onClick:()=>p(!1)},{children:e(s,{className:"h-6 w-6 shrink-0"})}))})),e("div",Object.assign({className:"mt-6 flex flex-col items-center"},{children:o("div",Object.assign({className:"flex w-full max-w-[360px] flex-col items-center text-center"},{children:[f.isProfileImage&&e(c,{src:null==x?void 0:x.coverphoto,alt:`${null==x?void 0:x.formtitle}'s Profile Picture`,width:90,height:90,className:"h-[90px] w-[90px] rounded-full"}),e("h2",Object.assign({className:a(h.h2,"mt-6 text-center font-semibold opacity-70")},{children:null==x?void 0:x.formtitle})),e("p",Object.assign({className:a(h.b1,"mt-4 font-semilight opacity-70")},{children:null==x?void 0:x.formdescription}))]}))}))]}))}))};export{m as default};
@@ -1 +1 @@
1
- import{__awaiter as e}from"../../../../../../_virtual/_tslib.js";import{jsx as t}from"react/jsx-runtime";import{useState as r,useEffect as o}from"react";import{useQuery as s}from"@tanstack/react-query";import{usePickaxeMarkdownContext as i}from"../../hooks/usePickaxeMarkdownContext.js";import n from"../common/Action.js";import a from"../Img/index.js";import c from"../../../../../../common/api/utils.js";import l from"../../../../../../common/error.js";const m=({node:m,href:u="",children:d})=>{const{accentColor:p,websiteMetadatas:f,linkPreviews:h,actions:w,setWebsiteMetadatas:b}=i(),[g,v]=r("");o((()=>{if(!u)return;const e=u.startsWith("http://")?`https://${u.slice(7)}`:u.startsWith("www.")?`https://${u}`:u;e!==g&&v(e)}),[u,g]),s({queryKey:["website-metadata",g],queryFn:()=>{return t=g,e(void 0,void 0,void 0,(function*(){try{if("development"===process.env.NODE_ENV&&console.log("[getWebsiteMetadata]",t),!t||!t.startsWith("https")||!t.includes("."))return null;if(["/api/fn/result","/api/function_call_results","https://prod-pickaxe-assets.s3.amazonaws.com"].some((e=>t.includes(e))))return null;const e=(yield c.get(`/metadata?url=${encodeURIComponent(t)}`)).data;if(e.error)throw new Error(e.error||"Failed to fetch metadata");return e}catch(e){if("development"===process.env.NODE_ENV){const t=l(e);console.error("[getJobResult]",t)}return null}}));var t},enabled:"undefined"!=typeof window&&h&&Boolean(g)&&!f.some((e=>e.href===g))&&g.includes(".")&&!g.includes("https://prod-pickaxe-assets")&&!g.includes("https://pickaxeproject--v2"),retry:2,onSuccess:t=>e(void 0,void 0,void 0,(function*(){t&&(f.some((e=>e.href===t.href))||b((e=>[...e,t])))}))});const y=g.match(/(?:https?:\/\/)?(?:www\.)?(?:youtube\.com\/watch\?v=|youtu\.be\/)([\w-]+)/i);if(y&&(null==y?void 0:y[1]))return t("div",Object.assign({style:{marginTop:"2rem",marginBottom:"2rem",display:"flex",width:"100%",justifyContent:"center"}},{children:t("iframe",Object.assign({title:"youtube-embed",src:`https://www.youtube.com/embed/${y[1]}`,style:{width:"100%",maxWidth:"560px",minHeight:"315px"},allowFullScreen:!0},{children:"Iframe not supported, use a different browser."}))}));return g.match(/\.(jpeg|jpg|gif|bmp|webp|svg|tiff|avif)$/)?t(a,{src:g,alt:"string"==typeof d?d:"Markdown Image"}):w&&g.includes("pickaxe")&&(g.includes("/api/fn/result")||g.includes("/api/function_call_results"))?t(n,{jobUrl:g}):t("a",Object.assign({href:g,target:"_blank",rel:"noopener noreferrer",style:{color:p,fontWeight:600}},{children:d}))};export{m as default};
1
+ import{__awaiter as e}from"../../../../../../_virtual/_tslib.js";import{jsx as t}from"react/jsx-runtime";import{useState as r,useEffect as o}from"react";import{useQuery as i}from"@tanstack/react-query";import{usePickaxeMarkdownContext as s}from"../../hooks/usePickaxeMarkdownContext.js";import n from"../common/Action.js";import a from"../Img/index.js";import c from"../common/Audio.js";import m from"../common/Html/index.js";import l from"../../../../../../common/api/utils.js";import u from"../../../../../../common/error.js";const p=({node:p,href:d="",children:f})=>{const{accentColor:h,websiteMetadatas:w,linkPreviews:g,actions:b,setWebsiteMetadatas:j}=s(),[v,y]=r("");o((()=>{if(!d)return;const e=d.startsWith("http://")?`https://${d.slice(7)}`:d.startsWith("www.")?`https://${d}`:d;e!==v&&y(e)}),[d,v]),i({queryKey:["website-metadata",v],queryFn:()=>{return t=v,e(void 0,void 0,void 0,(function*(){try{if("development"===process.env.NODE_ENV&&console.log("[getWebsiteMetadata]",t),!t||!t.startsWith("https")||!t.includes("."))return null;if(["/api/fn/result","/api/function_call_results","https://prod-pickaxe-assets.s3.amazonaws.com"].some((e=>t.includes(e))))return null;const e=(yield l.get(`/metadata?url=${encodeURIComponent(t)}`)).data;if(e.error)throw new Error(e.error||"Failed to fetch metadata");return e}catch(e){if("development"===process.env.NODE_ENV){const t=u(e);console.error("[getJobResult]",t)}return null}}));var t},enabled:"undefined"!=typeof window&&g&&Boolean(v)&&!w.some((e=>e.href===v))&&v.includes(".")&&!v.includes("https://prod-pickaxe-assets")&&!v.includes("https://pickaxeproject--v2"),retry:2,onSuccess:t=>e(void 0,void 0,void 0,(function*(){t&&(w.some((e=>e.href===t.href))||j((e=>[...e,t])))}))});const x=v.match(/(?:https?:\/\/)?(?:www\.)?(?:youtube\.com\/watch\?v=|youtu\.be\/)([\w-]+)/i);if(x&&(null==x?void 0:x[1]))return t("div",Object.assign({style:{marginTop:"2rem",marginBottom:"2rem",display:"flex",width:"100%",justifyContent:"center"}},{children:t("iframe",Object.assign({title:"youtube-embed",src:`https://www.youtube.com/embed/${x[1]}`,style:{width:"100%",maxWidth:"560px",minHeight:"315px"},allowFullScreen:!0},{children:"Iframe not supported, use a different browser."}))}));if(v.match(/\.(jpeg|jpg|gif|bmp|webp|svg|tiff|avif|png|jfif|pjpeg|pjp)$/))return t(a,{src:v,alt:"string"==typeof f?f:"Markdown Image"});if(v.match(/\.(mp3|wav|ogg|flac|aac|wma|alac|m4a|aiff|ape|au|mid|midi|opus)$/))return t(c,{url:v});return v.includes("action_generated_files")&&v.match(/\.html$/)?t(m,{url:v}):b&&v.includes("pickaxe")&&(v.includes("/api/fn/result")||v.includes("/api/function_call_results"))?t(n,{jobUrl:v}):t("a",Object.assign({href:v,target:"_blank",rel:"noopener noreferrer",style:{color:h,fontWeight:600}},{children:f}))};export{p as default};
@@ -1 +1 @@
1
- import{jsx as e}from"react/jsx-runtime";import{useState as o,useEffect as r}from"react";import t from"../../../../../Core/Modal/index.js";import n from"../../../../../Core/Modal/Body.js";const a=({src:a,isOpen:i,onChangeIsOpen:d})=>{const[h,s]=o({width:500,height:500});return r((()=>{if(!a)return;const e=new Image;e.src=a,e.onload=()=>{s({width:Math.min(e.naturalWidth,750),height:Math.min(e.naturalHeight,600)})}}),[a]),e(t,Object.assign({isOpen:i,onChange:d},{children:e(n,{className:"border-0 p-4",style:{backgroundColor:"#000",backgroundImage:`url("${a}")`,backgroundSize:"contain",backgroundPosition:"center",backgroundRepeat:"no-repeat",width:h.width,height:h.height},avoidOverflow:!0})}))};export{a as default};
1
+ import{jsx as o}from"react/jsx-runtime";import{useState as n,useEffect as e}from"react";import t from"../common/Modal/index.js";import r from"../common/Modal/Body.js";const i=({src:i,isOpen:a,onChangeIsOpen:d})=>{const[h,c]=n({width:500,height:500});return e((()=>{if(!i)return;const o=new Image;o.src=i,o.onload=()=>{c({width:Math.min(o.naturalWidth,750),height:Math.min(o.naturalHeight,600)})}}),[i]),o(t,Object.assign({isOpen:a,onChange:d},{children:o(r,{style:{border:"none",padding:"1rem",backgroundColor:"#000",backgroundImage:`url("${i}")`,backgroundSize:"contain",backgroundPosition:"center",backgroundRepeat:"no-repeat",width:h.width,height:h.height},avoidOverflow:!0})}))};export{i 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 n from"../common/Action.js";import s from"../Img/index.js";const r=({node:r,children:o})=>{const{actions:l}=i(),c="string"==typeof o&&o.match(/(?:https?:\/\/)?(?:www\.)?(?:youtube\.com\/watch\?v=|youtu\.be\/)([\w-]+)/i);if(c&&(null==c?void 0:c[1]))return t("div",Object.assign({style:{marginTop:"2rem",marginBottom:"2rem",display:"flex",width:"100%",justifyContent:"center"}},{children:t("iframe",Object.assign({title:"youtube-embed",src:`https://www.youtube.com/embed/${c[1]}`,style:{width:"100%",maxWidth:"560px",minHeight:"315px"},allowFullScreen:!0},{children:"Iframe not supported, use a different browser."}))}));if("string"==typeof o&&o.match(/\.(jpeg|jpg|gif|bmp|webp|svg|tiff|avif)$/))return t(s,{src:o,alt:"string"==typeof o?o:"Markdown Image"});if(l&&"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}},{children:i})),t(n,{jobUrl:(null==s?void 0:s[0])||""})]}))}return t("p",Object.assign({style:{fontWeight:350}},{children:o}))};export{r as default};
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:r})=>{const{actions:o}=i(),l="string"==typeof r&&r.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:{marginTop:"2rem",marginBottom:"2rem",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(o&&"string"==typeof r&&r.includes("pickaxe")&&(r.includes("/api/fn/result")||r.includes("/api/function_call_results"))){const i=r.replace(/https:\/\/\S*(\/api\/fn\/result|\/api\/function_call_results)\S*/g,""),s=r.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}},{children:i})),t(n,{jobUrl:(null==s?void 0:s[0])||""})]}))}return t("p",Object.assign({style:{fontWeight:350}},{children:r}))};export{s as default};
@@ -0,0 +1 @@
1
+ import{jsx as t}from"react/jsx-runtime";const o=({url:o})=>t("audio",Object.assign({style:{marginTop:"1rem",marginBottom:"1rem",objectFit:"contain",maxWidth:"100%"},controls:!0},{children:t("source",{src:o,type:"audio/mpeg"})}));export{o as default};
@@ -0,0 +1 @@
1
+ import{jsx as e}from"react/jsx-runtime";import r from"../Modal/index.js";import o from"../Modal/Body.js";const s=({src:s,isOpen:i,onChangeIsOpen:t})=>e(r,Object.assign({isOpen:i,onChange:t},{children:e(o,Object.assign({style:{width:"90vw",height:"90vh",border:"none"},avoidOverflow:!0},{children:e("iframe",{src:s,title:"Random HTML",className:"scrollbar scrollbar-thin",style:{width:"100%",height:"100%",flex:1,borderRadius:"8px"}})}))}));export{s as default};
@@ -0,0 +1 @@
1
+ import{jsxs as e,Fragment as r,jsx as t}from"react/jsx-runtime";import{useState as i}from"react";import{usePickaxeMarkdownContext as o}from"../../../hooks/usePickaxeMarkdownContext.js";import n from"../../../../../../Icons/eye.svg.js";import s from"../../../../../../Icons/arrow-up-right.svg.js";import l from"./HtmlModal.js";const a=({url:a})=>{const{theme:c,accentColor:d}=o(),[h,m]=i(!1);return e(r,{children:[h&&t(l,{src:a,isOpen:h,onChangeIsOpen:m}),e("div",Object.assign({style:{display:"flex",alignItems:"flex-start",gap:"1rem",minHeight:"200px",overflow:"hidden",borderRadius:"8px"}},{children:[t("iframe",{src:a,title:"Random HTML",className:"scrollbar scrollbar-thin",style:{width:"100%",minHeight:"200px",border:"1px solid "+("dark"===c?"#30363D":"#D0D7DE")}}),e("div",Object.assign({style:{display:"flex",flexDirection:"column",gap:".75rem"}},{children:[t("button",Object.assign({style:{outline:"none",color:d},onClick:()=>m(!0)},{children:t(n,{width:24,height:24,style:{flexShrink:0}})})),t("a",Object.assign({href:a,rel:"noreferrer",target:"_blank"},{children:t("button",Object.assign({style:{outline:"none",color:d}},{children:t(s,{width:24,height:24,style:{flexShrink:0}})}))}))]}))]}))]})};export{a as default};
@@ -0,0 +1 @@
1
+ import{__rest as r}from"../../../../../../../_virtual/_tslib.js";import{jsx as e,Fragment as t}from"react/jsx-runtime";import{forwardRef as o,useRef as i,useContext as a,useEffect as l}from"react";import{createPortal as s}from"react-dom";import{MarkdownModalContext as c}from"./index.js";import{useOutsideAlerter as n}from"../../../../../../../hooks/core/useOutsideAlerter.js";import{randomStr as m}from"../../../../../../../common/utils.js";import{motion as d}from"framer-motion";import u from"../../../../../../../common/cn.js";const f=o(((o,f)=>{var{children:p,className:b,avoidOverflow:h=!1}=o,y=r(o,["children","className","avoidOverflow"]);const v=document.createElement("div"),x=i(),j=i(v),{closeOnOutsideClick:O,setIsOpen:k}=a(c);return n({ref:x,callback:()=>{O&&k(!1)}}),l((()=>{const r=document.querySelector("main"),e=null==r?void 0:r.getAttribute("class"),t=j.current;return t.setAttribute("id",m(5)+"-modal"),t.setAttribute("class","fixed inset-0 z-50 flex items-center justify-center backdrop-blur-sm bg-black/20"+(e?` ${e}`:"")),document.body.appendChild(t),()=>{document.body.removeChild(t)}}),[]),j.current?s(e(d.div,Object.assign({initial:{y:300,opacity:0},animate:{y:0,opacity:1},exit:{y:300,opacity:0},transition:{type:"spring",stiffness:260,damping:20},className:u(h&&"max-h-[100vh] overflow-auto scrollbar scrollbar-thumb-black/50 scrollbar-thumb-rounded-full scrollbar-w-[4px] scrollbar-h-[4px]",b,"p-0")},{children:e("div",Object.assign({ref:r=>{r&&(x.current=r,"function"==typeof f?f(r):f&&(f.current=r))}},y,{className:u("animate-fade-in flex flex-col rounded border border-transparent shadow-md",b)},{children:p}))})),j.current):e(t,{children:null})}));f.displayName="MarkdownModalBody";export{f as default};
@@ -0,0 +1 @@
1
+ import{jsxs as e,Fragment as n}from"react/jsx-runtime";import{createContext as r,useState as i,useEffect as l}from"react";const s=r({}),o=({children:r,isOpen:o,closeOnOutsideClick:t=!0,onChange:c})=>{const[d,u]=i(null!=o&&o);return l((()=>{void 0!==o&&u(o)}),[o]),e(s.Provider,Object.assign({value:{isOpen:d,closeOnOutsideClick:t,setIsOpen:e=>{u(e),!0!==e&&!1!==e||null==c||c(e)}}},{children:[Array.isArray(r)&&e(n,{children:[null==r?void 0:r[0],d&&(null==r?void 0:r[1])]}),d&&r]}))};export{s as MarkdownModalContext,o as default};
@@ -1 +1 @@
1
- import{jsxs as e,jsx as i}from"react/jsx-runtime";import{useRef as t,useMemo as r}from"react";import{usePickaxeMarkdownContext as n}from"./hooks/usePickaxeMarkdownContext.js";import l from"react-markdown";import s from"remark-gfm";import o from"remark-math";import d from"rehype-katex";import m from"./Custom/A/index.js";import a from"./Custom/P/index.js";import c from"./Custom/Img/index.js";import h from"./Custom/Iframe/index.js";import p from"./Custom/Code/index.js";import g from"./Custom/common/LinkPreview.js";const f=({className:f,style:b,value:y,recursion:j=!1})=>{const{theme:u,websiteMetadatas:x}=n(),O=t(null),k=r((()=>{if(!y)return"";let e=y;return e=y.replace(/<!--[\s\S]*?-->/g,""),e=y.replace(/\u200B/g,""),e}),[y]),S={h1:({node:e,children:t})=>i("h1",Object.assign({style:{fontSize:"2.25rem",lineHeight:"2.5rem"}},{children:t})),h2:({node:e,children:t})=>i("h2",Object.assign({style:{fontSize:"1.875rem",lineHeight:"2.25rem"}},{children:t})),h3:({node:e,children:t})=>i("h3",Object.assign({style:{fontSize:"1.5rem",lineHeight:"2rem"}},{children:t})),h4:({node:e,children:t})=>i("h4",Object.assign({className:"mt-2 text-xl",style:{fontSize:"1.25rem",lineHeight:"1.75rem"}},{children:t})),h5:({node:e,children:t})=>i("h5",Object.assign({style:{fontSize:"1.125rem",lineHeight:"1.75rem"}},{children:t})),p:a,a:m,ol:({node:e,children:t})=>i("ol",Object.assign({style:{listStyleType:"decimal",listStylePosition:"inside",paddingLeft:"1.5rem",whiteSpace:"normal"}},{children:t})),ul:({node:e,children:t})=>i("ul",Object.assign({style:{listStyleType:"disc",listStylePosition:"inside",paddingLeft:"1.5rem",whiteSpace:"normal"}},{children:t})),li:({node:e,children:t})=>i("li",Object.assign({style:{whiteSpace:"normal"}},{children:t})),table:({children:e})=>i("div",Object.assign({className:"overflow-auto"},{children:i("table",Object.assign({style:{tableLayout:"fixed",fontSize:"0.875rem",lineHeight:"1.24rem"}},{children:e}))})),th:({node:e,children:t})=>i("th",Object.assign({style:{padding:"0.75em 1em",fontWeight:600,textAlign:"left"}},{children:t})),tr:({node:e,children:t})=>i("tr",Object.assign({style:{border:"dark"===u?"1px solid #30363D":"1px solid #D0D7DE"}},{children:t})),td:({node:e,children:t})=>i("td",Object.assign({style:{padding:"0.75em 1em"}},{children:t})),code:p,blockquote:({node:e,children:t})=>i("blockquote",Object.assign({style:{lineHeight:"15px",borderLeft:"dark"===u?"4px solid #30363D":"4px solid #D0D7DE",color:"dark"===u?"#8B8B8B":"#656D76",paddingLeft:"1rem",marginBottom:"1rem"}},{children:t})),img:c,iframe:h,hr:()=>i("hr",{style:{border:0,borderTop:"dark"===u?"1px solid #30363D":"1px solid #D0D7DE"}})};return e("div",Object.assign({className:"pxe-markdown",ref:O,style:Object.assign({position:"relative",whiteSpace:"pre-wrap"},b)},{children:[i(l,Object.assign({},f&&{className:f},{components:S,remarkPlugins:[s,o],rehypePlugins:[d]},{children:`${k}${!j&&x.length>0?"\n\n---":""}`})),!j&&x.length>0&&i("div",Object.assign({style:{display:"flex",flexDirection:"column",gap:"2rem",marginTop:"2rem"}},{children:x.map(((e,t)=>i(g,{data:e},t)))}))]}))};export{f as PickaxeMarkdownRenderer};
1
+ import{jsxs as e,jsx as i}from"react/jsx-runtime";import{useRef as t,useMemo as r}from"react";import{usePickaxeMarkdownContext as n}from"./hooks/usePickaxeMarkdownContext.js";import l from"react-markdown";import s from"remark-gfm";import o from"remark-math";import d from"rehype-katex";import m from"./Custom/A/index.js";import a from"./Custom/P/index.js";import c from"./Custom/Img/index.js";import h from"./Custom/Iframe/index.js";import p from"./Custom/Code/index.js";import g from"./Custom/common/LinkPreview.js";const f=({className:f,style:b,value:y,recursion:j=!1})=>{const{theme:u,websiteMetadatas:x}=n(),O=t(null),k=r((()=>{if(!y)return"";let e=y;return e=y.replace(/<!--[\s\S]*?-->/g,""),e=y.replace(/\u200B/g,""),e}),[y]),S={h1:({node:e,children:t})=>i("h1",Object.assign({style:{fontSize:"2.25rem",lineHeight:"2.5rem"}},{children:t})),h2:({node:e,children:t})=>i("h2",Object.assign({style:{fontSize:"1.875rem",lineHeight:"2.25rem"}},{children:t})),h3:({node:e,children:t})=>i("h3",Object.assign({style:{fontSize:"1.5rem",lineHeight:"2rem"}},{children:t})),h4:({node:e,children:t})=>i("h4",Object.assign({className:"mt-2",style:{fontSize:"1.25rem",lineHeight:"1.75rem"}},{children:t})),h5:({node:e,children:t})=>i("h5",Object.assign({style:{fontSize:"1.125rem",lineHeight:"1.75rem"}},{children:t})),p:a,a:m,ol:({node:e,children:t})=>i("ol",Object.assign({style:{listStyleType:"decimal",listStylePosition:"inside",paddingLeft:"1.5rem",whiteSpace:"normal"}},{children:t})),ul:({node:e,children:t})=>i("ul",Object.assign({style:{listStyleType:"disc",listStylePosition:"inside",paddingLeft:"1.5rem",whiteSpace:"normal"}},{children:t})),li:({node:e,children:t})=>i("li",Object.assign({style:{whiteSpace:"normal"}},{children:t})),table:({children:e})=>i("div",Object.assign({className:"overflow-auto"},{children:i("table",Object.assign({style:{tableLayout:"fixed",fontSize:"0.875rem",lineHeight:"1.24rem"}},{children:e}))})),th:({node:e,children:t})=>i("th",Object.assign({style:{padding:"0.75em 1em",fontWeight:600,textAlign:"left"}},{children:t})),tr:({node:e,children:t})=>i("tr",Object.assign({style:{border:"dark"===u?"1px solid #30363D":"1px solid #D0D7DE"}},{children:t})),td:({node:e,children:t})=>i("td",Object.assign({style:{padding:"0.75em 1em"}},{children:t})),code:p,blockquote:({node:e,children:t})=>i("blockquote",Object.assign({style:{lineHeight:"15px",borderLeft:"dark"===u?"4px solid #30363D":"4px solid #D0D7DE",color:"dark"===u?"#8B8B8B":"#656D76",paddingLeft:"1rem",marginBottom:"1rem"}},{children:t})),img:c,iframe:h,hr:()=>i("hr",{style:{border:0,borderTop:"dark"===u?"1px solid #30363D":"1px solid #D0D7DE"}})};return e("div",Object.assign({className:"pxe-markdown",ref:O,style:Object.assign({position:"relative",whiteSpace:"pre-wrap"},b)},{children:[i(l,Object.assign({},f&&{className:f},{components:S,remarkPlugins:[s,o],rehypePlugins:[d]},{children:`${k}${!j&&x.length>0?"\n\n---":""}`})),!j&&x.length>0&&i("div",Object.assign({style:{display:"flex",flexDirection:"column",gap:"2rem",marginTop:"2rem"}},{children:x.map(((e,t)=>i(g,{data:e},t)))}))]}))};export{f as PickaxeMarkdownRenderer};
@@ -1 +1 @@
1
- import{jsx as e,jsxs as s}from"react/jsx-runtime";import{AnimatePresence as o}from"framer-motion";import{usePickaxeContext as t}from"../../../hooks/pickaxe/usePickaxeContext.js";import{useResponseContext as r}from"../../../hooks/pickaxe/useResponseContext.js";import a from"../../Icons/circle-exclamation.svg.js";import m from"../../Core/SpringTransition.js";import i from"../../Core/HtmlRenderer.js";import c from"./PickaxeButton.js";import n from"../../../common/cn.js";const l=({className:l,iconClassName:p,htmlClassName:f})=>{const{colors:x}=t(),{limitData:h}=r();return e(o,{children:!!h&&s(m,Object.assign({className:n("flex gap-3",l)},{children:[e(a,{className:n("h-5 w-5 shrink-0",p),style:{color:x.accent}}),s("div",Object.assign({className:"flex flex-col gap-4"},{children:[e(i,{className:n("text-sm font-semibold",f),style:{color:x.text},html:h.html}),e("a",Object.assign({href:h.ctaLink},{children:e(c,Object.assign({variant:"primary",className:"min-h-[38px]"},{children:h.cta}))}))]}))]}))})};export{l as default};
1
+ import{jsx as o,jsxs as s}from"react/jsx-runtime";import{AnimatePresence as e}from"framer-motion";import{usePickaxeContext as t}from"../../../hooks/pickaxe/usePickaxeContext.js";import{useResponseContext as r}from"../../../hooks/pickaxe/useResponseContext.js";import{useStyleFontSize as a}from"../../../hooks/studio/useStyleFontSize.js";import i from"../../Icons/circle-exclamation.svg.js";import m from"../../Core/SpringTransition.js";import c from"../../Core/HtmlRenderer.js";import n from"./PickaxeButton.js";import l from"../../../common/cn.js";const p=({className:p,iconClassName:f,htmlClassName:h})=>{const{colors:x}=t(),j=a(),{limitData:d}=r();return o(e,{children:!!d&&s(m,Object.assign({className:l("flex gap-3",p)},{children:[o(i,{className:l("h-5 w-5 shrink-0",f),style:{color:x.accent}}),s("div",Object.assign({className:"flex flex-col gap-4"},{children:[o(c,{className:l(j.b2,"font-semibold",h),style:{color:x.text},html:d.html}),o("a",Object.assign({href:d.ctaLink},{children:o(n,Object.assign({variant:"primary",className:"min-h-[38px]"},{children:d.cta}))}))]}))]}))})};export{p as default};
@@ -1 +1 @@
1
- import{usePickaxeContext as x}from"../pickaxe/usePickaxeContext.js";import{useMemo as t}from"react";import p from"../../common/cn.js";const e={viewport:{h1:{lg:"text-[72px] max-[1024px]:text-[56px] max-[899px]:text-[32px]",md:"text-[56px] max-[1024px]:text-[48px] max-[899px]:text-[28px]",sm:"text-[4px] max-[1024px]:text-[34px] max-[899px]:text-[24px]"},h2:{lg:"text-[56px] max-[1024px]:text-[40px] max-[899px]:text-[26px]",md:"text-[40px] max-[1024px]:text-[34px] max-[899px]:text-[22px]",sm:"text-[34px] max-[1024px]:text-[28px] max-[899px]:text-[20px]"},h3:{lg:"text-[40px] max-[1024px]:text-[32px] max-[899px]:text-[20px]",md:"text-[32px] max-[1024px]:text-[30px] max-[899px]:text-[20px]",sm:"text-[28px] max-[1024px]:text-[22px] max-[899px]:text-[18px]"},h4:{lg:"text-[32px] max-[1024px]:text-[24px] max-[899px]:text-[18px]",md:"text-[24px] max-[1024px]:text-[22px] max-[899px]:text-[18px]",sm:"text-[20px] max-[1024px]:text-[18px] max-[899px]:text-[16px]"},b1:{lg:"text-[24px] max-[1024px]:text-[20px] max-[899px]:text-[18px]",md:"text-[20px] max-[1024px]:text-[20px] max-[899px]:text-[18px]",sm:"text-[18px] max-[1024px]:text-[18px] max-[899px]:text-[16px]"},b2:{lg:"text-[18px] max-[1024px]:text-[18px] max-[899px]:text-[16px]",md:"text-[16px] max-[1024px]:text-[16px] max-[899px]:text-[16px]",sm:"text-[16px] max-[1024px]:text-[16px] max-[899px]:text-[14px]"},b3:{lg:"text-[16px] max-[1024px]:text-[16px] max-[899px]:text-[14px]",md:"text-[14px] max-[1024px]:text-[14px] max-[899px]:text-[14px]",sm:"text-[14px] max-[1024px]:text-[14px] max-[899px]:text-[12px]"},b4:{lg:"text-[14px] max-[1024px]:text-[14px] max-[899px]:text-[12px]",md:"text-[12px] max-[1024px]:text-[12px] max-[899px]:text-[12px]",sm:"text-[12px] max-[1024px]:text-[12px] max-[899px]:text-[10px]"},l1:{lg:"text-[18px] max-[1024px]:text-[18px] max-[899px]:text-[16px]",md:"text-[16px] max-[1024px]:text-[16px] max-[899px]:text-[16px]",sm:"text-[16px] max-[1024px]:text-[16px] max-[899px]:text-[14px]"},l2:{lg:"text-[16px] max-[1024px]:text-[16px] max-[899px]:text-[14px]",md:"text-[14px] max-[1024px]:text-[14px] max-[899px]:text-[14px]",sm:"text-[14px] max-[1024px]:text-[14px] max-[899px]:text-[12px]"}},container:{h1:{lg:"text-[32px] @[899px]/pickaxe-root:text-[56px] @[1024px]/pickaxe-root:text-[72px]",md:"text-[28px] @[899px]/pickaxe-root:text-[48px] @[1024px]/pickaxe-root:text-[56px]",sm:"text-[24px] @[899px]/pickaxe-root:text-[34px] @[1024px]/pickaxe-root:text-[48px]"},h2:{lg:"text-[26px] @[899px]/pickaxe-root:text-[40px] @[1024px]/pickaxe-root:text-[56px]",md:"text-[22px] @[899px]/pickaxe-root:text-[34px] @[1024px]/pickaxe-root:text-[40px]",sm:"text-[20px] @[899px]/pickaxe-root:text-[28px] @[1024px]/pickaxe-root:text-[34px]"},h3:{lg:"text-[20px] @[899px]/pickaxe-root:text-[32px] @[1024px]/pickaxe-root:text-[40px]",md:"text-[20px] @[899px]/pickaxe-root:text-[30px] @[1024px]/pickaxe-root:text-[32px]",sm:"text-[18px] @[899px]/pickaxe-root:text-[22px] @[1024px]/pickaxe-root:text-[28px]"},h4:{lg:"text-[18px] @[899px]/pickaxe-root:text-[24px] @[1024px]/pickaxe-root:text-[32px]",md:"text-[18px] @[899px]/pickaxe-root:text-[22px] @[1024px]/pickaxe-root:text-[24px]",sm:"text-[16px] @[899px]/pickaxe-root:text-[18px] @[1024px]/pickaxe-root:text-[20px]"},b1:{lg:"text-[18px] @[899px]/pickaxe-root:text-[20px] @[1024px]/pickaxe-root:text-[24px]",md:"text-[18px] @[899px]/pickaxe-root:text-[20px] @[1024px]/pickaxe-root:text-[20px]",sm:"text-[16px] @[899px]/pickaxe-root:text-[18px] @[1024px]/pickaxe-root:text-[18px]"},b2:{lg:"text-[16px] @[899px]/pickaxe-root:text-[18px] @[1024px]/pickaxe-root:text-[18px]",md:"text-[16px] @[899px]/pickaxe-root:text-[16px] @[1024px]/pickaxe-root:text-[16px]",sm:"text-[14px] @[899px]/pickaxe-root:text-[16px] @[1024px]/pickaxe-root:text-[16px]"},b3:{lg:"text-[14px] @[899px]/pickaxe-root:text-[16px] @[1024px]/pickaxe-root:text-[16px]",md:"text-[14px] @[899px]/pickaxe-root:text-[14px] @[1024px]/pickaxe-root:text-[14px]",sm:"text-[12px] @[899px]/pickaxe-root:text-[14px] @[1024px]/pickaxe-root:text-[14px]"},b4:{lg:"text-[12px] @[899px]/pickaxe-root:text-[14px] @[1024px]/pickaxe-root:text-[14px]",md:"text-[12px] @[899px]/pickaxe-root:text-[12px] @[1024px]/pickaxe-root:text-[12px]",sm:"text-[10px] @[899px]/pickaxe-root:text-[12px] @[1024px]/pickaxe-root:text-[12px]"},l1:{lg:"text-[16px] @[899px]/pickaxe-root:text-[18px] @[1024px]/pickaxe-root:text-[18px]",md:"text-[16px] @[899px]/pickaxe-root:text-[16px] @[1024px]/pickaxe-root:text-[16px]",sm:"text-[14px] @[899px]/pickaxe-root:text-[16px] @[1024px]/pickaxe-root:text-[16px]"},l2:{lg:"text-[14px] @[899px]/pickaxe-root:text-[16px] @[1024px]/pickaxe-root:text-[16px]",md:"text-[14px] @[899px]/pickaxe-root:text-[14px] @[1024px]/pickaxe-root:text-[14px]",sm:"text-[12px] @[899px]/pickaxe-root:text-[14px] @[1024px]/pickaxe-root:text-[14px]"}}},o=({type:o,size:a="md"})=>{const{styles:m,responsiveBy:r}=x(),i=t((()=>e[r][o][m.fontSize||a]),[o,a,m,r]);return x=>p(x,i)};export{e as fontSizeMap,o as useStyleFontSize};
1
+ import{useMemo as x}from"react";import{usePickaxeContext as t}from"../pickaxe/usePickaxeContext.js";const p={viewport:{lg:{h1:"text-[72px] max-[1024px]:text-[56px] max-[899px]:text-[32px]",h2:"text-[56px] max-[1024px]:text-[40px] max-[899px]:text-[26px]",h3:"text-[40px] max-[1024px]:text-[32px] max-[899px]:text-[20px]",h4:"text-[32px] max-[1024px]:text-[24px] max-[899px]:text-[18px]",b1:"text-[24px] max-[1024px]:text-[20px] max-[899px]:text-[18px]",b2:"text-[18px] max-[1024px]:text-[18px] max-[899px]:text-[16px]",b3:"text-[16px] max-[1024px]:text-[16px] max-[899px]:text-[14px]",b4:"text-[14px] max-[1024px]:text-[14px] max-[899px]:text-[12px]",l1:"text-[18px] max-[1024px]:text-[18px] max-[899px]:text-[16px]",l2:"text-[16px] max-[1024px]:text-[16px] max-[899px]:text-[14px]"},md:{h1:"text-[56px] max-[1024px]:text-[48px] max-[899px]:text-[28px]",h2:"text-[40px] max-[1024px]:text-[34px] max-[899px]:text-[22px]",h3:"text-[32px] max-[1024px]:text-[30px] max-[899px]:text-[20px]",h4:"text-[24px] max-[1024px]:text-[22px] max-[899px]:text-[18px]",b1:"text-[20px] max-[1024px]:text-[20px] max-[899px]:text-[18px]",b2:"text-[16px] max-[1024px]:text-[16px] max-[899px]:text-[16px]",b3:"text-[14px] max-[1024px]:text-[14px] max-[899px]:text-[14px]",b4:"text-[12px] max-[1024px]:text-[12px] max-[899px]:text-[12px]",l1:"text-[16px] max-[1024px]:text-[16px] max-[899px]:text-[16px]",l2:"text-[14px] max-[1024px]:text-[14px] max-[899px]:text-[14px]"},sm:{h1:"text-[48px] max-[1024px]:text-[34px] max-[899px]:text-[24px]",h2:"text-[34px] max-[1024px]:text-[28px] max-[899px]:text-[20px]",h3:"text-[28px] max-[1024px]:text-[22px] max-[899px]:text-[18px]",h4:"text-[20px] max-[1024px]:text-[18px] max-[899px]:text-[16px]",b1:"text-[18px] max-[1024px]:text-[18px] max-[899px]:text-[16px]",b2:"text-[16px] max-[1024px]:text-[16px] max-[899px]:text-[14px]",b3:"text-[14px] max-[1024px]:text-[14px] max-[899px]:text-[12px]",b4:"text-[12px] max-[1024px]:text-[12px] max-[899px]:text-[10px]",l1:"text-[16px] max-[1024px]:text-[16px] max-[899px]:text-[14px]",l2:"text-[14px] max-[1024px]:text-[14px] max-[899px]:text-[12px]"}},container:{lg:{h1:"text-[32px] @[899px]/pickaxe-root:text-[56px] @[1024px]/pickaxe-root:text-[72px]",h2:"text-[26px] @[899px]/pickaxe-root:text-[40px] @[1024px]/pickaxe-root:text-[56px]",h3:"text-[20px] @[899px]/pickaxe-root:text-[32px] @[1024px]/pickaxe-root:text-[40px]",h4:"text-[18px] @[899px]/pickaxe-root:text-[24px] @[1024px]/pickaxe-root:text-[32px]",b1:"text-[18px] @[899px]/pickaxe-root:text-[20px] @[1024px]/pickaxe-root:text-[24px]",b2:"text-[16px] @[899px]/pickaxe-root:text-[18px] @[1024px]/pickaxe-root:text-[18px]",b3:"text-[14px] @[899px]/pickaxe-root:text-[16px] @[1024px]/pickaxe-root:text-[16px]",b4:"text-[12px] @[899px]/pickaxe-root:text-[14px] @[1024px]/pickaxe-root:text-[14px]",l1:"text-[16px] @[899px]/pickaxe-root:text-[18px] @[1024px]/pickaxe-root:text-[18px]",l2:"text-[14px] @[899px]/pickaxe-root:text-[16px] @[1024px]/pickaxe-root:text-[16px]"},md:{h1:"text-[28px] @[899px]/pickaxe-root:text-[48px] @[1024px]/pickaxe-root:text-[56px]",h2:"text-[22px] @[899px]/pickaxe-root:text-[34px] @[1024px]/pickaxe-root:text-[40px]",h3:"text-[20px] @[899px]/pickaxe-root:text-[30px] @[1024px]/pickaxe-root:text-[32px]",h4:"text-[18px] @[899px]/pickaxe-root:text-[22px] @[1024px]/pickaxe-root:text-[24px]",b1:"text-[18px] @[899px]/pickaxe-root:text-[20px] @[1024px]/pickaxe-root:text-[20px]",b2:"text-[16px] @[899px]/pickaxe-root:text-[16px] @[1024px]/pickaxe-root:text-[16px]",b3:"text-[14px] @[899px]/pickaxe-root:text-[14px] @[1024px]/pickaxe-root:text-[14px]",b4:"text-[12px] @[899px]/pickaxe-root:text-[12px] @[1024px]/pickaxe-root:text-[12px]",l1:"text-[16px] @[899px]/pickaxe-root:text-[16px] @[1024px]/pickaxe-root:text-[16px]",l2:"text-[14px] @[899px]/pickaxe-root:text-[14px] @[1024px]/pickaxe-root:text-[14px]"},sm:{h1:"text-[24px] @[899px]/pickaxe-root:text-[34px] @[1024px]/pickaxe-root:text-[48px]",h2:"text-[20px] @[899px]/pickaxe-root:text-[28px] @[1024px]/pickaxe-root:text-[34px]",h3:"text-[18px] @[899px]/pickaxe-root:text-[22px] @[1024px]/pickaxe-root:text-[28px]",h4:"text-[16px] @[899px]/pickaxe-root:text-[18px] @[1024px]/pickaxe-root:text-[20px]",b1:"text-[16px] @[899px]/pickaxe-root:text-[18px] @[1024px]/pickaxe-root:text-[18px]",b2:"text-[14px] @[899px]/pickaxe-root:text-[16px] @[1024px]/pickaxe-root:text-[16px]",b3:"text-[12px] @[899px]/pickaxe-root:text-[14px] @[1024px]/pickaxe-root:text-[14px]",b4:"text-[10px] @[899px]/pickaxe-root:text-[12px] @[1024px]/pickaxe-root:text-[12px]",l1:"text-[14px] @[899px]/pickaxe-root:text-[16px] @[1024px]/pickaxe-root:text-[16px]",l2:"text-[12px] @[899px]/pickaxe-root:text-[14px] @[1024px]/pickaxe-root:text-[14px]"}}},e=({size:e}={})=>{const{styles:o,responsiveBy:a}=t();return x((()=>p[a][e||o.fontSize||"md"]),[e,o,a])};export{p as fontSizeMap,e as useStyleFontSize};
@@ -0,0 +1,5 @@
1
+ interface AudioProps {
2
+ url: string;
3
+ }
4
+ declare const Audio: ({ url }: AudioProps) => import("react/jsx-runtime").JSX.Element;
5
+ export default Audio;
@@ -0,0 +1,7 @@
1
+ interface HtmlModalProps {
2
+ src: string;
3
+ isOpen: boolean;
4
+ onChangeIsOpen: (isOpen: boolean) => void;
5
+ }
6
+ declare const HtmlModal: ({ src, isOpen, onChangeIsOpen }: HtmlModalProps) => import("react/jsx-runtime").JSX.Element;
7
+ export default HtmlModal;
@@ -0,0 +1,5 @@
1
+ interface HtmlProps {
2
+ url: string;
3
+ }
4
+ declare const Html: ({ url }: HtmlProps) => import("react/jsx-runtime").JSX.Element;
5
+ export default Html;
@@ -0,0 +1,6 @@
1
+ import { type DetailedHTMLProps, type HTMLAttributes } from "react";
2
+ interface MarkdownModalBodyProps extends DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement> {
3
+ avoidOverflow?: boolean;
4
+ }
5
+ declare const MarkdownModalBody: import("react").ForwardRefExoticComponent<Omit<MarkdownModalBodyProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
6
+ export default MarkdownModalBody;
@@ -0,0 +1,9 @@
1
+ import { type CSSProperties, type ReactNode } from "react";
2
+ interface MarkdownModalCloseButtonProps {
3
+ className?: string;
4
+ icon?: ReactNode;
5
+ style?: CSSProperties;
6
+ onClick?: () => void;
7
+ }
8
+ declare const MarkdownModalCloseButton: ({ className, icon, style, onClick, }: MarkdownModalCloseButtonProps) => import("react/jsx-runtime").JSX.Element;
9
+ export default MarkdownModalCloseButton;
@@ -0,0 +1,15 @@
1
+ import { type Dispatch, type ReactNode, type SetStateAction } from "react";
2
+ type MarkdownModalContextType = {
3
+ isOpen: boolean;
4
+ closeOnOutsideClick: boolean;
5
+ setIsOpen: Dispatch<SetStateAction<boolean>>;
6
+ };
7
+ interface MarkdownModalProviderProps {
8
+ children: ReactNode | ReactNode[];
9
+ isOpen?: boolean;
10
+ closeOnOutsideClick?: boolean;
11
+ onChange?: (isOpen: boolean) => void;
12
+ }
13
+ export declare const MarkdownModalContext: import("react").Context<MarkdownModalContextType>;
14
+ declare const MarkdownModal: ({ children, isOpen: _isOpen, closeOnOutsideClick, onChange, }: MarkdownModalProviderProps) => import("react/jsx-runtime").JSX.Element;
15
+ export default MarkdownModal;
@@ -1,10 +1,10 @@
1
1
  import type { StudioFontSize } from "../../types/studio";
2
2
  import type { PickaxeResponsiveBy } from "../../components/Pickaxe/Provider";
3
3
  export type FontSizeType = "h1" | "h2" | "h3" | "h4" | "b1" | "b2" | "b3" | "b4" | "l1" | "l2";
4
- export declare const fontSizeMap: Record<PickaxeResponsiveBy, Record<FontSizeType, Record<StudioFontSize, string>>>;
4
+ export type FontListType = Record<FontSizeType, string>;
5
+ export declare const fontSizeMap: Record<PickaxeResponsiveBy, Record<StudioFontSize, Record<FontSizeType, string>>>;
5
6
  interface UseStyleFontSizeOptions {
6
- type: FontSizeType;
7
7
  size?: StudioFontSize;
8
8
  }
9
- export declare const useStyleFontSize: ({ type, size, }: UseStyleFontSizeOptions) => (base?: string) => string;
9
+ export declare const useStyleFontSize: ({ size, }?: UseStyleFontSizeOptions) => FontListType;
10
10
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pickaxeproject/react",
3
- "version": "0.0.58",
3
+ "version": "0.0.60",
4
4
  "description": "Client utility library for Pickaxe",
5
5
  "repository": {
6
6
  "type": "git",