@primeui-devkit/react-markdown 0.1.0-beta.2 → 0.1.0-rc.2

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/index.d.ts CHANGED
@@ -34,10 +34,11 @@ declare function ProseImg({ src, alt, width, height }: {
34
34
  width?: string | number;
35
35
  height?: string | number;
36
36
  }): react.JSX.Element;
37
- declare function ProsePre({ code, filename, class: className, children }: ProseProps & {
37
+ declare function ProsePre({ code, filename, class: classAttr, className: classNameProp, children }: ProseProps & {
38
38
  code?: string;
39
39
  filename?: string;
40
40
  class?: string;
41
+ className?: string;
41
42
  }): react.JSX.Element;
42
43
  declare function ProseTable({ children }: ProseProps): react.JSX.Element;
43
44
  declare const ProseP: ({ children }: ProseProps) => react.ReactElement<any, string | react.JSXElementConstructor<any>>;
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- export{Comark as Markdown,ComarkClient as MarkdownClient,ComarkLive as MarkdownLive,ComarkRenderer as MarkdownRenderer,defineComarkComponent as defineMarkdownComponent,defineComarkRendererComponent as defineMarkdownRenderer}from'@comark/react';import {useState,createElement}from'react';import {jsx,jsxs}from'react/jsx-runtime';function r(o,s){return function({children:t}){return createElement(o,{className:s},t)}}function p(o,s){return function({id:t,children:a}){return t?createElement(o,{id:t,className:s},jsxs("a",{href:`#${t}`,className:"prose-heading-link",children:[jsx("span",{className:"prose-heading-anchor",children:"#"}),a]})):createElement(o,{className:s},a)}}var P=p("h1","prose-h1"),g=p("h2","prose-h2"),f=p("h3","prose-h3"),x=p("h4","prose-h4"),k=p("h5","prose-h5"),C=p("h6","prose-h6");function b({href:o,target:s,children:n}){return jsx("a",{className:"prose-a",href:o,target:s,children:n})}function v({src:o,alt:s,width:n,height:t}){return jsx("img",{className:"prose-img",src:o,alt:s,width:n,height:t})}function y({code:o="",filename:s,class:n,children:t}){let[a,l]=useState(false),d=s?.replace(":line-numbers","")||null,m=s?.includes(":line-numbers");async function h(){o&&(await navigator.clipboard.writeText(o),l(true),setTimeout(()=>l(false),2e3));}return jsxs("div",{className:"prose-pre",children:[d&&jsx("div",{className:"prose-pre-filename",children:jsx("span",{children:d})}),jsx("div",{className:"prose-pre-actions",children:jsx("button",{type:"button",className:"prose-pre-copy",title:a?"Copied":"Copy Code",onClick:h,children:a?jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:jsx("path",{d:"M20 6 9 17l-5-5"})}):jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsx("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2"}),jsx("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})})}),jsx("pre",{className:[n,m?"prose-pre-line-numbers":""].filter(Boolean).join(" ")||void 0,children:t})]})}function w({children:o}){return jsx("div",{className:"prose-table-scroll",children:jsx("table",{className:"prose-table",children:o})})}var N=r("p","prose-p"),T=r("blockquote","prose-blockquote"),H=r("code","prose-code"),M=r("em","prose-em"),R=r("strong","prose-strong"),E=r("li","prose-li"),B=r("ol","prose-ol"),L=r("ul","prose-ul"),q=r("tbody","prose-tbody"),S=r("td","prose-td"),W=r("th","prose-th"),A=r("thead","prose-thead"),F=r("tr","prose-tr");function I(){return jsx("hr",{className:"prose-hr"})}var U={ProseA:b,ProseBlockquote:T,ProseCode:H,ProseEm:M,ProseH1:P,ProseH2:g,ProseH3:f,ProseH4:x,ProseH5:k,ProseH6:C,ProseHr:I,ProseImg:v,ProseLi:E,ProseOl:B,ProseP:N,ProsePre:y,ProseStrong:R,ProseTable:w,ProseTbody:q,ProseTd:S,ProseTh:W,ProseThead:A,ProseTr:F,ProseUl:L};export{b as ProseA,T as ProseBlockquote,H as ProseCode,M as ProseEm,P as ProseH1,g as ProseH2,f as ProseH3,x as ProseH4,k as ProseH5,C as ProseH6,I as ProseHr,v as ProseImg,E as ProseLi,B as ProseOl,N as ProseP,y as ProsePre,R as ProseStrong,w as ProseTable,q as ProseTbody,S as ProseTd,W as ProseTh,A as ProseThead,F as ProseTr,L as ProseUl,U as proseComponents};
1
+ export{Comark as Markdown,ComarkClient as MarkdownClient,ComarkLive as MarkdownLive,ComarkRenderer as MarkdownRenderer,defineComarkComponent as defineMarkdownComponent,defineComarkRendererComponent as defineMarkdownRenderer}from'@comark/react';import {useState,useRef,useEffect,createElement}from'react';import {jsx,jsxs}from'react/jsx-runtime';function r(o,s){return function({children:t}){return createElement(o,{className:s},t)}}function p(o,s){return function({id:t,children:a}){return t?createElement(o,{id:t,className:s},jsxs("a",{href:`#${t}`,className:"prose-heading-link",children:[jsx("span",{className:"prose-heading-anchor",children:"#"}),a]})):createElement(o,{className:s},a)}}var b=p("h1","prose-h1"),y=p("h2","prose-h2"),v=p("h3","prose-h3"),N=p("h4","prose-h4"),w=p("h5","prose-h5"),T=p("h6","prose-h6");function H({href:o,target:s,children:n}){return jsx("a",{className:"prose-a",href:o,target:s,children:n})}function M({src:o,alt:s,width:n,height:t}){return jsx("img",{className:"prose-img",src:o,alt:s,width:n,height:t})}function R({code:o="",filename:s,class:n,className:t,children:a}){let P=t??n,[l,d]=useState(false),m=useRef(null);useEffect(()=>{for(let h of m.current?.querySelectorAll('[class*=","]')??[])h.setAttribute("class",h.getAttribute("class").split(",").join(" "));});let u=s?.replace(":line-numbers","")||null,f=s?.includes(":line-numbers");async function g(){o&&(await navigator.clipboard.writeText(o),d(true),setTimeout(()=>d(false),2e3));}return jsxs("div",{className:"prose-pre",children:[u&&jsx("div",{className:"prose-pre-filename",children:jsx("span",{children:u})}),jsx("div",{className:"prose-pre-actions",children:jsx("button",{type:"button",className:"prose-pre-copy",title:l?"Copied":"Copy Code",onClick:g,children:l?jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:jsx("path",{d:"M20 6 9 17l-5-5"})}):jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsx("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2"}),jsx("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})})}),jsx("pre",{ref:m,className:[P,f?"prose-pre-line-numbers":""].filter(Boolean).join(" ")||void 0,children:a})]})}function E({children:o}){return jsx("div",{className:"prose-table-scroll",children:jsx("table",{className:"prose-table",children:o})})}var L=r("p","prose-p"),q=r("blockquote","prose-blockquote"),A=r("code","prose-code"),B=r("em","prose-em"),S=r("strong","prose-strong"),W=r("li","prose-li"),j=r("ol","prose-ol"),F=r("ul","prose-ul"),I=r("tbody","prose-tbody"),O=r("td","prose-td"),U=r("th","prose-th"),V=r("thead","prose-thead"),$=r("tr","prose-tr");function z(){return jsx("hr",{className:"prose-hr"})}var G={ProseA:H,ProseBlockquote:q,ProseCode:A,ProseEm:B,ProseH1:b,ProseH2:y,ProseH3:v,ProseH4:N,ProseH5:w,ProseH6:T,ProseHr:z,ProseImg:M,ProseLi:W,ProseOl:j,ProseP:L,ProsePre:R,ProseStrong:S,ProseTable:E,ProseTbody:I,ProseTd:O,ProseTh:U,ProseThead:V,ProseTr:$,ProseUl:F};export{H as ProseA,q as ProseBlockquote,A as ProseCode,B as ProseEm,b as ProseH1,y as ProseH2,v as ProseH3,N as ProseH4,w as ProseH5,T as ProseH6,z as ProseHr,M as ProseImg,W as ProseLi,j as ProseOl,L as ProseP,R as ProsePre,S as ProseStrong,E as ProseTable,I as ProseTbody,O as ProseTd,U as ProseTh,V as ProseThead,$ as ProseTr,F as ProseUl,G as proseComponents};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@primeui-devkit/react-markdown",
3
- "version": "0.1.0-beta.2",
3
+ "version": "0.1.0-rc.2",
4
4
  "description": "React renderer for the PrimeUI DevKit markdown AST, plus the Prose* component set. The rendering backend is an internal implementation detail.",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "type": "module",
@@ -30,10 +30,10 @@
30
30
  "tsup": "^8.5.1",
31
31
  "typescript": "~6.0.0",
32
32
  "vitest": "4.1.10",
33
- "@primeui-devkit/markdown-core": "0.1.0-beta.2",
34
- "@primeui-devkit/test-config": "0.0.0",
35
33
  "@primeui-devkit/bundler": "0.0.0",
36
- "@primeui-devkit/ts-config": "0.0.0"
34
+ "@primeui-devkit/ts-config": "0.0.0",
35
+ "@primeui-devkit/markdown-core": "0.1.0-rc.2",
36
+ "@primeui-devkit/test-config": "0.0.0"
37
37
  },
38
38
  "types": "./dist/index.d.ts",
39
39
  "module": "./dist/index.js",