@primeui-devkit/react-markdown 0.1.0-beta.1

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/LICENSE.md ADDED
@@ -0,0 +1,45 @@
1
+ # PrimeUI License
2
+
3
+ This package is part of **PrimeUI**, a family of commercial UI libraries by PrimeTek Informatics.
4
+
5
+ ## How PrimeUI May Be Used
6
+
7
+ PrimeUI may be used under one of two licenses. You choose the one that applies to you based on eligibility.
8
+
9
+ ### Community License (Free)
10
+
11
+ Free for organizations that meet all of the following criteria:
12
+
13
+ - Less than $1,000,000 USD in annual gross revenue
14
+ - Fewer than 5 developers
15
+ - Fewer than 10 employees
16
+ - Less than $3,000,000 USD in venture capital or outside funding
17
+
18
+ Individuals, students, non-profits, and non-commercial open source projects also qualify.
19
+
20
+ The Community License provides full access to the core libraries and supports up to 4 developers. It requires annual renewal by confirming continued eligibility.
21
+
22
+ ### Commercial License (Paid)
23
+
24
+ For organizations that do not qualify for the Community License.
25
+
26
+ Licensed per developer, perpetual, with one year of updates included. Renewal is optional and extends access to new versions. The Commercial Suite also includes PrimeBlocks, Theme Designer, all PrimeUI Pro components, and Premium Support.
27
+
28
+ ## License Key
29
+
30
+ A valid license key is required to use this software. License verification is performed offline, with no telemetry and no remote connection. A missing, invalid, or expired key may cause the software to display a license notice.
31
+
32
+ ## Full Terms
33
+
34
+ The complete license terms, eligibility details, and renewal information are available at:
35
+
36
+ - Community License: <https://primeui.dev/licenses/community>
37
+ - Commercial License: <https://primeui.dev/licenses/commercial>
38
+
39
+ ## Restrictions
40
+
41
+ This software is distributed as a compiled package. You may not reverse-engineer, decompile, or extract its source code, redistribute it as a component library or development tool, or remove its license mechanisms. Redistributing the software so that third parties can develop with it requires a separate OEM License. See the full terms for details.
42
+
43
+ ---
44
+
45
+ © 2026 PrimeTek Informatics. All rights reserved.
package/README.md ADDED
@@ -0,0 +1,16 @@
1
+ # @primeui-devkit/react-markdown
2
+
3
+ React renderer for the markdown AST, plus the `Prose*` component set.
4
+
5
+ ```tsx
6
+ import { MarkdownRenderer, proseComponents } from '@primeui-devkit/react-markdown';
7
+ import { DemoViewer } from './demo-viewer';
8
+
9
+ export function DocPage({ tree }) {
10
+ return <MarkdownRenderer tree={tree} components={{ ...proseComponents, 'demo-viewer': DemoViewer }} />;
11
+ }
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.
@@ -0,0 +1,36 @@
1
+ # Third-Party Notices
2
+
3
+ This package uses the following third-party open source software.
4
+ Each is provided under its own license, reproduced below.
5
+
6
+ ---
7
+
8
+ ## comark / @comark/react
9
+
10
+ Copyright (c) 2026 Comark team and contributors
11
+
12
+ The markdown engine and its React renderer used by this package (https://github.com/comarkdown/comark).
13
+
14
+ Licensed under the MIT License.
15
+
16
+ MIT License
17
+
18
+ Copyright (c) 2026 Comark team and contributors
19
+
20
+ Permission is hereby granted, free of charge, to any person obtaining a copy
21
+ of this software and associated documentation files (the "Software"), to deal
22
+ in the Software without restriction, including without limitation the rights
23
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
24
+ copies of the Software, and to permit persons to whom the Software is
25
+ furnished to do so, subject to the following conditions:
26
+
27
+ The above copyright notice and this permission notice shall be included in all
28
+ copies or substantial portions of the Software.
29
+
30
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
31
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
32
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
33
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
34
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
35
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
36
+ SOFTWARE.
@@ -0,0 +1,96 @@
1
+ export { Comark as Markdown, ComarkClient as MarkdownClient, ComarkLive as MarkdownLive, ComarkRenderer as MarkdownRenderer, defineComarkComponent as defineMarkdownComponent, defineComarkRendererComponent as defineMarkdownRenderer } from '@comark/react';
2
+ import * as react from 'react';
3
+ import { ReactNode } from 'react';
4
+
5
+ type ProseProps = {
6
+ children?: ReactNode;
7
+ [key: string]: unknown;
8
+ };
9
+ declare const ProseH1: ({ id, children }: ProseProps & {
10
+ id?: string;
11
+ }) => react.ReactElement<any, string | react.JSXElementConstructor<any>>;
12
+ declare const ProseH2: ({ id, children }: ProseProps & {
13
+ id?: string;
14
+ }) => react.ReactElement<any, string | react.JSXElementConstructor<any>>;
15
+ declare const ProseH3: ({ id, children }: ProseProps & {
16
+ id?: string;
17
+ }) => react.ReactElement<any, string | react.JSXElementConstructor<any>>;
18
+ declare const ProseH4: ({ id, children }: ProseProps & {
19
+ id?: string;
20
+ }) => react.ReactElement<any, string | react.JSXElementConstructor<any>>;
21
+ declare const ProseH5: ({ id, children }: ProseProps & {
22
+ id?: string;
23
+ }) => react.ReactElement<any, string | react.JSXElementConstructor<any>>;
24
+ declare const ProseH6: ({ id, children }: ProseProps & {
25
+ id?: string;
26
+ }) => react.ReactElement<any, string | react.JSXElementConstructor<any>>;
27
+ declare function ProseA({ href, target, children }: ProseProps & {
28
+ href?: string;
29
+ target?: string;
30
+ }): react.JSX.Element;
31
+ declare function ProseImg({ src, alt, width, height }: {
32
+ src?: string;
33
+ alt?: string;
34
+ width?: string | number;
35
+ height?: string | number;
36
+ }): react.JSX.Element;
37
+ declare function ProsePre({ code, filename, class: className, children }: ProseProps & {
38
+ code?: string;
39
+ filename?: string;
40
+ class?: string;
41
+ }): react.JSX.Element;
42
+ 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>>;
56
+ declare function ProseHr(): react.JSX.Element;
57
+ declare const proseComponents: {
58
+ 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>>;
62
+ ProseH1: ({ id, children }: ProseProps & {
63
+ id?: string;
64
+ }) => react.ReactElement<any, string | react.JSXElementConstructor<any>>;
65
+ ProseH2: ({ id, children }: ProseProps & {
66
+ id?: string;
67
+ }) => react.ReactElement<any, string | react.JSXElementConstructor<any>>;
68
+ ProseH3: ({ id, children }: ProseProps & {
69
+ id?: string;
70
+ }) => react.ReactElement<any, string | react.JSXElementConstructor<any>>;
71
+ ProseH4: ({ id, children }: ProseProps & {
72
+ id?: string;
73
+ }) => react.ReactElement<any, string | react.JSXElementConstructor<any>>;
74
+ ProseH5: ({ id, children }: ProseProps & {
75
+ id?: string;
76
+ }) => react.ReactElement<any, string | react.JSXElementConstructor<any>>;
77
+ ProseH6: ({ id, children }: ProseProps & {
78
+ id?: string;
79
+ }) => react.ReactElement<any, string | react.JSXElementConstructor<any>>;
80
+ ProseHr: typeof ProseHr;
81
+ 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>>;
85
+ ProsePre: typeof ProsePre;
86
+ ProseStrong: ({ children }: ProseProps) => react.ReactElement<any, string | react.JSXElementConstructor<any>>;
87
+ 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>>;
94
+ };
95
+
96
+ 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 ADDED
@@ -0,0 +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};
package/package.json ADDED
@@ -0,0 +1,55 @@
1
+ {
2
+ "name": "@primeui-devkit/react-markdown",
3
+ "version": "0.1.0-beta.1",
4
+ "description": "React renderer for the PrimeUI DevKit markdown AST, plus the Prose* component set. The rendering backend is an internal implementation detail.",
5
+ "license": "SEE LICENSE IN LICENSE.md",
6
+ "type": "module",
7
+ "exports": {
8
+ ".": {
9
+ "types": "./dist/index.d.ts",
10
+ "import": "./dist/index.js"
11
+ }
12
+ },
13
+ "files": [
14
+ "dist",
15
+ "LICENSE.md",
16
+ "THIRD-PARTY-NOTICES.txt",
17
+ "README.md"
18
+ ],
19
+ "sideEffects": false,
20
+ "dependencies": {
21
+ "@comark/react": "^0.5.1"
22
+ },
23
+ "peerDependencies": {
24
+ "react": ">=18.0.0"
25
+ },
26
+ "devDependencies": {
27
+ "@types/react": "^19.0.0",
28
+ "cross-env": "^10.1.0",
29
+ "react": "^19.0.0",
30
+ "tsup": "^8.5.1",
31
+ "typescript": "~6.0.0",
32
+ "vitest": "4.1.10",
33
+ "@primeui-devkit/bundler": "0.0.0",
34
+ "@primeui-devkit/markdown-core": "0.1.0-beta.1",
35
+ "@primeui-devkit/test-config": "0.0.0",
36
+ "@primeui-devkit/ts-config": "0.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"
43
+ },
44
+ "publishConfig": {
45
+ "access": "public"
46
+ },
47
+ "scripts": {
48
+ "build": "pnpm run build:package",
49
+ "build:package": "pnpm run test && tsup",
50
+ "type:check": "tsc --noEmit",
51
+ "test": "cross-env NODE_ENV=test vitest run --passWithNoTests",
52
+ "test:watch": "vitest --watch --passWithNoTests",
53
+ "test:coverage": "vitest run --coverage --passWithNoTests"
54
+ }
55
+ }