@kubb/renderer-jsx 5.0.0-beta.4 → 5.0.0-beta.41
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 +134 -0
- package/dist/index.cjs +621 -193
- package/dist/index.d.ts +326 -90
- package/dist/index.js +615 -193
- package/dist/jsx-dev-runtime.cjs +1 -1
- package/dist/jsx-dev-runtime.d.ts +7 -8
- package/dist/jsx-dev-runtime.js +2 -2
- package/dist/{jsx-namespace-CNp0arTN.d.ts → jsx-namespace-dmStM1a2.d.ts} +3 -3
- package/dist/{jsx-runtime-DdmO3p0U.cjs → jsx-runtime-4M1bV6ub.cjs} +9 -9
- package/dist/{jsx-runtime-Cvu_ZYgL.js → jsx-runtime-CQ6-_gue.js} +10 -10
- package/dist/jsx-runtime.cjs +1 -1
- package/dist/jsx-runtime.d.ts +9 -10
- package/dist/jsx-runtime.js +2 -2
- package/dist/{types-nAFMiWFw.d.ts → types-B5VGpHs0.d.ts} +11 -10
- package/dist/types.d.ts +1 -1
- package/package.json +8 -12
- package/src/Renderer.ts +1 -5
- package/src/Runtime.tsx +7 -18
- package/src/SyncRuntime.tsx +309 -0
- package/src/components/Callout.tsx +59 -0
- package/src/components/CodeBlock.tsx +37 -0
- package/src/components/Const.tsx +4 -4
- package/src/components/File.tsx +7 -5
- package/src/components/Frontmatter.tsx +38 -0
- package/src/components/Function.tsx +8 -8
- package/src/components/Heading.tsx +34 -0
- package/src/components/Jsx.tsx +1 -1
- package/src/components/List.tsx +40 -0
- package/src/components/Paragraph.tsx +28 -0
- package/src/components/Type.tsx +3 -3
- package/src/constants.ts +19 -9
- package/src/createRenderer.tsx +81 -62
- package/src/dom.ts +7 -19
- package/src/index.ts +7 -1
- package/src/types.ts +9 -8
- package/src/utils.ts +153 -174
- package/dist/index.cjs.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/jsx-dev-runtime.cjs.map +0 -1
- package/dist/jsx-dev-runtime.js.map +0 -1
- package/dist/jsx-runtime-Cvu_ZYgL.js.map +0 -1
- package/dist/jsx-runtime-DdmO3p0U.cjs.map +0 -1
- package/dist/jsx-runtime.cjs.map +0 -1
- package/dist/jsx-runtime.js.map +0 -1
- /package/dist/{chunk-Bb7HlUDG.js → chunk-DoukXa0m.js} +0 -0
package/dist/jsx-dev-runtime.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_jsx_runtime$1 = require("./jsx-runtime-
|
|
2
|
+
const require_jsx_runtime$1 = require("./jsx-runtime-4M1bV6ub.cjs");
|
|
3
3
|
//#region src/jsx-dev-runtime.ts
|
|
4
4
|
var import_jsx_runtime = /* @__PURE__ */ require_jsx_runtime$1.__toESM(require_jsx_runtime$1.require_jsx_runtime(), 1);
|
|
5
5
|
const Fragment = import_jsx_runtime.Fragment;
|
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import { n as __name } from "./chunk-
|
|
2
|
-
import { h as KubbReactNode, m as KubbReactElement } from "./types-
|
|
3
|
-
import { t as JSX } from "./jsx-namespace-
|
|
4
|
-
import * as
|
|
5
|
-
import * as React$1 from "react/jsx-runtime";
|
|
1
|
+
import { n as __name } from "./chunk-DoukXa0m.js";
|
|
2
|
+
import { h as KubbReactNode, m as KubbReactElement } from "./types-B5VGpHs0.js";
|
|
3
|
+
import { t as JSX } from "./jsx-namespace-dmStM1a2.js";
|
|
4
|
+
import * as React from "react/jsx-runtime";
|
|
6
5
|
|
|
7
6
|
//#region src/jsx-dev-runtime.d.ts
|
|
8
|
-
declare const Fragment:
|
|
9
|
-
declare const jsxDEV: typeof React
|
|
7
|
+
declare const Fragment: import("react").ExoticComponent<import("react").FragmentProps>;
|
|
8
|
+
declare const jsxDEV: typeof React.jsx;
|
|
10
9
|
type JSXElement = KubbReactElement;
|
|
11
10
|
type ReactNode = KubbReactNode;
|
|
12
11
|
//#endregion
|
|
13
|
-
export { Fragment, JSX, JSXElement, ReactNode, jsxDEV };
|
|
12
|
+
export { Fragment, type JSX, JSXElement, ReactNode, jsxDEV };
|
|
14
13
|
//# sourceMappingURL=jsx-dev-runtime.d.ts.map
|
package/dist/jsx-dev-runtime.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { r as __toESM } from "./chunk-
|
|
2
|
-
import { t as require_jsx_runtime } from "./jsx-runtime-
|
|
1
|
+
import { r as __toESM } from "./chunk-DoukXa0m.js";
|
|
2
|
+
import { t as require_jsx_runtime } from "./jsx-runtime-CQ6-_gue.js";
|
|
3
3
|
//#region src/jsx-dev-runtime.ts
|
|
4
4
|
var import_jsx_runtime = /* @__PURE__ */ __toESM(require_jsx_runtime(), 1);
|
|
5
5
|
const Fragment = import_jsx_runtime.Fragment;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as __name } from "./chunk-
|
|
2
|
-
import { _ as KubbTextProps, c as KubbConstProps, d as KubbFunctionProps, f as KubbImportProps, g as KubbSourceProps, h as KubbReactNode, l as KubbExportProps, m as KubbReactElement, p as KubbJsxProps, s as KubbArrowFunctionProps, u as KubbFileProps, v as KubbTypeProps, y as LineBreakProps } from "./types-
|
|
1
|
+
import { n as __name } from "./chunk-DoukXa0m.js";
|
|
2
|
+
import { _ as KubbTextProps, c as KubbConstProps, d as KubbFunctionProps, f as KubbImportProps, g as KubbSourceProps, h as KubbReactNode, l as KubbExportProps, m as KubbReactElement, p as KubbJsxProps, s as KubbArrowFunctionProps, u as KubbFileProps, v as KubbTypeProps, y as LineBreakProps } from "./types-B5VGpHs0.js";
|
|
3
3
|
import React from "react";
|
|
4
4
|
|
|
5
5
|
//#region src/jsx-namespace.d.ts
|
|
@@ -36,4 +36,4 @@ declare namespace JSX$1 {
|
|
|
36
36
|
}
|
|
37
37
|
//#endregion
|
|
38
38
|
export { JSX$1 as t };
|
|
39
|
-
//# sourceMappingURL=jsx-namespace-
|
|
39
|
+
//# sourceMappingURL=jsx-namespace-dmStM1a2.d.ts.map
|
|
@@ -25,7 +25,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
25
25
|
enumerable: true
|
|
26
26
|
}) : target, mod));
|
|
27
27
|
//#endregion
|
|
28
|
-
//#region ../../node_modules/.pnpm/react@19.2.
|
|
28
|
+
//#region ../../node_modules/.pnpm/react@19.2.6/node_modules/react/cjs/react-jsx-runtime.production.js
|
|
29
29
|
/**
|
|
30
30
|
* @license React
|
|
31
31
|
* react-jsx-runtime.production.js
|
|
@@ -60,7 +60,7 @@ var require_react_jsx_runtime_production = /* @__PURE__ */ __commonJSMin(((expor
|
|
|
60
60
|
exports.jsxs = jsxProd;
|
|
61
61
|
}));
|
|
62
62
|
//#endregion
|
|
63
|
-
//#region ../../node_modules/.pnpm/react@19.2.
|
|
63
|
+
//#region ../../node_modules/.pnpm/react@19.2.6/node_modules/react/cjs/react.production.js
|
|
64
64
|
/**
|
|
65
65
|
* @license React
|
|
66
66
|
* react.production.js
|
|
@@ -439,10 +439,10 @@ var require_react_production = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
439
439
|
exports.useTransition = function() {
|
|
440
440
|
return ReactSharedInternals.H.useTransition();
|
|
441
441
|
};
|
|
442
|
-
exports.version = "19.2.
|
|
442
|
+
exports.version = "19.2.6";
|
|
443
443
|
}));
|
|
444
444
|
//#endregion
|
|
445
|
-
//#region ../../node_modules/.pnpm/react@19.2.
|
|
445
|
+
//#region ../../node_modules/.pnpm/react@19.2.6/node_modules/react/cjs/react.development.js
|
|
446
446
|
/**
|
|
447
447
|
* @license React
|
|
448
448
|
* react.development.js
|
|
@@ -1235,18 +1235,18 @@ var require_react_development = /* @__PURE__ */ __commonJSMin(((exports, module)
|
|
|
1235
1235
|
exports.useTransition = function() {
|
|
1236
1236
|
return resolveDispatcher().useTransition();
|
|
1237
1237
|
};
|
|
1238
|
-
exports.version = "19.2.
|
|
1238
|
+
exports.version = "19.2.6";
|
|
1239
1239
|
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
|
|
1240
1240
|
})();
|
|
1241
1241
|
}));
|
|
1242
1242
|
//#endregion
|
|
1243
|
-
//#region ../../node_modules/.pnpm/react@19.2.
|
|
1243
|
+
//#region ../../node_modules/.pnpm/react@19.2.6/node_modules/react/index.js
|
|
1244
1244
|
var require_react = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1245
1245
|
if (process.env.NODE_ENV === "production") module.exports = require_react_production();
|
|
1246
1246
|
else module.exports = require_react_development();
|
|
1247
1247
|
}));
|
|
1248
1248
|
//#endregion
|
|
1249
|
-
//#region ../../node_modules/.pnpm/react@19.2.
|
|
1249
|
+
//#region ../../node_modules/.pnpm/react@19.2.6/node_modules/react/cjs/react-jsx-runtime.development.js
|
|
1250
1250
|
/**
|
|
1251
1251
|
* @license React
|
|
1252
1252
|
* react-jsx-runtime.development.js
|
|
@@ -1463,7 +1463,7 @@ var require_react_jsx_runtime_development = /* @__PURE__ */ __commonJSMin(((expo
|
|
|
1463
1463
|
})();
|
|
1464
1464
|
}));
|
|
1465
1465
|
//#endregion
|
|
1466
|
-
//#region ../../node_modules/.pnpm/react@19.2.
|
|
1466
|
+
//#region ../../node_modules/.pnpm/react@19.2.6/node_modules/react/jsx-runtime.js
|
|
1467
1467
|
var require_jsx_runtime = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1468
1468
|
if (process.env.NODE_ENV === "production") module.exports = require_react_jsx_runtime_production();
|
|
1469
1469
|
else module.exports = require_react_jsx_runtime_development();
|
|
@@ -1500,4 +1500,4 @@ Object.defineProperty(exports, "require_react", {
|
|
|
1500
1500
|
}
|
|
1501
1501
|
});
|
|
1502
1502
|
|
|
1503
|
-
//# sourceMappingURL=jsx-runtime-
|
|
1503
|
+
//# sourceMappingURL=jsx-runtime-4M1bV6ub.cjs.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as __commonJSMin } from "./chunk-
|
|
2
|
-
//#region ../../node_modules/.pnpm/react@19.2.
|
|
1
|
+
import { t as __commonJSMin } from "./chunk-DoukXa0m.js";
|
|
2
|
+
//#region ../../node_modules/.pnpm/react@19.2.6/node_modules/react/cjs/react-jsx-runtime.production.js
|
|
3
3
|
/**
|
|
4
4
|
* @license React
|
|
5
5
|
* react-jsx-runtime.production.js
|
|
@@ -34,7 +34,7 @@ var require_react_jsx_runtime_production = /* @__PURE__ */ __commonJSMin(((expor
|
|
|
34
34
|
exports.jsxs = jsxProd;
|
|
35
35
|
}));
|
|
36
36
|
//#endregion
|
|
37
|
-
//#region ../../node_modules/.pnpm/react@19.2.
|
|
37
|
+
//#region ../../node_modules/.pnpm/react@19.2.6/node_modules/react/cjs/react.production.js
|
|
38
38
|
/**
|
|
39
39
|
* @license React
|
|
40
40
|
* react.production.js
|
|
@@ -413,10 +413,10 @@ var require_react_production = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
413
413
|
exports.useTransition = function() {
|
|
414
414
|
return ReactSharedInternals.H.useTransition();
|
|
415
415
|
};
|
|
416
|
-
exports.version = "19.2.
|
|
416
|
+
exports.version = "19.2.6";
|
|
417
417
|
}));
|
|
418
418
|
//#endregion
|
|
419
|
-
//#region ../../node_modules/.pnpm/react@19.2.
|
|
419
|
+
//#region ../../node_modules/.pnpm/react@19.2.6/node_modules/react/cjs/react.development.js
|
|
420
420
|
/**
|
|
421
421
|
* @license React
|
|
422
422
|
* react.development.js
|
|
@@ -1209,18 +1209,18 @@ var require_react_development = /* @__PURE__ */ __commonJSMin(((exports, module)
|
|
|
1209
1209
|
exports.useTransition = function() {
|
|
1210
1210
|
return resolveDispatcher().useTransition();
|
|
1211
1211
|
};
|
|
1212
|
-
exports.version = "19.2.
|
|
1212
|
+
exports.version = "19.2.6";
|
|
1213
1213
|
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
|
|
1214
1214
|
})();
|
|
1215
1215
|
}));
|
|
1216
1216
|
//#endregion
|
|
1217
|
-
//#region ../../node_modules/.pnpm/react@19.2.
|
|
1217
|
+
//#region ../../node_modules/.pnpm/react@19.2.6/node_modules/react/index.js
|
|
1218
1218
|
var require_react = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1219
1219
|
if (process.env.NODE_ENV === "production") module.exports = require_react_production();
|
|
1220
1220
|
else module.exports = require_react_development();
|
|
1221
1221
|
}));
|
|
1222
1222
|
//#endregion
|
|
1223
|
-
//#region ../../node_modules/.pnpm/react@19.2.
|
|
1223
|
+
//#region ../../node_modules/.pnpm/react@19.2.6/node_modules/react/cjs/react-jsx-runtime.development.js
|
|
1224
1224
|
/**
|
|
1225
1225
|
* @license React
|
|
1226
1226
|
* react-jsx-runtime.development.js
|
|
@@ -1437,7 +1437,7 @@ var require_react_jsx_runtime_development = /* @__PURE__ */ __commonJSMin(((expo
|
|
|
1437
1437
|
})();
|
|
1438
1438
|
}));
|
|
1439
1439
|
//#endregion
|
|
1440
|
-
//#region ../../node_modules/.pnpm/react@19.2.
|
|
1440
|
+
//#region ../../node_modules/.pnpm/react@19.2.6/node_modules/react/jsx-runtime.js
|
|
1441
1441
|
var require_jsx_runtime = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1442
1442
|
if (process.env.NODE_ENV === "production") module.exports = require_react_jsx_runtime_production();
|
|
1443
1443
|
else module.exports = require_react_jsx_runtime_development();
|
|
@@ -1445,4 +1445,4 @@ var require_jsx_runtime = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1445
1445
|
//#endregion
|
|
1446
1446
|
export { require_react as n, require_jsx_runtime as t };
|
|
1447
1447
|
|
|
1448
|
-
//# sourceMappingURL=jsx-runtime-
|
|
1448
|
+
//# sourceMappingURL=jsx-runtime-CQ6-_gue.js.map
|
package/dist/jsx-runtime.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_jsx_runtime$1 = require("./jsx-runtime-
|
|
2
|
+
const require_jsx_runtime$1 = require("./jsx-runtime-4M1bV6ub.cjs");
|
|
3
3
|
//#region src/jsx-runtime.ts
|
|
4
4
|
var import_jsx_runtime = /* @__PURE__ */ require_jsx_runtime$1.__toESM(require_jsx_runtime$1.require_jsx_runtime(), 1);
|
|
5
5
|
const Fragment = import_jsx_runtime.Fragment;
|
package/dist/jsx-runtime.d.ts
CHANGED
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
import { n as __name } from "./chunk-
|
|
2
|
-
import { h as KubbReactNode, m as KubbReactElement } from "./types-
|
|
3
|
-
import { t as JSX } from "./jsx-namespace-
|
|
4
|
-
import * as
|
|
5
|
-
import * as React$1 from "react/jsx-runtime";
|
|
1
|
+
import { n as __name } from "./chunk-DoukXa0m.js";
|
|
2
|
+
import { h as KubbReactNode, m as KubbReactElement } from "./types-B5VGpHs0.js";
|
|
3
|
+
import { t as JSX } from "./jsx-namespace-dmStM1a2.js";
|
|
4
|
+
import * as React from "react/jsx-runtime";
|
|
6
5
|
|
|
7
6
|
//#region src/jsx-runtime.d.ts
|
|
8
|
-
declare const Fragment:
|
|
9
|
-
declare const jsx: typeof React
|
|
10
|
-
declare const jsxDEV: typeof React
|
|
11
|
-
declare const jsxs: typeof React
|
|
7
|
+
declare const Fragment: import("react").ExoticComponent<import("react").FragmentProps>;
|
|
8
|
+
declare const jsx: typeof React.jsx;
|
|
9
|
+
declare const jsxDEV: typeof React.jsx;
|
|
10
|
+
declare const jsxs: typeof React.jsxs;
|
|
12
11
|
type JSXElement = KubbReactElement;
|
|
13
12
|
type ReactNode = KubbReactNode;
|
|
14
13
|
//#endregion
|
|
15
|
-
export { Fragment, JSX, JSXElement, ReactNode, jsx, jsxDEV, jsxs };
|
|
14
|
+
export { Fragment, type JSX, JSXElement, ReactNode, jsx, jsxDEV, jsxs };
|
|
16
15
|
//# sourceMappingURL=jsx-runtime.d.ts.map
|
package/dist/jsx-runtime.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { r as __toESM } from "./chunk-
|
|
2
|
-
import { t as require_jsx_runtime } from "./jsx-runtime-
|
|
1
|
+
import { r as __toESM } from "./chunk-DoukXa0m.js";
|
|
2
|
+
import { t as require_jsx_runtime } from "./jsx-runtime-CQ6-_gue.js";
|
|
3
3
|
//#region src/jsx-runtime.ts
|
|
4
4
|
var import_jsx_runtime = /* @__PURE__ */ __toESM(require_jsx_runtime(), 1);
|
|
5
5
|
const Fragment = import_jsx_runtime.Fragment;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as __name } from "./chunk-
|
|
1
|
+
import { n as __name } from "./chunk-DoukXa0m.js";
|
|
2
2
|
import { ArrowFunctionNode, ConstNode, ExportNode, FileNode, FunctionNode, ImportNode, SourceNode, TypeNode } from "@kubb/ast";
|
|
3
3
|
import React, { JSX, ReactNode } from "react";
|
|
4
4
|
|
|
@@ -13,13 +13,14 @@ type Key = string | number | bigint;
|
|
|
13
13
|
*/
|
|
14
14
|
type ElementNames = 'br' | 'div' | 'indent' | 'dedent' | 'kubb-jsx' | 'kubb-text' | 'kubb-file' | 'kubb-source' | 'kubb-import' | 'kubb-export' | 'kubb-function' | 'kubb-arrow-function' | 'kubb-const' | 'kubb-type' | 'kubb-root' | 'kubb-app';
|
|
15
15
|
type Node = {
|
|
16
|
-
parentNode: DOMElement |
|
|
16
|
+
parentNode: DOMElement | null;
|
|
17
17
|
internal_static?: boolean;
|
|
18
18
|
};
|
|
19
19
|
/**
|
|
20
20
|
* Allowed attribute value types for DOM elements.
|
|
21
|
+
* `null` signals intentionally empty, the prop was explicitly cleared.
|
|
21
22
|
*/
|
|
22
|
-
type DOMNodeAttribute = boolean | string | number | Record<string, unknown> | Array<unknown>;
|
|
23
|
+
type DOMNodeAttribute = boolean | string | number | null | Record<string, unknown> | Array<unknown>;
|
|
23
24
|
type TextName = '#text';
|
|
24
25
|
/**
|
|
25
26
|
* Leaf DOM node containing raw text.
|
|
@@ -29,7 +30,7 @@ type TextNode = {
|
|
|
29
30
|
nodeValue: string;
|
|
30
31
|
} & Node;
|
|
31
32
|
/**
|
|
32
|
-
* Virtual DOM node
|
|
33
|
+
* Virtual DOM node, either a text node or a named element.
|
|
33
34
|
*/
|
|
34
35
|
type DOMNode<T = {
|
|
35
36
|
nodeName: NodeNames;
|
|
@@ -46,11 +47,11 @@ type DOMElement = {
|
|
|
46
47
|
/**
|
|
47
48
|
* Key/value attributes passed as JSX props to this element.
|
|
48
49
|
*/
|
|
49
|
-
attributes:
|
|
50
|
+
attributes: Record<string, DOMNodeAttribute>;
|
|
50
51
|
/**
|
|
51
52
|
* Ordered list of child nodes attached to this element.
|
|
52
53
|
*/
|
|
53
|
-
childNodes: DOMNode
|
|
54
|
+
childNodes: Array<DOMNode>;
|
|
54
55
|
internal_transform?: OutputTransformer;
|
|
55
56
|
isStaticDirty?: boolean;
|
|
56
57
|
staticNode?: DOMElement;
|
|
@@ -86,12 +87,12 @@ type KubbTextProps = {
|
|
|
86
87
|
* Represents a generated file.
|
|
87
88
|
*/
|
|
88
89
|
type KubbFileProps = {
|
|
89
|
-
id?: string;
|
|
90
|
+
id?: string | null;
|
|
90
91
|
children?: KubbReactNode;
|
|
91
92
|
baseName: string;
|
|
92
93
|
path: string;
|
|
93
|
-
override?: boolean;
|
|
94
|
-
meta?: FileNode['meta'];
|
|
94
|
+
override?: boolean | null;
|
|
95
|
+
meta?: FileNode['meta'] | null;
|
|
95
96
|
};
|
|
96
97
|
/**
|
|
97
98
|
* Props for the `<kubb-source>` element.
|
|
@@ -165,4 +166,4 @@ type JSDoc = {
|
|
|
165
166
|
};
|
|
166
167
|
//#endregion
|
|
167
168
|
export { KubbTextProps as _, JSDoc as a, TextNode as b, KubbConstProps as c, KubbFunctionProps as d, KubbImportProps as f, KubbSourceProps as g, KubbReactNode as h, ElementNames as i, KubbExportProps as l, KubbReactElement as m, DOMNode as n, Key as o, KubbJsxProps as p, DOMNodeAttribute as r, KubbArrowFunctionProps as s, DOMElement as t, KubbFileProps as u, KubbTypeProps as v, LineBreakProps as y };
|
|
168
|
-
//# sourceMappingURL=types-
|
|
169
|
+
//# sourceMappingURL=types-B5VGpHs0.d.ts.map
|
package/dist/types.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { _ as KubbTextProps, a as JSDoc, b as TextNode, c as KubbConstProps, d as KubbFunctionProps, f as KubbImportProps, g as KubbSourceProps, h as KubbReactNode, i as ElementNames, l as KubbExportProps, m as KubbReactElement, n as DOMNode, o as Key, p as KubbJsxProps, r as DOMNodeAttribute, s as KubbArrowFunctionProps, t as DOMElement, u as KubbFileProps, v as KubbTypeProps, y as LineBreakProps } from "./types-
|
|
1
|
+
import { _ as KubbTextProps, a as JSDoc, b as TextNode, c as KubbConstProps, d as KubbFunctionProps, f as KubbImportProps, g as KubbSourceProps, h as KubbReactNode, i as ElementNames, l as KubbExportProps, m as KubbReactElement, n as DOMNode, o as Key, p as KubbJsxProps, r as DOMNodeAttribute, s as KubbArrowFunctionProps, t as DOMElement, u as KubbFileProps, v as KubbTypeProps, y as LineBreakProps } from "./types-B5VGpHs0.js";
|
|
2
2
|
export { DOMElement, DOMNode, DOMNodeAttribute, ElementNames, JSDoc, Key, KubbArrowFunctionProps, KubbConstProps, KubbExportProps, KubbFileProps, KubbFunctionProps, KubbImportProps, KubbJsxProps, KubbReactElement, KubbReactNode, KubbSourceProps, KubbTextProps, KubbTypeProps, LineBreakProps, TextNode };
|
package/package.json
CHANGED
|
@@ -1,19 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kubb/renderer-jsx",
|
|
3
|
-
"version": "5.0.0-beta.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "5.0.0-beta.41",
|
|
4
|
+
"description": "JSX-based renderer for Kubb. Provides a custom React runtime, reconciler, and built-in components (File, Function, Type, Const) for component-based, type-safe code generation.",
|
|
5
5
|
"keywords": [
|
|
6
|
-
"code-generator",
|
|
7
6
|
"codegen",
|
|
8
|
-
"component-generation",
|
|
9
|
-
"file-generation",
|
|
10
7
|
"jsx",
|
|
11
8
|
"jsx-runtime",
|
|
12
9
|
"kubb",
|
|
13
|
-
"plugin-system",
|
|
14
|
-
"plugins",
|
|
15
10
|
"react",
|
|
16
|
-
"react-reconciler",
|
|
17
11
|
"typescript"
|
|
18
12
|
],
|
|
19
13
|
"license": "MIT",
|
|
@@ -81,12 +75,13 @@
|
|
|
81
75
|
"registry": "https://registry.npmjs.org/"
|
|
82
76
|
},
|
|
83
77
|
"dependencies": {
|
|
84
|
-
"
|
|
78
|
+
"yaml": "^2.9.0",
|
|
79
|
+
"@kubb/ast": "5.0.0-beta.41"
|
|
85
80
|
},
|
|
86
81
|
"devDependencies": {
|
|
87
|
-
"@types/react": "^19.2.
|
|
82
|
+
"@types/react": "^19.2.16",
|
|
88
83
|
"@types/react-reconciler": "0.33.0",
|
|
89
|
-
"react": "19.2.
|
|
84
|
+
"react": "19.2.6",
|
|
90
85
|
"react-reconciler": "0.33.0",
|
|
91
86
|
"@internals/utils": "0.0.0"
|
|
92
87
|
},
|
|
@@ -101,7 +96,7 @@
|
|
|
101
96
|
"node": ">=22"
|
|
102
97
|
},
|
|
103
98
|
"inlinedDependencies": {
|
|
104
|
-
"react": "19.2.
|
|
99
|
+
"react": "19.2.6",
|
|
105
100
|
"react-reconciler": "0.33.0",
|
|
106
101
|
"scheduler": "0.27.0"
|
|
107
102
|
},
|
|
@@ -112,6 +107,7 @@
|
|
|
112
107
|
"lint:fix": "oxlint --fix .",
|
|
113
108
|
"release": "pnpm publish --no-git-check",
|
|
114
109
|
"release:canary": "bash ../../.github/canary.sh && node ../../scripts/build.js canary && pnpm publish --no-git-check -tag canary",
|
|
110
|
+
"release:stage": "pnpm stage publish --no-git-check",
|
|
115
111
|
"start": "tsdown --watch ./src",
|
|
116
112
|
"start:devtools": "npx react-devtools",
|
|
117
113
|
"test": "vitest --passWithNoTests",
|
package/src/Renderer.ts
CHANGED
|
@@ -105,7 +105,7 @@ export const Renderer = Reconciler({
|
|
|
105
105
|
return false
|
|
106
106
|
},
|
|
107
107
|
supportsMutation: true,
|
|
108
|
-
isPrimaryRenderer:
|
|
108
|
+
isPrimaryRenderer: false,
|
|
109
109
|
supportsPersistence: false,
|
|
110
110
|
supportsHydration: false,
|
|
111
111
|
scheduleTimeout: setTimeout,
|
|
@@ -155,9 +155,7 @@ export const Renderer = Reconciler({
|
|
|
155
155
|
maySuspendCommit() {
|
|
156
156
|
return false
|
|
157
157
|
},
|
|
158
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
159
158
|
NotPendingTransition: undefined,
|
|
160
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
161
159
|
HostTransitionContext: createContext(null) as unknown as ReactContext<unknown>,
|
|
162
160
|
resetFormInstance() {},
|
|
163
161
|
requestPostPaintCallback() {},
|
|
@@ -180,5 +178,3 @@ export const Renderer = Reconciler({
|
|
|
180
178
|
return null
|
|
181
179
|
},
|
|
182
180
|
})
|
|
183
|
-
|
|
184
|
-
export type { FiberRoot } from 'react-reconciler'
|
package/src/Runtime.tsx
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { onProcessExit } from '@internals/utils'
|
|
2
2
|
import type { FileNode } from '@kubb/ast'
|
|
3
|
-
import {
|
|
3
|
+
import { LegacyRoot } from 'react-reconciler/constants.js'
|
|
4
4
|
import { Root } from './components/Root.tsx'
|
|
5
5
|
import { createNode } from './dom.ts'
|
|
6
|
-
import type { FiberRoot } from '
|
|
6
|
+
import type { FiberRoot } from 'react-reconciler'
|
|
7
7
|
import { Renderer } from './Renderer.ts'
|
|
8
8
|
import type { DOMElement, KubbReactElement } from './types.ts'
|
|
9
|
-
import {
|
|
9
|
+
import { collectFiles } from './utils.ts'
|
|
10
10
|
|
|
11
11
|
type Options = {
|
|
12
12
|
/**
|
|
@@ -22,11 +22,11 @@ export class Runtime {
|
|
|
22
22
|
|
|
23
23
|
exitPromise?: Promise<void>
|
|
24
24
|
|
|
25
|
-
nodes: FileNode
|
|
25
|
+
nodes: Array<FileNode> = []
|
|
26
26
|
readonly #container: FiberRoot
|
|
27
27
|
readonly #rootNode: DOMElement
|
|
28
28
|
|
|
29
|
-
constructor(options: Options) {
|
|
29
|
+
constructor(options: Options = {}) {
|
|
30
30
|
this.#options = options
|
|
31
31
|
this.#rootNode = createNode('kubb-root')
|
|
32
32
|
this.#rootNode.onRender = this.onRender
|
|
@@ -51,7 +51,7 @@ export class Runtime {
|
|
|
51
51
|
|
|
52
52
|
const logRecoverableError = typeof reportError === 'function' ? reportError : console.error
|
|
53
53
|
|
|
54
|
-
const rootTag =
|
|
54
|
+
const rootTag = LegacyRoot
|
|
55
55
|
this.#container = Renderer.createContainer(
|
|
56
56
|
this.#rootNode,
|
|
57
57
|
rootTag,
|
|
@@ -86,7 +86,7 @@ export class Runtime {
|
|
|
86
86
|
return
|
|
87
87
|
}
|
|
88
88
|
|
|
89
|
-
const files =
|
|
89
|
+
const files = collectFiles(this.#rootNode)
|
|
90
90
|
|
|
91
91
|
this.nodes.push(...files)
|
|
92
92
|
|
|
@@ -156,15 +156,4 @@ export class Runtime {
|
|
|
156
156
|
|
|
157
157
|
this.resolveExitPromise()
|
|
158
158
|
}
|
|
159
|
-
|
|
160
|
-
async waitUntilExit(): Promise<void> {
|
|
161
|
-
if (!this.exitPromise) {
|
|
162
|
-
this.exitPromise = new Promise((resolve, reject) => {
|
|
163
|
-
this.resolveExitPromise = resolve
|
|
164
|
-
this.rejectExitPromise = reject
|
|
165
|
-
})
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
return this.exitPromise
|
|
169
|
-
}
|
|
170
159
|
}
|