@pickaxeproject/react 0.0.68 → 0.0.69
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/common/PickaxeMarkdown/Custom/Iframe/index.js +1 -1
- package/dist/cjs/components/Pickaxe/common/PickaxeMarkdown/Custom/P/index.js +1 -1
- package/dist/cjs/components/Pickaxe/common/PickaxeMarkdown/Renderer.js +1 -1
- package/dist/esm/components/Pickaxe/common/PickaxeMarkdown/Custom/Iframe/index.js +1 -1
- package/dist/esm/components/Pickaxe/common/PickaxeMarkdown/Custom/P/index.js +1 -1
- package/dist/esm/components/Pickaxe/common/PickaxeMarkdown/Renderer.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../../../../_virtual/_tslib.js"),r=require("react/jsx-runtime");exports.default=t=>{var{node:i,title:l="Random Iframe",children:s}=t,
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../../../../_virtual/_tslib.js"),r=require("react/jsx-runtime");exports.default=t=>{var{node:i,title:l="Random Iframe",children:s,style:a}=t,n=e.__rest(t,["node","title","children","style"]);return r.jsx("iframe",Object.assign({title:l,style:Object.assign({borderRadius:"8px",width:"100%",marginBottom:"1.5rem"},a),allowFullScreen:!0},n,{children:s}))};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("../../hooks/usePickaxeMarkdownContext.js"),s=require("../common/Action.js");exports.default=({node:i,children:n})=>{const{actions:r}=t.usePickaxeMarkdownContext(),l="string"==typeof n&&n.match(/(?:https?:\/\/)?(?:www\.)?(?:youtube\.com\/watch\?v=|youtu\.be\/)([\w-]+)/i);if(l&&(null==l?void 0:l[1]))return e.jsx("div",Object.assign({style:{display:"flex",width:"100%",justifyContent:"center"}},{children:e.jsx("iframe",Object.assign({title:"youtube-embed",src:`https://www.youtube.com/embed/${l[1]}`,style:{width:"100%",maxWidth:"560px",minHeight:"315px"},allowFullScreen:!0},{children:"Iframe not supported, use a different browser."}))}));if(r&&"string"==typeof n&&n.includes("pickaxe")&&(n.includes("/api/fn/result")||n.includes("/api/function_call_results"))){const t=n.replace(/https:\/\/\S*(\/api\/fn\/result|\/api\/function_call_results)\S*/g,""),i=n.match(/https:\/\/\S*(\/api\/fn\/result|\/api\/function_call_results)\S*/g);return e.jsxs("div",Object.assign({className:"flex flex-col"},{children:[e.jsx("p",Object.assign({style:{fontWeight:350}},{children:t})),e.jsx(s.default,{jobUrl:(null==i?void 0:i[0])||""})]}))}return e.jsx("p",Object.assign({style:{fontWeight:350}},{children:n}))};
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("../../hooks/usePickaxeMarkdownContext.js"),s=require("../common/Action.js");exports.default=({node:i,children:n})=>{const{actions:r}=t.usePickaxeMarkdownContext(),l="string"==typeof n&&n.match(/(?:https?:\/\/)?(?:www\.)?(?:youtube\.com\/watch\?v=|youtu\.be\/)([\w-]+)/i);if(l&&(null==l?void 0:l[1]))return e.jsx("div",Object.assign({style:{display:"flex",width:"100%",justifyContent:"center"}},{children:e.jsx("iframe",Object.assign({title:"youtube-embed",src:`https://www.youtube.com/embed/${l[1]}`,style:{width:"100%",maxWidth:"560px",minHeight:"315px"},allowFullScreen:!0},{children:"Iframe not supported, use a different browser."}))}));if(r&&"string"==typeof n&&n.includes("pickaxe")&&(n.includes("/api/fn/result")||n.includes("/api/function_call_results"))){const t=n.replace(/https:\/\/\S*(\/api\/fn\/result|\/api\/function_call_results)\S*/g,""),i=n.match(/https:\/\/\S*(\/api\/fn\/result|\/api\/function_call_results)\S*/g);return e.jsxs("div",Object.assign({className:"flex flex-col"},{children:[e.jsx("p",Object.assign({style:{fontWeight:350,marginBottom:"0.75rem"}},{children:t})),e.jsx(s.default,{jobUrl:(null==i?void 0:i[0])||""})]}))}return e.jsx("p",Object.assign({style:{fontWeight:350,marginBottom:"0.75rem"}},{children:n}))};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../../_virtual/_tslib.js"),r=require("react/jsx-runtime"),i=require("react"),t=require("./hooks/usePickaxeMarkdownContext.js"),n=require("react-markdown"),s=require("remark-gfm"),l=require("remark-math"),a=require("rehype-katex"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../../_virtual/_tslib.js"),r=require("react/jsx-runtime"),i=require("react"),t=require("./hooks/usePickaxeMarkdownContext.js"),n=require("react-markdown"),s=require("remark-gfm"),l=require("remark-math"),a=require("rehype-katex"),o=require("rehype-raw"),d=require("./Custom/A/index.js"),m=require("./Custom/P/index.js"),c=require("./Custom/Img/index.js"),u=require("./Custom/Iframe/index.js"),h=require("./Custom/Code/index.js"),g=require("./Custom/common/LinkPreview.js"),j=require("./Custom/common/TextModal.js");function x(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var p=x(n),f=x(s),b=x(l),y=x(a),k=x(o);exports.PickaxeMarkdownRenderer=({className:n,style:s,value:l,recursion:a=!1,children:o,maxChar:x})=>{const{theme:O,accentColor:q,websiteMetadatas:v}=t.usePickaxeMarkdownContext(),[C,B]=i.useState(!1),D=i.useRef(null),S=i.useMemo((()=>{if(!l)return"";let e=l;return e=l.replace(/<!--[\s\S]*?-->/g,""),e=l.replace(/\u200B/g,""),x&&(e=e.slice(0,x)),e}),[l,x]),w={h1:({node:e,children:i})=>r.jsx("h1",Object.assign({style:{fontSize:"2.25rem",lineHeight:"2.5rem",marginBottom:"1.5rem"}},{children:i})),h2:({node:e,children:i})=>r.jsx("h2",Object.assign({style:{fontSize:"1.875rem",lineHeight:"2.25rem",marginBottom:"0.75rem"}},{children:i})),h3:({node:e,children:i})=>r.jsx("h3",Object.assign({style:{fontSize:"1.5rem",lineHeight:"2rem",marginBottom:"0.5rem"}},{children:i})),h4:({node:e,children:i})=>r.jsx("h4",Object.assign({className:"mt-2",style:{fontSize:"1.25rem",lineHeight:"1.75rem",marginBottom:"0.5rem"}},{children:i})),h5:({node:e,children:i})=>r.jsx("h5",Object.assign({style:{fontSize:"1.125rem",lineHeight:"1.75rem",marginBottom:"0.5rem"}},{children:i})),p:m.default,a:d.default,ol:({node:e,children:i})=>r.jsx("ol",Object.assign({style:{listStyleType:"decimal",listStylePosition:"inside",paddingLeft:"1.5rem",marginBottom:"1.5rem"}},{children:i})),ul:({node:e,children:i})=>r.jsx("ul",Object.assign({style:{listStyleType:"disc",listStylePosition:"inside",paddingLeft:"1.5rem",marginBottom:"1.5rem"}},{children:i})),li:({node:e,children:i})=>r.jsx("li",{children:i}),table:({children:e})=>r.jsx("div",Object.assign({style:{position:"relative",overflow:"auto",marginBottom:"1.5rem"}},{children:r.jsx("table",Object.assign({style:{tableLayout:"fixed",fontSize:"0.875rem",lineHeight:"1.24rem"}},{children:e}))})),th:({node:e,children:i})=>r.jsx("th",Object.assign({style:{padding:"0.75em 1em",fontWeight:600,textAlign:"left"}},{children:i})),tr:({node:e,children:i})=>r.jsx("tr",Object.assign({style:{border:"dark"===O?"1px solid #30363D":"1px solid #D0D7DE"}},{children:i})),td:({node:e,children:i})=>r.jsx("td",Object.assign({style:{padding:"0.75em 1em"}},{children:i})),code:h.default,blockquote:({node:e,children:i})=>r.jsx("blockquote",Object.assign({style:{lineHeight:"15px",borderLeft:"dark"===O?"4px solid #30363D":"4px solid #D0D7DE",color:"dark"===O?"#8B8B8B":"#656D76",paddingLeft:"1rem",marginBottom:"1rem"}},{children:i})),img:c.default,iframe:u.default,hr:()=>r.jsx("hr",{style:{border:0,borderTop:"dark"===O?"1px solid #30363D":"1px solid #D0D7DE",marginBottom:"1.5rem"}}),span:i=>{var{node:t,children:n}=i,s=e.__rest(i,["node","children"]);return"intro-msg-expand-btn"===s.className?r.jsx("span",Object.assign({},s,{style:{display:"inline",fontWeight:500,color:q,cursor:"pointer"},onClick:()=>B(!0)},{children:n})):r.jsx("span",Object.assign({},s,{children:n}))}};return r.jsxs("div",Object.assign({className:"pxe-markdown",ref:D,style:Object.assign({position:"relative",overflowWrap:"break-word",display:"grid",gridTemplateColumns:"repeat(1, minmax(0, 1fr))",gap:".625rem"},s)},{children:[C&&r.jsx(j.default,{value:S,isOpen:C,onChangeIsOpen:B}),r.jsx(p.default,Object.assign({},n&&{className:n},{components:w,remarkPlugins:[f.default,b.default],rehypePlugins:[y.default,k.default]},{children:`${S}${!a&&v.length>0?"\n\n---":""}${"number"==typeof x&&S.length>=x?'<span class="intro-msg-expand-btn">...</span>':""}`})),!a&&v.length>0&&r.jsx("div",Object.assign({style:{display:"flex",flexDirection:"column",gap:"2rem",marginTop:"2rem"}},{children:v.map(((e,i)=>r.jsx(g.default,{data:e},i)))})),o]}))};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__rest as e}from"../../../../../../_virtual/_tslib.js";import{jsx as t}from"react/jsx-runtime";const r=r=>{var{node:i,title:l="Random Iframe",children:a}=r,
|
|
1
|
+
import{__rest as e}from"../../../../../../_virtual/_tslib.js";import{jsx as t}from"react/jsx-runtime";const r=r=>{var{node:i,title:l="Random Iframe",children:a,style:n}=r,o=e(r,["node","title","children","style"]);return t("iframe",Object.assign({title:l,style:Object.assign({borderRadius:"8px",width:"100%",marginBottom:"1.5rem"},n),allowFullScreen:!0},o,{children:a}))};export{r as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as t,jsxs as e}from"react/jsx-runtime";import{usePickaxeMarkdownContext as i}from"../../hooks/usePickaxeMarkdownContext.js";import
|
|
1
|
+
import{jsx as t,jsxs as e}from"react/jsx-runtime";import{usePickaxeMarkdownContext as i}from"../../hooks/usePickaxeMarkdownContext.js";import n from"../common/Action.js";const s=({node:s,children:o})=>{const{actions:r}=i(),l="string"==typeof o&&o.match(/(?:https?:\/\/)?(?:www\.)?(?:youtube\.com\/watch\?v=|youtu\.be\/)([\w-]+)/i);if(l&&(null==l?void 0:l[1]))return t("div",Object.assign({style:{display:"flex",width:"100%",justifyContent:"center"}},{children:t("iframe",Object.assign({title:"youtube-embed",src:`https://www.youtube.com/embed/${l[1]}`,style:{width:"100%",maxWidth:"560px",minHeight:"315px"},allowFullScreen:!0},{children:"Iframe not supported, use a different browser."}))}));if(r&&"string"==typeof o&&o.includes("pickaxe")&&(o.includes("/api/fn/result")||o.includes("/api/function_call_results"))){const i=o.replace(/https:\/\/\S*(\/api\/fn\/result|\/api\/function_call_results)\S*/g,""),s=o.match(/https:\/\/\S*(\/api\/fn\/result|\/api\/function_call_results)\S*/g);return e("div",Object.assign({className:"flex flex-col"},{children:[t("p",Object.assign({style:{fontWeight:350,marginBottom:"0.75rem"}},{children:i})),t(n,{jobUrl:(null==s?void 0:s[0])||""})]}))}return t("p",Object.assign({style:{fontWeight:350,marginBottom:"0.75rem"}},{children:o}))};export{s as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__rest as e}from"../../../../_virtual/_tslib.js";import{jsxs as r,jsx as i}from"react/jsx-runtime";import{useState as t,useRef as n,useMemo as o}from"react";import{usePickaxeMarkdownContext as s}from"./hooks/usePickaxeMarkdownContext.js";import l from"react-markdown";import m from"remark-gfm";import a from"remark-math";import d from"rehype-katex";import c from"rehype-raw";import h from"./Custom/A/index.js";import p from"./Custom/P/index.js";import g from"./Custom/Img/index.js";import f from"./Custom/Iframe/index.js";import b from"./Custom/Code/index.js";import y from"./Custom/common/LinkPreview.js";import u from"./Custom/common/TextModal.js";const j=({className:j,style:x,value:O,recursion:k=!1,children:
|
|
1
|
+
import{__rest as e}from"../../../../_virtual/_tslib.js";import{jsxs as r,jsx as i}from"react/jsx-runtime";import{useState as t,useRef as n,useMemo as o}from"react";import{usePickaxeMarkdownContext as s}from"./hooks/usePickaxeMarkdownContext.js";import l from"react-markdown";import m from"remark-gfm";import a from"remark-math";import d from"rehype-katex";import c from"rehype-raw";import h from"./Custom/A/index.js";import p from"./Custom/P/index.js";import g from"./Custom/Img/index.js";import f from"./Custom/Iframe/index.js";import b from"./Custom/Code/index.js";import y from"./Custom/common/LinkPreview.js";import u from"./Custom/common/TextModal.js";const j=({className:j,style:x,value:O,recursion:k=!1,children:B,maxChar:C})=>{const{theme:D,accentColor:v,websiteMetadatas:S}=s(),[w,H]=t(!1),P=n(null),z=o((()=>{if(!O)return"";let e=O;return e=O.replace(/<!--[\s\S]*?-->/g,""),e=O.replace(/\u200B/g,""),C&&(e=e.slice(0,C)),e}),[O,C]),L={h1:({node:e,children:r})=>i("h1",Object.assign({style:{fontSize:"2.25rem",lineHeight:"2.5rem",marginBottom:"1.5rem"}},{children:r})),h2:({node:e,children:r})=>i("h2",Object.assign({style:{fontSize:"1.875rem",lineHeight:"2.25rem",marginBottom:"0.75rem"}},{children:r})),h3:({node:e,children:r})=>i("h3",Object.assign({style:{fontSize:"1.5rem",lineHeight:"2rem",marginBottom:"0.5rem"}},{children:r})),h4:({node:e,children:r})=>i("h4",Object.assign({className:"mt-2",style:{fontSize:"1.25rem",lineHeight:"1.75rem",marginBottom:"0.5rem"}},{children:r})),h5:({node:e,children:r})=>i("h5",Object.assign({style:{fontSize:"1.125rem",lineHeight:"1.75rem",marginBottom:"0.5rem"}},{children:r})),p:p,a:h,ol:({node:e,children:r})=>i("ol",Object.assign({style:{listStyleType:"decimal",listStylePosition:"inside",paddingLeft:"1.5rem",marginBottom:"1.5rem"}},{children:r})),ul:({node:e,children:r})=>i("ul",Object.assign({style:{listStyleType:"disc",listStylePosition:"inside",paddingLeft:"1.5rem",marginBottom:"1.5rem"}},{children:r})),li:({node:e,children:r})=>i("li",{children:r}),table:({children:e})=>i("div",Object.assign({style:{position:"relative",overflow:"auto",marginBottom:"1.5rem"}},{children:i("table",Object.assign({style:{tableLayout:"fixed",fontSize:"0.875rem",lineHeight:"1.24rem"}},{children:e}))})),th:({node:e,children:r})=>i("th",Object.assign({style:{padding:"0.75em 1em",fontWeight:600,textAlign:"left"}},{children:r})),tr:({node:e,children:r})=>i("tr",Object.assign({style:{border:"dark"===D?"1px solid #30363D":"1px solid #D0D7DE"}},{children:r})),td:({node:e,children:r})=>i("td",Object.assign({style:{padding:"0.75em 1em"}},{children:r})),code:b,blockquote:({node:e,children:r})=>i("blockquote",Object.assign({style:{lineHeight:"15px",borderLeft:"dark"===D?"4px solid #30363D":"4px solid #D0D7DE",color:"dark"===D?"#8B8B8B":"#656D76",paddingLeft:"1rem",marginBottom:"1rem"}},{children:r})),img:g,iframe:f,hr:()=>i("hr",{style:{border:0,borderTop:"dark"===D?"1px solid #30363D":"1px solid #D0D7DE",marginBottom:"1.5rem"}}),span:r=>{var{node:t,children:n}=r,o=e(r,["node","children"]);return"intro-msg-expand-btn"===o.className?i("span",Object.assign({},o,{style:{display:"inline",fontWeight:500,color:v,cursor:"pointer"},onClick:()=>H(!0)},{children:n})):i("span",Object.assign({},o,{children:n}))}};return r("div",Object.assign({className:"pxe-markdown",ref:P,style:Object.assign({position:"relative",overflowWrap:"break-word",display:"grid",gridTemplateColumns:"repeat(1, minmax(0, 1fr))",gap:".625rem"},x)},{children:[w&&i(u,{value:z,isOpen:w,onChangeIsOpen:H}),i(l,Object.assign({},j&&{className:j},{components:L,remarkPlugins:[m,a],rehypePlugins:[d,c]},{children:`${z}${!k&&S.length>0?"\n\n---":""}${"number"==typeof C&&z.length>=C?'<span class="intro-msg-expand-btn">...</span>':""}`})),!k&&S.length>0&&i("div",Object.assign({style:{display:"flex",flexDirection:"column",gap:"2rem",marginTop:"2rem"}},{children:S.map(((e,r)=>i(y,{data:e},r)))})),B]}))};export{j as PickaxeMarkdownRenderer};
|