@primeui-devkit/react-markdown 0.1.0-rc.1 → 0.1.0-rc.3
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/README.md +0 -4
- package/THIRD-PARTY-NOTICES.txt +2 -2
- package/dist/index.d.ts +28 -27
- package/dist/index.js +2 -1
- package/package.json +30 -19
package/README.md
CHANGED
|
@@ -10,7 +10,3 @@ export function DocPage({ tree }) {
|
|
|
10
10
|
return <MarkdownRenderer tree={tree} components={{ ...proseComponents, 'demo-viewer': DemoViewer }} />;
|
|
11
11
|
}
|
|
12
12
|
```
|
|
13
|
-
|
|
14
|
-
`Markdown` (runtime parse), `MarkdownClient` and `MarkdownLive` are also exported.
|
|
15
|
-
Note: `ProsePre` (copy button) is interactive — under React Server Components
|
|
16
|
-
it must be rendered inside a client boundary.
|
package/THIRD-PARTY-NOTICES.txt
CHANGED
|
@@ -5,11 +5,11 @@ Each is provided under its own license, reproduced below.
|
|
|
5
5
|
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
-
##
|
|
8
|
+
## @comark/react 0.5.1
|
|
9
9
|
|
|
10
10
|
Copyright (c) 2026 Comark team and contributors
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
https://comark.dev/rendering/react
|
|
13
13
|
|
|
14
14
|
Licensed under the MIT License.
|
|
15
15
|
|
package/dist/index.d.ts
CHANGED
|
@@ -34,31 +34,32 @@ 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
|
-
declare const ProseP: ({ children }: ProseProps) => react.ReactElement<any, string | react.JSXElementConstructor<any>>;
|
|
44
|
-
declare const ProseBlockquote: ({ children }: ProseProps) => react.ReactElement<any, string | react.JSXElementConstructor<any>>;
|
|
45
|
-
declare const ProseCode: ({ children }: ProseProps) => react.ReactElement<any, string | react.JSXElementConstructor<any>>;
|
|
46
|
-
declare const ProseEm: ({ children }: ProseProps) => react.ReactElement<any, string | react.JSXElementConstructor<any>>;
|
|
47
|
-
declare const ProseStrong: ({ children }: ProseProps) => react.ReactElement<any, string | react.JSXElementConstructor<any>>;
|
|
48
|
-
declare const ProseLi: ({ children }: ProseProps) => react.ReactElement<any, string | react.JSXElementConstructor<any>>;
|
|
49
|
-
declare const ProseOl: ({ children }: ProseProps) => react.ReactElement<any, string | react.JSXElementConstructor<any>>;
|
|
50
|
-
declare const ProseUl: ({ children }: ProseProps) => react.ReactElement<any, string | react.JSXElementConstructor<any>>;
|
|
51
|
-
declare const ProseTbody: ({ children }: ProseProps) => react.ReactElement<any, string | react.JSXElementConstructor<any>>;
|
|
52
|
-
declare const ProseTd: ({ children }: ProseProps) => react.ReactElement<any, string | react.JSXElementConstructor<any>>;
|
|
53
|
-
declare const ProseTh: ({ children }: ProseProps) => react.ReactElement<any, string | react.JSXElementConstructor<any>>;
|
|
54
|
-
declare const ProseThead: ({ children }: ProseProps) => react.ReactElement<any, string | react.JSXElementConstructor<any>>;
|
|
55
|
-
declare const ProseTr: ({ children }: ProseProps) => react.ReactElement<any, string | react.JSXElementConstructor<any>>;
|
|
44
|
+
declare const ProseP: ({ children, class: classAttr, className: classNameProp, style, ...rest }: ProseProps) => react.ReactElement<any, string | react.JSXElementConstructor<any>>;
|
|
45
|
+
declare const ProseBlockquote: ({ children, class: classAttr, className: classNameProp, style, ...rest }: ProseProps) => react.ReactElement<any, string | react.JSXElementConstructor<any>>;
|
|
46
|
+
declare const ProseCode: ({ children, class: classAttr, className: classNameProp, style, ...rest }: ProseProps) => react.ReactElement<any, string | react.JSXElementConstructor<any>>;
|
|
47
|
+
declare const ProseEm: ({ children, class: classAttr, className: classNameProp, style, ...rest }: ProseProps) => react.ReactElement<any, string | react.JSXElementConstructor<any>>;
|
|
48
|
+
declare const ProseStrong: ({ children, class: classAttr, className: classNameProp, style, ...rest }: ProseProps) => react.ReactElement<any, string | react.JSXElementConstructor<any>>;
|
|
49
|
+
declare const ProseLi: ({ children, class: classAttr, className: classNameProp, style, ...rest }: ProseProps) => react.ReactElement<any, string | react.JSXElementConstructor<any>>;
|
|
50
|
+
declare const ProseOl: ({ children, class: classAttr, className: classNameProp, style, ...rest }: ProseProps) => react.ReactElement<any, string | react.JSXElementConstructor<any>>;
|
|
51
|
+
declare const ProseUl: ({ children, class: classAttr, className: classNameProp, style, ...rest }: ProseProps) => react.ReactElement<any, string | react.JSXElementConstructor<any>>;
|
|
52
|
+
declare const ProseTbody: ({ children, class: classAttr, className: classNameProp, style, ...rest }: ProseProps) => react.ReactElement<any, string | react.JSXElementConstructor<any>>;
|
|
53
|
+
declare const ProseTd: ({ children, class: classAttr, className: classNameProp, style, ...rest }: ProseProps) => react.ReactElement<any, string | react.JSXElementConstructor<any>>;
|
|
54
|
+
declare const ProseTh: ({ children, class: classAttr, className: classNameProp, style, ...rest }: ProseProps) => react.ReactElement<any, string | react.JSXElementConstructor<any>>;
|
|
55
|
+
declare const ProseThead: ({ children, class: classAttr, className: classNameProp, style, ...rest }: ProseProps) => react.ReactElement<any, string | react.JSXElementConstructor<any>>;
|
|
56
|
+
declare const ProseTr: ({ children, class: classAttr, className: classNameProp, style, ...rest }: ProseProps) => react.ReactElement<any, string | react.JSXElementConstructor<any>>;
|
|
56
57
|
declare function ProseHr(): react.JSX.Element;
|
|
57
58
|
declare const proseComponents: {
|
|
58
59
|
ProseA: typeof ProseA;
|
|
59
|
-
ProseBlockquote: ({ children }: ProseProps) => react.ReactElement<any, string | react.JSXElementConstructor<any>>;
|
|
60
|
-
ProseCode: ({ children }: ProseProps) => react.ReactElement<any, string | react.JSXElementConstructor<any>>;
|
|
61
|
-
ProseEm: ({ children }: ProseProps) => react.ReactElement<any, string | react.JSXElementConstructor<any>>;
|
|
60
|
+
ProseBlockquote: ({ children, class: classAttr, className: classNameProp, style, ...rest }: ProseProps) => react.ReactElement<any, string | react.JSXElementConstructor<any>>;
|
|
61
|
+
ProseCode: ({ children, class: classAttr, className: classNameProp, style, ...rest }: ProseProps) => react.ReactElement<any, string | react.JSXElementConstructor<any>>;
|
|
62
|
+
ProseEm: ({ children, class: classAttr, className: classNameProp, style, ...rest }: ProseProps) => react.ReactElement<any, string | react.JSXElementConstructor<any>>;
|
|
62
63
|
ProseH1: ({ id, children }: ProseProps & {
|
|
63
64
|
id?: string;
|
|
64
65
|
}) => react.ReactElement<any, string | react.JSXElementConstructor<any>>;
|
|
@@ -79,18 +80,18 @@ declare const proseComponents: {
|
|
|
79
80
|
}) => react.ReactElement<any, string | react.JSXElementConstructor<any>>;
|
|
80
81
|
ProseHr: typeof ProseHr;
|
|
81
82
|
ProseImg: typeof ProseImg;
|
|
82
|
-
ProseLi: ({ children }: ProseProps) => react.ReactElement<any, string | react.JSXElementConstructor<any>>;
|
|
83
|
-
ProseOl: ({ children }: ProseProps) => react.ReactElement<any, string | react.JSXElementConstructor<any>>;
|
|
84
|
-
ProseP: ({ children }: ProseProps) => react.ReactElement<any, string | react.JSXElementConstructor<any>>;
|
|
83
|
+
ProseLi: ({ children, class: classAttr, className: classNameProp, style, ...rest }: ProseProps) => react.ReactElement<any, string | react.JSXElementConstructor<any>>;
|
|
84
|
+
ProseOl: ({ children, class: classAttr, className: classNameProp, style, ...rest }: ProseProps) => react.ReactElement<any, string | react.JSXElementConstructor<any>>;
|
|
85
|
+
ProseP: ({ children, class: classAttr, className: classNameProp, style, ...rest }: ProseProps) => react.ReactElement<any, string | react.JSXElementConstructor<any>>;
|
|
85
86
|
ProsePre: typeof ProsePre;
|
|
86
|
-
ProseStrong: ({ children }: ProseProps) => react.ReactElement<any, string | react.JSXElementConstructor<any>>;
|
|
87
|
+
ProseStrong: ({ children, class: classAttr, className: classNameProp, style, ...rest }: ProseProps) => react.ReactElement<any, string | react.JSXElementConstructor<any>>;
|
|
87
88
|
ProseTable: typeof ProseTable;
|
|
88
|
-
ProseTbody: ({ children }: ProseProps) => react.ReactElement<any, string | react.JSXElementConstructor<any>>;
|
|
89
|
-
ProseTd: ({ children }: ProseProps) => react.ReactElement<any, string | react.JSXElementConstructor<any>>;
|
|
90
|
-
ProseTh: ({ children }: ProseProps) => react.ReactElement<any, string | react.JSXElementConstructor<any>>;
|
|
91
|
-
ProseThead: ({ children }: ProseProps) => react.ReactElement<any, string | react.JSXElementConstructor<any>>;
|
|
92
|
-
ProseTr: ({ children }: ProseProps) => react.ReactElement<any, string | react.JSXElementConstructor<any>>;
|
|
93
|
-
ProseUl: ({ children }: ProseProps) => react.ReactElement<any, string | react.JSXElementConstructor<any>>;
|
|
89
|
+
ProseTbody: ({ children, class: classAttr, className: classNameProp, style, ...rest }: ProseProps) => react.ReactElement<any, string | react.JSXElementConstructor<any>>;
|
|
90
|
+
ProseTd: ({ children, class: classAttr, className: classNameProp, style, ...rest }: ProseProps) => react.ReactElement<any, string | react.JSXElementConstructor<any>>;
|
|
91
|
+
ProseTh: ({ children, class: classAttr, className: classNameProp, style, ...rest }: ProseProps) => react.ReactElement<any, string | react.JSXElementConstructor<any>>;
|
|
92
|
+
ProseThead: ({ children, class: classAttr, className: classNameProp, style, ...rest }: ProseProps) => react.ReactElement<any, string | react.JSXElementConstructor<any>>;
|
|
93
|
+
ProseTr: ({ children, class: classAttr, className: classNameProp, style, ...rest }: ProseProps) => react.ReactElement<any, string | react.JSXElementConstructor<any>>;
|
|
94
|
+
ProseUl: ({ children, class: classAttr, className: classNameProp, style, ...rest }: ProseProps) => react.ReactElement<any, string | react.JSXElementConstructor<any>>;
|
|
94
95
|
};
|
|
95
96
|
|
|
96
97
|
export { ProseA, ProseBlockquote, ProseCode, ProseEm, ProseH1, ProseH2, ProseH3, ProseH4, ProseH5, ProseH6, ProseHr, ProseImg, ProseLi, ProseOl, ProseP, ProsePre, ProseStrong, ProseTable, ProseTbody, ProseTd, ProseTh, ProseThead, ProseTr, ProseUl, proseComponents };
|
package/dist/index.js
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
'use client';
|
|
2
|
+
import{Comark as e,ComarkClient as t,ComarkLive as n,ComarkRenderer as r,defineComarkComponent as i,defineComarkRendererComponent as a}from"@comark/react";import{createElement as o,useEffect as s,useRef as c,useState as l}from"react";import{jsx as u,jsxs as d}from"react/jsx-runtime";function f(e){return typeof e==`string`?Object.fromEntries(e.split(`;`).map(e=>e.split(`:`)).filter(([e,t])=>e?.trim()&&t!==void 0).map(([e,...t])=>[e.trim().replace(/-([a-z])/g,(e,t)=>t.toUpperCase()),t.join(`:`).trim()])):e}function p(e,t){return function({children:n,class:r,className:i,style:a,...s}){let c=[t,i??r].filter(Boolean).join(` `);return o(e,{...s,className:c,...a===void 0?{}:{style:f(a)}},n)}}function m(e,t){return function({id:n,children:r}){return n?o(e,{id:n,className:t},/* @__PURE__ */ d(`a`,{href:`#${n}`,className:`prose-heading-link`,children:[/* @__PURE__ */ u(`span`,{className:`prose-heading-anchor`,children:`#`}),r]})):o(e,{className:t},r)}}const h=/* @__PURE__ */ m(`h1`,`prose-h1`),g=/* @__PURE__ */ m(`h2`,`prose-h2`),_=/* @__PURE__ */ m(`h3`,`prose-h3`),v=/* @__PURE__ */ m(`h4`,`prose-h4`),y=/* @__PURE__ */ m(`h5`,`prose-h5`),b=/* @__PURE__ */ m(`h6`,`prose-h6`);function x({href:e,target:t,children:n}){return/* @__PURE__ */ u(`a`,{className:`prose-a`,href:e,target:t,children:n})}function S({src:e,alt:t,width:n,height:r}){return/* @__PURE__ */ u(`img`,{className:`prose-img`,src:e,alt:t,width:n,height:r})}function C({code:e=``,filename:t,class:n,className:r,children:i}){let a=r??n,[o,f]=l(!1),p=c(null);s(()=>{for(let e of p.current?.querySelectorAll(`[class*=","]`)??[])e.setAttribute(`class`,e.getAttribute(`class`).split(`,`).join(` `))});let m=t?.replace(`:line-numbers`,``)||null,h=t?.includes(`:line-numbers`);async function g(){e&&(await navigator.clipboard.writeText(e),f(!0),setTimeout(()=>f(!1),2e3))}return/* @__PURE__ */ d(`div`,{className:`prose-pre`,children:[m&&/* @__PURE__ */ u(`div`,{className:`prose-pre-filename`,children:/* @__PURE__ */ u(`span`,{children:m})}),/* @__PURE__ */ u(`div`,{className:`prose-pre-actions`,children:/* @__PURE__ */ u(`button`,{type:`button`,className:`prose-pre-copy`,title:o?`Copied`:`Copy Code`,onClick:g,children:o?/* @__PURE__ */ u(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,children:/* @__PURE__ */ u(`path`,{d:`M20 6 9 17l-5-5`})}):/* @__PURE__ */ d(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,children:[/* @__PURE__ */ u(`rect`,{x:`9`,y:`9`,width:`13`,height:`13`,rx:`2`}),/* @__PURE__ */ u(`path`,{d:`M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1`})]})})}),/* @__PURE__ */ u(`pre`,{ref:p,className:[a,h?`prose-pre-line-numbers`:``].filter(Boolean).join(` `)||void 0,children:i})]})}function w({children:e}){return/* @__PURE__ */ u(`div`,{className:`prose-table-scroll`,children:/* @__PURE__ */ u(`table`,{className:`prose-table`,children:e})})}const T=/* @__PURE__ */ p(`p`,`prose-p`),E=/* @__PURE__ */ p(`blockquote`,`prose-blockquote`),D=/* @__PURE__ */ p(`code`,`prose-code`),O=/* @__PURE__ */ p(`em`,`prose-em`),k=/* @__PURE__ */ p(`strong`,`prose-strong`),A=/* @__PURE__ */ p(`li`,`prose-li`),j=/* @__PURE__ */ p(`ol`,`prose-ol`),M=/* @__PURE__ */ p(`ul`,`prose-ul`),N=/* @__PURE__ */ p(`tbody`,`prose-tbody`),P=/* @__PURE__ */ p(`td`,`prose-td`),F=/* @__PURE__ */ p(`th`,`prose-th`),I=/* @__PURE__ */ p(`thead`,`prose-thead`),L=/* @__PURE__ */ p(`tr`,`prose-tr`);function R(){return/* @__PURE__ */ u(`hr`,{className:`prose-hr`})}const z={ProseA:x,ProseBlockquote:E,ProseCode:D,ProseEm:O,ProseH1:h,ProseH2:g,ProseH3:_,ProseH4:v,ProseH5:y,ProseH6:b,ProseHr:R,ProseImg:S,ProseLi:A,ProseOl:j,ProseP:T,ProsePre:C,ProseStrong:k,ProseTable:w,ProseTbody:N,ProseTd:P,ProseTh:F,ProseThead:I,ProseTr:L,ProseUl:M};export{e as Markdown,t as MarkdownClient,n as MarkdownLive,r as MarkdownRenderer,x as ProseA,E as ProseBlockquote,D as ProseCode,O as ProseEm,h as ProseH1,g as ProseH2,_ as ProseH3,v as ProseH4,y as ProseH5,b as ProseH6,R as ProseHr,S as ProseImg,A as ProseLi,j as ProseOl,T as ProseP,C as ProsePre,k as ProseStrong,w as ProseTable,N as ProseTbody,P as ProseTd,F as ProseTh,I as ProseThead,L as ProseTr,M as ProseUl,i as defineMarkdownComponent,a as defineMarkdownRenderer,z as proseComponents};
|
package/package.json
CHANGED
|
@@ -1,22 +1,39 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@primeui-devkit/react-markdown",
|
|
3
|
-
"version": "0.1.0-rc.
|
|
3
|
+
"version": "0.1.0-rc.3",
|
|
4
|
+
"author": "PrimeTek Informatics",
|
|
4
5
|
"description": "React renderer for the PrimeUI DevKit markdown AST, plus the Prose* component set. The rendering backend is an internal implementation detail.",
|
|
5
6
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/primefaces/primeui-devkit.git",
|
|
10
|
+
"directory": "packages/markdown/react-markdown"
|
|
11
|
+
},
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://support.primeui.dev"
|
|
14
|
+
},
|
|
6
15
|
"type": "module",
|
|
16
|
+
"main": "./dist/index.js",
|
|
17
|
+
"module": "./dist/index.js",
|
|
18
|
+
"types": "./dist/index.d.ts",
|
|
7
19
|
"exports": {
|
|
8
20
|
".": {
|
|
9
21
|
"types": "./dist/index.d.ts",
|
|
10
|
-
"import": "./dist/index.js"
|
|
11
|
-
|
|
22
|
+
"import": "./dist/index.js",
|
|
23
|
+
"default": "./dist/index.js"
|
|
24
|
+
},
|
|
25
|
+
"./package.json": "./package.json"
|
|
26
|
+
},
|
|
27
|
+
"publishConfig": {
|
|
28
|
+
"access": "public"
|
|
12
29
|
},
|
|
30
|
+
"sideEffects": false,
|
|
13
31
|
"files": [
|
|
14
32
|
"dist",
|
|
15
33
|
"LICENSE.md",
|
|
16
34
|
"THIRD-PARTY-NOTICES.txt",
|
|
17
35
|
"README.md"
|
|
18
36
|
],
|
|
19
|
-
"sideEffects": false,
|
|
20
37
|
"dependencies": {
|
|
21
38
|
"@comark/react": "^0.5.1"
|
|
22
39
|
},
|
|
@@ -27,26 +44,20 @@
|
|
|
27
44
|
"@types/react": "^19.0.0",
|
|
28
45
|
"cross-env": "^10.1.0",
|
|
29
46
|
"react": "^19.0.0",
|
|
30
|
-
"tsup": "^8.5.1",
|
|
31
47
|
"typescript": "~6.0.0",
|
|
32
|
-
"vitest": "4.1.
|
|
33
|
-
"@primeui-devkit/
|
|
34
|
-
"@primeui-devkit/
|
|
35
|
-
"@primeui-devkit/
|
|
36
|
-
"@primeui-devkit/test-config": "0.0.
|
|
37
|
-
|
|
38
|
-
"types": "./dist/index.d.ts",
|
|
39
|
-
"module": "./dist/index.js",
|
|
40
|
-
"author": "PrimeTek Informatics",
|
|
41
|
-
"bugs": {
|
|
42
|
-
"url": "https://support.primeui.dev"
|
|
48
|
+
"vitest": "4.1.11",
|
|
49
|
+
"@primeui-devkit/cli": "0.1.0-rc.1",
|
|
50
|
+
"@primeui-devkit/bundle": "0.1.0-rc.1",
|
|
51
|
+
"@primeui-devkit/markdown-core": "0.1.0-rc.3",
|
|
52
|
+
"@primeui-devkit/test-config": "0.1.0-rc.1",
|
|
53
|
+
"@primeui-devkit/ts-config": "0.1.0-rc.1"
|
|
43
54
|
},
|
|
44
|
-
"
|
|
45
|
-
"
|
|
55
|
+
"engines": {
|
|
56
|
+
"node": ">=22.18.0"
|
|
46
57
|
},
|
|
47
58
|
"scripts": {
|
|
48
59
|
"build": "pnpm run build:package",
|
|
49
|
-
"build:package": "pnpm run test &&
|
|
60
|
+
"build:package": "pnpm run test && devkit bundle build",
|
|
50
61
|
"type:check": "tsc --noEmit",
|
|
51
62
|
"test": "cross-env NODE_ENV=test vitest run --passWithNoTests",
|
|
52
63
|
"test:watch": "vitest --watch --passWithNoTests",
|