@pickaxeproject/react 0.0.64 → 0.0.65

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("react/jsx-runtime"),i=require("react"),r=require("./hooks/usePickaxeMarkdownContext.js"),t=require("react-markdown"),s=require("remark-gfm"),n=require("remark-math"),l=require("rehype-katex"),d=require("./Custom/A/index.js"),a=require("./Custom/P/index.js"),o=require("./Custom/Img/index.js"),c=require("./Custom/Iframe/index.js"),h=require("./Custom/Code/index.js"),m=require("./Custom/common/LinkPreview.js");function u(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var j=u(t),x=u(s),g=u(n),f=u(l);exports.PickaxeMarkdownRenderer=({className:t,style:s,value:n,recursion:l=!1})=>{const{theme:u,websiteMetadatas:p}=r.usePickaxeMarkdownContext(),b=i.useRef(null),y=i.useMemo((()=>{if(!n)return"";let e=n;return e=n.replace(/<!--[\s\S]*?-->/g,""),e=n.replace(/\u200B/g,""),e}),[n]),k={h1:({node:i,children:r})=>e.jsx("h1",Object.assign({style:{fontSize:"2.25rem",lineHeight:"2.5rem"}},{children:r})),h2:({node:i,children:r})=>e.jsx("h2",Object.assign({style:{fontSize:"1.875rem",lineHeight:"2.25rem"}},{children:r})),h3:({node:i,children:r})=>e.jsx("h3",Object.assign({style:{fontSize:"1.5rem",lineHeight:"2rem"}},{children:r})),h4:({node:i,children:r})=>e.jsx("h4",Object.assign({className:"mt-2",style:{fontSize:"1.25rem",lineHeight:"1.75rem"}},{children:r})),h5:({node:i,children:r})=>e.jsx("h5",Object.assign({style:{fontSize:"1.125rem",lineHeight:"1.75rem"}},{children:r})),p:a.default,a:d.default,ol:({node:i,children:r})=>e.jsx("ol",Object.assign({style:{listStyleType:"decimal",listStylePosition:"inside",paddingLeft:"1.5rem",whiteSpace:"normal"}},{children:r})),ul:({node:i,children:r})=>e.jsx("ul",Object.assign({style:{listStyleType:"disc",listStylePosition:"inside",paddingLeft:"1.5rem",whiteSpace:"normal"}},{children:r})),li:({node:i,children:r})=>e.jsx("li",Object.assign({style:{whiteSpace:"normal"}},{children:r})),table:({children:i})=>e.jsx("div",Object.assign({className:"overflow-auto"},{children:e.jsx("table",Object.assign({style:{tableLayout:"fixed",fontSize:"0.875rem",lineHeight:"1.24rem"}},{children:i}))})),th:({node:i,children:r})=>e.jsx("th",Object.assign({style:{padding:"0.75em 1em",fontWeight:600,textAlign:"left"}},{children:r})),tr:({node:i,children:r})=>e.jsx("tr",Object.assign({style:{border:"dark"===u?"1px solid #30363D":"1px solid #D0D7DE"}},{children:r})),td:({node:i,children:r})=>e.jsx("td",Object.assign({style:{padding:"0.75em 1em"}},{children:r})),code:h.default,blockquote:({node:i,children:r})=>e.jsx("blockquote",Object.assign({style:{lineHeight:"15px",borderLeft:"dark"===u?"4px solid #30363D":"4px solid #D0D7DE",color:"dark"===u?"#8B8B8B":"#656D76",paddingLeft:"1rem",marginBottom:"1rem"}},{children:r})),img:o.default,iframe:c.default,hr:()=>e.jsx("hr",{style:{border:0,borderTop:"dark"===u?"1px solid #30363D":"1px solid #D0D7DE"}})};return e.jsxs("div",Object.assign({className:"pxe-markdown",ref:b,style:Object.assign({position:"relative",whiteSpace:"pre-wrap"},s)},{children:[e.jsx(j.default,Object.assign({},t&&{className:t},{components:k,remarkPlugins:[x.default,g.default],rehypePlugins:[f.default]},{children:`${y}${!l&&p.length>0?"\n\n---":""}`})),!l&&p.length>0&&e.jsx("div",Object.assign({style:{display:"flex",flexDirection:"column",gap:"2rem",marginTop:"2rem"}},{children:p.map(((i,r)=>e.jsx(m.default,{data:i},r)))}))]}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),i=require("react"),r=require("./hooks/usePickaxeMarkdownContext.js"),t=require("react-markdown"),s=require("remark-gfm"),n=require("remark-math"),l=require("rehype-katex"),d=require("rehype-raw"),a=require("./Custom/A/index.js"),o=require("./Custom/P/index.js"),c=require("./Custom/Img/index.js"),h=require("./Custom/Iframe/index.js"),m=require("./Custom/Code/index.js"),u=require("./Custom/common/LinkPreview.js");function j(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var x=j(t),g=j(s),f=j(n),p=j(l),b=j(d);exports.PickaxeMarkdownRenderer=({className:t,style:s,value:n,recursion:l=!1})=>{const{theme:d,websiteMetadatas:j}=r.usePickaxeMarkdownContext(),y=i.useRef(null),k=i.useMemo((()=>{if(!n)return"";let e=n;return e=n.replace(/<!--[\s\S]*?-->/g,""),e=n.replace(/\u200B/g,""),e}),[n]),O={h1:({node:i,children:r})=>e.jsx("h1",Object.assign({style:{fontSize:"2.25rem",lineHeight:"2.5rem"}},{children:r})),h2:({node:i,children:r})=>e.jsx("h2",Object.assign({style:{fontSize:"1.875rem",lineHeight:"2.25rem"}},{children:r})),h3:({node:i,children:r})=>e.jsx("h3",Object.assign({style:{fontSize:"1.5rem",lineHeight:"2rem"}},{children:r})),h4:({node:i,children:r})=>e.jsx("h4",Object.assign({className:"mt-2",style:{fontSize:"1.25rem",lineHeight:"1.75rem"}},{children:r})),h5:({node:i,children:r})=>e.jsx("h5",Object.assign({style:{fontSize:"1.125rem",lineHeight:"1.75rem"}},{children:r})),p:o.default,a:a.default,ol:({node:i,children:r})=>e.jsx("ol",Object.assign({style:{listStyleType:"decimal",listStylePosition:"inside",paddingLeft:"1.5rem",whiteSpace:"normal"}},{children:r})),ul:({node:i,children:r})=>e.jsx("ul",Object.assign({style:{listStyleType:"disc",listStylePosition:"inside",paddingLeft:"1.5rem",whiteSpace:"normal"}},{children:r})),li:({node:i,children:r})=>e.jsx("li",Object.assign({style:{whiteSpace:"normal"}},{children:r})),table:({children:i})=>e.jsx("div",Object.assign({className:"overflow-auto"},{children:e.jsx("table",Object.assign({style:{tableLayout:"fixed",fontSize:"0.875rem",lineHeight:"1.24rem"}},{children:i}))})),th:({node:i,children:r})=>e.jsx("th",Object.assign({style:{padding:"0.75em 1em",fontWeight:600,textAlign:"left"}},{children:r})),tr:({node:i,children:r})=>e.jsx("tr",Object.assign({style:{border:"dark"===d?"1px solid #30363D":"1px solid #D0D7DE"}},{children:r})),td:({node:i,children:r})=>e.jsx("td",Object.assign({style:{padding:"0.75em 1em"}},{children:r})),code:m.default,blockquote:({node:i,children:r})=>e.jsx("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:c.default,iframe:h.default,hr:()=>e.jsx("hr",{style:{border:0,borderTop:"dark"===d?"1px solid #30363D":"1px solid #D0D7DE"}})};return e.jsxs("div",Object.assign({className:"pxe-markdown",ref:y,style:Object.assign({position:"relative",whiteSpace:"pre-wrap"},s)},{children:[e.jsx(x.default,Object.assign({},t&&{className:t},{components:O,remarkPlugins:[g.default,f.default],rehypePlugins:[p.default,b.default]},{children:`${k}${!l&&j.length>0?"\n\n---":""}`})),!l&&j.length>0&&e.jsx("div",Object.assign({style:{display:"flex",flexDirection:"column",gap:"2rem",marginTop:"2rem"}},{children:j.map(((i,r)=>e.jsx(u.default,{data:i},r)))}))]}))};
@@ -1,5 +1,5 @@
1
1
  import { CSSProperties } from "react";
2
- interface PickaxeMarkdownRendererProps {
2
+ export interface PickaxeMarkdownRendererProps {
3
3
  className?: string;
4
4
  style?: CSSProperties;
5
5
  value?: string | null;
@@ -9,4 +9,3 @@ export type Node = {
9
9
  node?: any;
10
10
  };
11
11
  export declare const PickaxeMarkdownRenderer: ({ className, style, value, recursion, }: PickaxeMarkdownRendererProps) => import("react/jsx-runtime").JSX.Element;
12
- export {};
@@ -20,7 +20,7 @@ type PickaxeMarkdownContextType = {
20
20
  setLinkPreviews: SetState<boolean>;
21
21
  setActions: SetState<boolean>;
22
22
  };
23
- interface PickaxeMarkdownProps {
23
+ export interface PickaxeMarkdownProps {
24
24
  children: ReactNode;
25
25
  theme?: PickaxeMarkdownTheme;
26
26
  syntaxTheme?: Record<string, CSSProperties>;
@@ -1 +1 @@
1
- import{jsxs as e,jsx as i}from"react/jsx-runtime";import{useRef as t,useMemo as r}from"react";import{usePickaxeMarkdownContext as n}from"./hooks/usePickaxeMarkdownContext.js";import l from"react-markdown";import s from"remark-gfm";import o from"remark-math";import d from"rehype-katex";import m from"./Custom/A/index.js";import a from"./Custom/P/index.js";import c from"./Custom/Img/index.js";import h from"./Custom/Iframe/index.js";import p from"./Custom/Code/index.js";import g from"./Custom/common/LinkPreview.js";const f=({className:f,style:b,value:y,recursion:j=!1})=>{const{theme:u,websiteMetadatas:x}=n(),O=t(null),k=r((()=>{if(!y)return"";let e=y;return e=y.replace(/<!--[\s\S]*?-->/g,""),e=y.replace(/\u200B/g,""),e}),[y]),S={h1:({node:e,children:t})=>i("h1",Object.assign({style:{fontSize:"2.25rem",lineHeight:"2.5rem"}},{children:t})),h2:({node:e,children:t})=>i("h2",Object.assign({style:{fontSize:"1.875rem",lineHeight:"2.25rem"}},{children:t})),h3:({node:e,children:t})=>i("h3",Object.assign({style:{fontSize:"1.5rem",lineHeight:"2rem"}},{children:t})),h4:({node:e,children:t})=>i("h4",Object.assign({className:"mt-2",style:{fontSize:"1.25rem",lineHeight:"1.75rem"}},{children:t})),h5:({node:e,children:t})=>i("h5",Object.assign({style:{fontSize:"1.125rem",lineHeight:"1.75rem"}},{children:t})),p:a,a:m,ol:({node:e,children:t})=>i("ol",Object.assign({style:{listStyleType:"decimal",listStylePosition:"inside",paddingLeft:"1.5rem",whiteSpace:"normal"}},{children:t})),ul:({node:e,children:t})=>i("ul",Object.assign({style:{listStyleType:"disc",listStylePosition:"inside",paddingLeft:"1.5rem",whiteSpace:"normal"}},{children:t})),li:({node:e,children:t})=>i("li",Object.assign({style:{whiteSpace:"normal"}},{children:t})),table:({children:e})=>i("div",Object.assign({className:"overflow-auto"},{children:i("table",Object.assign({style:{tableLayout:"fixed",fontSize:"0.875rem",lineHeight:"1.24rem"}},{children:e}))})),th:({node:e,children:t})=>i("th",Object.assign({style:{padding:"0.75em 1em",fontWeight:600,textAlign:"left"}},{children:t})),tr:({node:e,children:t})=>i("tr",Object.assign({style:{border:"dark"===u?"1px solid #30363D":"1px solid #D0D7DE"}},{children:t})),td:({node:e,children:t})=>i("td",Object.assign({style:{padding:"0.75em 1em"}},{children:t})),code:p,blockquote:({node:e,children:t})=>i("blockquote",Object.assign({style:{lineHeight:"15px",borderLeft:"dark"===u?"4px solid #30363D":"4px solid #D0D7DE",color:"dark"===u?"#8B8B8B":"#656D76",paddingLeft:"1rem",marginBottom:"1rem"}},{children:t})),img:c,iframe:h,hr:()=>i("hr",{style:{border:0,borderTop:"dark"===u?"1px solid #30363D":"1px solid #D0D7DE"}})};return e("div",Object.assign({className:"pxe-markdown",ref:O,style:Object.assign({position:"relative",whiteSpace:"pre-wrap"},b)},{children:[i(l,Object.assign({},f&&{className:f},{components:S,remarkPlugins:[s,o],rehypePlugins:[d]},{children:`${k}${!j&&x.length>0?"\n\n---":""}`})),!j&&x.length>0&&i("div",Object.assign({style:{display:"flex",flexDirection:"column",gap:"2rem",marginTop:"2rem"}},{children:x.map(((e,t)=>i(g,{data:e},t)))}))]}))};export{f as PickaxeMarkdownRenderer};
1
+ import{jsxs as e,jsx as i}from"react/jsx-runtime";import{useRef as r,useMemo as t}from"react";import{usePickaxeMarkdownContext as n}from"./hooks/usePickaxeMarkdownContext.js";import l from"react-markdown";import o from"remark-gfm";import s from"remark-math";import d from"rehype-katex";import m from"rehype-raw";import a from"./Custom/A/index.js";import c from"./Custom/P/index.js";import h from"./Custom/Img/index.js";import p from"./Custom/Iframe/index.js";import g from"./Custom/Code/index.js";import f from"./Custom/common/LinkPreview.js";const b=({className:b,style:y,value:j,recursion:u=!1})=>{const{theme:x,websiteMetadatas:O}=n(),k=r(null),S=t((()=>{if(!j)return"";let e=j;return e=j.replace(/<!--[\s\S]*?-->/g,""),e=j.replace(/\u200B/g,""),e}),[j]),D={h1:({node:e,children:r})=>i("h1",Object.assign({style:{fontSize:"2.25rem",lineHeight:"2.5rem"}},{children:r})),h2:({node:e,children:r})=>i("h2",Object.assign({style:{fontSize:"1.875rem",lineHeight:"2.25rem"}},{children:r})),h3:({node:e,children:r})=>i("h3",Object.assign({style:{fontSize:"1.5rem",lineHeight:"2rem"}},{children:r})),h4:({node:e,children:r})=>i("h4",Object.assign({className:"mt-2",style:{fontSize:"1.25rem",lineHeight:"1.75rem"}},{children:r})),h5:({node:e,children:r})=>i("h5",Object.assign({style:{fontSize:"1.125rem",lineHeight:"1.75rem"}},{children:r})),p:c,a:a,ol:({node:e,children:r})=>i("ol",Object.assign({style:{listStyleType:"decimal",listStylePosition:"inside",paddingLeft:"1.5rem",whiteSpace:"normal"}},{children:r})),ul:({node:e,children:r})=>i("ul",Object.assign({style:{listStyleType:"disc",listStylePosition:"inside",paddingLeft:"1.5rem",whiteSpace:"normal"}},{children:r})),li:({node:e,children:r})=>i("li",Object.assign({style:{whiteSpace:"normal"}},{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"}},{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"===x?"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:g,blockquote:({node:e,children:r})=>i("blockquote",Object.assign({style:{lineHeight:"15px",borderLeft:"dark"===x?"4px solid #30363D":"4px solid #D0D7DE",color:"dark"===x?"#8B8B8B":"#656D76",paddingLeft:"1rem",marginBottom:"1rem"}},{children:r})),img:h,iframe:p,hr:()=>i("hr",{style:{border:0,borderTop:"dark"===x?"1px solid #30363D":"1px solid #D0D7DE"}})};return e("div",Object.assign({className:"pxe-markdown",ref:k,style:Object.assign({position:"relative",whiteSpace:"pre-wrap"},y)},{children:[i(l,Object.assign({},b&&{className:b},{components:D,remarkPlugins:[o,s],rehypePlugins:[d,m]},{children:`${S}${!u&&O.length>0?"\n\n---":""}`})),!u&&O.length>0&&i("div",Object.assign({style:{display:"flex",flexDirection:"column",gap:"2rem",marginTop:"2rem"}},{children:O.map(((e,r)=>i(f,{data:e},r)))}))]}))};export{b as PickaxeMarkdownRenderer};
@@ -1,5 +1,5 @@
1
1
  import { CSSProperties } from "react";
2
- interface PickaxeMarkdownRendererProps {
2
+ export interface PickaxeMarkdownRendererProps {
3
3
  className?: string;
4
4
  style?: CSSProperties;
5
5
  value?: string | null;
@@ -9,4 +9,3 @@ export type Node = {
9
9
  node?: any;
10
10
  };
11
11
  export declare const PickaxeMarkdownRenderer: ({ className, style, value, recursion, }: PickaxeMarkdownRendererProps) => import("react/jsx-runtime").JSX.Element;
12
- export {};
@@ -20,7 +20,7 @@ type PickaxeMarkdownContextType = {
20
20
  setLinkPreviews: SetState<boolean>;
21
21
  setActions: SetState<boolean>;
22
22
  };
23
- interface PickaxeMarkdownProps {
23
+ export interface PickaxeMarkdownProps {
24
24
  children: ReactNode;
25
25
  theme?: PickaxeMarkdownTheme;
26
26
  syntaxTheme?: Record<string, CSSProperties>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pickaxeproject/react",
3
- "version": "0.0.64",
3
+ "version": "0.0.65",
4
4
  "description": "Client utility library for Pickaxe",
5
5
  "repository": {
6
6
  "type": "git",
@@ -106,6 +106,7 @@
106
106
  "react-tooltip": "^5.28.0",
107
107
  "react-virtualized-auto-sizer": "^1.0.25",
108
108
  "rehype-katex": "^7.0.1",
109
+ "rehype-raw": "^7.0.0",
109
110
  "remark-gfm": "^4.0.0",
110
111
  "remark-math": "^6.0.0",
111
112
  "rollup": "^2.79.1",
@@ -149,6 +150,7 @@
149
150
  "react-tooltip": "^5.28.0",
150
151
  "react-virtualized-auto-sizer": "^1.0.25",
151
152
  "rehype-katex": "^7.0.1",
153
+ "rehype-raw": "^7.0.0",
152
154
  "remark-gfm": "^4.0.0",
153
155
  "remark-math": "^6.0.0",
154
156
  "tailwind-merge": "^2.6.0",