@kubb/react-fabric 0.10.0 → 0.11.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-DitK3IEP.d.ts → Fabric-BELBf-bX.d.cts} +5 -5
- package/dist/{Fabric-C61uYmUy.d.cts → Fabric-DbJhvsCq.d.ts} +5 -5
- package/dist/globals.d.cts +2 -2
- package/dist/globals.d.ts +2 -2
- package/dist/index.cjs +99 -34
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -511
- package/dist/index.d.ts +3 -511
- package/dist/index.js +100 -35
- package/dist/index.js.map +1 -1
- package/dist/jsx-dev-runtime.d.cts +5 -5
- package/dist/jsx-dev-runtime.d.ts +3 -3
- package/dist/{jsx-namespace-D0a66_uR.d.ts → jsx-namespace-CBOEkCmJ.d.ts} +2 -2
- package/dist/{jsx-namespace-BnoysbjP.d.cts → jsx-namespace-od7sqrmY.d.cts} +2 -2
- package/dist/jsx-runtime.d.cts +5 -5
- package/dist/jsx-runtime.d.ts +3 -3
- package/dist/parsers.d.cts +1 -1
- package/dist/parsers.d.ts +1 -1
- package/dist/plugins.cjs +1 -1
- package/dist/plugins.d.cts +2 -2
- package/dist/plugins.d.ts +2 -2
- package/dist/plugins.js +1 -1
- package/dist/{reactPlugin-D4SmGYbm.cjs → reactPlugin-B8F6jVb5.cjs} +33 -13
- package/dist/reactPlugin-B8F6jVb5.cjs.map +1 -0
- package/dist/{reactPlugin-DT9toQPK.js → reactPlugin-CAtVV84d.js} +34 -14
- package/dist/reactPlugin-CAtVV84d.js.map +1 -0
- package/dist/types-C3ODUOKN.d.cts +675 -0
- package/dist/types-DwaohVJS.d.ts +675 -0
- package/dist/types.d.cts +3 -3
- package/dist/types.d.ts +3 -3
- package/package.json +2 -2
- package/src/Runtime.tsx +22 -12
- package/src/components/App.tsx +23 -7
- package/src/components/Const.tsx +17 -4
- package/src/components/File.tsx +83 -24
- package/src/components/Function.tsx +28 -7
- package/src/components/Root.tsx +23 -16
- package/src/components/Type.tsx +17 -4
- package/src/components/__snapshots__/arrow_function.ts +3 -0
- package/src/components/__snapshots__/arrow_function_default.ts +3 -0
- package/src/components/__snapshots__/arrow_function_generics.ts +3 -0
- package/src/components/__snapshots__/arrow_function_single_line.ts +1 -0
- package/src/components/__snapshots__/arrow_function_with_generics.ts +3 -0
- package/src/components/__snapshots__/async_arrow_function.ts +3 -0
- package/src/components/__snapshots__/async_function.ts +3 -0
- package/src/components/__snapshots__/async_function_with_Promise_return_type.ts +3 -0
- package/src/components/__snapshots__/basic_arrow_function.ts +3 -0
- package/src/components/__snapshots__/basic_const.ts +1 -0
- package/src/components/__snapshots__/basic_export.ts +1 -0
- package/src/components/__snapshots__/basic_function.ts +3 -0
- package/src/components/__snapshots__/basic_import.ts +1 -0
- package/src/components/__snapshots__/basic_type.ts +1 -0
- package/src/components/__snapshots__/const_with_JSDoc.ts +4 -0
- package/src/components/__snapshots__/const_with_as_const.ts +1 -0
- package/src/components/__snapshots__/const_with_type.ts +1 -0
- package/src/components/__snapshots__/default_exported_arrow_function.ts +3 -0
- package/src/components/__snapshots__/default_exported_function.ts +3 -0
- package/src/components/__snapshots__/exported_arrow_function.ts +3 -0
- package/src/components/__snapshots__/exported_const.ts +1 -0
- package/src/components/__snapshots__/exported_function.ts +3 -0
- package/src/components/__snapshots__/exported_type.ts +1 -0
- package/src/components/__snapshots__/function_generics.ts +3 -0
- package/src/components/__snapshots__/function_with_JSDoc.ts +6 -0
- package/src/components/__snapshots__/function_with_comments.ts +6 -0
- package/src/components/__snapshots__/function_with_generics.ts +3 -0
- package/src/components/__snapshots__/function_with_parameters.ts +3 -0
- package/src/components/__snapshots__/function_with_params.ts +3 -0
- package/src/components/__snapshots__/function_with_returnType.ts +3 -0
- package/src/components/__snapshots__/function_with_return_type.ts +3 -0
- package/src/components/__snapshots__/matches_with_root_import.ts +1 -0
- package/src/components/__snapshots__/multiple_functions.ts +3 -0
- package/src/components/__snapshots__/named_export.ts +1 -0
- package/src/components/__snapshots__/named_export_(object_advanced).ts +1 -0
- package/src/components/__snapshots__/named_import.ts +1 -0
- package/src/components/__snapshots__/named_import_(object).ts +1 -0
- package/src/components/__snapshots__/named_import_(object_advanced).ts +1 -0
- package/src/components/__snapshots__/named_typed_export.ts +1 -0
- package/src/components/__snapshots__/named_typed_import.ts +1 -0
- package/src/components/__snapshots__/single_line_arrow_function.ts +1 -0
- package/src/components/__snapshots__/type_with_JSDoc.ts +4 -0
- package/src/components/__snapshots__/typed_export.ts +1 -0
- package/src/components/__snapshots__/typed_import.ts +1 -0
- package/src/composables/useLifecycle.tsx +1 -1
- package/src/plugins/reactPlugin.ts +7 -6
- package/dist/reactPlugin-4-kcMKwZ.d.ts +0 -31
- package/dist/reactPlugin-B4xarQJX.d.cts +0 -31
- package/dist/reactPlugin-D4SmGYbm.cjs.map +0 -1
- package/dist/reactPlugin-DT9toQPK.js.map +0 -1
- package/dist/types-BL7PkfqA.d.ts +0 -106
- package/dist/types-BdOHT5YF.d.cts +0 -106
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { r as __toESM, t as __commonJSMin } from "./chunk-BCPZiDLE.js";
|
|
2
2
|
import { t as require_react } from "./react-DfIUVisP.js";
|
|
3
3
|
import { n as jsx } from "./jsx-runtime-Isgf9orn.js";
|
|
4
|
-
import { RootContext, provide } from "@kubb/fabric-core";
|
|
4
|
+
import { NodeTreeContext, RootContext, TreeNode, provide } from "@kubb/fabric-core";
|
|
5
5
|
import { onExit } from "signal-exit";
|
|
6
6
|
import { definePlugin } from "@kubb/fabric-core/plugins";
|
|
7
7
|
import process$1 from "node:process";
|
|
@@ -108,15 +108,15 @@ var ErrorBoundary = class extends import_react.Component {
|
|
|
108
108
|
};
|
|
109
109
|
_defineProperty(ErrorBoundary, "displayName", "KubbErrorBoundary");
|
|
110
110
|
/**
|
|
111
|
-
*
|
|
112
|
-
* ErrorBoundary so errors can be forwarded to the `onError` handler.
|
|
113
|
-
*
|
|
114
|
-
* This component provides the root behaviour for the React Fabric runtime.
|
|
115
|
-
*
|
|
116
|
-
* Returns a React node tree representing the root of the Fabric app.
|
|
111
|
+
* This component provides the root behavior for the Fabric runtime.
|
|
117
112
|
*/
|
|
118
|
-
function Root({ onError, onExit: onExit$1, children }) {
|
|
119
|
-
provide(RootContext, {
|
|
113
|
+
function Root({ onError, onExit: onExit$1, treeNode, fileManager, children }) {
|
|
114
|
+
provide(RootContext, {
|
|
115
|
+
exit: onExit$1,
|
|
116
|
+
treeNode,
|
|
117
|
+
fileManager
|
|
118
|
+
});
|
|
119
|
+
provide(NodeTreeContext, treeNode);
|
|
120
120
|
return /* @__PURE__ */ jsx(ErrorBoundary, {
|
|
121
121
|
onError: (error) => {
|
|
122
122
|
onError(error);
|
|
@@ -15514,9 +15514,19 @@ var Runtime = class {
|
|
|
15514
15514
|
this.unmount(error);
|
|
15515
15515
|
}
|
|
15516
15516
|
async render(node) {
|
|
15517
|
-
const
|
|
15517
|
+
const treeNode = new TreeNode({
|
|
15518
|
+
type: "Root",
|
|
15519
|
+
props: {}
|
|
15520
|
+
});
|
|
15521
|
+
const props = {
|
|
15522
|
+
fileManager: this.fileManager,
|
|
15523
|
+
treeNode,
|
|
15518
15524
|
onExit: this.onExit.bind(this),
|
|
15519
|
-
onError: this.onError.bind(this)
|
|
15525
|
+
onError: this.onError.bind(this)
|
|
15526
|
+
};
|
|
15527
|
+
treeNode.data.props = props;
|
|
15528
|
+
const element = /* @__PURE__ */ jsx(Root, {
|
|
15529
|
+
...props,
|
|
15520
15530
|
children: node
|
|
15521
15531
|
});
|
|
15522
15532
|
Renderer.updateContainerSync(element, _classPrivateFieldGet2(_container, this), null, null);
|
|
@@ -15529,9 +15539,19 @@ var Runtime = class {
|
|
|
15529
15539
|
}
|
|
15530
15540
|
}
|
|
15531
15541
|
async renderToString(node) {
|
|
15532
|
-
const
|
|
15542
|
+
const treeNode = new TreeNode({
|
|
15543
|
+
type: "Root",
|
|
15544
|
+
props: {}
|
|
15545
|
+
});
|
|
15546
|
+
const props = {
|
|
15547
|
+
fileManager: this.fileManager,
|
|
15548
|
+
treeNode,
|
|
15533
15549
|
onExit: this.onExit.bind(this),
|
|
15534
|
-
onError: this.onError.bind(this)
|
|
15550
|
+
onError: this.onError.bind(this)
|
|
15551
|
+
};
|
|
15552
|
+
treeNode.data.props = props;
|
|
15553
|
+
const element = /* @__PURE__ */ jsx(Root, {
|
|
15554
|
+
...props,
|
|
15535
15555
|
children: node
|
|
15536
15556
|
});
|
|
15537
15557
|
Renderer.updateContainerSync(element, _classPrivateFieldGet2(_container, this), null, null);
|
|
@@ -15604,4 +15624,4 @@ const reactPlugin = definePlugin({
|
|
|
15604
15624
|
|
|
15605
15625
|
//#endregion
|
|
15606
15626
|
export { _classPrivateFieldInitSpec as a, _classPrivateFieldGet2 as i, Runtime as n, _classPrivateFieldSet2 as r, reactPlugin as t };
|
|
15607
|
-
//# sourceMappingURL=reactPlugin-
|
|
15627
|
+
//# sourceMappingURL=reactPlugin-CAtVV84d.js.map
|