@pickaxeproject/react 1.3.4 → 1.3.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../../../../_virtual/_tslib.js"),t=require("react/jsx-runtime"),r=require("react"),s=require("@tanstack/react-query"),a=require("../../hooks/usePickaxeMarkdownContext.js"),o=require("../common/Action.js"),i=require("../Img/index.js"),n=require("../common/Audio.js"),u=require("../common/Html/index.js"),l=require("../../../../../../common/api/utils.js"),c=require("../../../../../../common/error.js");exports.default=({node:d,href:m="",children:f})=>{const{accentColor:p,websiteMetadatas:h,actions:w,setWebsiteMetadatas:j}=a.usePickaxeMarkdownContext(),b=r.useMemo((()=>{if(!m)return"";return m.startsWith("http://")?`https://${m.slice(7)}`:m.startsWith("www.")?`https://${m}`:m}),[m]),g=r.useMemo((()=>{var e;const t=b.match(/(?:https?:\/\/)?(?:www\.)?(?:youtube\.com\/watch\?v=|youtu\.be\/)([\w-]+)/i);return t&&null!==(e=null==t?void 0:t[1])&&void 0!==e?e:null}),[b]),x=r.useMemo((()=>b.match(/\.(jpeg|jpg|gif|bmp|webp|svg|tiff|avif|png|jfif|pjpeg|pjp)$/)),[b]),v=r.useMemo((()=>b.includes("action_generated_files")&&b.match(/\.(mp3|wav|ogg|flac|aac|wma|alac|m4a|aiff|ape|au|mid|midi|opus)$/)),[b]),y=r.useMemo((()=>b.includes("action_generated_files")&&b.match(/\.html$/)),[b]),_=r.useMemo((()=>w&&b.includes("pickaxe")&&(b.includes("/api/fn/result")||b.includes("/api/function_call_results"))),[w,b]);return s.useQuery({queryKey:["website-metadata",b],queryFn:()=>e.__awaiter(void 0,void 0,void 0,(function*(){return t=b,e.__awaiter(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.default.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=c.default(e);console.error("[getJobResult]",t)}return null}}));var t})),enabled:!1,retry:2,onSuccess:e=>{e&&e.title&&(h.some((t=>t.href===e.href))||j((t=>[...t,e])))}}),g?t.jsx("div",Object.assign({className:"pxe-markdown-youtube",style:{display:"flex",width:"100%",justifyContent:"center"}},{children:t.jsx("iframe",Object.assign({title:"youtube-embed",src:`https://www.youtube.com/embed/${g}`,style:{width:"100%",maxWidth:"560px",minHeight:"315px",backgroundColor:"#000000"},allowFullScreen:!0},{children:"Iframe not supported, use a different browser."}))})):x?t.jsx(i.default,{src:b,alt:"string"==typeof f?f:"Markdown Image"}):v?t.jsx(n.default,{url:b}):y?t.jsx(u.default,{url:b}):_?t.jsx(o.default,{jobUrl:b}):t.jsx("a",Object.assign({href:b,target:"_blank",rel:"noopener noreferrer",style:{color:p}},{children:f}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../../../../_virtual/_tslib.js"),t=require("react/jsx-runtime"),r=require("react"),s=require("@tanstack/react-query"),a=require("../../hooks/usePickaxeMarkdownContext.js"),o=require("../common/Action.js"),i=require("../Img/index.js"),n=require("../common/Audio.js"),l=require("../common/Html/index.js"),u=require("../../../../../../common/api/utils.js"),c=require("../../../../../../common/error.js");exports.default=({node:d,href:m="",children:p})=>{const{accentColor:f,websiteMetadatas:w,actions:h,setWebsiteMetadatas:j}=a.usePickaxeMarkdownContext(),b=r.useMemo((()=>{if(!m)return"";return m.startsWith("http://")?`https://${m.slice(7)}`:m.startsWith("www.")?`https://${m}`:m}),[m]),v=r.useMemo((()=>{var e;const t=b.match(/(?:https?:\/\/)?(?:www\.)?loom\.com\/(?:share|embed)\/([\w-]+)/i);return t&&null!==(e=null==t?void 0:t[1])&&void 0!==e?e:null}),[b]),x=r.useMemo((()=>{var e;const t=b.match(/(?:https?:\/\/)?(?:www\.)?(?:youtube\.com\/watch\?v=|youtu\.be\/)([\w-]+)/i);return t&&null!==(e=null==t?void 0:t[1])&&void 0!==e?e:null}),[b]),g=r.useMemo((()=>b.match(/\.(jpeg|jpg|gif|bmp|webp|svg|tiff|avif|png|jfif|pjpeg|pjp)$/)),[b]),_=r.useMemo((()=>b.includes("action_generated_files")&&b.match(/\.(mp3|wav|ogg|flac|aac|wma|alac|m4a|aiff|ape|au|mid|midi|opus)$/)),[b]),y=r.useMemo((()=>b.includes("action_generated_files")&&b.match(/\.html$/)),[b]),q=r.useMemo((()=>h&&b.includes("pickaxe")&&(b.includes("/api/fn/result")||b.includes("/api/function_call_results"))),[h,b]);return s.useQuery({queryKey:["website-metadata",b],queryFn:()=>e.__awaiter(void 0,void 0,void 0,(function*(){return t=b,e.__awaiter(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 u.default.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=c.default(e);console.error("[getJobResult]",t)}return null}}));var t})),enabled:!1,retry:2,onSuccess:e=>{e&&e.title&&(w.some((t=>t.href===e.href))||j((t=>[...t,e])))}}),v?t.jsx("div",Object.assign({className:"pxe-markdown-loom"},{children:t.jsx("iframe",Object.assign({title:"loom-embed",src:`https://www.loom.com/embed/${v}`,allowFullScreen:!0,style:{width:"100%",maxWidth:"560px",aspectRatio:"16 / 9"}},{children:"Iframe not supported, use a different browser."}))})):x?t.jsx("div",Object.assign({className:"pxe-markdown-youtube"},{children:t.jsx("iframe",Object.assign({title:"youtube-embed",src:`https://www.youtube.com/embed/${x}`,allowFullScreen:!0,style:{width:"100%",maxWidth:"560px",aspectRatio:"16 / 9"}},{children:"Iframe not supported, use a different browser."}))})):g?t.jsx(i.default,{src:b,alt:"string"==typeof p?p:"Markdown Image"}):_?t.jsx(n.default,{url:b}):y?t.jsx(l.default,{url:b}):q?t.jsx(o.default,{jobUrl:b}):t.jsx("a",Object.assign({href:b,target:"_blank",rel:"noopener noreferrer",style:{color:f}},{children:p}))};
@@ -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({className:"pxe-markdown-youtube",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({style:{display:"flex",flexDirection:"column"}},{children:[e.jsx("p",{children:t}),e.jsx(s.default,{jobUrl:(null==i?void 0:i[0])||""})]}))}return e.jsx("p",{children:n})};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),s=require("../../hooks/usePickaxeMarkdownContext.js"),r=require("../common/Action.js");exports.default=({node:i,children:l})=>{const{actions:n}=s.usePickaxeMarkdownContext(),o=t.useMemo((()=>{var e;if("string"!=typeof l)return null;const t=l.match(/(?:https?:\/\/)?(?:www\.)?loom\.com\/(?:share|embed)\/([\w-]+)/i);return t&&null!==(e=null==t?void 0:t[1])&&void 0!==e?e:null}),[l]),u=t.useMemo((()=>{var e;if("string"!=typeof l)return null;const t=l.match(/(?:https?:\/\/)?(?:www\.)?(?:youtube\.com\/watch\?v=|youtu\.be\/)([\w-]+)/i);return t&&null!==(e=null==t?void 0:t[1])&&void 0!==e?e:null}),[l]);if(o)return e.jsx("div",Object.assign({className:"pxe-markdown-loom"},{children:e.jsx("iframe",Object.assign({title:"loom-embed",src:`https://www.loom.com/embed/${o}`,allowFullScreen:!0,style:{width:"100%",maxWidth:"560px",aspectRatio:"16 / 9"}},{children:"Iframe not supported, use a different browser."}))}));if(u)return e.jsx("div",Object.assign({className:"pxe-markdown-youtube"},{children:e.jsx("iframe",Object.assign({title:"youtube-embed",src:`https://www.youtube.com/embed/${u}`,allowFullScreen:!0,style:{width:"100%",maxWidth:"560px",aspectRatio:"16 / 9"}},{children:"Iframe not supported, use a different browser."}))}));if(n&&"string"==typeof l&&l.includes("pickaxe")&&(l.includes("/api/fn/result")||l.includes("/api/function_call_results"))){const t=l.replace(/https:\/\/\S*(\/api\/fn\/result|\/api\/function_call_results)\S*/g,""),s=l.match(/https:\/\/\S*(\/api\/fn\/result|\/api\/function_call_results)\S*/g);return e.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"column"}},{children:[e.jsx("p",{children:t}),e.jsx(r.default,{jobUrl:(null==s?void 0:s[0])||""})]}))}return e.jsx("p",{children:l})};
@@ -1 +1 @@
1
- .pxe-prose p{font-weight:350}.pxe-prose p:not(:only-child){margin-bottom:.75rem}.pxe-prose a{font-weight:600;text-decoration:underline;text-underline-offset:.2rem}.pxe-prose iframe{margin-bottom:1.5rem}.pxe-prose blockquote{margin-bottom:2.5rem;padding-bottom:.25rem;padding-left:1rem;padding-top:.25rem}.pxe-prose hr{margin-bottom:1.5rem}.pxe-prose .pxe-markdown-image,.pxe-prose .pxe-markdown-youtube{margin-bottom:1.5rem;margin-top:1.5rem}.pxe-prose .pxe-markdown-code{margin-bottom:1.5rem}.pxe-prose ol{list-style-type:decimal}.pxe-prose ol,.pxe-prose ul{list-style-position:inside;margin-bottom:1.5rem;padding-left:1rem}.pxe-prose ul{list-style-type:disc}.pxe-prose li{margin:10px 10px 14px}.pxe-prose li>p{display:inline}.pxe-prose .pxe-markdown-table{margin-bottom:2.5rem;overflow:auto;position:relative}.pxe-prose table{font-size:.875rem;line-height:1.24rem;table-layout:fixed}.pxe-prose th{font-weight:600;text-align:left}.pxe-prose td,.pxe-prose th{padding:.75em 1em}.pxe-prose h1{font-size:2.25rem;line-height:2.5rem;margin-bottom:1.5rem}.pxe-prose h2{font-size:1.875rem;line-height:2.25rem;margin-bottom:1.5rem}.pxe-prose h3{font-size:1.5rem;line-height:2rem;margin-bottom:1.5rem}.pxe-prose h4{font-size:1.25rem}.pxe-prose h4,.pxe-prose h5{line-height:1.75rem;margin-bottom:1rem}.pxe-prose h5{font-size:1.125rem}.pxe-prose h2:not(:first-child),.pxe-prose h3:not(:first-child),.pxe-prose h4:not(:first-child),.pxe-prose h5:not(:first-child){margin-top:2.5rem}.pxe-prose>pre:not(:first-child){margin-top:1rem}.pxe-prose .pxe-markdown-code{display:flex;flex-direction:column}.pxe-prose .pxe-markdown-code>div:first-child{background-color:#1d1f21;border-radius:.3em;display:flex;flex-direction:column;max-width:min-content;padding-top:1em;position:relative}.pxe-prose .pxe-markdown-code>div:first-child>div:first-child{display:flex;justify-content:flex-end;padding:0 1em}.pxe-prose .pxe-markdown-code>div:first-child>div:last-child{overflow:auto}.pxe-prose .pxe-action[data-action-id]:not(:nth-child(2)){margin-top:1rem}.pxe-prose .pxe-markdown-code-inline{background-color:#1d1f21;border-radius:.3em;color:#fff;font-size:10pt;padding:.15em .4em}.pxe-prose .pxe-animated-token{animation:fadeIn .3s ease-out forwards;display:inline-block;opacity:0}.pxe-link-previews{display:flex;flex-direction:column;gap:2rem}.pxe-prose>p:first-child>.pxe-markdown-image,.pxe-prose>p:first-child>.pxe-markdown-youtube{margin-top:0}@keyframes fadeIn{0%{opacity:0;transform:translateX(5px)}to{opacity:1;transform:translateX(0)}}
1
+ .pxe-prose p{font-weight:350}.pxe-prose p:not(:only-child){margin-bottom:.75rem}.pxe-prose a{font-weight:600;text-decoration:underline;text-underline-offset:.2rem}.pxe-prose iframe{margin-bottom:1.5rem}.pxe-prose blockquote{margin-bottom:2.5rem;padding-bottom:.25rem;padding-left:1rem;padding-top:.25rem}.pxe-prose hr{margin-bottom:1.5rem}.pxe-prose .pxe-markdown-image,.pxe-prose .pxe-markdown-loom{margin-bottom:1.5rem;margin-top:1.5rem}.pxe-prose .pxe-markdown-loom,.pxe-prose .pxe-markdown-youtube{display:flex;justify-content:center;width:100%}.pxe-prose .pxe-markdown-youtube{margin-bottom:1.5rem;margin-top:1.5rem}.pxe-prose .pxe-markdown-code{margin-bottom:1.5rem}.pxe-prose ol{list-style-type:decimal}.pxe-prose ol,.pxe-prose ul{list-style-position:inside;margin-bottom:1.5rem;padding-left:1rem}.pxe-prose ul{list-style-type:disc}.pxe-prose li{margin:10px 10px 14px}.pxe-prose li>p{display:inline}.pxe-prose .pxe-markdown-table{margin-bottom:2.5rem;overflow:auto;position:relative}.pxe-prose table{font-size:.875rem;line-height:1.24rem;table-layout:fixed}.pxe-prose th{font-weight:600;text-align:left}.pxe-prose td,.pxe-prose th{padding:.75em 1em}.pxe-prose h1{font-size:2.25rem;line-height:2.5rem;margin-bottom:1.5rem}.pxe-prose h2{font-size:1.875rem;line-height:2.25rem;margin-bottom:1.5rem}.pxe-prose h3{font-size:1.5rem;line-height:2rem;margin-bottom:1.5rem}.pxe-prose h4{font-size:1.25rem}.pxe-prose h4,.pxe-prose h5{line-height:1.75rem;margin-bottom:1rem}.pxe-prose h5{font-size:1.125rem}.pxe-prose h2:not(:first-child),.pxe-prose h3:not(:first-child),.pxe-prose h4:not(:first-child),.pxe-prose h5:not(:first-child){margin-top:2.5rem}.pxe-prose>pre:not(:first-child){margin-top:1rem}.pxe-prose .pxe-markdown-code{display:flex;flex-direction:column}.pxe-prose .pxe-markdown-code>div:first-child{background-color:#1d1f21;border-radius:.3em;display:flex;flex-direction:column;max-width:min-content;padding-top:1em;position:relative}.pxe-prose .pxe-markdown-code>div:first-child>div:first-child{display:flex;justify-content:flex-end;padding:0 1em}.pxe-prose .pxe-markdown-code>div:first-child>div:last-child{overflow:auto}.pxe-prose .pxe-action[data-action-id]:not(:nth-child(2)){margin-top:1rem}.pxe-prose .pxe-markdown-code-inline{background-color:#1d1f21;border-radius:.3em;color:#fff;font-size:10pt;padding:.15em .4em}.pxe-prose .pxe-animated-token{animation:fadeIn .3s ease-out forwards;display:inline-block;opacity:0}.pxe-link-previews{display:flex;flex-direction:column;gap:2rem}.pxe-prose>p:first-child>.pxe-markdown-image,.pxe-prose>p:first-child>.pxe-markdown-youtube{margin-top:0}@keyframes fadeIn{0%{opacity:0;transform:translateX(5px)}to{opacity:1;transform:translateX(0)}}
@@ -1,4 +1,4 @@
1
- import type { FC, ComponentPropsWithoutRef } from "react";
1
+ import { type FC, type ComponentPropsWithoutRef } from "react";
2
2
  import type { Node } from "../../Renderer";
3
3
  declare const P: FC<ComponentPropsWithoutRef<"p"> & Node>;
4
4
  export default P;
@@ -1 +1 @@
1
- import{__awaiter as e}from"../../../../../../_virtual/_tslib.js";import{jsx as t}from"react/jsx-runtime";import{useMemo as r}from"react";import{useQuery as o}from"@tanstack/react-query";import{usePickaxeMarkdownContext as i}from"../../hooks/usePickaxeMarkdownContext.js";import a from"../common/Action.js";import n from"../Img/index.js";import s from"../common/Audio.js";import l from"../common/Html/index.js";import c from"../../../../../../common/api/utils.js";import m from"../../../../../../common/error.js";const u=({node:u,href:d="",children:p})=>{const{accentColor:f,websiteMetadatas:h,actions:w,setWebsiteMetadatas:b}=i(),g=r((()=>{if(!d)return"";return d.startsWith("http://")?`https://${d.slice(7)}`:d.startsWith("www.")?`https://${d}`:d}),[d]),v=r((()=>{var e;const t=g.match(/(?:https?:\/\/)?(?:www\.)?(?:youtube\.com\/watch\?v=|youtu\.be\/)([\w-]+)/i);return t&&null!==(e=null==t?void 0:t[1])&&void 0!==e?e:null}),[g]),j=r((()=>g.match(/\.(jpeg|jpg|gif|bmp|webp|svg|tiff|avif|png|jfif|pjpeg|pjp)$/)),[g]),y=r((()=>g.includes("action_generated_files")&&g.match(/\.(mp3|wav|ogg|flac|aac|wma|alac|m4a|aiff|ape|au|mid|midi|opus)$/)),[g]),x=r((()=>g.includes("action_generated_files")&&g.match(/\.html$/)),[g]),_=r((()=>w&&g.includes("pickaxe")&&(g.includes("/api/fn/result")||g.includes("/api/function_call_results"))),[w,g]);return o({queryKey:["website-metadata",g],queryFn:()=>e(void 0,void 0,void 0,(function*(){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=m(e);console.error("[getJobResult]",t)}return null}}));var t})),enabled:!1,retry:2,onSuccess:e=>{e&&e.title&&(h.some((t=>t.href===e.href))||b((t=>[...t,e])))}}),v?t("div",Object.assign({className:"pxe-markdown-youtube",style:{display:"flex",width:"100%",justifyContent:"center"}},{children:t("iframe",Object.assign({title:"youtube-embed",src:`https://www.youtube.com/embed/${v}`,style:{width:"100%",maxWidth:"560px",minHeight:"315px",backgroundColor:"#000000"},allowFullScreen:!0},{children:"Iframe not supported, use a different browser."}))})):j?t(n,{src:g,alt:"string"==typeof p?p:"Markdown Image"}):y?t(s,{url:g}):x?t(l,{url:g}):_?t(a,{jobUrl:g}):t("a",Object.assign({href:g,target:"_blank",rel:"noopener noreferrer",style:{color:f}},{children:p}))};export{u as default};
1
+ import{__awaiter as e}from"../../../../../../_virtual/_tslib.js";import{jsx as t}from"react/jsx-runtime";import{useMemo as r}from"react";import{useQuery as o}from"@tanstack/react-query";import{usePickaxeMarkdownContext as a}from"../../hooks/usePickaxeMarkdownContext.js";import s from"../common/Action.js";import i from"../Img/index.js";import n from"../common/Audio.js";import l from"../common/Html/index.js";import c from"../../../../../../common/api/utils.js";import m from"../../../../../../common/error.js";const u=({node:u,href:d="",children:p})=>{const{accentColor:f,websiteMetadatas:h,actions:w,setWebsiteMetadatas:b}=a(),v=r((()=>{if(!d)return"";return d.startsWith("http://")?`https://${d.slice(7)}`:d.startsWith("www.")?`https://${d}`:d}),[d]),g=r((()=>{var e;const t=v.match(/(?:https?:\/\/)?(?:www\.)?loom\.com\/(?:share|embed)\/([\w-]+)/i);return t&&null!==(e=null==t?void 0:t[1])&&void 0!==e?e:null}),[v]),j=r((()=>{var e;const t=v.match(/(?:https?:\/\/)?(?:www\.)?(?:youtube\.com\/watch\?v=|youtu\.be\/)([\w-]+)/i);return t&&null!==(e=null==t?void 0:t[1])&&void 0!==e?e:null}),[v]),y=r((()=>v.match(/\.(jpeg|jpg|gif|bmp|webp|svg|tiff|avif|png|jfif|pjpeg|pjp)$/)),[v]),x=r((()=>v.includes("action_generated_files")&&v.match(/\.(mp3|wav|ogg|flac|aac|wma|alac|m4a|aiff|ape|au|mid|midi|opus)$/)),[v]),_=r((()=>v.includes("action_generated_files")&&v.match(/\.html$/)),[v]),k=r((()=>w&&v.includes("pickaxe")&&(v.includes("/api/fn/result")||v.includes("/api/function_call_results"))),[w,v]);return o({queryKey:["website-metadata",v],queryFn:()=>e(void 0,void 0,void 0,(function*(){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 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=m(e);console.error("[getJobResult]",t)}return null}}));var t})),enabled:!1,retry:2,onSuccess:e=>{e&&e.title&&(h.some((t=>t.href===e.href))||b((t=>[...t,e])))}}),g?t("div",Object.assign({className:"pxe-markdown-loom"},{children:t("iframe",Object.assign({title:"loom-embed",src:`https://www.loom.com/embed/${g}`,allowFullScreen:!0,style:{width:"100%",maxWidth:"560px",aspectRatio:"16 / 9"}},{children:"Iframe not supported, use a different browser."}))})):j?t("div",Object.assign({className:"pxe-markdown-youtube"},{children:t("iframe",Object.assign({title:"youtube-embed",src:`https://www.youtube.com/embed/${j}`,allowFullScreen:!0,style:{width:"100%",maxWidth:"560px",aspectRatio:"16 / 9"}},{children:"Iframe not supported, use a different browser."}))})):y?t(i,{src:v,alt:"string"==typeof p?p:"Markdown Image"}):x?t(n,{url:v}):_?t(l,{url:v}):k?t(s,{jobUrl:v}):t("a",Object.assign({href:v,target:"_blank",rel:"noopener noreferrer",style:{color:f}},{children:p}))};export{u as default};
@@ -1 +1 @@
1
- import{jsx as e,jsxs as t}from"react/jsx-runtime";import{usePickaxeMarkdownContext as i}from"../../hooks/usePickaxeMarkdownContext.js";import n from"../common/Action.js";const s=({node:s,children:l})=>{const{actions:r}=i(),o="string"==typeof l&&l.match(/(?:https?:\/\/)?(?:www\.)?(?:youtube\.com\/watch\?v=|youtu\.be\/)([\w-]+)/i);if(o&&(null==o?void 0:o[1]))return e("div",Object.assign({className:"pxe-markdown-youtube",style:{display:"flex",width:"100%",justifyContent:"center"}},{children:e("iframe",Object.assign({title:"youtube-embed",src:`https://www.youtube.com/embed/${o[1]}`,style:{width:"100%",maxWidth:"560px",minHeight:"315px"},allowFullScreen:!0},{children:"Iframe not supported, use a different browser."}))}));if(r&&"string"==typeof l&&l.includes("pickaxe")&&(l.includes("/api/fn/result")||l.includes("/api/function_call_results"))){const i=l.replace(/https:\/\/\S*(\/api\/fn\/result|\/api\/function_call_results)\S*/g,""),s=l.match(/https:\/\/\S*(\/api\/fn\/result|\/api\/function_call_results)\S*/g);return t("div",Object.assign({style:{display:"flex",flexDirection:"column"}},{children:[e("p",{children:i}),e(n,{jobUrl:(null==s?void 0:s[0])||""})]}))}return e("p",{children:l})};export{s as default};
1
+ import{jsx as e,jsxs as t}from"react/jsx-runtime";import{useMemo as r}from"react";import{usePickaxeMarkdownContext as i}from"../../hooks/usePickaxeMarkdownContext.js";import l from"../common/Action.js";const n=({node:n,children:o})=>{const{actions:s}=i(),c=r((()=>{var e;if("string"!=typeof o)return null;const t=o.match(/(?:https?:\/\/)?(?:www\.)?loom\.com\/(?:share|embed)\/([\w-]+)/i);return t&&null!==(e=null==t?void 0:t[1])&&void 0!==e?e:null}),[o]),a=r((()=>{var e;if("string"!=typeof o)return null;const t=o.match(/(?:https?:\/\/)?(?:www\.)?(?:youtube\.com\/watch\?v=|youtu\.be\/)([\w-]+)/i);return t&&null!==(e=null==t?void 0:t[1])&&void 0!==e?e:null}),[o]);if(c)return e("div",Object.assign({className:"pxe-markdown-loom"},{children:e("iframe",Object.assign({title:"loom-embed",src:`https://www.loom.com/embed/${c}`,allowFullScreen:!0,style:{width:"100%",maxWidth:"560px",aspectRatio:"16 / 9"}},{children:"Iframe not supported, use a different browser."}))}));if(a)return e("div",Object.assign({className:"pxe-markdown-youtube"},{children:e("iframe",Object.assign({title:"youtube-embed",src:`https://www.youtube.com/embed/${a}`,allowFullScreen:!0,style:{width:"100%",maxWidth:"560px",aspectRatio:"16 / 9"}},{children:"Iframe not supported, use a different browser."}))}));if(s&&"string"==typeof o&&o.includes("pickaxe")&&(o.includes("/api/fn/result")||o.includes("/api/function_call_results"))){const r=o.replace(/https:\/\/\S*(\/api\/fn\/result|\/api\/function_call_results)\S*/g,""),i=o.match(/https:\/\/\S*(\/api\/fn\/result|\/api\/function_call_results)\S*/g);return t("div",Object.assign({style:{display:"flex",flexDirection:"column"}},{children:[e("p",{children:r}),e(l,{jobUrl:(null==i?void 0:i[0])||""})]}))}return e("p",{children:o})};export{n as default};
@@ -1 +1 @@
1
- .pxe-prose p{font-weight:350}.pxe-prose p:not(:only-child){margin-bottom:.75rem}.pxe-prose a{font-weight:600;text-decoration:underline;text-underline-offset:.2rem}.pxe-prose iframe{margin-bottom:1.5rem}.pxe-prose blockquote{margin-bottom:2.5rem;padding-bottom:.25rem;padding-left:1rem;padding-top:.25rem}.pxe-prose hr{margin-bottom:1.5rem}.pxe-prose .pxe-markdown-image,.pxe-prose .pxe-markdown-youtube{margin-bottom:1.5rem;margin-top:1.5rem}.pxe-prose .pxe-markdown-code{margin-bottom:1.5rem}.pxe-prose ol{list-style-type:decimal}.pxe-prose ol,.pxe-prose ul{list-style-position:inside;margin-bottom:1.5rem;padding-left:1rem}.pxe-prose ul{list-style-type:disc}.pxe-prose li{margin:10px 10px 14px}.pxe-prose li>p{display:inline}.pxe-prose .pxe-markdown-table{margin-bottom:2.5rem;overflow:auto;position:relative}.pxe-prose table{font-size:.875rem;line-height:1.24rem;table-layout:fixed}.pxe-prose th{font-weight:600;text-align:left}.pxe-prose td,.pxe-prose th{padding:.75em 1em}.pxe-prose h1{font-size:2.25rem;line-height:2.5rem;margin-bottom:1.5rem}.pxe-prose h2{font-size:1.875rem;line-height:2.25rem;margin-bottom:1.5rem}.pxe-prose h3{font-size:1.5rem;line-height:2rem;margin-bottom:1.5rem}.pxe-prose h4{font-size:1.25rem}.pxe-prose h4,.pxe-prose h5{line-height:1.75rem;margin-bottom:1rem}.pxe-prose h5{font-size:1.125rem}.pxe-prose h2:not(:first-child),.pxe-prose h3:not(:first-child),.pxe-prose h4:not(:first-child),.pxe-prose h5:not(:first-child){margin-top:2.5rem}.pxe-prose>pre:not(:first-child){margin-top:1rem}.pxe-prose .pxe-markdown-code{display:flex;flex-direction:column}.pxe-prose .pxe-markdown-code>div:first-child{background-color:#1d1f21;border-radius:.3em;display:flex;flex-direction:column;max-width:min-content;padding-top:1em;position:relative}.pxe-prose .pxe-markdown-code>div:first-child>div:first-child{display:flex;justify-content:flex-end;padding:0 1em}.pxe-prose .pxe-markdown-code>div:first-child>div:last-child{overflow:auto}.pxe-prose .pxe-action[data-action-id]:not(:nth-child(2)){margin-top:1rem}.pxe-prose .pxe-markdown-code-inline{background-color:#1d1f21;border-radius:.3em;color:#fff;font-size:10pt;padding:.15em .4em}.pxe-prose .pxe-animated-token{animation:fadeIn .3s ease-out forwards;display:inline-block;opacity:0}.pxe-link-previews{display:flex;flex-direction:column;gap:2rem}.pxe-prose>p:first-child>.pxe-markdown-image,.pxe-prose>p:first-child>.pxe-markdown-youtube{margin-top:0}@keyframes fadeIn{0%{opacity:0;transform:translateX(5px)}to{opacity:1;transform:translateX(0)}}
1
+ .pxe-prose p{font-weight:350}.pxe-prose p:not(:only-child){margin-bottom:.75rem}.pxe-prose a{font-weight:600;text-decoration:underline;text-underline-offset:.2rem}.pxe-prose iframe{margin-bottom:1.5rem}.pxe-prose blockquote{margin-bottom:2.5rem;padding-bottom:.25rem;padding-left:1rem;padding-top:.25rem}.pxe-prose hr{margin-bottom:1.5rem}.pxe-prose .pxe-markdown-image,.pxe-prose .pxe-markdown-loom{margin-bottom:1.5rem;margin-top:1.5rem}.pxe-prose .pxe-markdown-loom,.pxe-prose .pxe-markdown-youtube{display:flex;justify-content:center;width:100%}.pxe-prose .pxe-markdown-youtube{margin-bottom:1.5rem;margin-top:1.5rem}.pxe-prose .pxe-markdown-code{margin-bottom:1.5rem}.pxe-prose ol{list-style-type:decimal}.pxe-prose ol,.pxe-prose ul{list-style-position:inside;margin-bottom:1.5rem;padding-left:1rem}.pxe-prose ul{list-style-type:disc}.pxe-prose li{margin:10px 10px 14px}.pxe-prose li>p{display:inline}.pxe-prose .pxe-markdown-table{margin-bottom:2.5rem;overflow:auto;position:relative}.pxe-prose table{font-size:.875rem;line-height:1.24rem;table-layout:fixed}.pxe-prose th{font-weight:600;text-align:left}.pxe-prose td,.pxe-prose th{padding:.75em 1em}.pxe-prose h1{font-size:2.25rem;line-height:2.5rem;margin-bottom:1.5rem}.pxe-prose h2{font-size:1.875rem;line-height:2.25rem;margin-bottom:1.5rem}.pxe-prose h3{font-size:1.5rem;line-height:2rem;margin-bottom:1.5rem}.pxe-prose h4{font-size:1.25rem}.pxe-prose h4,.pxe-prose h5{line-height:1.75rem;margin-bottom:1rem}.pxe-prose h5{font-size:1.125rem}.pxe-prose h2:not(:first-child),.pxe-prose h3:not(:first-child),.pxe-prose h4:not(:first-child),.pxe-prose h5:not(:first-child){margin-top:2.5rem}.pxe-prose>pre:not(:first-child){margin-top:1rem}.pxe-prose .pxe-markdown-code{display:flex;flex-direction:column}.pxe-prose .pxe-markdown-code>div:first-child{background-color:#1d1f21;border-radius:.3em;display:flex;flex-direction:column;max-width:min-content;padding-top:1em;position:relative}.pxe-prose .pxe-markdown-code>div:first-child>div:first-child{display:flex;justify-content:flex-end;padding:0 1em}.pxe-prose .pxe-markdown-code>div:first-child>div:last-child{overflow:auto}.pxe-prose .pxe-action[data-action-id]:not(:nth-child(2)){margin-top:1rem}.pxe-prose .pxe-markdown-code-inline{background-color:#1d1f21;border-radius:.3em;color:#fff;font-size:10pt;padding:.15em .4em}.pxe-prose .pxe-animated-token{animation:fadeIn .3s ease-out forwards;display:inline-block;opacity:0}.pxe-link-previews{display:flex;flex-direction:column;gap:2rem}.pxe-prose>p:first-child>.pxe-markdown-image,.pxe-prose>p:first-child>.pxe-markdown-youtube{margin-top:0}@keyframes fadeIn{0%{opacity:0;transform:translateX(5px)}to{opacity:1;transform:translateX(0)}}
@@ -1,4 +1,4 @@
1
- import type { FC, ComponentPropsWithoutRef } from "react";
1
+ import { type FC, type ComponentPropsWithoutRef } from "react";
2
2
  import type { Node } from "../../Renderer";
3
3
  declare const P: FC<ComponentPropsWithoutRef<"p"> & Node>;
4
4
  export default P;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pickaxeproject/react",
3
- "version": "1.3.4",
3
+ "version": "1.3.6",
4
4
  "description": "Client utility library for Pickaxe",
5
5
  "repository": {
6
6
  "type": "git",