@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.
Files changed (90) hide show
  1. package/dist/{Fabric-DitK3IEP.d.ts → Fabric-BELBf-bX.d.cts} +5 -5
  2. package/dist/{Fabric-C61uYmUy.d.cts → Fabric-DbJhvsCq.d.ts} +5 -5
  3. package/dist/globals.d.cts +2 -2
  4. package/dist/globals.d.ts +2 -2
  5. package/dist/index.cjs +99 -34
  6. package/dist/index.cjs.map +1 -1
  7. package/dist/index.d.cts +3 -511
  8. package/dist/index.d.ts +3 -511
  9. package/dist/index.js +100 -35
  10. package/dist/index.js.map +1 -1
  11. package/dist/jsx-dev-runtime.d.cts +5 -5
  12. package/dist/jsx-dev-runtime.d.ts +3 -3
  13. package/dist/{jsx-namespace-D0a66_uR.d.ts → jsx-namespace-CBOEkCmJ.d.ts} +2 -2
  14. package/dist/{jsx-namespace-BnoysbjP.d.cts → jsx-namespace-od7sqrmY.d.cts} +2 -2
  15. package/dist/jsx-runtime.d.cts +5 -5
  16. package/dist/jsx-runtime.d.ts +3 -3
  17. package/dist/parsers.d.cts +1 -1
  18. package/dist/parsers.d.ts +1 -1
  19. package/dist/plugins.cjs +1 -1
  20. package/dist/plugins.d.cts +2 -2
  21. package/dist/plugins.d.ts +2 -2
  22. package/dist/plugins.js +1 -1
  23. package/dist/{reactPlugin-D4SmGYbm.cjs → reactPlugin-B8F6jVb5.cjs} +33 -13
  24. package/dist/reactPlugin-B8F6jVb5.cjs.map +1 -0
  25. package/dist/{reactPlugin-DT9toQPK.js → reactPlugin-CAtVV84d.js} +34 -14
  26. package/dist/reactPlugin-CAtVV84d.js.map +1 -0
  27. package/dist/types-C3ODUOKN.d.cts +675 -0
  28. package/dist/types-DwaohVJS.d.ts +675 -0
  29. package/dist/types.d.cts +3 -3
  30. package/dist/types.d.ts +3 -3
  31. package/package.json +2 -2
  32. package/src/Runtime.tsx +22 -12
  33. package/src/components/App.tsx +23 -7
  34. package/src/components/Const.tsx +17 -4
  35. package/src/components/File.tsx +83 -24
  36. package/src/components/Function.tsx +28 -7
  37. package/src/components/Root.tsx +23 -16
  38. package/src/components/Type.tsx +17 -4
  39. package/src/components/__snapshots__/arrow_function.ts +3 -0
  40. package/src/components/__snapshots__/arrow_function_default.ts +3 -0
  41. package/src/components/__snapshots__/arrow_function_generics.ts +3 -0
  42. package/src/components/__snapshots__/arrow_function_single_line.ts +1 -0
  43. package/src/components/__snapshots__/arrow_function_with_generics.ts +3 -0
  44. package/src/components/__snapshots__/async_arrow_function.ts +3 -0
  45. package/src/components/__snapshots__/async_function.ts +3 -0
  46. package/src/components/__snapshots__/async_function_with_Promise_return_type.ts +3 -0
  47. package/src/components/__snapshots__/basic_arrow_function.ts +3 -0
  48. package/src/components/__snapshots__/basic_const.ts +1 -0
  49. package/src/components/__snapshots__/basic_export.ts +1 -0
  50. package/src/components/__snapshots__/basic_function.ts +3 -0
  51. package/src/components/__snapshots__/basic_import.ts +1 -0
  52. package/src/components/__snapshots__/basic_type.ts +1 -0
  53. package/src/components/__snapshots__/const_with_JSDoc.ts +4 -0
  54. package/src/components/__snapshots__/const_with_as_const.ts +1 -0
  55. package/src/components/__snapshots__/const_with_type.ts +1 -0
  56. package/src/components/__snapshots__/default_exported_arrow_function.ts +3 -0
  57. package/src/components/__snapshots__/default_exported_function.ts +3 -0
  58. package/src/components/__snapshots__/exported_arrow_function.ts +3 -0
  59. package/src/components/__snapshots__/exported_const.ts +1 -0
  60. package/src/components/__snapshots__/exported_function.ts +3 -0
  61. package/src/components/__snapshots__/exported_type.ts +1 -0
  62. package/src/components/__snapshots__/function_generics.ts +3 -0
  63. package/src/components/__snapshots__/function_with_JSDoc.ts +6 -0
  64. package/src/components/__snapshots__/function_with_comments.ts +6 -0
  65. package/src/components/__snapshots__/function_with_generics.ts +3 -0
  66. package/src/components/__snapshots__/function_with_parameters.ts +3 -0
  67. package/src/components/__snapshots__/function_with_params.ts +3 -0
  68. package/src/components/__snapshots__/function_with_returnType.ts +3 -0
  69. package/src/components/__snapshots__/function_with_return_type.ts +3 -0
  70. package/src/components/__snapshots__/matches_with_root_import.ts +1 -0
  71. package/src/components/__snapshots__/multiple_functions.ts +3 -0
  72. package/src/components/__snapshots__/named_export.ts +1 -0
  73. package/src/components/__snapshots__/named_export_(object_advanced).ts +1 -0
  74. package/src/components/__snapshots__/named_import.ts +1 -0
  75. package/src/components/__snapshots__/named_import_(object).ts +1 -0
  76. package/src/components/__snapshots__/named_import_(object_advanced).ts +1 -0
  77. package/src/components/__snapshots__/named_typed_export.ts +1 -0
  78. package/src/components/__snapshots__/named_typed_import.ts +1 -0
  79. package/src/components/__snapshots__/single_line_arrow_function.ts +1 -0
  80. package/src/components/__snapshots__/type_with_JSDoc.ts +4 -0
  81. package/src/components/__snapshots__/typed_export.ts +1 -0
  82. package/src/components/__snapshots__/typed_import.ts +1 -0
  83. package/src/composables/useLifecycle.tsx +1 -1
  84. package/src/plugins/reactPlugin.ts +7 -6
  85. package/dist/reactPlugin-4-kcMKwZ.d.ts +0 -31
  86. package/dist/reactPlugin-B4xarQJX.d.cts +0 -31
  87. package/dist/reactPlugin-D4SmGYbm.cjs.map +0 -1
  88. package/dist/reactPlugin-DT9toQPK.js.map +0 -1
  89. package/dist/types-BL7PkfqA.d.ts +0 -106
  90. 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
- * Provides the root context (exit hook) and wraps children into an
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, { exit: onExit$1 });
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 element = /* @__PURE__ */ jsx(Root, {
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 element = /* @__PURE__ */ jsx(Root, {
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-DT9toQPK.js.map
15627
+ //# sourceMappingURL=reactPlugin-CAtVV84d.js.map