@pickaxeproject/react 2.3.3 → 2.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/components/Pickaxe/Chat/History/Message.js +1 -1
- package/dist/cjs/components/Pickaxe/Form/History/Item.js +1 -1
- package/dist/cjs/components/Pickaxe/Form/History/Response.js +1 -1
- package/dist/cjs/components/Pickaxe/Provider.js +1 -1
- package/dist/cjs/components/Pickaxe/common/PickaxeHead.js +1 -1
- package/dist/cjs/components/Pickaxe/common/PickaxeMarkdown/Renderer.js +1 -1
- package/dist/cjs/components/Pickaxe/common/PickaxeMarkdown/index.js +1 -1
- package/dist/cjs/components/Pickaxe/common/PickaxeMarkdown/utils/custom-plugins.js +1 -1
- package/dist/cjs/src/components/Pickaxe/Provider.d.ts +7 -1
- package/dist/cjs/src/components/Pickaxe/common/PickaxeMarkdown/hooks/usePickaxeMarkdownContext.d.ts +3 -0
- package/dist/cjs/src/components/Pickaxe/common/PickaxeMarkdown/index.d.ts +7 -1
- package/dist/cjs/src/components/Pickaxe/common/PickaxeMarkdown/utils/custom-plugins.d.ts +4 -0
- package/dist/cjs/src/hooks/pickaxe/usePickaxeContext.d.ts +3 -0
- package/dist/esm/components/Pickaxe/Chat/History/Message.js +1 -1
- package/dist/esm/components/Pickaxe/Form/History/Item.js +1 -1
- package/dist/esm/components/Pickaxe/Form/History/Response.js +1 -1
- package/dist/esm/components/Pickaxe/Provider.js +1 -1
- package/dist/esm/components/Pickaxe/common/PickaxeHead.js +1 -1
- package/dist/esm/components/Pickaxe/common/PickaxeMarkdown/Renderer.js +1 -1
- package/dist/esm/components/Pickaxe/common/PickaxeMarkdown/index.js +1 -1
- package/dist/esm/components/Pickaxe/common/PickaxeMarkdown/utils/custom-plugins.js +1 -1
- package/dist/esm/src/components/Pickaxe/Provider.d.ts +7 -1
- package/dist/esm/src/components/Pickaxe/common/PickaxeMarkdown/hooks/usePickaxeMarkdownContext.d.ts +3 -0
- package/dist/esm/src/components/Pickaxe/common/PickaxeMarkdown/index.d.ts +7 -1
- package/dist/esm/src/components/Pickaxe/common/PickaxeMarkdown/utils/custom-plugins.d.ts +4 -0
- package/dist/esm/src/hooks/pickaxe/usePickaxeContext.d.ts +3 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),s=require("react"),t=require("../../../../hooks/pickaxe/usePickaxeContext.js"),a=require("../../../../hooks/studio/useStyleFontSize.js"),i=require("../../common/PickaxeMarkdown/index.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),s=require("react"),t=require("../../../../hooks/pickaxe/usePickaxeContext.js"),a=require("../../../../hooks/studio/useStyleFontSize.js"),i=require("../../common/PickaxeMarkdown/index.js"),l=require("../../common/PickaxeMarkdown/Renderer.js"),c=require("../../common/PickaxeIcon.js"),r=require("./Document.js"),n=require("../../common/PickaxeCopyButton.js"),o=require("../../../../common/cn.js");exports.default=({index:d,message:x,isIntroExpand:u})=>{var m,j;const{formId:p,pickaxe:h,styles:f,colors:b,misc:g,responsiveBy:v,disableHtml:k,disableJs:w,disableCss:y,isNewChat:N,isRtl:O}=t.usePickaxeContext(),C=a.useStyleFontSize(),P=null!==(m=null==h?void 0:h.chaticon)&&void 0!==m?m:`https://prod-pickaxe-assets.s3.us-west-2.amazonaws.com/chaticons/${p}.png`;return"assistant"===x.role?e.jsx("div",Object.assign({className:o.default("flex w-full",O?"justify-end":"justify-start")},{children:e.jsx("div",Object.assign({className:o.default("flex flex-col",0===d&&N&&"viewport"===v&&"min-[767px]:max-w-[80%]",0===d&&N&&"container"===v&&"@[767px]/pickaxe-root:max-w-[80%]")},{children:e.jsxs("div",Object.assign({className:o.default("flex gap-x-3",O&&"flex-row-reverse")},{children:[g.isChatImage&&"NONE"!==P&&e.jsx(c.default,{src:P,alt:"Assistant",width:24,height:24,className:"my-3 h-6 w-6",textColor:b.text}),e.jsxs("div",Object.assign({className:o.default("flex flex-col",O?"items-end":"items-start")},{children:[e.jsx("div",Object.assign({className:o.default(C.b2,"chat-message pt-3",O?"text-right":"text-left")},{children:e.jsx(i.PickaxeMarkdown,Object.assign({theme:f.theme,accentColor:b.accent,actions:!0},O&&{rtl:!0},k&&{disableHtml:!0},w&&{disableJs:!0},y&&{disableCss:!0},{children:e.jsx(l.PickaxeMarkdownRenderer,Object.assign({value:x.content},0===d&&N&&x.content.length>470&&3===(null!==(j=null==h?void 0:h.icebreakers)&&void 0!==j?j:[]).length&&!x.content.includes("https://utils.pickaxe.co/api/fn")&&{maxLines:u?void 0:12}))}))})),e.jsx("div",Object.assign({className:"mt-4 flex gap-3"},{children:e.jsx(n.default,{color:b.accent,text:x.content})}))]}))]}))}))})):"user"===x.role?e.jsx("div",Object.assign({className:o.default("flex w-full",O?"justify-start":"justify-end")},{children:e.jsx("div",Object.assign({className:o.default("flex gap-x-3 max-w-[80%]",O?"pr-9":"pl-9","viewport"===v?O?"min-[767px]:pr-0":"min-[767px]:pl-0":O?"@[767px]/pickaxe-root:pr-0":"@[767px]/pickaxe-root:pl-0")},{children:e.jsxs("div",Object.assign({className:o.default(C.b2,"overflow-x-auto overflow-y-hidden px-4 py-3 scrollbar-thin scrollbar-track-white scrollbar-thumb-[#4A4A4B] flex flex-col gap-y-3",O?"text-right":"text-left"),style:{backgroundColor:b.secondary+"80",color:b.secondaryText,borderRadius:f.cornerRadius}},{children:[x.documentIds&&x.documentIds.length>0&&e.jsx("div",Object.assign({className:o.default("flex flex-col",O?"items-start":"items-end")},{children:x.documentIds.map((t=>e.jsx(s.Fragment,{children:t.startsWith("IMAGE-")?e.jsx("div",Object.assign({className:"max-w-[300px]"},{children:e.jsx("img",{style:{borderRadius:f.cornerRadius},className:"object-cover w-full h-full",src:`https://prod-pickaxe-assets.s3.us-west-2.amazonaws.com/documentinterrogation/${t.split("-")[2]}/${t.split("-")[1]}.${null==t?void 0:t.split("-")[2]}`,alt:""})})):e.jsx(r.default,{documentId:t})},t)))})),e.jsx(i.PickaxeMarkdown,Object.assign({theme:f.theme,accentColor:b.accent},O&&{rtl:!0},k&&{disableHtml:!0},w&&{disableJs:!0},y&&{disableCss:!0},{children:e.jsx(l.PickaxeMarkdownRenderer,{value:x.content})}))]}))}))})):e.jsx("div",{})};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),s=require("react"),o=require("../../../../hooks/pickaxe/usePickaxeContext.js"),t=require("../../../../hooks/pickaxe/useResponseContext.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),s=require("react"),o=require("../../../../hooks/pickaxe/usePickaxeContext.js"),t=require("../../../../hooks/pickaxe/useResponseContext.js"),a=require("../../../../hooks/studio/useStyleFontSize.js"),l=require("../../Addons/Document/hooks/useDocument.js"),i=require("date-fns"),n=require("../../common/PickaxeMarkdown/index.js"),r=require("../../common/PickaxeMarkdown/Renderer.js"),c=require("../../../Icons/message-square-notes.svg.js"),d=require("../../../Icons/visitor.svg.js"),u=require("../../common/PickaxeIcon.js"),m=require("../../common/PickaxeSimpleButton.js"),x=require("../../common/PickaxeCopyButton.js"),h=require("../../../../common/cn.js");exports.default=({item:p})=>{const{pickaxe:j,styles:f,colors:b,misc:g,translations:v,disableHtml:k,disableJs:y,disableCss:w,isRtl:N,setChatId:q,setIsNewChat:C}=o.usePickaxeContext(),{setMessages:O}=t.useResponseContext(),{setDocuments:M}=l.useDocument(),I=a.useStyleFontSize(),P=s.useMemo((()=>i.format(p.createdAt,"hh:mm a MMM dd, yy")),[p]),S=s.useMemo((()=>p&&p.messages?p.messages.length:0),[p]),R=s.useMemo((()=>{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]),$=s.useMemo((()=>{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.jsxs("div",Object.assign({className:"flex flex-col shadow-black transition duration-300 hover:shadow"},{children:[e.jsxs("div",Object.assign({className:"flex gap-x-3 overflow-hidden px-4 py-5",style:{backgroundColor:b.primary,color:b.text}},{children:[e.jsx("div",Object.assign({className:"shrink-0 pt-1"},{children:e.jsx(d.default,{className:"h-6 w-6"})})),e.jsxs("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:[e.jsx("input",{id:`${p.responseId}-input`,type:"checkbox",className:"peer hidden",defaultChecked:R.length<280}),e.jsx("div",{className:"danger-html hidden flex-col peer-checked:flex",dangerouslySetInnerHTML:{__html:R}}),e.jsx("label",Object.assign({htmlFor:`${p.responseId}-input`,className:h.default(I.b3,"mt-1 flex shrink-0 whitespace-nowrap font-semibold peer-checked:hidden hover:cursor-pointer"),style:{color:b.accent}},{children:(null==v?void 0:v["see-input"])||"See input"})),e.jsx("label",Object.assign({htmlFor:`${p.responseId}-input`,className:h.default(I.b3,"hidden shrink-0 whitespace-nowrap font-semibold peer-checked:flex hover:cursor-pointer"),style:{color:b.accent}},{children:(null==v?void 0:v["hide-input"])||"Hide input"}))]}))]})),e.jsxs("div",Object.assign({className:"flex gap-x-3 px-4 py-5",style:{backgroundColor:b.secondary,color:b.secondaryText}},{children:[g.isChatImage&&e.jsx(u.default,{src:null==j?void 0:j.chaticon,alt:`${null==j?void 0:j.formtitle}'s Chat Icon`,width:24,height:24,className:"h-6 w-6 pt-1",textColor:b.secondaryText}),e.jsxs("div",Object.assign({className:"flex w-full flex-col gap-y-2 overflow-hidden"},{children:[e.jsx(n.PickaxeMarkdown,Object.assign({theme:f.theme,accentColor:b.accent,actions:!0},N&&{rtl:!0},k&&{disableHtml:!0},y&&{disableJs:!0},w&&{disableCss:!0},{children:e.jsx(r.PickaxeMarkdownRenderer,{className:"overflow-x-auto pb-2 font-semilight opacity-90 scrollbar scrollbar-thin",value:$})})),e.jsxs("div",Object.assign({className:"flex flex-wrap items-center justify-between gap-x-3 gap-y-1"},{children:[e.jsxs("div",Object.assign({className:"flex items-center gap-3"},{children:[(null==j?void 0:j.enablechatresponses)&&e.jsxs(m.default,Object.assign({color:b.accent,onClick:()=>{return e=p.responseId,M([]),O([]),C(!1),void q(e);var e}},{children:[e.jsx(c.default,{className:"h-4 w-4 shrink-0"}),e.jsx("p",Object.assign({className:h.default(I.b3,"font-semibold")},{children:S+1}))]})),e.jsx(x.default,{color:b.accent,text:$})]})),e.jsx("div",Object.assign({className:"flex shrink-0 grow justify-end"},{children:e.jsx("p",Object.assign({className:h.default(I.b3,"font-semibold uppercase opacity-30")},{children:P}))}))]}))]}))]}))]}))};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),s=require("react"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),s=require("react"),t=require("../../../../hooks/pickaxe/usePickaxeContext.js"),o=require("../../../../hooks/pickaxe/useResponseContext.js"),l=require("../../Addons/Scroll/hooks/useScrollContext.js"),n=require("../../../../hooks/studio/useStyleFontSize.js"),a=require("../../Addons/Document/hooks/useDocument.js"),r=require("../../common/PickaxeMarkdown/index.js"),i=require("../../common/PickaxeMarkdown/Renderer.js"),c=require("date-fns"),d=require("../../../Icons/message-square-notes.svg.js"),u=require("../../../Icons/visitor.svg.js"),x=require("../../common/PickaxeIcon.js"),m=require("../../common/PickaxeCopyButton.js"),p=require("../../common/PickaxeSimpleButton.js"),h=require("../../Addons/Scroll/ScrollLockView.js"),j=require("../../../../common/cn.js");exports.default=()=>{var f;const{pickaxe:b,styles:g,colors:k,misc:v,translations:y,disableHtml:w,disableJs:q,disableCss:N,isRtl:C,setChatId:O,setIsNewChat:M}=t.usePickaxeContext(),{response:I}=o.useResponseContext(),{scrollTargetRef:S}=l.useScrollContext(),{setDocuments:P}=a.useDocument(),D=n.useStyleFontSize(),R=s.useMemo((()=>I?c.format(I.sentAt,"hh:mm a MMM dd, yy"):c.format(new Date,"hh:mm a MMM dd, yy")),[I]),$=s.useMemo((()=>{var e;if(!I)return"";return(null!==(e=I.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("")}),[I]);return I?e.jsxs("div",Object.assign({ref:S,className:"flex flex-col shadow-black transition duration-300 hover:shadow"},{children:[e.jsxs("div",Object.assign({className:"flex gap-x-3 overflow-hidden px-4 py-5",style:{backgroundColor:k.primary,color:k.text}},{children:[e.jsx("div",Object.assign({className:"shrink-0 pt-1"},{children:e.jsx(u.default,{className:"h-6 w-6"})})),e.jsxs("div",Object.assign({className:"flex flex-col gap-y-1 overflow-x-auto pb-[6px] scrollbar scrollbar-thin"},{children:[e.jsx("input",{id:`${I.responseId}-input`,type:"checkbox",className:"peer hidden",defaultChecked:$.length<280}),e.jsx("div",{className:"danger-html hidden flex-col opacity-50 peer-checked:flex",dangerouslySetInnerHTML:{__html:$}}),e.jsx("label",Object.assign({htmlFor:`${I.responseId}-input`,className:j.default(D.b3,"mt-1 flex shrink-0 whitespace-nowrap font-semibold text-[#228DD7] peer-checked:hidden hover:cursor-pointer"),style:{color:k.accent}},{children:(null==y?void 0:y["see-input"])||"See input"})),e.jsx("label",Object.assign({htmlFor:`${I.responseId}-input`,className:j.default(D.b3,"hidden shrink-0 whitespace-nowrap font-semibold text-[#228DD7] peer-checked:flex hover:cursor-pointer"),style:{color:k.accent}},{children:(null==y?void 0:y["hide-input"])||"Hide input"}))]}))]})),e.jsxs("div",Object.assign({className:"flex gap-x-3 px-4 py-5",style:{backgroundColor:k.secondary,color:k.secondaryText}},{children:[v.isChatImage&&e.jsx(x.default,{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:k.secondaryText}),e.jsxs("div",Object.assign({className:"flex w-full flex-col gap-y-2 overflow-hidden"},{children:[e.jsx(r.PickaxeMarkdown,Object.assign({theme:g.theme,accentColor:k.accent,actions:!0},C&&{rtl:!0},w&&{disableHtml:!0},q&&{disableJs:!0},N&&{disableCss:!0},{children:e.jsx(i.PickaxeMarkdownRenderer,{className:"overflow-x-auto pb-2 font-semilight opacity-90 scrollbar scrollbar-thin",value:I.questionResponse})})),e.jsxs("div",Object.assign({className:"flex flex-wrap items-center justify-between gap-x-3 gap-y-1"},{children:[e.jsxs("div",Object.assign({className:"flex items-center gap-3"},{children:[(null==b?void 0:b.enablechatresponses)&&e.jsxs(p.default,Object.assign({color:k.accent,onClick:()=>{return e=I.responseId,P([]),M(!1),void O(e);var e}},{children:[e.jsx(d.default,{className:"pxe-h-4 pxe-w-4 pxe-shrink-0"}),e.jsx("p",Object.assign({className:j.default(D.b3,"pxe-font-semibold")},{children:I.messageCount+1}))]})),e.jsx(m.default,{color:k.accent,text:null!==(f=I.questionResponse)&&void 0!==f?f:""})]})),e.jsx("div",Object.assign({className:"flex shrink-0 grow justify-end"},{children:e.jsx("p",Object.assign({className:j.default(D.b3,"font-semibold uppercase opacity-30")},{children:R}))}))]}))]}))]})),e.jsx(h.default,{className:"w-full"})]})):null};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),s=require("react"),t=require("./Addons/Document/Provider.js"),i=require("./ResponseProvider.js"),r=require("./DimensionProvider.js");const o=s.createContext({});exports.PickaxeContext=o,exports.PickaxeProvider=({children:a,userId:
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),s=require("react"),t=require("./Addons/Document/Provider.js"),i=require("./ResponseProvider.js"),r=require("./DimensionProvider.js");const o=s.createContext({});exports.PickaxeContext=o,exports.PickaxeProvider=({children:a,userId:d="",studioUserId:n="",deploymentId:l="",embedUserId:c="",styles:u,colors:b,limits:m={},misc:p={isWhiteLabel:!0,isProfileImage:!0,isChatImage:!0,isTitle:!0,isDescription:!0,isHistory:!0},translations:h,responsiveBy:F="viewport",forceMobile:x=!1,disableHtml:I=!1,disableJs:f=!1,disableCss:y=!1,loadFont:g=!0,isEmbed:j=!1,isRtl:P=!1,onGenerateComplete:v})=>{const[S,w]=s.useState(""),[k,C]=s.useState(""),[O,q]=s.useState(null),[D,H]=s.useState(!1),[R,U]=s.useState(!0),[B,E]=s.useState(!0);return s.useEffect((()=>{H(!1)}),[null==u?void 0:u.font]),e.jsx(o.Provider,Object.assign({value:Object.assign({formId:S,chatId:k,userId:d,studioUserId:n,deploymentId:l,embedUserId:c,pickaxe:O,styles:Object.assign({theme:"light",font:"Real Head Pro",fontSize:"md",formFieldStyle:"box",btnStyle:"filled",outlineThickness:1,cornerRadius:4},u),colors:Object.assign({primary:"#F6F8FA",text:"#000000",secondary:"#FFFFFF",secondaryText:"#000000",accent:"#228DD7",accentText:"#FFFFFF",error:"#EF4444"},b),misc:p,translations:Object.assign({"new-chat":"New chat","see-history":"See history","see-input":"See input","hide-input":"Hide input",processing:"Processing...",uploading:"Uploading...",loading:"Loading...","powered-by-pickaxe":"Powered by Pickaxe","form-doc-placeholder":"Paste a website/video link or drag a file",website:"Website"},h),responsiveBy:F,forceMobile:x,loadFont:g,disableHtml:I,disableJs:f,disableCss:y,isFontLoaded:D,isNewChat:R,isShowIceBreaker:B,isEmbed:j,isRtl:P,setIsFontLoaded:H,setFormId:w,setChatId:C,setPickaxe:q,setIsNewChat:U,setIsShowIceBreaker:E},v&&{onGenerateComplete:v})},{children:e.jsx(i.default,Object.assign({limits:m},{children:e.jsx(r.default,{children:e.jsx(t.default,{children:a})})}))}))};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),s=require("react"),i=require("../../../hooks/pickaxe/usePickaxeContext.js"),t=require("../../../hooks/studio/useStyleFontSize.js"),l=require("./PickaxeMarkdown/Renderer.js"),r=require("./PickaxeIcon.js"),a=require("./PickaxeInfoModal.js"),o=require("./PickaxeMarkdown/index.js"),n=require("../../../common/cn.js");exports.default=({className:c,iconClassName:d,maxLines:u,onIconClick:x})=>{const{pickaxe:m,styles:j,colors:k,misc:p,disableHtml:f,disableJs:h,disableCss:b,isRtl:P}=i.usePickaxeContext(),[v,C]=s.useState(!1),g=t.useStyleFontSize(),q=s.useMemo((()=>({title:(null==m?void 0:m.formtitle)||"",description:(null==m?void 0:m.formdescription)||""})),[m]);return e.jsxs("div",Object.assign({className:n.default("flex flex-col items-center",c)},{children:[v&&e.jsx(a.default,{isOpen:v,onChangeIsOpen:C}),p.isProfileImage&&e.jsx(r.default,Object.assign({src:null==m?void 0:m.coverphoto,alt:`${null==m?void 0:m.formtitle}'s Profile Picture`,width:72,height:72,className:n.default("h-[72px] w-[72px] rounded-full",d,!!x&&"cursor-pointer")},x&&{onClick:x})),p.isTitle&&!!q.title&&e.jsx("h2",Object.assign({className:n.default(g.h2,"mt-6 text-center font-semilight opacity-90",!u&&"line-clamp-2")},{children:null==m?void 0:m.formtitle})),p.isDescription&&!!q.description&&e.jsx(o.PickaxeMarkdown,Object.assign({theme:j.theme,accentColor:k.accent},P&&{rtl:!0},f&&{disableHtml:!0},h&&{disableJs:!0},b&&{disableCss:!0},{children:e.jsx(l.PickaxeMarkdownRenderer,Object.assign({className:"mt-2 text-center",value:q.description},u&&{maxLines:u},{onExpandClick:()=>C(!0)}))}))]}))};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../../_virtual/_tslib.js"),r=require("react/jsx-runtime"),n=require("react"),t=require("./hooks/usePickaxeMarkdownContext.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../../_virtual/_tslib.js"),r=require("react/jsx-runtime"),n=require("react"),t=require("./hooks/usePickaxeMarkdownContext.js"),s=require("./utils/custom-plugins.js"),i=require("react-markdown"),o=require("remark-gfm"),a=require("remark-math"),l=require("rehype-katex"),u=require("rehype-raw"),c=require("./Components/A/index.js"),d=require("./Components/P/index.js"),p=require("./Components/Img/index.js"),m=require("./Components/Iframe/index.js"),h=require("./Components/Code/index.js"),g=require("./Components/Headings/index.js"),f=require("./Components/List/index.js"),x=require("./Components/Table/index.js"),b=require("./Components/Others/index.js"),j=require("./Components/Action/index.js"),q=require("../../../../common/cn.js");function C(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var k=C(i),w=C(o),y=C(a),v=C(l),A=C(u);exports.PickaxeMarkdownRenderer=({className:i,style:o,children:a,value:l,maxLines:u,multiLineBreaks:C,recursion:O,onExpandClick:H})=>{const{accentColor:P,rtl:S,disableHtml:M,disableJs:$,disableCss:T}=t.usePickaxeMarkdownContext(),[_,E]=n.useState({width:0,height:0}),[I,L]=n.useState(null),B=n.useRef(null),N=n.useMemo((()=>{if(!l)return"";let e=l.trim();return e=e.replace(/<!--[\s\S]*?-->/g,""),e=e.replace(/\u200B/g,""),e=e.replace(/\\[\s\S]*?\\]/g,(e=>"$$"+e.substring(2,e.length-2)+"$$")).replace(/\\\(\s*[\s\S]*?\s*\\\)/g,(e=>"$$"+e.substring(2,e.length-2)+"$$")),C&&(e=e.replace(/```[\s\S]*?```|(\n(?=\n))/g,((e,r)=>r?"\n\n<br/>\n":e))),e||""}),[l,C]);n.useEffect((()=>{if(!u)return void L(null);if(!B.current||!N||I)return;const e=B.current,r=parseInt(window.getComputedStyle(e).lineHeight,10),n=u*r;if(!(_.height>n))return;const t=Math.floor(_.width/8),s=Math.floor(t*u);L(N.slice(0,s)+'<span class="pxe-expand-btn">...</span>')}),[N,u,_,I]);const R={h1:g.H1,h2:g.H2,h3:g.H3,h4:g.H4,h5:g.H5,p:d.P,a:c.A,img:p.Img,iframe:m.Iframe,code:h.Code,ol:f.Ol,ul:f.Ul,li:f.Li,table:x.Table,th:x.Th,tr:x.Tr,td:x.Td,hr:b.Hr,br:b.Br,blockquote:b.Blockquote,span:n=>{var{children:t}=n,s=e.__rest(n,["children"]);return"pxe-expand-btn"===s.className?r.jsx("span",Object.assign({},s,{style:Object.assign({display:"inline",fontWeight:500,color:P,marginLeft:".25rem",userSelect:"none"},H&&{cursor:"pointer"})},H&&{onClick:H},{children:t})):r.jsx("span",Object.assign({},s,{children:t}))},ActionCaption:j.ActionCaption,ActionFinished:j.ActionFinished,ActionError:j.ActionError};n.useEffect((()=>{if(!B.current)return;const e=new ResizeObserver((e=>{for(const r of e){const{width:e,height:n}=r.contentRect;E({width:e,height:n})}}));return e.observe(B.current),()=>{e.disconnect()}}),[]);const z=I||N;return r.jsxs("div",Object.assign({className:"pxe-markdown",ref:B,style:Object.assign({position:"relative",overflowWrap:"break-word",display:"grid",gridTemplateColumns:"repeat(1, minmax(0, 1fr))",gap:".625rem"},o)},S&&{dir:"rtl"},{children:[r.jsx(k.default,Object.assign({className:q.default(!O&&"pxe-prose",i),components:R,remarkPlugins:[w.default,[y.default,{singleDollarTextMath:!1}]],rehypePlugins:[v.default,...M?[]:[A.default],[s.rehypeSanitize,{disableJs:$,disableCss:T}],s.rehypePickaxeAction]},{children:z})),a]}))};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var o=require("react/jsx-runtime"),e=require("react");const t=e.createContext({}),r=({children:r,theme:n="light",syntaxTheme:a,accentColor:c="#228DD7",accentTextColor:l="#FFFFFF",actions:i=!1,readOnly:s=!1,rtl:d=!1})=>{const[
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var o=require("react/jsx-runtime"),e=require("react");const t=e.createContext({}),r=({children:r,theme:n="light",syntaxTheme:a,accentColor:c="#228DD7",accentTextColor:l="#FFFFFF",actions:i=!1,readOnly:s=!1,rtl:d=!1,disableHtml:C=!1,disableJs:F=!1,disableCss:p=!1})=>{const[u,m]=e.useState(n),[b,g]=e.useState({}),[h,x]=e.useState(i);return o.jsx(t.Provider,Object.assign({value:{theme:u,accentColor:c,accentTextColor:l,actionState:b,actions:h,readOnly:s,rtl:d,disableHtml:C,disableJs:F,disableCss:p,setTheme:m,setActionState:g,setActions:x,syntaxTheme:a||{'code[class*="language-"]':{color:"#c5c8c6",textShadow:"0 1px rgba(0, 0, 0, 0.3)",fontFamily:"Inconsolata, Monaco, Consolas, 'Courier New', Courier, monospace",direction:"ltr",textAlign:"left",whiteSpace:"pre",wordSpacing:"normal",wordBreak:"normal",lineHeight:"1.5",MozTabSize:"4",OTabSize:"4",tabSize:"4",WebkitHyphens:"none",MozHyphens:"none",msHyphens:"none",hyphens:"none",width:"max-content"},'pre[class*="language-"]':{color:"#c5c8c6",textShadow:"0 1px rgba(0, 0, 0, 0.3)",fontFamily:"Inconsolata, Monaco, Consolas, 'Courier New', Courier, monospace",direction:"ltr",textAlign:"left",whiteSpace:"pre",wordSpacing:"normal",wordBreak:"normal",lineHeight:"1.5",MozTabSize:"4",OTabSize:"4",tabSize:"4",WebkitHyphens:"none",MozHyphens:"none",msHyphens:"none",hyphens:"none",padding:"1em",overflow:"auto",borderRadius:"0.3em",background:"#1d1f21",width:"max-content"},':not(pre) > code[class*="language-"]':{background:"#1d1f21",padding:".1em",borderRadius:".3em"},comment:{color:"#7C7C7C"},prolog:{color:"#7C7C7C"},doctype:{color:"#7C7C7C"},cdata:{color:"#7C7C7C"},punctuation:{color:"#c5c8c6"},".namespace":{opacity:".7"},property:{color:"#96CBFE"},keyword:{color:"#96CBFE"},tag:{color:"#96CBFE"},"class-name":{color:"#FFFFB6",textDecoration:"underline"},boolean:{color:"#99CC99"},constant:{color:"#99CC99"},symbol:{color:"#f92672"},deleted:{color:"#f92672"},number:{color:"#FF73FD"},selector:{color:"#A8FF60"},"attr-name":{color:"#A8FF60"},string:{color:"#A8FF60"},char:{color:"#A8FF60"},builtin:{color:"#A8FF60"},inserted:{color:"#A8FF60"},variable:{color:"#C6C5FE"},operator:{color:"#EDEDED"},entity:{color:"#FFFFB6",cursor:"help"},url:{color:"#96CBFE"},".language-css .token.string":{color:"#87C38A"},".style .token.string":{color:"#87C38A"},atrule:{color:"#F9EE98"},"attr-value":{color:"#F9EE98"},function:{color:"#DAD085"},regex:{color:"#E9C062"},important:{color:"#fd971f",fontWeight:"bold"},bold:{fontWeight:"bold"},italic:{fontStyle:"italic"}}}},{children:r}))};exports.PickaxeMarkdown=r,exports.PickaxeMarkdownContext=t,exports.default=r;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("unist-util-visit");const t=["action-caption","action-finished","action-error"],i=["ActionCaption","ActionFinished","ActionError"];exports.rehypePickaxeAction=()=>
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("unist-util-visit");const t=["action-caption","action-finished","action-error"],i=["ActionCaption","ActionFinished","ActionError"];exports.rehypePickaxeAction=()=>r=>(e.visit(r,"element",(e=>{const i=e.tagName;if(t.includes(i)){const t=i.split("-");e.tagName=t.map((e=>e.charAt(0).toUpperCase()+e.slice(1))).join(""),e.properties=e.properties||{}}})),e.visit(r,"element",((t,r,o)=>{if("p"===t.tagName){const s=t.children.filter((e=>"text"===e.type?""!==e.value.trim():"element"===e.type));if(1===s.length){const t=s[0];if("element"===t.type&&i.includes(t.tagName)&&o&&"children"in o&&o.children&&void 0!==r)return o.children.splice(r,1,t),[e.SKIP,r]}}})),r),exports.rehypeSanitize=(t={})=>i=>{e.visit(i,"element",((i,r,o)=>{if(t.disableJs){if("script"===i.tagName&&o&&"number"==typeof r)return o.children.splice(r,1),[e.SKIP,r];if(i.properties){["onclick","onload","onerror","onmouseover","onmouseout","onfocus","onblur"].forEach((e=>{i.properties[e]&&delete i.properties[e]})),i.properties.href&&"string"==typeof i.properties.href&&i.properties.href.toLowerCase().startsWith("javascript:")&&delete i.properties.href}}if(t.disableCss&&"style"===i.tagName&&o&&"number"==typeof r)return o.children.splice(r,1),[e.SKIP,r]}))};
|
|
@@ -48,6 +48,9 @@ type PickaxeContextType = {
|
|
|
48
48
|
responsiveBy: PickaxeResponsiveBy;
|
|
49
49
|
forceMobile: boolean;
|
|
50
50
|
loadFont: boolean;
|
|
51
|
+
disableHtml: boolean;
|
|
52
|
+
disableJs: boolean;
|
|
53
|
+
disableCss: boolean;
|
|
51
54
|
isFontLoaded: boolean;
|
|
52
55
|
isNewChat: boolean;
|
|
53
56
|
isShowIceBreaker: boolean;
|
|
@@ -75,10 +78,13 @@ export interface IPickaxeProviderProps {
|
|
|
75
78
|
responsiveBy?: PickaxeResponsiveBy;
|
|
76
79
|
forceMobile?: boolean;
|
|
77
80
|
loadFont?: boolean;
|
|
81
|
+
disableHtml?: boolean;
|
|
82
|
+
disableJs?: boolean;
|
|
83
|
+
disableCss?: boolean;
|
|
78
84
|
isEmbed?: boolean;
|
|
79
85
|
isRtl?: boolean;
|
|
80
86
|
onGenerateComplete?: (responseId: string) => void;
|
|
81
87
|
}
|
|
82
88
|
export declare const PickaxeContext: import("react").Context<PickaxeContextType>;
|
|
83
|
-
export declare const PickaxeProvider: ({ children, userId, studioUserId, deploymentId, embedUserId, styles, colors, limits, misc, translations, responsiveBy, forceMobile, loadFont, isEmbed, isRtl, onGenerateComplete, }: IPickaxeProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
89
|
+
export declare const PickaxeProvider: ({ children, userId, studioUserId, deploymentId, embedUserId, styles, colors, limits, misc, translations, responsiveBy, forceMobile, disableHtml, disableJs, disableCss, loadFont, isEmbed, isRtl, onGenerateComplete, }: IPickaxeProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
84
90
|
export {};
|
package/dist/cjs/src/components/Pickaxe/common/PickaxeMarkdown/hooks/usePickaxeMarkdownContext.d.ts
CHANGED
|
@@ -8,6 +8,9 @@ export declare const usePickaxeMarkdownContext: () => {
|
|
|
8
8
|
actions: boolean;
|
|
9
9
|
readOnly: boolean;
|
|
10
10
|
rtl: boolean;
|
|
11
|
+
disableHtml: boolean;
|
|
12
|
+
disableJs: boolean;
|
|
13
|
+
disableCss: boolean;
|
|
11
14
|
setTheme: import("../../../../../types/common").SetState<import("..").PickaxeMarkdownTheme>;
|
|
12
15
|
setActionState: import("../../../../../types/common").SetState<Record<string, import("..").ActionState>>;
|
|
13
16
|
setActions: import("../../../../../types/common").SetState<boolean>;
|
|
@@ -21,6 +21,9 @@ type PickaxeMarkdownContextType = {
|
|
|
21
21
|
actions: boolean;
|
|
22
22
|
readOnly: boolean;
|
|
23
23
|
rtl: boolean;
|
|
24
|
+
disableHtml: boolean;
|
|
25
|
+
disableJs: boolean;
|
|
26
|
+
disableCss: boolean;
|
|
24
27
|
setTheme: SetState<PickaxeMarkdownTheme>;
|
|
25
28
|
setActionState: SetState<Record<string, ActionState>>;
|
|
26
29
|
setActions: SetState<boolean>;
|
|
@@ -34,7 +37,10 @@ export interface PickaxeMarkdownProps {
|
|
|
34
37
|
actions?: boolean;
|
|
35
38
|
readOnly?: boolean;
|
|
36
39
|
rtl?: boolean;
|
|
40
|
+
disableHtml?: boolean;
|
|
41
|
+
disableJs?: boolean;
|
|
42
|
+
disableCss?: boolean;
|
|
37
43
|
}
|
|
38
44
|
export declare const PickaxeMarkdownContext: import("react").Context<PickaxeMarkdownContextType>;
|
|
39
|
-
export declare const PickaxeMarkdown: ({ children, theme: _theme, syntaxTheme, accentColor, accentTextColor, actions: _actions, readOnly, rtl, }: PickaxeMarkdownProps) => import("react/jsx-runtime").JSX.Element;
|
|
45
|
+
export declare const PickaxeMarkdown: ({ children, theme: _theme, syntaxTheme, accentColor, accentTextColor, actions: _actions, readOnly, rtl, disableHtml, disableJs, disableCss, }: PickaxeMarkdownProps) => import("react/jsx-runtime").JSX.Element;
|
|
40
46
|
export default PickaxeMarkdown;
|
|
@@ -13,6 +13,9 @@ export declare const usePickaxeContext: () => {
|
|
|
13
13
|
responsiveBy: import("../../components/Pickaxe/Provider").PickaxeResponsiveBy;
|
|
14
14
|
forceMobile: boolean;
|
|
15
15
|
loadFont: boolean;
|
|
16
|
+
disableHtml: boolean;
|
|
17
|
+
disableJs: boolean;
|
|
18
|
+
disableCss: boolean;
|
|
16
19
|
isFontLoaded: boolean;
|
|
17
20
|
isNewChat: boolean;
|
|
18
21
|
isShowIceBreaker: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,jsxs as
|
|
1
|
+
import{jsx as e,jsxs as s}from"react/jsx-runtime";import{Fragment as t}from"react";import{usePickaxeContext as i}from"../../../../hooks/pickaxe/usePickaxeContext.js";import{useStyleFontSize as a}from"../../../../hooks/studio/useStyleFontSize.js";import{PickaxeMarkdown as o}from"../../common/PickaxeMarkdown/index.js";import{PickaxeMarkdownRenderer as c}from"../../common/PickaxeMarkdown/Renderer.js";import l from"../../common/PickaxeIcon.js";import n from"./Document.js";import r from"../../common/PickaxeCopyButton.js";import m from"../../../../common/cn.js";const d=({index:d,message:x,isIntroExpand:p})=>{var h,u;const{formId:f,pickaxe:b,styles:g,colors:j,misc:v,responsiveBy:w,disableHtml:k,disableJs:y,disableCss:N,isNewChat:O,isRtl:C}=i(),I=a(),R=null!==(h=null==b?void 0:b.chaticon)&&void 0!==h?h:`https://prod-pickaxe-assets.s3.us-west-2.amazonaws.com/chaticons/${f}.png`;return"assistant"===x.role?e("div",Object.assign({className:m("flex w-full",C?"justify-end":"justify-start")},{children:e("div",Object.assign({className:m("flex flex-col",0===d&&O&&"viewport"===w&&"min-[767px]:max-w-[80%]",0===d&&O&&"container"===w&&"@[767px]/pickaxe-root:max-w-[80%]")},{children:s("div",Object.assign({className:m("flex gap-x-3",C&&"flex-row-reverse")},{children:[v.isChatImage&&"NONE"!==R&&e(l,{src:R,alt:"Assistant",width:24,height:24,className:"my-3 h-6 w-6",textColor:j.text}),s("div",Object.assign({className:m("flex flex-col",C?"items-end":"items-start")},{children:[e("div",Object.assign({className:m(I.b2,"chat-message pt-3",C?"text-right":"text-left")},{children:e(o,Object.assign({theme:g.theme,accentColor:j.accent,actions:!0},C&&{rtl:!0},k&&{disableHtml:!0},y&&{disableJs:!0},N&&{disableCss:!0},{children:e(c,Object.assign({value:x.content},0===d&&O&&x.content.length>470&&3===(null!==(u=null==b?void 0:b.icebreakers)&&void 0!==u?u:[]).length&&!x.content.includes("https://utils.pickaxe.co/api/fn")&&{maxLines:p?void 0:12}))}))})),e("div",Object.assign({className:"mt-4 flex gap-3"},{children:e(r,{color:j.accent,text:x.content})}))]}))]}))}))})):"user"===x.role?e("div",Object.assign({className:m("flex w-full",C?"justify-start":"justify-end")},{children:e("div",Object.assign({className:m("flex gap-x-3 max-w-[80%]",C?"pr-9":"pl-9","viewport"===w?C?"min-[767px]:pr-0":"min-[767px]:pl-0":C?"@[767px]/pickaxe-root:pr-0":"@[767px]/pickaxe-root:pl-0")},{children:s("div",Object.assign({className:m(I.b2,"overflow-x-auto overflow-y-hidden px-4 py-3 scrollbar-thin scrollbar-track-white scrollbar-thumb-[#4A4A4B] flex flex-col gap-y-3",C?"text-right":"text-left"),style:{backgroundColor:j.secondary+"80",color:j.secondaryText,borderRadius:g.cornerRadius}},{children:[x.documentIds&&x.documentIds.length>0&&e("div",Object.assign({className:m("flex flex-col",C?"items-start":"items-end")},{children:x.documentIds.map((s=>e(t,{children:s.startsWith("IMAGE-")?e("div",Object.assign({className:"max-w-[300px]"},{children:e("img",{style:{borderRadius:g.cornerRadius},className:"object-cover w-full h-full",src:`https://prod-pickaxe-assets.s3.us-west-2.amazonaws.com/documentinterrogation/${s.split("-")[2]}/${s.split("-")[1]}.${null==s?void 0:s.split("-")[2]}`,alt:""})})):e(n,{documentId:s})},s)))})),e(o,Object.assign({theme:g.theme,accentColor:j.accent},C&&{rtl:!0},k&&{disableHtml:!0},y&&{disableJs:!0},N&&{disableCss:!0},{children:e(c,{value:x.content})}))]}))}))})):e("div",{})};export{d 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
|
|
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 i}from"../../../../hooks/pickaxe/useResponseContext.js";import{useStyleFontSize as l}from"../../../../hooks/studio/useStyleFontSize.js";import{useDocument as n}from"../../Addons/Document/hooks/useDocument.js";import{format as a}from"date-fns";import{PickaxeMarkdown as r}from"../../common/PickaxeMarkdown/index.js";import{PickaxeMarkdownRenderer as c}from"../../common/PickaxeMarkdown/Renderer.js";import d from"../../../Icons/message-square-notes.svg.js";import m from"../../../Icons/visitor.svg.js";import p from"../../common/PickaxeIcon.js";import h from"../../common/PickaxeSimpleButton.js";import u from"../../common/PickaxeCopyButton.js";import f from"../../../../common/cn.js";const g=({item:g})=>{const{pickaxe:x,styles:b,colors:v,misc:j,translations:k,disableHtml:y,disableJs:w,disableCss:N,isRtl:C,setChatId:O,setIsNewChat:I}=t(),{setMessages:M}=i(),{setDocuments:P}=n(),$=l(),S=o((()=>a(g.createdAt,"hh:mm a MMM dd, yy")),[g]),q=o((()=>g&&g.messages?g.messages.length:0),[g]),A=o((()=>{var e,s,o,t;if("form"===g.type){return(null!==(e=g.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=g.messages)||void 0===s?void 0:s[0])||void 0===o?void 0:o.message)&&void 0!==t?t:""}),[g]),H=o((()=>{var e,s,o,t;return"form"===g.type?null!==(e=g.questionResponse)&&void 0!==e?e:"":null!==(t=null===(o=null===(s=g.messages)||void 0===s?void 0:s[1])||void 0===o?void 0:o.message)&&void 0!==t?t:""}),[g]);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:v.primary,color:v.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-1.5 scrollbar-track-gray-100 scrollbar-thumb-[#4A4A4B] lg:max-w-[520px] lg:scrollbar-thin"},{children:[s("input",{id:`${g.responseId}-input`,type:"checkbox",className:"peer hidden",defaultChecked:A.length<280}),s("div",{className:"danger-html hidden flex-col peer-checked:flex",dangerouslySetInnerHTML:{__html:A}}),s("label",Object.assign({htmlFor:`${g.responseId}-input`,className:f($.b3,"mt-1 flex shrink-0 whitespace-nowrap font-semibold peer-checked:hidden hover:cursor-pointer"),style:{color:v.accent}},{children:(null==k?void 0:k["see-input"])||"See input"})),s("label",Object.assign({htmlFor:`${g.responseId}-input`,className:f($.b3,"hidden shrink-0 whitespace-nowrap font-semibold peer-checked:flex hover:cursor-pointer"),style:{color:v.accent}},{children:(null==k?void 0:k["hide-input"])||"Hide input"}))]}))]})),e("div",Object.assign({className:"flex gap-x-3 px-4 py-5",style:{backgroundColor:v.secondary,color:v.secondaryText}},{children:[j.isChatImage&&s(p,{src:null==x?void 0:x.chaticon,alt:`${null==x?void 0:x.formtitle}'s Chat Icon`,width:24,height:24,className:"h-6 w-6 pt-1",textColor:v.secondaryText}),e("div",Object.assign({className:"flex w-full flex-col gap-y-2 overflow-hidden"},{children:[s(r,Object.assign({theme:b.theme,accentColor:v.accent,actions:!0},C&&{rtl:!0},y&&{disableHtml:!0},w&&{disableJs:!0},N&&{disableCss:!0},{children:s(c,{className:"overflow-x-auto pb-2 font-semilight opacity-90 scrollbar scrollbar-thin",value:H})})),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==x?void 0:x.enablechatresponses)&&e(h,Object.assign({color:v.accent,onClick:()=>{return e=g.responseId,P([]),M([]),I(!1),void O(e);var e}},{children:[s(d,{className:"h-4 w-4 shrink-0"}),s("p",Object.assign({className:f($.b3,"font-semibold")},{children:q+1}))]})),s(u,{color:v.accent,text:H})]})),s("div",Object.assign({className:"flex shrink-0 grow justify-end"},{children:s("p",Object.assign({className:f($.b3,"font-semibold uppercase opacity-30")},{children:S}))}))]}))]}))]}))]}))};export{g as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as e,jsx as
|
|
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 n}from"../../../../hooks/pickaxe/useResponseContext.js";import{useScrollContext as i}from"../../Addons/Scroll/hooks/useScrollContext.js";import{useStyleFontSize as l}from"../../../../hooks/studio/useStyleFontSize.js";import{useDocument as r}from"../../Addons/Document/hooks/useDocument.js";import{PickaxeMarkdown as a}from"../../common/PickaxeMarkdown/index.js";import{PickaxeMarkdownRenderer as c}from"../../common/PickaxeMarkdown/Renderer.js";import{format as m}from"date-fns";import d from"../../../Icons/message-square-notes.svg.js";import p from"../../../Icons/visitor.svg.js";import h from"../../common/PickaxeIcon.js";import f from"../../common/PickaxeCopyButton.js";import u from"../../common/PickaxeSimpleButton.js";import x from"../../Addons/Scroll/ScrollLockView.js";import b from"../../../../common/cn.js";const g=()=>{var g;const{pickaxe:v,styles:j,colors:k,misc:y,translations:w,disableHtml:N,disableJs:C,disableCss:O,isRtl:I,setChatId:S,setIsNewChat:D}=t(),{response:M}=n(),{scrollTargetRef:P}=i(),{setDocuments:R}=r(),$=l(),q=o((()=>m(M?M.sentAt:new Date,"hh:mm a MMM dd, yy")),[M]),A=o((()=>{var e;if(!M)return"";return(null!==(e=M.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("")}),[M]);return M?e("div",Object.assign({ref:P,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:k.primary,color:k.text}},{children:[s("div",Object.assign({className:"shrink-0 pt-1"},{children:s(p,{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:`${M.responseId}-input`,type:"checkbox",className:"peer hidden",defaultChecked:A.length<280}),s("div",{className:"danger-html hidden flex-col opacity-50 peer-checked:flex",dangerouslySetInnerHTML:{__html:A}}),s("label",Object.assign({htmlFor:`${M.responseId}-input`,className:b($.b3,"mt-1 flex shrink-0 whitespace-nowrap font-semibold text-[#228DD7] peer-checked:hidden hover:cursor-pointer"),style:{color:k.accent}},{children:(null==w?void 0:w["see-input"])||"See input"})),s("label",Object.assign({htmlFor:`${M.responseId}-input`,className:b($.b3,"hidden shrink-0 whitespace-nowrap font-semibold text-[#228DD7] peer-checked:flex hover:cursor-pointer"),style:{color:k.accent}},{children:(null==w?void 0:w["hide-input"])||"Hide input"}))]}))]})),e("div",Object.assign({className:"flex gap-x-3 px-4 py-5",style:{backgroundColor:k.secondary,color:k.secondaryText}},{children:[y.isChatImage&&s(h,{src:null==v?void 0:v.chaticon,alt:`${null==v?void 0:v.formtitle}'s Chat Icon`,width:24,height:24,className:"h-6 w-6 pt-1",textColor:k.secondaryText}),e("div",Object.assign({className:"flex w-full flex-col gap-y-2 overflow-hidden"},{children:[s(a,Object.assign({theme:j.theme,accentColor:k.accent,actions:!0},I&&{rtl:!0},N&&{disableHtml:!0},C&&{disableJs:!0},O&&{disableCss:!0},{children:s(c,{className:"overflow-x-auto pb-2 font-semilight opacity-90 scrollbar scrollbar-thin",value:M.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==v?void 0:v.enablechatresponses)&&e(u,Object.assign({color:k.accent,onClick:()=>{return e=M.responseId,R([]),D(!1),void S(e);var e}},{children:[s(d,{className:"pxe-h-4 pxe-w-4 pxe-shrink-0"}),s("p",Object.assign({className:b($.b3,"pxe-font-semibold")},{children:M.messageCount+1}))]})),s(f,{color:k.accent,text:null!==(g=M.questionResponse)&&void 0!==g?g:""})]})),s("div",Object.assign({className:"flex shrink-0 grow justify-end"},{children:s("p",Object.assign({className:b($.b3,"font-semibold uppercase opacity-30")},{children:q}))}))]}))]}))]})),s(x,{className:"w-full"})]})):null};export{g as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e}from"react/jsx-runtime";import{createContext as
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import{createContext as s,useState as i,useEffect as t}from"react";import o from"./Addons/Document/Provider.js";import r from"./ResponseProvider.js";import d from"./DimensionProvider.js";const n=s({}),a=({children:s,userId:a="",studioUserId:l="",deploymentId:c="",embedUserId:m="",styles:p,colors:b,limits:h={},misc:F={isWhiteLabel:!0,isProfileImage:!0,isChatImage:!0,isTitle:!0,isDescription:!0,isHistory:!0},translations:I,responsiveBy:u="viewport",forceMobile:f=!1,disableHtml:g=!1,disableJs:y=!1,disableCss:w=!1,loadFont:P=!0,isEmbed:j=!1,isRtl:v=!1,onGenerateComplete:x})=>{const[k,C]=i(""),[S,O]=i(""),[D,H]=i(null),[R,U]=i(!1),[B,L]=i(!0),[T,E]=i(!0);return t((()=>{U(!1)}),[null==p?void 0:p.font]),e(n.Provider,Object.assign({value:Object.assign({formId:k,chatId:S,userId:a,studioUserId:l,deploymentId:c,embedUserId:m,pickaxe:D,styles:Object.assign({theme:"light",font:"Real Head Pro",fontSize:"md",formFieldStyle:"box",btnStyle:"filled",outlineThickness:1,cornerRadius:4},p),colors:Object.assign({primary:"#F6F8FA",text:"#000000",secondary:"#FFFFFF",secondaryText:"#000000",accent:"#228DD7",accentText:"#FFFFFF",error:"#EF4444"},b),misc:F,translations:Object.assign({"new-chat":"New chat","see-history":"See history","see-input":"See input","hide-input":"Hide input",processing:"Processing...",uploading:"Uploading...",loading:"Loading...","powered-by-pickaxe":"Powered by Pickaxe","form-doc-placeholder":"Paste a website/video link or drag a file",website:"Website"},I),responsiveBy:u,forceMobile:f,loadFont:P,disableHtml:g,disableJs:y,disableCss:w,isFontLoaded:R,isNewChat:B,isShowIceBreaker:T,isEmbed:j,isRtl:v,setIsFontLoaded:U,setFormId:C,setChatId:O,setPickaxe:H,setIsNewChat:L,setIsShowIceBreaker:E},x&&{onGenerateComplete:x})},{children:e(r,Object.assign({limits:h},{children:e(d,{children:e(o,{children:s})})}))}))};export{n as PickaxeContext,a as PickaxeProvider};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as e,jsx as i}from"react/jsx-runtime";import{useState as
|
|
1
|
+
import{jsxs as e,jsx as i}from"react/jsx-runtime";import{useState as s,useMemo as t}from"react";import{usePickaxeContext as o}from"../../../hooks/pickaxe/usePickaxeContext.js";import{useStyleFontSize as l}from"../../../hooks/studio/useStyleFontSize.js";import{PickaxeMarkdownRenderer as r}from"./PickaxeMarkdown/Renderer.js";import c from"./PickaxeIcon.js";import n from"./PickaxeInfoModal.js";import{PickaxeMarkdown as a}from"./PickaxeMarkdown/index.js";import m from"../../../common/cn.js";const d=({className:d,iconClassName:p,maxLines:f,onIconClick:x})=>{const{pickaxe:h,styles:u,colors:k,misc:j,disableHtml:b,disableJs:g,disableCss:C,isRtl:v}=o(),[P,O]=s(!1),N=l(),I=t((()=>({title:(null==h?void 0:h.formtitle)||"",description:(null==h?void 0:h.formdescription)||""})),[h]);return e("div",Object.assign({className:m("flex flex-col items-center",d)},{children:[P&&i(n,{isOpen:P,onChangeIsOpen:O}),j.isProfileImage&&i(c,Object.assign({src:null==h?void 0:h.coverphoto,alt:`${null==h?void 0:h.formtitle}'s Profile Picture`,width:72,height:72,className:m("h-[72px] w-[72px] rounded-full",p,!!x&&"cursor-pointer")},x&&{onClick:x})),j.isTitle&&!!I.title&&i("h2",Object.assign({className:m(N.h2,"mt-6 text-center font-semilight opacity-90",!f&&"line-clamp-2")},{children:null==h?void 0:h.formtitle})),j.isDescription&&!!I.description&&i(a,Object.assign({theme:u.theme,accentColor:k.accent},v&&{rtl:!0},b&&{disableHtml:!0},g&&{disableJs:!0},C&&{disableCss:!0},{children:i(r,Object.assign({className:"mt-2 text-center",value:I.description},f&&{maxLines:f},{onExpandClick:()=>O(!0)}))}))]}))};export{d as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__rest as e}from"../../../../_virtual/_tslib.js";import{jsxs as r,jsx as n}from"react/jsx-runtime";import{useState as t,useRef as o,useMemo as
|
|
1
|
+
import{__rest as e}from"../../../../_virtual/_tslib.js";import{jsxs as r,jsx as n}from"react/jsx-runtime";import{useState as t,useRef as o,useMemo as s,useEffect as i}from"react";import{usePickaxeMarkdownContext as m}from"./hooks/usePickaxeMarkdownContext.js";import{rehypeSanitize as a,rehypePickaxeAction as l}from"./utils/custom-plugins.js";import p from"react-markdown";import c from"remark-gfm";import d from"remark-math";import h from"rehype-katex";import f from"rehype-raw";import{A as u}from"./Components/A/index.js";import{P as g}from"./Components/P/index.js";import{Img as x}from"./Components/Img/index.js";import{Iframe as b}from"./Components/Iframe/index.js";import{Code as j}from"./Components/Code/index.js";import{H1 as C,H2 as k,H3 as w,H4 as v,H5 as y}from"./Components/Headings/index.js";import{Ol as O,Ul as $,Li as S}from"./Components/List/index.js";import{Table as A,Th as L,Tr as M,Td as N}from"./Components/Table/index.js";import{Hr as P,Br as H,Blockquote as I}from"./Components/Others/index.js";import{ActionCaption as T,ActionFinished as B,ActionError as E}from"./Components/Action/index.js";import J from"../../../../common/cn.js";const R=({className:R,style:W,children:_,value:q,maxLines:z,multiLineBreaks:D,recursion:F,onExpandClick:G})=>{const{accentColor:K,rtl:Q,disableHtml:U,disableJs:V,disableCss:X}=m(),[Y,Z]=t({width:0,height:0}),[ee,re]=t(null),ne=o(null),te=s((()=>{if(!q)return"";let e=q.trim();return e=e.replace(/<!--[\s\S]*?-->/g,""),e=e.replace(/\u200B/g,""),e=e.replace(/\\[\s\S]*?\\]/g,(e=>"$$"+e.substring(2,e.length-2)+"$$")).replace(/\\\(\s*[\s\S]*?\s*\\\)/g,(e=>"$$"+e.substring(2,e.length-2)+"$$")),D&&(e=e.replace(/```[\s\S]*?```|(\n(?=\n))/g,((e,r)=>r?"\n\n<br/>\n":e))),e||""}),[q,D]);i((()=>{if(!z)return void re(null);if(!ne.current||!te||ee)return;const e=ne.current,r=parseInt(window.getComputedStyle(e).lineHeight,10),n=z*r;if(!(Y.height>n))return;const t=Math.floor(Y.width/8),o=Math.floor(t*z);re(te.slice(0,o)+'<span class="pxe-expand-btn">...</span>')}),[te,z,Y,ee]);const oe={h1:C,h2:k,h3:w,h4:v,h5:y,p:g,a:u,img:x,iframe:b,code:j,ol:O,ul:$,li:S,table:A,th:L,tr:M,td:N,hr:P,br:H,blockquote:I,span:r=>{var{children:t}=r,o=e(r,["children"]);return"pxe-expand-btn"===o.className?n("span",Object.assign({},o,{style:Object.assign({display:"inline",fontWeight:500,color:K,marginLeft:".25rem",userSelect:"none"},G&&{cursor:"pointer"})},G&&{onClick:G},{children:t})):n("span",Object.assign({},o,{children:t}))},ActionCaption:T,ActionFinished:B,ActionError:E};i((()=>{if(!ne.current)return;const e=new ResizeObserver((e=>{for(const r of e){const{width:e,height:n}=r.contentRect;Z({width:e,height:n})}}));return e.observe(ne.current),()=>{e.disconnect()}}),[]);const se=ee||te;return r("div",Object.assign({className:"pxe-markdown",ref:ne,style:Object.assign({position:"relative",overflowWrap:"break-word",display:"grid",gridTemplateColumns:"repeat(1, minmax(0, 1fr))",gap:".625rem"},W)},Q&&{dir:"rtl"},{children:[n(p,Object.assign({className:J(!F&&"pxe-prose",R),components:oe,remarkPlugins:[c,[d,{singleDollarTextMath:!1}]],rehypePlugins:[h,...U?[]:[f],[a,{disableJs:V,disableCss:X}],l]},{children:se})),_]}))};export{R as PickaxeMarkdownRenderer};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as o}from"react/jsx-runtime";import{createContext as e,useState as r}from"react";const t=e({}),n=({children:e,theme:n="light",syntaxTheme:
|
|
1
|
+
import{jsx as o}from"react/jsx-runtime";import{createContext as e,useState as r}from"react";const t=e({}),n=({children:e,theme:n="light",syntaxTheme:a,accentColor:l="#228DD7",accentTextColor:c="#FFFFFF",actions:i=!1,readOnly:s=!1,rtl:d=!1,disableHtml:F=!1,disableJs:C=!1,disableCss:m=!1})=>{const[p,g]=r(n),[h,b]=r({}),[u,y]=r(i);return o(t.Provider,Object.assign({value:{theme:p,accentColor:l,accentTextColor:c,actionState:h,actions:u,readOnly:s,rtl:d,disableHtml:F,disableJs:C,disableCss:m,setTheme:g,setActionState:b,setActions:y,syntaxTheme:a||{'code[class*="language-"]':{color:"#c5c8c6",textShadow:"0 1px rgba(0, 0, 0, 0.3)",fontFamily:"Inconsolata, Monaco, Consolas, 'Courier New', Courier, monospace",direction:"ltr",textAlign:"left",whiteSpace:"pre",wordSpacing:"normal",wordBreak:"normal",lineHeight:"1.5",MozTabSize:"4",OTabSize:"4",tabSize:"4",WebkitHyphens:"none",MozHyphens:"none",msHyphens:"none",hyphens:"none",width:"max-content"},'pre[class*="language-"]':{color:"#c5c8c6",textShadow:"0 1px rgba(0, 0, 0, 0.3)",fontFamily:"Inconsolata, Monaco, Consolas, 'Courier New', Courier, monospace",direction:"ltr",textAlign:"left",whiteSpace:"pre",wordSpacing:"normal",wordBreak:"normal",lineHeight:"1.5",MozTabSize:"4",OTabSize:"4",tabSize:"4",WebkitHyphens:"none",MozHyphens:"none",msHyphens:"none",hyphens:"none",padding:"1em",overflow:"auto",borderRadius:"0.3em",background:"#1d1f21",width:"max-content"},':not(pre) > code[class*="language-"]':{background:"#1d1f21",padding:".1em",borderRadius:".3em"},comment:{color:"#7C7C7C"},prolog:{color:"#7C7C7C"},doctype:{color:"#7C7C7C"},cdata:{color:"#7C7C7C"},punctuation:{color:"#c5c8c6"},".namespace":{opacity:".7"},property:{color:"#96CBFE"},keyword:{color:"#96CBFE"},tag:{color:"#96CBFE"},"class-name":{color:"#FFFFB6",textDecoration:"underline"},boolean:{color:"#99CC99"},constant:{color:"#99CC99"},symbol:{color:"#f92672"},deleted:{color:"#f92672"},number:{color:"#FF73FD"},selector:{color:"#A8FF60"},"attr-name":{color:"#A8FF60"},string:{color:"#A8FF60"},char:{color:"#A8FF60"},builtin:{color:"#A8FF60"},inserted:{color:"#A8FF60"},variable:{color:"#C6C5FE"},operator:{color:"#EDEDED"},entity:{color:"#FFFFB6",cursor:"help"},url:{color:"#96CBFE"},".language-css .token.string":{color:"#87C38A"},".style .token.string":{color:"#87C38A"},atrule:{color:"#F9EE98"},"attr-value":{color:"#F9EE98"},function:{color:"#DAD085"},regex:{color:"#E9C062"},important:{color:"#fd971f",fontWeight:"bold"},bold:{fontWeight:"bold"},italic:{fontStyle:"italic"}}}},{children:e}))};export{n as PickaxeMarkdown,t as PickaxeMarkdownContext,n as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{visit as e,SKIP as t}from"unist-util-visit";const
|
|
1
|
+
import{visit as e,SKIP as t}from"unist-util-visit";const r=["action-caption","action-finished","action-error"],i=["ActionCaption","ActionFinished","ActionError"],o=()=>o=>(e(o,"element",(e=>{const t=e.tagName;if(r.includes(t)){const r=t.split("-");e.tagName=r.map((e=>e.charAt(0).toUpperCase()+e.slice(1))).join(""),e.properties=e.properties||{}}})),e(o,"element",((e,r,o)=>{if("p"===e.tagName){const n=e.children.filter((e=>"text"===e.type?""!==e.value.trim():"element"===e.type));if(1===n.length){const e=n[0];if("element"===e.type&&i.includes(e.tagName)&&o&&"children"in o&&o.children&&void 0!==r)return o.children.splice(r,1,e),[t,r]}}})),o),n=(r={})=>i=>{e(i,"element",((e,i,o)=>{if(r.disableJs){if("script"===e.tagName&&o&&"number"==typeof i)return o.children.splice(i,1),[t,i];if(e.properties){["onclick","onload","onerror","onmouseover","onmouseout","onfocus","onblur"].forEach((t=>{e.properties[t]&&delete e.properties[t]})),e.properties.href&&"string"==typeof e.properties.href&&e.properties.href.toLowerCase().startsWith("javascript:")&&delete e.properties.href}}if(r.disableCss&&"style"===e.tagName&&o&&"number"==typeof i)return o.children.splice(i,1),[t,i]}))};export{o as rehypePickaxeAction,n as rehypeSanitize};
|
|
@@ -48,6 +48,9 @@ type PickaxeContextType = {
|
|
|
48
48
|
responsiveBy: PickaxeResponsiveBy;
|
|
49
49
|
forceMobile: boolean;
|
|
50
50
|
loadFont: boolean;
|
|
51
|
+
disableHtml: boolean;
|
|
52
|
+
disableJs: boolean;
|
|
53
|
+
disableCss: boolean;
|
|
51
54
|
isFontLoaded: boolean;
|
|
52
55
|
isNewChat: boolean;
|
|
53
56
|
isShowIceBreaker: boolean;
|
|
@@ -75,10 +78,13 @@ export interface IPickaxeProviderProps {
|
|
|
75
78
|
responsiveBy?: PickaxeResponsiveBy;
|
|
76
79
|
forceMobile?: boolean;
|
|
77
80
|
loadFont?: boolean;
|
|
81
|
+
disableHtml?: boolean;
|
|
82
|
+
disableJs?: boolean;
|
|
83
|
+
disableCss?: boolean;
|
|
78
84
|
isEmbed?: boolean;
|
|
79
85
|
isRtl?: boolean;
|
|
80
86
|
onGenerateComplete?: (responseId: string) => void;
|
|
81
87
|
}
|
|
82
88
|
export declare const PickaxeContext: import("react").Context<PickaxeContextType>;
|
|
83
|
-
export declare const PickaxeProvider: ({ children, userId, studioUserId, deploymentId, embedUserId, styles, colors, limits, misc, translations, responsiveBy, forceMobile, loadFont, isEmbed, isRtl, onGenerateComplete, }: IPickaxeProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
89
|
+
export declare const PickaxeProvider: ({ children, userId, studioUserId, deploymentId, embedUserId, styles, colors, limits, misc, translations, responsiveBy, forceMobile, disableHtml, disableJs, disableCss, loadFont, isEmbed, isRtl, onGenerateComplete, }: IPickaxeProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
84
90
|
export {};
|
package/dist/esm/src/components/Pickaxe/common/PickaxeMarkdown/hooks/usePickaxeMarkdownContext.d.ts
CHANGED
|
@@ -8,6 +8,9 @@ export declare const usePickaxeMarkdownContext: () => {
|
|
|
8
8
|
actions: boolean;
|
|
9
9
|
readOnly: boolean;
|
|
10
10
|
rtl: boolean;
|
|
11
|
+
disableHtml: boolean;
|
|
12
|
+
disableJs: boolean;
|
|
13
|
+
disableCss: boolean;
|
|
11
14
|
setTheme: import("../../../../../types/common").SetState<import("..").PickaxeMarkdownTheme>;
|
|
12
15
|
setActionState: import("../../../../../types/common").SetState<Record<string, import("..").ActionState>>;
|
|
13
16
|
setActions: import("../../../../../types/common").SetState<boolean>;
|
|
@@ -21,6 +21,9 @@ type PickaxeMarkdownContextType = {
|
|
|
21
21
|
actions: boolean;
|
|
22
22
|
readOnly: boolean;
|
|
23
23
|
rtl: boolean;
|
|
24
|
+
disableHtml: boolean;
|
|
25
|
+
disableJs: boolean;
|
|
26
|
+
disableCss: boolean;
|
|
24
27
|
setTheme: SetState<PickaxeMarkdownTheme>;
|
|
25
28
|
setActionState: SetState<Record<string, ActionState>>;
|
|
26
29
|
setActions: SetState<boolean>;
|
|
@@ -34,7 +37,10 @@ export interface PickaxeMarkdownProps {
|
|
|
34
37
|
actions?: boolean;
|
|
35
38
|
readOnly?: boolean;
|
|
36
39
|
rtl?: boolean;
|
|
40
|
+
disableHtml?: boolean;
|
|
41
|
+
disableJs?: boolean;
|
|
42
|
+
disableCss?: boolean;
|
|
37
43
|
}
|
|
38
44
|
export declare const PickaxeMarkdownContext: import("react").Context<PickaxeMarkdownContextType>;
|
|
39
|
-
export declare const PickaxeMarkdown: ({ children, theme: _theme, syntaxTheme, accentColor, accentTextColor, actions: _actions, readOnly, rtl, }: PickaxeMarkdownProps) => import("react/jsx-runtime").JSX.Element;
|
|
45
|
+
export declare const PickaxeMarkdown: ({ children, theme: _theme, syntaxTheme, accentColor, accentTextColor, actions: _actions, readOnly, rtl, disableHtml, disableJs, disableCss, }: PickaxeMarkdownProps) => import("react/jsx-runtime").JSX.Element;
|
|
40
46
|
export default PickaxeMarkdown;
|
|
@@ -13,6 +13,9 @@ export declare const usePickaxeContext: () => {
|
|
|
13
13
|
responsiveBy: import("../../components/Pickaxe/Provider").PickaxeResponsiveBy;
|
|
14
14
|
forceMobile: boolean;
|
|
15
15
|
loadFont: boolean;
|
|
16
|
+
disableHtml: boolean;
|
|
17
|
+
disableJs: boolean;
|
|
18
|
+
disableCss: boolean;
|
|
16
19
|
isFontLoaded: boolean;
|
|
17
20
|
isNewChat: boolean;
|
|
18
21
|
isShowIceBreaker: boolean;
|