@pickaxeproject/react 0.0.32 → 0.0.34
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/A.js +1 -1
- package/dist/cjs/components/Pickaxe/common/PickaxeMarkdown/Img.js +1 -0
- 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/src/components/Pickaxe/common/PickaxeMarkdown/Img.d.ts +4 -0
- package/dist/cjs/src/components/Pickaxe/common/PickaxeMarkdown/Renderer.d.ts +3 -1
- package/dist/cjs/src/components/Pickaxe/common/PickaxeMarkdown/hooks/usePickaxeMarkdownContext.d.ts +2 -0
- package/dist/cjs/src/components/Pickaxe/common/PickaxeMarkdown/index.d.ts +4 -2
- package/dist/esm/components/Pickaxe/common/PickaxeMarkdown/A.js +1 -1
- package/dist/esm/components/Pickaxe/common/PickaxeMarkdown/Img.js +1 -0
- 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/src/components/Pickaxe/common/PickaxeMarkdown/Img.d.ts +4 -0
- package/dist/esm/src/components/Pickaxe/common/PickaxeMarkdown/Renderer.d.ts +3 -1
- package/dist/esm/src/components/Pickaxe/common/PickaxeMarkdown/hooks/usePickaxeMarkdownContext.d.ts +2 -0
- package/dist/esm/src/components/Pickaxe/common/PickaxeMarkdown/index.d.ts +4 -2
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("./hooks/usePickaxeMarkdownContext.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("./hooks/usePickaxeMarkdownContext.js"),r=require("../../../../common/lotties/loader-black.js"),i=require("../../../../common/lotties/loader-white.js"),s=require("react-lottie"),a=require("./Img.js");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n=o(s);exports.default=({node:s,href:o="",children:l})=>{const{theme:c,accentColor:u,linkPreviews:d,actions:m}=t.usePickaxeMarkdownContext(),p=(o||"").startsWith("www.")?`https://${o}`:o,f=p.match(/(?:https?:\/\/)?(?:www\.)?(?:youtube\.com\/watch\?v=|youtu\.be\/)([\w-]+)/i);if(f&&(null==f?void 0:f[1]))return e.jsx("div",Object.assign({style:{marginTop:"2.5rem",marginBottom:"2.5rem",display:"flex",width:"100%",justifyContent:"center"}},{children:e.jsx("iframe",Object.assign({title:"youtube-embed",src:`https://www.youtube.com/embed/${f[1]}`,style:{width:"100%",maxWidth:"560px"},allowFullScreen:!0},{children:"Iframe not supported, use a different browser."}))}));return p.match(/\.(jpeg|jpg|gif|bmp|webp|svg|tiff|avif)$/)?e.jsx(a.default,{src:p,alt:"string"==typeof l?l:"Markdown Image"}):m&&p.includes("pickaxe")&&(p.includes("/api/fn/result")||p.includes("/api/function_call_results"))?e.jsx("div",Object.assign({className:"marked-link-function-calling-loader",style:{width:"100%",maxWidth:"150px",minHeight:"150px"}},{children:e.jsx(n.default,{style:{cursor:"default",pointerEvents:"none"},options:{autoplay:!0,loop:!0,animationData:"dark"===c?i.loaderWhite:r.loaderBlack},isClickToPauseDisabled:!0,width:150,height:150})})):e.jsx("a",Object.assign({href:p,target:"_blank",rel:"noopener noreferrer"},d&&{className:"marked-link-possible-preview-render"},{style:{color:u,fontWeight:600}},{children:l}))};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react");exports.default=({node:r,src:s,alt:i})=>{const[n,a]=t.useState(!1);return e.jsx("div",Object.assign({style:{marginTop:"2.5rem",marginBottom:"2.5rem",display:"flex",width:"100%",justifyContent:"center"}},{children:n?e.jsx("p",Object.assign({style:{userSelect:"none",opacity:.5,fontStyle:"italic"}},{children:"[Image link is broken]"})):e.jsx("img",{src:s,alt:i,style:{borderRadius:"8px",maxWidth:"680px"},onError:()=>a(!0)})}))};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../../_virtual/_tslib.js"),
|
|
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-syntax-highlighter"),s=require("react-markdown"),l=require("remark-gfm"),a=require("remark-math"),d=require("rehype-katex"),o=require("./A.js"),c=require("./Img.js");function m(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var h=m(s),g=m(l),j=m(a),u=m(d);exports.PickaxeMarkdownRenderer=({className:s,style:l,value:a})=>{const{theme:d,syntaxTheme:m}=t.usePickaxeMarkdownContext(),x=i.useRef(null),b={h1:({node:e,children:i})=>r.jsx("h1",Object.assign({style:{fontSize:"2.25rem",lineHeight:"2.5rem",marginTop:"1rem",marginBottom:"1.5rem"}},{children:i})),h2:({node:e,children:i})=>r.jsx("h2",Object.assign({style:{fontSize:"1.875rem",lineHeight:"2.25rem",marginTop:"1.25rem",marginBottom:"1.25rem"}},{children:i})),h3:({node:e,children:i})=>r.jsx("h3",Object.assign({style:{fontSize:"1.5rem",lineHeight:"2rem",marginBottom:"1rem"}},{children:i})),h4:({node:e,children:i})=>r.jsx("h4",Object.assign({className:"mt-2 text-xl",style:{fontSize:"1.25rem",lineHeight:"1.75rem",marginBottom:"0.75rem"}},{children:i})),h5:({node:e,children:i})=>r.jsx("h5",Object.assign({style:{fontSize:"1.125rem",lineHeight:"1.75rem"}},{children:i})),p:({node:e,children:i})=>r.jsx("p",Object.assign({style:{fontWeight:350}},{children:i})),a:o.default,ol:({node:e,children:i})=>r.jsx("ol",Object.assign({style:{listStyleType:"decimal",listStylePosition:"inside",paddingLeft:"1.5rem",marginTop:"1rem",marginBottom:"2rem"}},{children:i})),ul:({node:e,children:i})=>r.jsx("ul",Object.assign({style:{listStyleType:"disc",listStylePosition:"inside",paddingLeft:"1.5rem",marginTop:"1rem",marginBottom:"2rem"}},{children:i})),li:({node:e,children:i})=>r.jsx("li",Object.assign({style:{marginBottom:"0.75rem"}},{children:i})),table:({children:e})=>r.jsx("div",Object.assign({className:"overflow-auto"},{children:r.jsx("table",Object.assign({style:{tableLayout:"fixed",fontSize:"0.875rem",lineHeight:"1.24rem",marginBottom:"1.5rem"}},{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"===d?"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:i=>{var{node:t,children:s,className:l}=i,a=e.__rest(i,["node","children","className"]);const d=/language-(\w+)/.exec(l||"");return d?r.jsx(n.Prism,Object.assign({},a,{PreTag:"div",language:d[1],style:m,showLineNumbers:!0},{children:String(s).replace(/\n$/,"")})):r.jsx("code",Object.assign({},a,{className:l},{children:s}))},blockquote:({node:e,children:i})=>r.jsx("blockquote",Object.assign({style:{borderLeft:"dark"===d?"4px solid #30363D":"4px solid #D0D7DE",color:"dark"===d?"#8B8B8B":"#656D76",paddingLeft:"1rem",marginBottom:"1.5rem"}},{children:i})),img:c.default};return r.jsx("div",Object.assign({className:"pxe-markdown",ref:x,style:Object.assign({position:"relative",whiteSpace:"pre-wrap"},l)},{children:r.jsx(h.default,Object.assign({},s&&{className:s},{components:b,remarkPlugins:[g.default,j.default],rehypePlugins:[u.default]},{children:(null!=a?a:"").replace(/\u200B/g,"")}))}))};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var o=require("react/jsx-runtime"),e=require("react");const r=e.createContext({}),t=({children:t,theme:n="light",syntaxTheme:c,accentColor:a="#228DD7",linkPreviews:l=!1,actions:i=!1})=>{const[s,d]=e.useState(n),[p,u]=e.useState(a),[C,F]=e.useState(l),[g,m]=e.useState(i);return o.jsx(r.Provider,Object.assign({value:{theme:s,syntaxTheme:c||{'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"},'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",margin:".5em 0",overflow:"auto",borderRadius:"0.3em",background:"#1d1f21"},':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"}},accentColor:p,linkPreviews:C,actions:g,setTheme:d,setAccentColor:u,setLinkPreviews:F,setActions:m}},{children:t}))};exports.PickaxeMarkdown=t,exports.PickaxeMarkdownContext=r,exports.default=t;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
import { CSSProperties } from "react";
|
|
1
2
|
interface PickaxeMarkdownRendererProps {
|
|
2
3
|
className?: string;
|
|
4
|
+
style?: CSSProperties;
|
|
3
5
|
value?: string | null;
|
|
4
6
|
}
|
|
5
7
|
export type Node = {
|
|
6
8
|
node?: any;
|
|
7
9
|
};
|
|
8
|
-
export declare const PickaxeMarkdownRenderer: ({ className, value, }: PickaxeMarkdownRendererProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export declare const PickaxeMarkdownRenderer: ({ className, style, value, }: PickaxeMarkdownRendererProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
11
|
export {};
|
package/dist/cjs/src/components/Pickaxe/common/PickaxeMarkdown/hooks/usePickaxeMarkdownContext.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
export declare const usePickaxeMarkdownContext: () => {
|
|
2
3
|
theme?: ("light" | "dark") | undefined;
|
|
4
|
+
syntaxTheme?: Record<string, import("react").CSSProperties> | undefined;
|
|
3
5
|
accentColor?: string | undefined;
|
|
4
6
|
linkPreviews?: boolean | undefined;
|
|
5
7
|
actions?: boolean | undefined;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type { SetState } from "../../../../types/common";
|
|
2
|
-
import { type ReactNode } from "react";
|
|
2
|
+
import { type CSSProperties, type ReactNode } from "react";
|
|
3
3
|
type PickaxeMarkdownTheme = "light" | "dark";
|
|
4
4
|
type PickaxeMarkdownContextType = {
|
|
5
5
|
theme?: PickaxeMarkdownTheme;
|
|
6
|
+
syntaxTheme?: Record<string, CSSProperties>;
|
|
6
7
|
accentColor?: string;
|
|
7
8
|
linkPreviews?: boolean;
|
|
8
9
|
actions?: boolean;
|
|
@@ -14,10 +15,11 @@ type PickaxeMarkdownContextType = {
|
|
|
14
15
|
interface PickaxeMarkdownProps {
|
|
15
16
|
children: ReactNode;
|
|
16
17
|
theme?: PickaxeMarkdownTheme;
|
|
18
|
+
syntaxTheme?: Record<string, CSSProperties>;
|
|
17
19
|
accentColor?: string;
|
|
18
20
|
linkPreviews?: boolean;
|
|
19
21
|
actions?: boolean;
|
|
20
22
|
}
|
|
21
23
|
export declare const PickaxeMarkdownContext: import("react").Context<PickaxeMarkdownContextType>;
|
|
22
|
-
export declare const PickaxeMarkdown: ({ children, theme: _theme, accentColor: _accentColor, linkPreviews: _linkPreviews, actions: _actions, }: PickaxeMarkdownProps) => import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
export declare const PickaxeMarkdown: ({ children, theme: _theme, syntaxTheme, accentColor: _accentColor, linkPreviews: _linkPreviews, actions: _actions, }: PickaxeMarkdownProps) => import("react/jsx-runtime").JSX.Element;
|
|
23
25
|
export default PickaxeMarkdown;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e}from"react/jsx-runtime";import{usePickaxeMarkdownContext as t}from"./hooks/usePickaxeMarkdownContext.js";import{loaderBlack as i}from"../../../../common/lotties/loader-black.js";import{loaderWhite as
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import{usePickaxeMarkdownContext as t}from"./hooks/usePickaxeMarkdownContext.js";import{loaderBlack as i}from"../../../../common/lotties/loader-black.js";import{loaderWhite as o}from"../../../../common/lotties/loader-white.js";import r from"react-lottie";import s from"./Img.js";const n=({node:n,href:a="",children:l})=>{const{theme:c,accentColor:m,linkPreviews:d,actions:p}=t(),u=(a||"").startsWith("www.")?`https://${a}`:a,f=u.match(/(?:https?:\/\/)?(?:www\.)?(?:youtube\.com\/watch\?v=|youtu\.be\/)([\w-]+)/i);if(f&&(null==f?void 0:f[1]))return e("div",Object.assign({style:{marginTop:"2.5rem",marginBottom:"2.5rem",display:"flex",width:"100%",justifyContent:"center"}},{children:e("iframe",Object.assign({title:"youtube-embed",src:`https://www.youtube.com/embed/${f[1]}`,style:{width:"100%",maxWidth:"560px"},allowFullScreen:!0},{children:"Iframe not supported, use a different browser."}))}));return u.match(/\.(jpeg|jpg|gif|bmp|webp|svg|tiff|avif)$/)?e(s,{src:u,alt:"string"==typeof l?l:"Markdown Image"}):p&&u.includes("pickaxe")&&(u.includes("/api/fn/result")||u.includes("/api/function_call_results"))?e("div",Object.assign({className:"marked-link-function-calling-loader",style:{width:"100%",maxWidth:"150px",minHeight:"150px"}},{children:e(r,{style:{cursor:"default",pointerEvents:"none"},options:{autoplay:!0,loop:!0,animationData:"dark"===c?o:i},isClickToPauseDisabled:!0,width:150,height:150})})):e("a",Object.assign({href:u,target:"_blank",rel:"noopener noreferrer"},d&&{className:"marked-link-possible-preview-render"},{style:{color:m,fontWeight:600}},{children:l}))};export{n as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as t}from"react/jsx-runtime";import{useState as e}from"react";const r=({node:r,src:i,alt:n})=>{const[o,s]=e(!1);return t("div",Object.assign({style:{marginTop:"2.5rem",marginBottom:"2.5rem",display:"flex",width:"100%",justifyContent:"center"}},{children:o?t("p",Object.assign({style:{userSelect:"none",opacity:.5,fontStyle:"italic"}},{children:"[Image link is broken]"})):t("img",{src:i,alt:n,style:{borderRadius:"8px",maxWidth:"680px"},onError:()=>s(!0)})}))};export{r as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__rest as e}from"../../../../_virtual/_tslib.js";import{jsx as
|
|
1
|
+
import{__rest as e}from"../../../../_virtual/_tslib.js";import{jsx as i}from"react/jsx-runtime";import{useRef as r}from"react";import{usePickaxeMarkdownContext as t}from"./hooks/usePickaxeMarkdownContext.js";import{Prism as n}from"react-syntax-highlighter";import l from"react-markdown";import o from"remark-gfm";import s from"remark-math";import m from"rehype-katex";import a from"./A.js";import d from"./Img.js";const c=({className:c,style:h,value:g})=>{const{theme:p,syntaxTheme:b}=t(),f=r(null),y={h1:({node:e,children:r})=>i("h1",Object.assign({style:{fontSize:"2.25rem",lineHeight:"2.5rem",marginTop:"1rem",marginBottom:"1.5rem"}},{children:r})),h2:({node:e,children:r})=>i("h2",Object.assign({style:{fontSize:"1.875rem",lineHeight:"2.25rem",marginTop:"1.25rem",marginBottom:"1.25rem"}},{children:r})),h3:({node:e,children:r})=>i("h3",Object.assign({style:{fontSize:"1.5rem",lineHeight:"2rem",marginBottom:"1rem"}},{children:r})),h4:({node:e,children:r})=>i("h4",Object.assign({className:"mt-2 text-xl",style:{fontSize:"1.25rem",lineHeight:"1.75rem",marginBottom:"0.75rem"}},{children:r})),h5:({node:e,children:r})=>i("h5",Object.assign({style:{fontSize:"1.125rem",lineHeight:"1.75rem"}},{children:r})),p:({node:e,children:r})=>i("p",Object.assign({style:{fontWeight:350}},{children:r})),a:a,ol:({node:e,children:r})=>i("ol",Object.assign({style:{listStyleType:"decimal",listStylePosition:"inside",paddingLeft:"1.5rem",marginTop:"1rem",marginBottom:"2rem"}},{children:r})),ul:({node:e,children:r})=>i("ul",Object.assign({style:{listStyleType:"disc",listStylePosition:"inside",paddingLeft:"1.5rem",marginTop:"1rem",marginBottom:"2rem"}},{children:r})),li:({node:e,children:r})=>i("li",Object.assign({style:{marginBottom:"0.75rem"}},{children:r})),table:({children:e})=>i("div",Object.assign({className:"overflow-auto"},{children:i("table",Object.assign({style:{tableLayout:"fixed",fontSize:"0.875rem",lineHeight:"1.24rem",marginBottom:"1.5rem"}},{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"===p?"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:r=>{var{node:t,children:l,className:o}=r,s=e(r,["node","children","className"]);const m=/language-(\w+)/.exec(o||"");return m?i(n,Object.assign({},s,{PreTag:"div",language:m[1],style:b,showLineNumbers:!0},{children:String(l).replace(/\n$/,"")})):i("code",Object.assign({},s,{className:o},{children:l}))},blockquote:({node:e,children:r})=>i("blockquote",Object.assign({style:{borderLeft:"dark"===p?"4px solid #30363D":"4px solid #D0D7DE",color:"dark"===p?"#8B8B8B":"#656D76",paddingLeft:"1rem",marginBottom:"1.5rem"}},{children:r})),img:d};return i("div",Object.assign({className:"pxe-markdown",ref:f,style:Object.assign({position:"relative",whiteSpace:"pre-wrap"},h)},{children:i(l,Object.assign({},c&&{className:c},{components:y,remarkPlugins:[o,s],rehypePlugins:[m]},{children:(null!=g?g:"").replace(/\u200B/g,"")}))}))};export{c as PickaxeMarkdownRenderer};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as o}from"react/jsx-runtime";import{createContext as e,useState as r}from"react";const n=e({}),t=({children:e,theme:t="light",syntaxTheme:c,accentColor:l="#228DD7",linkPreviews:a=!1,actions:i=!1})=>{const[s,d]=r(t),[p,m]=r(l),[C,F]=r(a),[g,h]=r(i);return o(n.Provider,Object.assign({value:{theme:s,syntaxTheme:c||{'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"},'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",margin:".5em 0",overflow:"auto",borderRadius:"0.3em",background:"#1d1f21"},':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"}},accentColor:p,linkPreviews:C,actions:g,setTheme:d,setAccentColor:m,setLinkPreviews:F,setActions:h}},{children:e}))};export{t as PickaxeMarkdown,n as PickaxeMarkdownContext,t as default};
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
import { CSSProperties } from "react";
|
|
1
2
|
interface PickaxeMarkdownRendererProps {
|
|
2
3
|
className?: string;
|
|
4
|
+
style?: CSSProperties;
|
|
3
5
|
value?: string | null;
|
|
4
6
|
}
|
|
5
7
|
export type Node = {
|
|
6
8
|
node?: any;
|
|
7
9
|
};
|
|
8
|
-
export declare const PickaxeMarkdownRenderer: ({ className, value, }: PickaxeMarkdownRendererProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export declare const PickaxeMarkdownRenderer: ({ className, style, value, }: PickaxeMarkdownRendererProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
11
|
export {};
|
package/dist/esm/src/components/Pickaxe/common/PickaxeMarkdown/hooks/usePickaxeMarkdownContext.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
export declare const usePickaxeMarkdownContext: () => {
|
|
2
3
|
theme?: ("light" | "dark") | undefined;
|
|
4
|
+
syntaxTheme?: Record<string, import("react").CSSProperties> | undefined;
|
|
3
5
|
accentColor?: string | undefined;
|
|
4
6
|
linkPreviews?: boolean | undefined;
|
|
5
7
|
actions?: boolean | undefined;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type { SetState } from "../../../../types/common";
|
|
2
|
-
import { type ReactNode } from "react";
|
|
2
|
+
import { type CSSProperties, type ReactNode } from "react";
|
|
3
3
|
type PickaxeMarkdownTheme = "light" | "dark";
|
|
4
4
|
type PickaxeMarkdownContextType = {
|
|
5
5
|
theme?: PickaxeMarkdownTheme;
|
|
6
|
+
syntaxTheme?: Record<string, CSSProperties>;
|
|
6
7
|
accentColor?: string;
|
|
7
8
|
linkPreviews?: boolean;
|
|
8
9
|
actions?: boolean;
|
|
@@ -14,10 +15,11 @@ type PickaxeMarkdownContextType = {
|
|
|
14
15
|
interface PickaxeMarkdownProps {
|
|
15
16
|
children: ReactNode;
|
|
16
17
|
theme?: PickaxeMarkdownTheme;
|
|
18
|
+
syntaxTheme?: Record<string, CSSProperties>;
|
|
17
19
|
accentColor?: string;
|
|
18
20
|
linkPreviews?: boolean;
|
|
19
21
|
actions?: boolean;
|
|
20
22
|
}
|
|
21
23
|
export declare const PickaxeMarkdownContext: import("react").Context<PickaxeMarkdownContextType>;
|
|
22
|
-
export declare const PickaxeMarkdown: ({ children, theme: _theme, accentColor: _accentColor, linkPreviews: _linkPreviews, actions: _actions, }: PickaxeMarkdownProps) => import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
export declare const PickaxeMarkdown: ({ children, theme: _theme, syntaxTheme, accentColor: _accentColor, linkPreviews: _linkPreviews, actions: _actions, }: PickaxeMarkdownProps) => import("react/jsx-runtime").JSX.Element;
|
|
23
25
|
export default PickaxeMarkdown;
|