@kubb/react-fabric 0.2.18 → 0.3.0
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/{Fabric-DX0joaWR.d.cts → Fabric-D1uNzkRd.d.cts} +4 -4
- package/dist/{Fabric-7g9iQC3E.d.ts → Fabric-OfeFgFB2.d.ts} +4 -4
- package/dist/{devtools-CLhxB1Hr.cjs → devtools-BajE-eCd.cjs} +1 -3
- package/dist/{devtools-CLhxB1Hr.cjs.map → devtools-BajE-eCd.cjs.map} +1 -1
- package/dist/devtools.cjs +1 -1
- package/dist/globals.d.cts +2 -2
- package/dist/globals.d.ts +2 -2
- package/dist/index.cjs +18 -22
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +16 -17
- package/dist/index.js.map +1 -1
- package/dist/jsx-dev-runtime.cjs +0 -1
- package/dist/jsx-dev-runtime.d.cts +3 -3
- package/dist/jsx-dev-runtime.d.ts +3 -3
- package/dist/{jsx-namespace-ChOBBWsr.d.ts → jsx-namespace-BEUVmgyn.d.ts} +2 -2
- package/dist/{jsx-namespace-BrIMxQyM.d.cts → jsx-namespace-kapEWb5o.d.cts} +2 -2
- package/dist/jsx-runtime-BhbaU98p.cjs +2 -0
- package/dist/jsx-runtime.cjs +1 -3
- package/dist/jsx-runtime.d.cts +3 -3
- package/dist/jsx-runtime.d.ts +3 -3
- package/dist/parsers.d.cts +1 -2
- package/dist/parsers.d.ts +1 -2
- package/dist/plugins.cjs +2 -2
- package/dist/plugins.d.cts +2 -2
- package/dist/plugins.d.ts +2 -2
- package/dist/plugins.js +1 -1
- package/dist/{reactPlugin-BKFEDZfC.js → reactPlugin-B7zzvM5n.js} +136 -115
- package/dist/reactPlugin-B7zzvM5n.js.map +1 -0
- package/dist/{reactPlugin-CiFqRD0J.cjs → reactPlugin-B9OmXm5F.cjs} +136 -121
- package/dist/reactPlugin-B9OmXm5F.cjs.map +1 -0
- package/dist/{reactPlugin-CNdpw8pN.d.ts → reactPlugin-DVGn6gSn.d.ts} +2 -2
- package/dist/{reactPlugin-DvAUyVTQ.d.cts → reactPlugin-heqDYGKi.d.cts} +2 -2
- package/dist/{types-CGgYj2pZ.d.ts → types-34ycUiHt.d.ts} +3 -3
- package/dist/{types-Xd33VuKS.d.cts → types-zrCju594.d.cts} +3 -3
- package/dist/types.d.cts +2 -2
- package/dist/types.d.ts +2 -2
- package/package.json +2 -2
- package/src/Runtime.tsx +38 -58
- package/src/components/Indent.tsx +3 -3
- package/src/composables/useLifecycle.tsx +3 -1
- package/src/dom.ts +3 -3
- package/src/types.ts +1 -1
- package/src/utils/createJSDoc.ts +3 -4
- package/src/utils/processFiles.ts +15 -19
- package/src/utils/squashExportNodes.ts +21 -11
- package/src/utils/squashImportNodes.ts +22 -11
- package/src/utils/squashSourceNodes.ts +32 -28
- package/src/utils/squashTextNodes.ts +65 -56
- package/dist/jsx-runtime-CywUjp4I.cjs +0 -5
- package/dist/reactPlugin-BKFEDZfC.js.map +0 -1
- package/dist/reactPlugin-CiFqRD0J.cjs.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as KubbExportProps, d as KubbNode, f as KubbSourceProps, l as KubbFileProps, m as LineBreakProps, p as KubbTextProps, s as KubbElement, u as KubbImportProps } from "./types-
|
|
1
|
+
import { c as KubbExportProps, d as KubbNode, f as KubbSourceProps, l as KubbFileProps, m as LineBreakProps, p as KubbTextProps, s as KubbElement, u as KubbImportProps } from "./types-34ycUiHt.js";
|
|
2
2
|
import React from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/jsx-namespace.d.ts
|
|
@@ -28,4 +28,4 @@ declare namespace JSX$1 {
|
|
|
28
28
|
}
|
|
29
29
|
//#endregion
|
|
30
30
|
export { JSX$1 as t };
|
|
31
|
-
//# sourceMappingURL=jsx-namespace-
|
|
31
|
+
//# sourceMappingURL=jsx-namespace-BEUVmgyn.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as KubbExportProps, d as KubbNode, f as KubbSourceProps, l as KubbFileProps, m as LineBreakProps, p as KubbTextProps, s as KubbElement, u as KubbImportProps } from "./types-
|
|
1
|
+
import { c as KubbExportProps, d as KubbNode, f as KubbSourceProps, l as KubbFileProps, m as LineBreakProps, p as KubbTextProps, s as KubbElement, u as KubbImportProps } from "./types-zrCju594.cjs";
|
|
2
2
|
import React from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/jsx-namespace.d.ts
|
|
@@ -28,4 +28,4 @@ declare namespace JSX$1 {
|
|
|
28
28
|
}
|
|
29
29
|
//#endregion
|
|
30
30
|
export { JSX$1 as t };
|
|
31
|
-
//# sourceMappingURL=jsx-namespace-
|
|
31
|
+
//# sourceMappingURL=jsx-namespace-kapEWb5o.d.cts.map
|
package/dist/jsx-runtime.cjs
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
const require_chunk = require('./chunk-CUT6urMc.cjs');
|
|
2
|
-
require('./jsx-runtime-
|
|
2
|
+
require('./jsx-runtime-BhbaU98p.cjs');
|
|
3
3
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
4
|
-
react_jsx_runtime = require_chunk.__toESM(react_jsx_runtime);
|
|
5
4
|
let react_jsx_dev_runtime = require("react/jsx-dev-runtime");
|
|
6
|
-
react_jsx_dev_runtime = require_chunk.__toESM(react_jsx_dev_runtime);
|
|
7
5
|
|
|
8
6
|
Object.defineProperty(exports, 'Fragment', {
|
|
9
7
|
enumerable: true,
|
package/dist/jsx-runtime.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import "./Fabric-
|
|
2
|
-
import { d as KubbNode, s as KubbElement } from "./types-
|
|
3
|
-
import { t as JSX } from "./jsx-namespace-
|
|
1
|
+
import "./Fabric-D1uNzkRd.cjs";
|
|
2
|
+
import { d as KubbNode, s as KubbElement } from "./types-zrCju594.cjs";
|
|
3
|
+
import { t as JSX } from "./jsx-namespace-kapEWb5o.cjs";
|
|
4
4
|
import { jsxDEV } from "react/jsx-dev-runtime";
|
|
5
5
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
6
6
|
|
package/dist/jsx-runtime.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import "./Fabric-
|
|
2
|
-
import { d as KubbNode, s as KubbElement } from "./types-
|
|
3
|
-
import { t as JSX } from "./jsx-namespace-
|
|
1
|
+
import "./Fabric-OfeFgFB2.js";
|
|
2
|
+
import { d as KubbNode, s as KubbElement } from "./types-34ycUiHt.js";
|
|
3
|
+
import { t as JSX } from "./jsx-namespace-BEUVmgyn.js";
|
|
4
4
|
import { jsxDEV } from "react/jsx-dev-runtime";
|
|
5
5
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
6
6
|
|
package/dist/parsers.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { d as UserParser, u as Parser } from "./Fabric-
|
|
1
|
+
import { d as UserParser, u as Parser } from "./Fabric-D1uNzkRd.cjs";
|
|
2
2
|
|
|
3
3
|
//#region ../fabric-core/src/parsers/createParser.d.ts
|
|
4
4
|
declare function createParser<TOptions = unknown, TMeta extends object = any>(parser: UserParser<TOptions, TMeta>): Parser<TOptions, TMeta>;
|
|
@@ -10,7 +10,6 @@ declare const defaultParser: Parser<[], any>;
|
|
|
10
10
|
declare const tsxParser: Parser<[], any>;
|
|
11
11
|
//#endregion
|
|
12
12
|
//#region ../fabric-core/src/parsers/typescriptParser.d.ts
|
|
13
|
-
|
|
14
13
|
declare const typescriptParser: Parser<[], any>;
|
|
15
14
|
//#endregion
|
|
16
15
|
export { createParser, defaultParser, tsxParser, typescriptParser };
|
package/dist/parsers.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { d as UserParser, u as Parser } from "./Fabric-
|
|
1
|
+
import { d as UserParser, u as Parser } from "./Fabric-OfeFgFB2.js";
|
|
2
2
|
|
|
3
3
|
//#region ../fabric-core/src/parsers/createParser.d.ts
|
|
4
4
|
declare function createParser<TOptions = unknown, TMeta extends object = any>(parser: UserParser<TOptions, TMeta>): Parser<TOptions, TMeta>;
|
|
@@ -10,7 +10,6 @@ declare const defaultParser: Parser<[], any>;
|
|
|
10
10
|
declare const tsxParser: Parser<[], any>;
|
|
11
11
|
//#endregion
|
|
12
12
|
//#region ../fabric-core/src/parsers/typescriptParser.d.ts
|
|
13
|
-
|
|
14
13
|
declare const typescriptParser: Parser<[], any>;
|
|
15
14
|
//#endregion
|
|
16
15
|
export { createParser, defaultParser, tsxParser, typescriptParser };
|
package/dist/plugins.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const require_reactPlugin = require('./reactPlugin-
|
|
2
|
-
require('./jsx-runtime-
|
|
1
|
+
const require_reactPlugin = require('./reactPlugin-B9OmXm5F.cjs');
|
|
2
|
+
require('./jsx-runtime-BhbaU98p.cjs');
|
|
3
3
|
|
|
4
4
|
exports.reactPlugin = require_reactPlugin.reactPlugin;
|
|
5
5
|
var __kubb_fabric_core_plugins = require("@kubb/fabric-core/plugins");
|
package/dist/plugins.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { m as Extname, o as Plugin, s as UserPlugin } from "./Fabric-
|
|
2
|
-
import { n as reactPlugin } from "./reactPlugin-
|
|
1
|
+
import { m as Extname, o as Plugin, s as UserPlugin } from "./Fabric-D1uNzkRd.cjs";
|
|
2
|
+
import { n as reactPlugin } from "./reactPlugin-heqDYGKi.cjs";
|
|
3
3
|
|
|
4
4
|
//#region ../fabric-core/src/plugins/barrelPlugin.d.ts
|
|
5
5
|
type Mode = 'all' | 'named' | 'propagate' | false;
|
package/dist/plugins.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { m as Extname, o as Plugin, s as UserPlugin } from "./Fabric-
|
|
2
|
-
import { n as reactPlugin } from "./reactPlugin-
|
|
1
|
+
import { m as Extname, o as Plugin, s as UserPlugin } from "./Fabric-OfeFgFB2.js";
|
|
2
|
+
import { n as reactPlugin } from "./reactPlugin-DVGn6gSn.js";
|
|
3
3
|
|
|
4
4
|
//#region ../fabric-core/src/plugins/barrelPlugin.d.ts
|
|
5
5
|
type Mode = 'all' | 'named' | 'propagate' | false;
|
package/dist/plugins.js
CHANGED
|
@@ -7,7 +7,7 @@ import { ConcurrentRoot, DefaultEventPriority, NoEventPriority } from "react-rec
|
|
|
7
7
|
import Reconciler from "react-reconciler";
|
|
8
8
|
import { createExport, createImport, print } from "@kubb/fabric-core/parsers/typescript";
|
|
9
9
|
|
|
10
|
-
//#region \0@oxc-project+runtime@0.
|
|
10
|
+
//#region \0@oxc-project+runtime@0.96.0/helpers/typeof.js
|
|
11
11
|
function _typeof(o) {
|
|
12
12
|
"@babel/helpers - typeof";
|
|
13
13
|
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o$1) {
|
|
@@ -18,7 +18,7 @@ function _typeof(o) {
|
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
//#endregion
|
|
21
|
-
//#region \0@oxc-project+runtime@0.
|
|
21
|
+
//#region \0@oxc-project+runtime@0.96.0/helpers/toPrimitive.js
|
|
22
22
|
function toPrimitive(t, r) {
|
|
23
23
|
if ("object" != _typeof(t) || !t) return t;
|
|
24
24
|
var e = t[Symbol.toPrimitive];
|
|
@@ -31,14 +31,14 @@ function toPrimitive(t, r) {
|
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
//#endregion
|
|
34
|
-
//#region \0@oxc-project+runtime@0.
|
|
34
|
+
//#region \0@oxc-project+runtime@0.96.0/helpers/toPropertyKey.js
|
|
35
35
|
function toPropertyKey(t) {
|
|
36
36
|
var i = toPrimitive(t, "string");
|
|
37
37
|
return "symbol" == _typeof(i) ? i : i + "";
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
//#endregion
|
|
41
|
-
//#region \0@oxc-project+runtime@0.
|
|
41
|
+
//#region \0@oxc-project+runtime@0.96.0/helpers/defineProperty.js
|
|
42
42
|
function _defineProperty(e, r, t) {
|
|
43
43
|
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
44
44
|
value: t,
|
|
@@ -91,7 +91,7 @@ Root.displayName = "KubbRoot";
|
|
|
91
91
|
const createNode = (nodeName) => {
|
|
92
92
|
return {
|
|
93
93
|
nodeName,
|
|
94
|
-
attributes:
|
|
94
|
+
attributes: /* @__PURE__ */ new Map(),
|
|
95
95
|
childNodes: [],
|
|
96
96
|
parentNode: void 0
|
|
97
97
|
};
|
|
@@ -119,7 +119,7 @@ const removeChildNode = (node, removeNode) => {
|
|
|
119
119
|
if (index >= 0) node.childNodes.splice(index, 1);
|
|
120
120
|
};
|
|
121
121
|
const setAttribute = (node, key, value) => {
|
|
122
|
-
node.attributes
|
|
122
|
+
node.attributes.set(key, value);
|
|
123
123
|
};
|
|
124
124
|
const createTextNode = (text) => {
|
|
125
125
|
const node = {
|
|
@@ -134,13 +134,16 @@ const setTextNodeValue = (node, text) => {
|
|
|
134
134
|
if (typeof text !== "string") text = String(text);
|
|
135
135
|
node.nodeValue = text;
|
|
136
136
|
};
|
|
137
|
-
const nodeNames = [
|
|
137
|
+
const nodeNames = new Set([
|
|
138
138
|
"kubb-export",
|
|
139
139
|
"kubb-file",
|
|
140
140
|
"kubb-source",
|
|
141
141
|
"kubb-import",
|
|
142
|
-
"kubb-text"
|
|
143
|
-
|
|
142
|
+
"kubb-text",
|
|
143
|
+
"kubb-root",
|
|
144
|
+
"kubb-app",
|
|
145
|
+
"br"
|
|
146
|
+
]);
|
|
144
147
|
|
|
145
148
|
//#endregion
|
|
146
149
|
//#region src/Renderer.ts
|
|
@@ -269,28 +272,47 @@ const Renderer = Reconciler({
|
|
|
269
272
|
//#endregion
|
|
270
273
|
//#region src/utils/squashExportNodes.ts
|
|
271
274
|
function squashExportNodes(node) {
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
275
|
+
const exports = /* @__PURE__ */ new Set();
|
|
276
|
+
const walk = (current) => {
|
|
277
|
+
for (const child of current.childNodes) {
|
|
278
|
+
if (!child) continue;
|
|
279
|
+
if (child.nodeName !== "#text" && nodeNames.has(child.nodeName)) walk(child);
|
|
280
|
+
if (child.nodeName === "kubb-export") {
|
|
281
|
+
var _child$attributes$get, _child$attributes$get2;
|
|
282
|
+
exports.add({
|
|
283
|
+
name: child.attributes.get("name"),
|
|
284
|
+
path: child.attributes.get("path"),
|
|
285
|
+
isTypeOnly: (_child$attributes$get = child.attributes.get("isTypeOnly")) !== null && _child$attributes$get !== void 0 ? _child$attributes$get : false,
|
|
286
|
+
asAlias: (_child$attributes$get2 = child.attributes.get("asAlias")) !== null && _child$attributes$get2 !== void 0 ? _child$attributes$get2 : false
|
|
287
|
+
});
|
|
288
|
+
}
|
|
278
289
|
}
|
|
279
|
-
}
|
|
290
|
+
};
|
|
291
|
+
walk(node);
|
|
280
292
|
return exports;
|
|
281
293
|
}
|
|
282
294
|
|
|
283
295
|
//#endregion
|
|
284
296
|
//#region src/utils/squashImportNodes.ts
|
|
285
297
|
function squashImportNodes(node) {
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
298
|
+
const imports = /* @__PURE__ */ new Set();
|
|
299
|
+
const walk = (current) => {
|
|
300
|
+
for (const child of current.childNodes) {
|
|
301
|
+
if (!child) continue;
|
|
302
|
+
if (child.nodeName !== "#text" && nodeNames.has(child.nodeName)) walk(child);
|
|
303
|
+
if (child.nodeName === "kubb-import") {
|
|
304
|
+
var _child$attributes$get, _child$attributes$get2;
|
|
305
|
+
imports.add({
|
|
306
|
+
name: child.attributes.get("name"),
|
|
307
|
+
path: child.attributes.get("path"),
|
|
308
|
+
root: child.attributes.get("root"),
|
|
309
|
+
isTypeOnly: (_child$attributes$get = child.attributes.get("isTypeOnly")) !== null && _child$attributes$get !== void 0 ? _child$attributes$get : false,
|
|
310
|
+
isNameSpace: (_child$attributes$get2 = child.attributes.get("isNameSpace")) !== null && _child$attributes$get2 !== void 0 ? _child$attributes$get2 : false
|
|
311
|
+
});
|
|
312
|
+
}
|
|
292
313
|
}
|
|
293
|
-
}
|
|
314
|
+
};
|
|
315
|
+
walk(node);
|
|
294
316
|
return imports;
|
|
295
317
|
}
|
|
296
318
|
|
|
@@ -298,71 +320,79 @@ function squashImportNodes(node) {
|
|
|
298
320
|
//#region src/utils/squashTextNodes.ts
|
|
299
321
|
function squashTextNodes(node) {
|
|
300
322
|
let text = "";
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
"kubb-text"
|
|
330
|
-
|
|
331
|
-
"
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
if (
|
|
338
|
-
|
|
339
|
-
}
|
|
340
|
-
nodeText = `<${childNode.nodeName}${attributes}>${squashTextNodes(childNode)}</${childNode.nodeName}>`;
|
|
323
|
+
const walk = (current) => {
|
|
324
|
+
let content = "";
|
|
325
|
+
for (const child of current.childNodes) {
|
|
326
|
+
if (!child) continue;
|
|
327
|
+
let nodeText = "";
|
|
328
|
+
const getPrintText = (text$1) => {
|
|
329
|
+
switch (child.nodeName) {
|
|
330
|
+
case "kubb-import": return print(createImport({
|
|
331
|
+
name: child.attributes.get("name"),
|
|
332
|
+
path: child.attributes.get("path"),
|
|
333
|
+
root: child.attributes.get("root"),
|
|
334
|
+
isTypeOnly: child.attributes.get("isTypeOnly"),
|
|
335
|
+
isNameSpace: child.attributes.get("isNameSpace")
|
|
336
|
+
}));
|
|
337
|
+
case "kubb-export":
|
|
338
|
+
if (child.attributes.has("path")) return print(createExport({
|
|
339
|
+
name: child.attributes.get("name"),
|
|
340
|
+
path: child.attributes.get("path"),
|
|
341
|
+
isTypeOnly: child.attributes.get("isTypeOnly"),
|
|
342
|
+
asAlias: child.attributes.get("asAlias")
|
|
343
|
+
}));
|
|
344
|
+
return "";
|
|
345
|
+
case "kubb-source": return text$1;
|
|
346
|
+
default: return text$1;
|
|
347
|
+
}
|
|
348
|
+
};
|
|
349
|
+
if (child.nodeName === "#text") nodeText = child.nodeValue;
|
|
350
|
+
else {
|
|
351
|
+
if (child.nodeName === "kubb-text" || child.nodeName === "kubb-file" || child.nodeName === "kubb-source") nodeText = walk(child);
|
|
352
|
+
nodeText = getPrintText(nodeText);
|
|
353
|
+
if (child.nodeName === "br") nodeText = "\n";
|
|
354
|
+
if (!nodeNames.has(child.nodeName)) {
|
|
355
|
+
const attributes = child.attributes;
|
|
356
|
+
let attrString = "";
|
|
357
|
+
const hasAttributes = attributes.size > 0;
|
|
358
|
+
for (const [key, value] of attributes) attrString += typeof value === "string" ? ` ${key}="${value}"` : ` ${key}={${String(value)}}`;
|
|
359
|
+
if (hasAttributes) nodeText = `<${child.nodeName}${attrString}>${walk(child)}</${child.nodeName}>`;
|
|
360
|
+
else nodeText = `<${child.nodeName}>${walk(child)}</${child.nodeName}>`;
|
|
361
|
+
}
|
|
341
362
|
}
|
|
363
|
+
content += nodeText;
|
|
342
364
|
}
|
|
343
|
-
|
|
344
|
-
}
|
|
365
|
+
return content;
|
|
366
|
+
};
|
|
367
|
+
text = walk(node);
|
|
345
368
|
return text;
|
|
346
369
|
}
|
|
347
370
|
|
|
348
371
|
//#endregion
|
|
349
372
|
//#region src/utils/squashSourceNodes.ts
|
|
350
373
|
function squashSourceNodes(node, ignores) {
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
374
|
+
const ignoreSet = new Set(ignores);
|
|
375
|
+
const sources = /* @__PURE__ */ new Set();
|
|
376
|
+
const walk = (current) => {
|
|
377
|
+
for (const child of current.childNodes) {
|
|
378
|
+
if (!child) continue;
|
|
379
|
+
if (child.nodeName !== "#text" && ignoreSet.has(child.nodeName)) continue;
|
|
380
|
+
if (child.nodeName === "kubb-source") {
|
|
381
|
+
var _child$attributes$get, _child$attributes$get2, _child$attributes$get3;
|
|
382
|
+
const value = squashTextNodes(child);
|
|
383
|
+
sources.add({
|
|
384
|
+
name: child.attributes.get("name"),
|
|
385
|
+
isTypeOnly: (_child$attributes$get = child.attributes.get("isTypeOnly")) !== null && _child$attributes$get !== void 0 ? _child$attributes$get : false,
|
|
386
|
+
isExportable: (_child$attributes$get2 = child.attributes.get("isExportable")) !== null && _child$attributes$get2 !== void 0 ? _child$attributes$get2 : false,
|
|
387
|
+
isIndexable: (_child$attributes$get3 = child.attributes.get("isIndexable")) !== null && _child$attributes$get3 !== void 0 ? _child$attributes$get3 : false,
|
|
388
|
+
value: value.trim().replace(/^\s+|\s+$/g, "")
|
|
389
|
+
});
|
|
390
|
+
continue;
|
|
391
|
+
}
|
|
392
|
+
if (child.nodeName !== "#text" && nodeNames.has(child.nodeName)) walk(child);
|
|
363
393
|
}
|
|
364
|
-
|
|
365
|
-
|
|
394
|
+
};
|
|
395
|
+
walk(node);
|
|
366
396
|
return sources;
|
|
367
397
|
}
|
|
368
398
|
|
|
@@ -371,22 +401,21 @@ function squashSourceNodes(node, ignores) {
|
|
|
371
401
|
async function processFiles(node) {
|
|
372
402
|
const collected = [];
|
|
373
403
|
async function walk(current) {
|
|
374
|
-
for (const
|
|
375
|
-
if (!
|
|
376
|
-
if (
|
|
377
|
-
if (
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
const sources = squashSourceNodes(childNode, ["kubb-export", "kubb-import"]);
|
|
404
|
+
for (const child of current.childNodes) {
|
|
405
|
+
if (!child) continue;
|
|
406
|
+
if (child.nodeName !== "#text" && child.nodeName !== "kubb-file" && nodeNames.has(child.nodeName)) await walk(child);
|
|
407
|
+
if (child.nodeName === "kubb-file") {
|
|
408
|
+
if (child.attributes.has("baseName") && child.attributes.has("path")) {
|
|
409
|
+
const sources = squashSourceNodes(child, ["kubb-export", "kubb-import"]);
|
|
381
410
|
collected.push({
|
|
382
|
-
baseName: attributes.baseName,
|
|
383
|
-
path: attributes.path,
|
|
411
|
+
baseName: child.attributes.get("baseName"),
|
|
412
|
+
path: child.attributes.get("path"),
|
|
413
|
+
meta: child.attributes.get("meta") || {},
|
|
414
|
+
footer: child.attributes.get("footer"),
|
|
415
|
+
banner: child.attributes.get("banner"),
|
|
384
416
|
sources: [...sources],
|
|
385
|
-
exports: [...squashExportNodes(
|
|
386
|
-
imports: [...squashImportNodes(
|
|
387
|
-
meta: attributes.meta || {},
|
|
388
|
-
footer: attributes.footer,
|
|
389
|
-
banner: attributes.banner
|
|
417
|
+
exports: [...squashExportNodes(child)],
|
|
418
|
+
imports: [...squashImportNodes(child)]
|
|
390
419
|
});
|
|
391
420
|
}
|
|
392
421
|
}
|
|
@@ -397,38 +426,38 @@ async function processFiles(node) {
|
|
|
397
426
|
}
|
|
398
427
|
|
|
399
428
|
//#endregion
|
|
400
|
-
//#region \0@oxc-project+runtime@0.
|
|
429
|
+
//#region \0@oxc-project+runtime@0.96.0/helpers/checkPrivateRedeclaration.js
|
|
401
430
|
function _checkPrivateRedeclaration(e, t) {
|
|
402
431
|
if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object");
|
|
403
432
|
}
|
|
404
433
|
|
|
405
434
|
//#endregion
|
|
406
|
-
//#region \0@oxc-project+runtime@0.
|
|
435
|
+
//#region \0@oxc-project+runtime@0.96.0/helpers/classPrivateMethodInitSpec.js
|
|
407
436
|
function _classPrivateMethodInitSpec(e, a) {
|
|
408
437
|
_checkPrivateRedeclaration(e, a), a.add(e);
|
|
409
438
|
}
|
|
410
439
|
|
|
411
440
|
//#endregion
|
|
412
|
-
//#region \0@oxc-project+runtime@0.
|
|
441
|
+
//#region \0@oxc-project+runtime@0.96.0/helpers/classPrivateFieldInitSpec.js
|
|
413
442
|
function _classPrivateFieldInitSpec(e, t, a) {
|
|
414
443
|
_checkPrivateRedeclaration(e, t), t.set(e, a);
|
|
415
444
|
}
|
|
416
445
|
|
|
417
446
|
//#endregion
|
|
418
|
-
//#region \0@oxc-project+runtime@0.
|
|
447
|
+
//#region \0@oxc-project+runtime@0.96.0/helpers/assertClassBrand.js
|
|
419
448
|
function _assertClassBrand(e, t, n) {
|
|
420
449
|
if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n;
|
|
421
450
|
throw new TypeError("Private element is not present on this object");
|
|
422
451
|
}
|
|
423
452
|
|
|
424
453
|
//#endregion
|
|
425
|
-
//#region \0@oxc-project+runtime@0.
|
|
454
|
+
//#region \0@oxc-project+runtime@0.96.0/helpers/classPrivateFieldGet2.js
|
|
426
455
|
function _classPrivateFieldGet2(s, a) {
|
|
427
456
|
return s.get(_assertClassBrand(s, a));
|
|
428
457
|
}
|
|
429
458
|
|
|
430
459
|
//#endregion
|
|
431
|
-
//#region \0@oxc-project+runtime@0.
|
|
460
|
+
//#region \0@oxc-project+runtime@0.96.0/helpers/classPrivateFieldSet2.js
|
|
432
461
|
function _classPrivateFieldSet2(s, a, r) {
|
|
433
462
|
return s.set(_assertClassBrand(s, a), r), r;
|
|
434
463
|
}
|
|
@@ -462,7 +491,7 @@ var Runtime = class {
|
|
|
462
491
|
if (!((_classPrivateFieldGet2$1 = _classPrivateFieldGet2(_options, this)) === null || _classPrivateFieldGet2$1 === void 0 ? void 0 : _classPrivateFieldGet2$1.debug) && !((_classPrivateFieldGet3 = _classPrivateFieldGet2(_options, this)) === null || _classPrivateFieldGet3 === void 0 ? void 0 : _classPrivateFieldGet3.stdout)) return;
|
|
463
492
|
const output = await _assertClassBrand(_Runtime_brand, this, _getOutput).call(this, _classPrivateFieldGet2(_rootNode, this));
|
|
464
493
|
if ((_classPrivateFieldGet4 = _classPrivateFieldGet2(_options, this)) === null || _classPrivateFieldGet4 === void 0 ? void 0 : _classPrivateFieldGet4.debug) {
|
|
465
|
-
console.log("Rendering
|
|
494
|
+
console.log("Rendering:\n");
|
|
466
495
|
console.log(output);
|
|
467
496
|
}
|
|
468
497
|
if (((_classPrivateFieldGet5 = _classPrivateFieldGet2(_options, this)) === null || _classPrivateFieldGet5 === void 0 ? void 0 : _classPrivateFieldGet5.stdout) && process.env.NODE_ENV !== "test") {
|
|
@@ -486,23 +515,12 @@ var Runtime = class {
|
|
|
486
515
|
const originalError = console.error;
|
|
487
516
|
console.error = (data) => {
|
|
488
517
|
const message = typeof data === "string" ? data : data === null || data === void 0 ? void 0 : data.message;
|
|
489
|
-
if (message === null || message === void 0 ? void 0 : message.match(/Encountered two children with the same key/gi)) return;
|
|
490
|
-
if (message === null || message === void 0 ? void 0 : message.match(/React will try to recreat/gi)) return;
|
|
491
|
-
if (message === null || message === void 0 ? void 0 : message.match(/Each child in a list should have a unique/gi)) return;
|
|
492
|
-
if (message === null || message === void 0 ? void 0 : message.match(/The above error occurred in the <KubbErrorBoundary/gi)) return;
|
|
493
|
-
if (message === null || message === void 0 ? void 0 : message.match(/A React Element from an older version of React was render/gi)) return;
|
|
518
|
+
if ((message === null || message === void 0 ? void 0 : message.match(/Encountered two children with the same key/gi)) || (message === null || message === void 0 ? void 0 : message.match(/React will try to recreat/gi)) || (message === null || message === void 0 ? void 0 : message.match(/Each child in a list should have a unique/gi)) || (message === null || message === void 0 ? void 0 : message.match(/The above error occurred in the <KubbErrorBoundary/gi)) || (message === null || message === void 0 ? void 0 : message.match(/A React Element from an older version of React was render/gi))) return;
|
|
494
519
|
originalError(data);
|
|
495
520
|
};
|
|
496
521
|
const logRecoverableError = typeof reportError === "function" ? reportError : console.error;
|
|
497
522
|
const rootTag = ConcurrentRoot;
|
|
498
|
-
|
|
499
|
-
const isStrictMode = false;
|
|
500
|
-
const concurrentUpdatesByDefaultOverride = false;
|
|
501
|
-
const identifierPrefix = "id";
|
|
502
|
-
const onUncaughtError = logRecoverableError;
|
|
503
|
-
const onCaughtError = logRecoverableError;
|
|
504
|
-
const onRecoverableError = logRecoverableError;
|
|
505
|
-
_classPrivateFieldSet2(_container, this, Renderer.createContainer(_classPrivateFieldGet2(_rootNode, this), rootTag, hydrationCallbacks, isStrictMode, concurrentUpdatesByDefaultOverride, identifierPrefix, onUncaughtError, onCaughtError, onRecoverableError, null));
|
|
523
|
+
_classPrivateFieldSet2(_container, this, Renderer.createContainer(_classPrivateFieldGet2(_rootNode, this), rootTag, null, false, false, "id", logRecoverableError, logRecoverableError, logRecoverableError, null));
|
|
506
524
|
this.unsubscribeExit = onExit((code) => {
|
|
507
525
|
this.unmount(code);
|
|
508
526
|
}, { alwaysLast: false }).bind(this);
|
|
@@ -569,7 +587,10 @@ var Runtime = class {
|
|
|
569
587
|
async function _getOutput(node) {
|
|
570
588
|
const text = squashTextNodes(node);
|
|
571
589
|
const files = this.fileManager.files;
|
|
572
|
-
|
|
590
|
+
if (!files.length) return text;
|
|
591
|
+
const values = /* @__PURE__ */ new Set();
|
|
592
|
+
for (const file of files) for (const source of file.sources) if (source === null || source === void 0 ? void 0 : source.value) values.add(source.value);
|
|
593
|
+
return [...values].join("\n\n");
|
|
573
594
|
}
|
|
574
595
|
|
|
575
596
|
//#endregion
|
|
@@ -601,4 +622,4 @@ const reactPlugin = createPlugin({
|
|
|
601
622
|
|
|
602
623
|
//#endregion
|
|
603
624
|
export { _classPrivateFieldInitSpec as a, _classPrivateFieldGet2 as i, Runtime as n, Root as o, _classPrivateFieldSet2 as r, RootContext as s, reactPlugin as t };
|
|
604
|
-
//# sourceMappingURL=reactPlugin-
|
|
625
|
+
//# sourceMappingURL=reactPlugin-B7zzvM5n.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reactPlugin-B7zzvM5n.js","names":["onExit","node: TextNode","text","collected: Array<KubbFile.File>"],"sources":["../src/components/Root.tsx","../src/dom.ts","../src/Renderer.ts","../src/utils/squashExportNodes.ts","../src/utils/squashImportNodes.ts","../src/utils/squashTextNodes.ts","../src/utils/squashSourceNodes.ts","../src/utils/processFiles.ts","../src/Runtime.tsx","../src/plugins/reactPlugin.ts"],"sourcesContent":["import { Component, createContext } from 'react'\n\nimport type { KubbNode } from '../types.ts'\n\ntype ErrorBoundaryProps = {\n onError: (error: Error) => void\n children?: KubbNode\n}\n\nclass ErrorBoundary extends Component<{\n onError: ErrorBoundaryProps['onError']\n children?: KubbNode\n}> {\n state = { hasError: false }\n\n static displayName = 'KubbErrorBoundary'\n static getDerivedStateFromError(_error: Error) {\n return { hasError: true }\n }\n\n componentDidCatch(error: Error) {\n if (error) {\n this.props.onError(error)\n }\n }\n\n render() {\n if (this.state.hasError) {\n return null\n }\n return this.props.children\n }\n}\n\nexport type RootContextProps = {\n /**\n * Exit (unmount) the whole Ink app.\n */\n readonly exit: (error?: Error) => void\n}\n\nexport const RootContext = createContext<RootContextProps>({\n exit: () => {},\n})\n\ntype RootProps = {\n /**\n * Exit (unmount) hook\n */\n readonly onExit: (error?: Error) => void\n /**\n * Error hook\n */\n readonly onError: (error: Error) => void\n readonly children?: KubbNode\n}\n\nexport function Root({ onError, onExit, children }: RootProps) {\n try {\n return (\n <ErrorBoundary\n onError={(error) => {\n onError(error)\n }}\n >\n <RootContext.Provider value={{ exit: onExit }}>{children}</RootContext.Provider>\n </ErrorBoundary>\n )\n } catch (_e) {\n return null\n }\n}\n\nRoot.Context = RootContext\nRoot.displayName = 'KubbRoot'\n","import type { DOMElement, DOMNode, DOMNodeAttribute, ElementNames, TextNode } from './types.ts'\n\nexport const createNode = (nodeName: string): DOMElement => {\n const node: DOMElement = {\n nodeName: nodeName as DOMElement['nodeName'],\n attributes: new Map(),\n childNodes: [],\n parentNode: undefined,\n }\n\n return node\n}\n\nexport const appendChildNode = (node: DOMNode, childNode: DOMElement | DOMNode): void => {\n if (childNode.parentNode) {\n removeChildNode(childNode.parentNode, childNode)\n }\n\n if (node.nodeName !== '#text') {\n childNode.parentNode = node\n node.childNodes.push(childNode)\n }\n}\n\nexport const insertBeforeNode = (node: DOMElement, newChildNode: DOMNode, beforeChildNode: DOMNode): void => {\n if (newChildNode.parentNode) {\n removeChildNode(newChildNode.parentNode, newChildNode)\n }\n\n newChildNode.parentNode = node\n\n const index = node.childNodes.indexOf(beforeChildNode)\n if (index >= 0) {\n node.childNodes.splice(index, 0, newChildNode)\n\n return\n }\n\n node.childNodes.push(newChildNode)\n}\n\nexport const removeChildNode = (node: DOMElement, removeNode: DOMNode): void => {\n removeNode.parentNode = undefined\n\n const index = node.childNodes.indexOf(removeNode)\n if (index >= 0) {\n node.childNodes.splice(index, 1)\n }\n}\n\nexport const setAttribute = (node: DOMElement, key: string, value: DOMNodeAttribute): void => {\n node.attributes.set(key, value)\n}\n\nexport const createTextNode = (text: string): TextNode => {\n const node: TextNode = {\n nodeName: '#text',\n nodeValue: text,\n parentNode: undefined,\n }\n\n setTextNodeValue(node, text)\n\n return node\n}\n\nexport const setTextNodeValue = (node: TextNode, text: string): void => {\n if (typeof text !== 'string') {\n text = String(text)\n }\n\n node.nodeValue = text\n}\n\nexport const nodeNames = new Set<ElementNames>(['kubb-export', 'kubb-file', 'kubb-source', 'kubb-import', 'kubb-text', 'kubb-root', 'kubb-app', 'br'])\n","import { createContext } from 'react'\nimport Reconciler, { type ReactContext } from 'react-reconciler'\nimport { DefaultEventPriority, NoEventPriority } from 'react-reconciler/constants.js'\nimport { appendChildNode, createNode, createTextNode, insertBeforeNode, removeChildNode, setAttribute, setTextNodeValue } from './dom.ts'\nimport type { KubbNode } from './types'\nimport type { DOMElement, DOMNodeAttribute, ElementNames, TextNode } from './types.ts'\n\ndeclare module 'react-reconciler' {\n // @ts-expect-error custom override\n interface Reconciler {\n updateContainerSync(element: KubbNode, container: unknown, parentComponent: any, callback?: null | (() => void)): void\n flushSyncWork(): void\n createContainer(\n containerInfo: unknown,\n tag: Reconciler.RootTag,\n hydrationCallbacks: null | Reconciler.SuspenseHydrationCallbacks<any>,\n isStrictMode: boolean,\n concurrentUpdatesByDefaultOverride: null | boolean,\n identifierPrefix: string,\n onUncaughtError: (error: Error) => void,\n onCaughtError: (error: Error) => void,\n onRecoverableError: (error: Error) => void,\n transitionCallbacks: null | Reconciler.TransitionTracingCallbacks,\n ): Reconciler.OpaqueRoot\n }\n}\n\ntype Props = Record<string, unknown>\n\ntype HostContext = {\n type: ElementNames\n isFile: boolean\n isSource: boolean\n}\n\nlet currentUpdatePriority = NoEventPriority\n\n/**\n * @link https://www.npmjs.com/package/react-devtools-inline\n * @link https://github.com/nitin42/Making-a-custom-React-renderer/blob/master/part-one.md\n * @link https://github.com/facebook/react/tree/main/packages/react-reconciler#practical-examples\n * @link https://github.com/vadimdemedes/ink\n * @link https://github.com/pixijs/pixi-react/tree/main/packages\n * @link https://github.com/diegomura/react-pdf/blob/master/packages/reconciler/src/reconciler-31.ts\n */\nexport const Renderer = Reconciler({\n getRootHostContext: () => ({\n type: 'kubb-root',\n isFile: false,\n isSource: false,\n }),\n prepareForCommit: () => {\n return null\n },\n preparePortalMount: () => null,\n clearContainer: () => false,\n resetAfterCommit(rootNode: DOMElement) {\n if (typeof rootNode.onRender === 'function') {\n rootNode.onRender()\n }\n },\n getChildHostContext(parentHostContext: HostContext, type: ElementNames) {\n const isInsideText = type === 'kubb-text'\n const isFile = type === 'kubb-file' || parentHostContext.isFile\n const isSource = type === 'kubb-source' || parentHostContext.isSource\n\n return { isInsideText, isFile, isSource, type }\n },\n shouldSetTextContent: () => false,\n createInstance(originalType: ElementNames, newProps: Props, _root: DOMElement) {\n const node = createNode(originalType)\n\n for (const [key, value] of Object.entries(newProps)) {\n if (key === 'children') {\n continue\n }\n\n setAttribute(node, key, value as DOMNodeAttribute)\n }\n\n return node\n },\n createTextInstance(text: string, _root: DOMElement, hostContext: HostContext) {\n if (hostContext.isFile && !hostContext.isSource) {\n throw new Error(`[react] '${text}' should be part of <File.Source> component when using the <File/> component`)\n }\n\n return createTextNode(text)\n },\n resetTextContent() {},\n hideTextInstance(node: TextNode) {\n setTextNodeValue(node, '')\n },\n unhideTextInstance(node: TextNode, text: string) {\n setTextNodeValue(node, text)\n },\n getPublicInstance: (instance) => instance,\n appendInitialChild: appendChildNode,\n appendChild: appendChildNode,\n insertBefore: insertBeforeNode,\n finalizeInitialChildren(_node, _type, _props, _rootNode) {\n return false\n },\n supportsMutation: true,\n isPrimaryRenderer: true,\n supportsPersistence: false,\n supportsHydration: false,\n scheduleTimeout: setTimeout,\n cancelTimeout: clearTimeout,\n noTimeout: -1,\n beforeActiveInstanceBlur() {},\n afterActiveInstanceBlur() {},\n detachDeletedInstance() {},\n getInstanceFromNode: () => null,\n prepareScopeUpdate() {},\n getInstanceFromScope: () => null,\n appendChildToContainer: appendChildNode,\n insertInContainerBefore: insertBeforeNode,\n removeChildFromContainer(node: DOMElement, removeNode: TextNode) {\n removeChildNode(node, removeNode)\n },\n commitMount() {},\n commitUpdate(node: DOMElement, _payload, _type, _oldProps: Props, newProps: Props) {\n const { props } = newProps\n\n if (props) {\n for (const [key, value] of Object.entries(props)) {\n setAttribute(node, key, value as DOMNodeAttribute)\n }\n }\n },\n commitTextUpdate(node: TextNode, _oldText, newText) {\n setTextNodeValue(node, newText)\n },\n removeChild(node: DOMElement, removeNode: TextNode) {\n removeChildNode(node, removeNode)\n },\n setCurrentUpdatePriority: (newPriority: number) => {\n currentUpdatePriority = newPriority\n },\n getCurrentUpdatePriority: () => currentUpdatePriority,\n resolveUpdatePriority() {\n if (currentUpdatePriority !== NoEventPriority) {\n return currentUpdatePriority\n }\n\n return DefaultEventPriority\n },\n maySuspendCommit() {\n return false\n },\n // eslint-disable-next-line @typescript-eslint/naming-convention\n NotPendingTransition: undefined,\n // eslint-disable-next-line @typescript-eslint/naming-convention\n HostTransitionContext: createContext(null) as unknown as ReactContext<unknown>,\n resetFormInstance() {},\n requestPostPaintCallback() {},\n shouldAttemptEagerTransition() {\n return false\n },\n trackSchedulerEvent() {},\n resolveEventType() {\n return null\n },\n resolveEventTimeStamp() {\n return -1.1\n },\n preloadInstance() {\n return true\n },\n startSuspendingCommit() {},\n suspendInstance() {},\n waitForCommitToBeReady() {\n return null\n },\n})\n\nexport type { FiberRoot } from 'react-reconciler'\n","import type { KubbFile } from '@kubb/fabric-core/types'\n\nimport { nodeNames } from '../dom.ts'\nimport type { DOMElement } from '../types.ts'\n\nexport function squashExportNodes(node: DOMElement): Set<KubbFile.ResolvedExport> {\n const exports = new Set<KubbFile.ResolvedExport>()\n\n const walk = (current: DOMElement): void => {\n for (const child of current.childNodes) {\n if (!child) {\n continue\n }\n\n if (child.nodeName !== '#text' && nodeNames.has(child.nodeName)) {\n walk(child)\n }\n\n if (child.nodeName === 'kubb-export') {\n exports.add({\n name: child.attributes.get('name'),\n path: child.attributes.get('path'),\n isTypeOnly: child.attributes.get('isTypeOnly') ?? false,\n asAlias: child.attributes.get('asAlias') ?? false,\n } as KubbFile.Export)\n }\n }\n }\n\n walk(node)\n return exports\n}\n","import type { KubbFile } from '@kubb/fabric-core/types'\n\nimport { nodeNames } from '../dom.ts'\nimport type { DOMElement } from '../types.ts'\n\nexport function squashImportNodes(node: DOMElement): Set<KubbFile.Import> {\n const imports = new Set<KubbFile.Import>()\n\n const walk = (current: DOMElement): void => {\n for (const child of current.childNodes) {\n if (!child) {\n continue\n }\n\n if (child.nodeName !== '#text' && nodeNames.has(child.nodeName)) {\n walk(child)\n }\n\n if (child.nodeName === 'kubb-import') {\n imports.add({\n name: child.attributes.get('name'),\n path: child.attributes.get('path'),\n root: child.attributes.get('root'),\n isTypeOnly: child.attributes.get('isTypeOnly') ?? false,\n isNameSpace: child.attributes.get('isNameSpace') ?? false,\n } as KubbFile.Import)\n }\n }\n }\n\n walk(node)\n return imports\n}\n","import { createExport, createImport, print } from '@kubb/fabric-core/parsers/typescript'\n\nimport { nodeNames } from '../dom.ts'\nimport type { DOMElement, KubbFile } from '../types.ts'\n\nexport function squashTextNodes(node: DOMElement): string {\n let text = ''\n\n const walk = (current: DOMElement): string => {\n let content = ''\n\n for (const child of current.childNodes) {\n if (!child) {\n continue\n }\n\n let nodeText = ''\n\n const getPrintText = (text: string): string => {\n switch (child.nodeName) {\n case 'kubb-import': {\n return print(\n createImport({\n name: child.attributes.get('name'),\n path: child.attributes.get('path'),\n root: child.attributes.get('root'),\n isTypeOnly: child.attributes.get('isTypeOnly'),\n isNameSpace: child.attributes.get('isNameSpace'),\n } as KubbFile.Import),\n )\n }\n case 'kubb-export': {\n if (child.attributes.has('path')) {\n return print(\n createExport({\n name: child.attributes.get('name'),\n path: child.attributes.get('path'),\n isTypeOnly: child.attributes.get('isTypeOnly'),\n asAlias: child.attributes.get('asAlias'),\n } as KubbFile.Export),\n )\n }\n return ''\n }\n case 'kubb-source':\n return text\n default:\n return text\n }\n }\n\n if (child.nodeName === '#text') {\n nodeText = child.nodeValue\n } else {\n if (child.nodeName === 'kubb-text' || child.nodeName === 'kubb-file' || child.nodeName === 'kubb-source') {\n nodeText = walk(child)\n }\n\n nodeText = getPrintText(nodeText)\n\n if (child.nodeName === 'br') {\n nodeText = '\\n'\n }\n\n if (!nodeNames.has(child.nodeName)) {\n const attributes = child.attributes\n let attrString = ''\n const hasAttributes = attributes.size > 0\n\n for (const [key, value] of attributes) {\n attrString += typeof value === 'string' ? ` ${key}=\"${value}\"` : ` ${key}={${String(value)}}`\n }\n\n if (hasAttributes) {\n nodeText = `<${child.nodeName}${attrString}>${walk(child)}</${child.nodeName}>`\n } else {\n nodeText = `<${child.nodeName}>${walk(child)}</${child.nodeName}>`\n }\n }\n }\n\n content += nodeText\n }\n\n return content\n }\n\n text = walk(node)\n\n return text\n}\n","import type { KubbFile } from '@kubb/fabric-core/types'\n\nimport { nodeNames } from '../dom.ts'\nimport type { DOMElement, ElementNames } from '../types.ts'\nimport { squashTextNodes } from './squashTextNodes.ts'\n\nexport function squashSourceNodes(node: DOMElement, ignores: Array<ElementNames>): Set<KubbFile.Source> {\n const ignoreSet = new Set(ignores)\n const sources = new Set<KubbFile.Source>()\n\n const walk = (current: DOMElement): void => {\n for (const child of current.childNodes) {\n if (!child) {\n continue\n }\n\n if (child.nodeName !== '#text' && ignoreSet.has(child.nodeName)) {\n continue\n }\n\n if (child.nodeName === 'kubb-source') {\n const value = squashTextNodes(child)\n\n sources.add({\n name: child.attributes.get('name'),\n isTypeOnly: child.attributes.get('isTypeOnly') ?? false,\n isExportable: child.attributes.get('isExportable') ?? false,\n isIndexable: child.attributes.get('isIndexable') ?? false,\n // trim whitespace/newlines\n value: value.trim().replace(/^\\s+|\\s+$/g, ''),\n } as KubbFile.Source)\n continue\n }\n\n if (child.nodeName !== '#text' && nodeNames.has(child.nodeName)) {\n walk(child)\n }\n }\n }\n\n walk(node)\n return sources\n}\n","import type { KubbFile } from '@kubb/fabric-core/types'\nimport { nodeNames } from '../dom.ts'\nimport type { DOMElement } from '../types.ts'\nimport { squashExportNodes } from './squashExportNodes.ts'\nimport { squashImportNodes } from './squashImportNodes.ts'\nimport { squashSourceNodes } from './squashSourceNodes.ts'\n\nexport async function processFiles(node: DOMElement): Promise<Array<KubbFile.File>> {\n const collected: Array<KubbFile.File> = []\n\n async function walk(current: DOMElement) {\n for (const child of current.childNodes) {\n if (!child) {\n continue\n }\n\n if (child.nodeName !== '#text' && child.nodeName !== 'kubb-file' && nodeNames.has(child.nodeName)) {\n await walk(child)\n }\n\n if (child.nodeName === 'kubb-file') {\n if (child.attributes.has('baseName') && child.attributes.has('path')) {\n const sources = squashSourceNodes(child, ['kubb-export', 'kubb-import'])\n\n collected.push({\n baseName: child.attributes.get('baseName'),\n path: child.attributes.get('path'),\n meta: child.attributes.get('meta') || {},\n footer: child.attributes.get('footer'),\n banner: child.attributes.get('banner'),\n sources: [...sources],\n exports: [...squashExportNodes(child)],\n imports: [...squashImportNodes(child)],\n } as KubbFile.File)\n }\n }\n }\n }\n\n await walk(node)\n\n return collected\n}\n","import process from 'node:process'\nimport type { FileManager } from '@kubb/fabric-core'\nimport type { ReactNode } from 'react'\nimport { ConcurrentRoot } from 'react-reconciler/constants.js'\nimport { onExit } from 'signal-exit'\nimport { Root } from './components/Root.tsx'\nimport { createNode } from './dom.ts'\nimport type { FiberRoot } from './Renderer.ts'\nimport { Renderer } from './Renderer.ts'\nimport type { DOMElement } from './types.ts'\nimport { processFiles } from './utils/processFiles.ts'\nimport { squashTextNodes } from './utils/squashTextNodes.ts'\n\ntype Options = {\n fileManager: FileManager\n stdout?: NodeJS.WriteStream\n stdin?: NodeJS.ReadStream\n stderr?: NodeJS.WriteStream\n /**\n * Set this to true to always see the result of the render in the console(line per render)\n */\n debug?: boolean\n}\n\nexport class Runtime {\n readonly #options: Options\n #isUnmounted: boolean\n\n exitPromise?: Promise<void>\n readonly #container: FiberRoot\n readonly #rootNode: DOMElement\n\n constructor(options: Options) {\n this.#options = options\n this.#rootNode = createNode('kubb-root')\n this.#rootNode.onRender = this.onRender\n this.#rootNode.onImmediateRender = this.onRender\n this.#isUnmounted = false\n this.unmount.bind(this)\n\n // Intercept noisy React errors\n const originalError = console.error\n console.error = (data: string | Error) => {\n const message = typeof data === 'string' ? data : data?.message\n if (\n message?.match(/Encountered two children with the same key/gi) ||\n message?.match(/React will try to recreat/gi) ||\n message?.match(/Each child in a list should have a unique/gi) ||\n message?.match(/The above error occurred in the <KubbErrorBoundary/gi) ||\n message?.match(/A React Element from an older version of React was render/gi)\n ) {\n return\n }\n originalError(data)\n }\n\n const logRecoverableError = typeof reportError === 'function' ? reportError : console.error\n\n const rootTag = ConcurrentRoot\n this.#container = Renderer.createContainer(\n this.#rootNode,\n rootTag,\n null,\n false,\n false,\n 'id',\n logRecoverableError,\n logRecoverableError,\n logRecoverableError,\n null,\n )\n\n // Unmount when process exits\n this.unsubscribeExit = onExit(\n (code) => {\n this.unmount(code)\n },\n { alwaysLast: false },\n ).bind(this)\n\n Renderer.injectIntoDevTools({\n bundleType: 1,\n version: '19.1.0',\n rendererPackageName: 'kubb',\n })\n }\n\n get fileManager() {\n return this.#options.fileManager\n }\n\n #renderPromise: Promise<void> = Promise.resolve()\n resolveExitPromise: () => void = () => {}\n rejectExitPromise: (reason?: Error) => void = () => {}\n unsubscribeExit: () => void = () => {}\n\n onRender: () => Promise<void> = () => {\n const previous = this.#renderPromise\n\n const task = previous\n .catch(() => {})\n .then(async () => {\n if (this.#isUnmounted) {\n return\n }\n\n const files = await processFiles(this.#rootNode)\n\n await this.fileManager.add(...files)\n\n if (!this.#options?.debug && !this.#options?.stdout) {\n return\n }\n\n const output = await this.#getOutput(this.#rootNode)\n\n if (this.#options?.debug) {\n console.log('Rendering:\\n')\n console.log(output)\n }\n\n if (this.#options?.stdout && process.env.NODE_ENV !== 'test') {\n this.#options.stdout.clearLine(0)\n this.#options.stdout.cursorTo(0)\n this.#options.stdout.write(output)\n }\n })\n\n this.#renderPromise = task.catch((error) => {\n this.onError(error as Error)\n throw error\n })\n\n return this.#renderPromise\n }\n\n onError(error: Error): void {\n if (process.env.NODE_ENV === 'test') {\n console.warn(error)\n }\n\n throw error\n }\n\n onExit(error?: Error): void {\n this.unmount(error)\n }\n\n async #getOutput(node: DOMElement): Promise<string> {\n const text = squashTextNodes(node)\n const files = this.fileManager.files\n\n if (!files.length) {\n return text\n }\n\n const values = new Set<string>()\n for (const file of files) {\n for (const source of file.sources) {\n if (source?.value) {\n values.add(source.value)\n }\n }\n }\n\n return [...values].join('\\n\\n')\n }\n\n async render(node: ReactNode): Promise<void> {\n const element = (\n <Root onExit={this.onExit.bind(this)} onError={this.onError.bind(this)}>\n {node}\n </Root>\n )\n\n Renderer.updateContainerSync(element, this.#container, null, null)\n Renderer.flushSyncWork()\n await this.#renderPromise\n }\n\n async renderToString(node: ReactNode): Promise<string> {\n const element = (\n <Root onExit={this.onExit.bind(this)} onError={this.onError.bind(this)}>\n {node}\n </Root>\n )\n\n Renderer.updateContainerSync(element, this.#container, null, null)\n Renderer.flushSyncWork()\n\n await this.#renderPromise\n this.fileManager.clear()\n\n return this.#getOutput(this.#rootNode)\n }\n\n unmount(error?: Error | number | null): void {\n if (this.#isUnmounted) {\n return\n }\n\n if (this.#options?.debug) {\n console.log('Unmount', error)\n }\n\n this.onRender()\n this.unsubscribeExit()\n\n this.#isUnmounted = true\n\n Renderer.updateContainerSync(null, this.#container, null, null)\n\n if (error instanceof Error) {\n this.rejectExitPromise(error)\n return\n }\n\n this.resolveExitPromise()\n }\n\n async waitUntilExit(): Promise<void> {\n if (!this.exitPromise) {\n this.exitPromise = new Promise((resolve, reject) => {\n this.resolveExitPromise = resolve\n this.rejectExitPromise = reject\n })\n }\n\n return this.exitPromise\n }\n}\n","import { createPlugin } from '@kubb/fabric-core/plugins'\nimport { createElement, type ElementType } from 'react'\nimport { Runtime } from '../Runtime.tsx'\n\nexport type Options = {\n stdout?: NodeJS.WriteStream\n stdin?: NodeJS.ReadStream\n stderr?: NodeJS.WriteStream\n /**\n * Set this to true to always see the result of the render in the console(line per render)\n */\n debug?: boolean\n}\n\ntype ExtendOptions = {\n render(App: ElementType): Promise<void>\n renderToString(App: ElementType): Promise<string>\n waitUntilExit(): Promise<void>\n}\n\ndeclare global {\n namespace Kubb {\n interface Fabric {\n render(App: ElementType): Promise<void>\n renderToString(App: ElementType): Promise<string>\n waitUntilExit(): Promise<void>\n }\n }\n}\n\nexport const reactPlugin = createPlugin<Options, ExtendOptions>({\n name: 'react',\n install() {},\n inject(ctx, options = {}) {\n const runtime = new Runtime({ fileManager: ctx.fileManager, ...options })\n\n return {\n async render(App) {\n await runtime.render(createElement(App))\n await ctx.emit('start')\n },\n async renderToString(App) {\n await ctx.emit('start')\n return runtime.renderToString(createElement(App))\n },\n async waitUntilExit() {\n await runtime.waitUntilExit()\n\n await ctx.emit('end')\n },\n }\n },\n})\n"],"mappings":";;;;;;;;;;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