@kubb/react-fabric 0.9.5 → 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 (108) 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/{devtools-D6dZodXp.js → devtools-8_UKWDTl.js} +1 -1
  4. package/dist/{devtools-D6dZodXp.js.map → devtools-8_UKWDTl.js.map} +1 -1
  5. package/dist/{devtools-CRkwwngz.cjs → devtools-BOpUJhc_.cjs} +1 -1
  6. package/dist/{devtools-CRkwwngz.cjs.map → devtools-BOpUJhc_.cjs.map} +1 -1
  7. package/dist/devtools.cjs +1 -1
  8. package/dist/devtools.js +1 -1
  9. package/dist/globals.d.cts +2 -2
  10. package/dist/globals.d.ts +2 -2
  11. package/dist/index.cjs +166 -73
  12. package/dist/index.cjs.map +1 -1
  13. package/dist/index.d.cts +3 -359
  14. package/dist/index.d.ts +3 -359
  15. package/dist/index.js +151 -68
  16. package/dist/index.js.map +1 -1
  17. package/dist/jsx-dev-runtime.d.cts +5 -5
  18. package/dist/jsx-dev-runtime.d.ts +3 -3
  19. package/dist/{jsx-namespace-BAkGpU6g.d.ts → jsx-namespace-CBOEkCmJ.d.ts} +2 -2
  20. package/dist/{jsx-namespace-CCPa1Nut.d.cts → jsx-namespace-od7sqrmY.d.cts} +2 -2
  21. package/dist/{jsx-runtime-BEVcoJUm.cjs → jsx-runtime-Cq39dA50.cjs} +1 -1
  22. package/dist/{jsx-runtime-BEVcoJUm.cjs.map → jsx-runtime-Cq39dA50.cjs.map} +1 -1
  23. package/dist/{jsx-runtime-DDu0mFTI.js → jsx-runtime-Isgf9orn.js} +1 -1
  24. package/dist/{jsx-runtime-DDu0mFTI.js.map → jsx-runtime-Isgf9orn.js.map} +1 -1
  25. package/dist/jsx-runtime.cjs +1 -1
  26. package/dist/jsx-runtime.d.cts +5 -5
  27. package/dist/jsx-runtime.d.ts +3 -3
  28. package/dist/jsx-runtime.js +1 -1
  29. package/dist/parsers.d.cts +1 -1
  30. package/dist/parsers.d.ts +1 -1
  31. package/dist/plugins.cjs +2 -2
  32. package/dist/plugins.d.cts +2 -2
  33. package/dist/plugins.d.ts +2 -2
  34. package/dist/plugins.js +2 -2
  35. package/dist/{reactPlugin-CXaAO13f.cjs → reactPlugin-B8F6jVb5.cjs} +77 -64
  36. package/dist/reactPlugin-B8F6jVb5.cjs.map +1 -0
  37. package/dist/{reactPlugin-ixOr00MK.js → reactPlugin-CAtVV84d.js} +78 -53
  38. package/dist/reactPlugin-CAtVV84d.js.map +1 -0
  39. package/dist/types-C3ODUOKN.d.cts +675 -0
  40. package/dist/types-DwaohVJS.d.ts +675 -0
  41. package/dist/types.d.cts +3 -3
  42. package/dist/types.d.ts +3 -3
  43. package/package.json +3 -3
  44. package/src/Runtime.tsx +22 -12
  45. package/src/components/App.tsx +24 -15
  46. package/src/components/Const.tsx +19 -3
  47. package/src/components/File.tsx +107 -31
  48. package/src/components/Function.tsx +36 -5
  49. package/src/components/Indent.tsx +3 -0
  50. package/src/components/Root.tsx +26 -20
  51. package/src/components/Type.tsx +19 -2
  52. package/src/components/__snapshots__/arrow_function.ts +3 -0
  53. package/src/components/__snapshots__/arrow_function_default.ts +3 -0
  54. package/src/components/__snapshots__/arrow_function_generics.ts +3 -0
  55. package/src/components/__snapshots__/arrow_function_single_line.ts +1 -0
  56. package/src/components/__snapshots__/arrow_function_with_generics.ts +3 -0
  57. package/src/components/__snapshots__/async_arrow_function.ts +3 -0
  58. package/src/components/__snapshots__/async_function.ts +3 -0
  59. package/src/components/__snapshots__/async_function_with_Promise_return_type.ts +3 -0
  60. package/src/components/__snapshots__/basic_arrow_function.ts +3 -0
  61. package/src/components/__snapshots__/basic_const.ts +1 -0
  62. package/src/components/__snapshots__/basic_export.ts +1 -0
  63. package/src/components/__snapshots__/basic_function.ts +3 -0
  64. package/src/components/__snapshots__/basic_import.ts +1 -0
  65. package/src/components/__snapshots__/basic_type.ts +1 -0
  66. package/src/components/__snapshots__/const_with_JSDoc.ts +4 -0
  67. package/src/components/__snapshots__/const_with_as_const.ts +1 -0
  68. package/src/components/__snapshots__/const_with_type.ts +1 -0
  69. package/src/components/__snapshots__/default_exported_arrow_function.ts +3 -0
  70. package/src/components/__snapshots__/default_exported_function.ts +3 -0
  71. package/src/components/__snapshots__/exported_arrow_function.ts +3 -0
  72. package/src/components/__snapshots__/exported_const.ts +1 -0
  73. package/src/components/__snapshots__/exported_function.ts +3 -0
  74. package/src/components/__snapshots__/exported_type.ts +1 -0
  75. package/src/components/__snapshots__/function_generics.ts +3 -0
  76. package/src/components/__snapshots__/function_with_JSDoc.ts +6 -0
  77. package/src/components/__snapshots__/function_with_comments.ts +6 -0
  78. package/src/components/__snapshots__/function_with_generics.ts +3 -0
  79. package/src/components/__snapshots__/function_with_parameters.ts +3 -0
  80. package/src/components/__snapshots__/function_with_params.ts +3 -0
  81. package/src/components/__snapshots__/function_with_returnType.ts +3 -0
  82. package/src/components/__snapshots__/function_with_return_type.ts +3 -0
  83. package/src/components/__snapshots__/matches_with_root_import.ts +1 -0
  84. package/src/components/__snapshots__/multiple_functions.ts +3 -0
  85. package/src/components/__snapshots__/named_export.ts +1 -0
  86. package/src/components/__snapshots__/named_export_(object_advanced).ts +1 -0
  87. package/src/components/__snapshots__/named_import.ts +1 -0
  88. package/src/components/__snapshots__/named_import_(object).ts +1 -0
  89. package/src/components/__snapshots__/named_import_(object_advanced).ts +1 -0
  90. package/src/components/__snapshots__/named_typed_export.ts +1 -0
  91. package/src/components/__snapshots__/named_typed_import.ts +1 -0
  92. package/src/components/__snapshots__/single_line_arrow_function.ts +1 -0
  93. package/src/components/__snapshots__/type_with_JSDoc.ts +4 -0
  94. package/src/components/__snapshots__/typed_export.ts +1 -0
  95. package/src/components/__snapshots__/typed_import.ts +1 -0
  96. package/src/composables/useApp.ts +1 -15
  97. package/src/composables/useFile.ts +1 -12
  98. package/src/composables/useLifecycle.tsx +7 -8
  99. package/src/index.ts +5 -1
  100. package/src/plugins/reactPlugin.ts +7 -6
  101. package/src/types.ts +0 -4
  102. package/src/utils/createJSDoc.ts +1 -8
  103. package/dist/reactPlugin-4-kcMKwZ.d.ts +0 -31
  104. package/dist/reactPlugin-B4xarQJX.d.cts +0 -31
  105. package/dist/reactPlugin-CXaAO13f.cjs.map +0 -1
  106. package/dist/reactPlugin-ixOr00MK.js.map +0 -1
  107. package/dist/types-CSUzVTpn.d.ts +0 -104
  108. package/dist/types-DP2mgqeb.d.cts +0 -104
@@ -1,11 +1,51 @@
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
- import { n as jsx } from "./jsx-runtime-DDu0mFTI.js";
3
+ import { n as jsx } from "./jsx-runtime-Isgf9orn.js";
4
+ import { NodeTreeContext, RootContext, TreeNode, provide } from "@kubb/fabric-core";
4
5
  import { onExit } from "signal-exit";
5
6
  import { definePlugin } from "@kubb/fabric-core/plugins";
6
7
  import process$1 from "node:process";
7
8
  import { createExport, createImport, print } from "@kubb/fabric-core/parsers/typescript";
8
9
 
10
+ //#region ../../node_modules/.pnpm/react-reconciler@0.32.0_react@19.2.1/node_modules/react-reconciler/cjs/react-reconciler-constants.production.js
11
+ /**
12
+ * @license React
13
+ * react-reconciler-constants.production.js
14
+ *
15
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
16
+ *
17
+ * This source code is licensed under the MIT license found in the
18
+ * LICENSE file in the root directory of this source tree.
19
+ */
20
+ var require_react_reconciler_constants_production = /* @__PURE__ */ __commonJSMin(((exports) => {
21
+ exports.ConcurrentRoot = 1;
22
+ exports.DefaultEventPriority = 32;
23
+ exports.NoEventPriority = 0;
24
+ }));
25
+
26
+ //#endregion
27
+ //#region ../../node_modules/.pnpm/react-reconciler@0.32.0_react@19.2.1/node_modules/react-reconciler/cjs/react-reconciler-constants.development.js
28
+ /**
29
+ * @license React
30
+ * react-reconciler-constants.development.js
31
+ *
32
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
33
+ *
34
+ * This source code is licensed under the MIT license found in the
35
+ * LICENSE file in the root directory of this source tree.
36
+ */
37
+ var require_react_reconciler_constants_development = /* @__PURE__ */ __commonJSMin(((exports) => {
38
+ "production" !== process.env.NODE_ENV && (exports.ConcurrentRoot = 1, exports.ContinuousEventPriority = 8, exports.DefaultEventPriority = 32, exports.DiscreteEventPriority = 2, exports.IdleEventPriority = 268435456, exports.LegacyRoot = 0, exports.NoEventPriority = 0);
39
+ }));
40
+
41
+ //#endregion
42
+ //#region ../../node_modules/.pnpm/react-reconciler@0.32.0_react@19.2.1/node_modules/react-reconciler/constants.js
43
+ var require_constants = /* @__PURE__ */ __commonJSMin(((exports, module) => {
44
+ if (process.env.NODE_ENV === "production") module.exports = require_react_reconciler_constants_production();
45
+ else module.exports = require_react_reconciler_constants_development();
46
+ }));
47
+
48
+ //#endregion
9
49
  //#region \0@oxc-project+runtime@0.103.0/helpers/typeof.js
10
50
  function _typeof(o) {
11
51
  "@babel/helpers - typeof";
@@ -67,60 +107,25 @@ var ErrorBoundary = class extends import_react.Component {
67
107
  }
68
108
  };
69
109
  _defineProperty(ErrorBoundary, "displayName", "KubbErrorBoundary");
70
- const RootContext = (0, import_react.createContext)({ exit: () => {} });
71
- function Root({ onError, onExit: onExit$1, children }) {
110
+ /**
111
+ * This component provides the root behavior for the Fabric runtime.
112
+ */
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);
72
120
  return /* @__PURE__ */ jsx(ErrorBoundary, {
73
121
  onError: (error) => {
74
122
  onError(error);
75
123
  },
76
- children: /* @__PURE__ */ jsx(RootContext.Provider, {
77
- value: { exit: onExit$1 },
78
- children
79
- })
124
+ children
80
125
  });
81
126
  }
82
- Root.Context = RootContext;
83
127
  Root.displayName = "KubbRoot";
84
128
 
85
- //#endregion
86
- //#region ../../node_modules/.pnpm/react-reconciler@0.32.0_react@19.2.1/node_modules/react-reconciler/cjs/react-reconciler-constants.production.js
87
- /**
88
- * @license React
89
- * react-reconciler-constants.production.js
90
- *
91
- * Copyright (c) Meta Platforms, Inc. and affiliates.
92
- *
93
- * This source code is licensed under the MIT license found in the
94
- * LICENSE file in the root directory of this source tree.
95
- */
96
- var require_react_reconciler_constants_production = /* @__PURE__ */ __commonJSMin(((exports) => {
97
- exports.ConcurrentRoot = 1;
98
- exports.DefaultEventPriority = 32;
99
- exports.NoEventPriority = 0;
100
- }));
101
-
102
- //#endregion
103
- //#region ../../node_modules/.pnpm/react-reconciler@0.32.0_react@19.2.1/node_modules/react-reconciler/cjs/react-reconciler-constants.development.js
104
- /**
105
- * @license React
106
- * react-reconciler-constants.development.js
107
- *
108
- * Copyright (c) Meta Platforms, Inc. and affiliates.
109
- *
110
- * This source code is licensed under the MIT license found in the
111
- * LICENSE file in the root directory of this source tree.
112
- */
113
- var require_react_reconciler_constants_development = /* @__PURE__ */ __commonJSMin(((exports) => {
114
- "production" !== process.env.NODE_ENV && (exports.ConcurrentRoot = 1, exports.ContinuousEventPriority = 8, exports.DefaultEventPriority = 32, exports.DiscreteEventPriority = 2, exports.IdleEventPriority = 268435456, exports.LegacyRoot = 0, exports.NoEventPriority = 0);
115
- }));
116
-
117
- //#endregion
118
- //#region ../../node_modules/.pnpm/react-reconciler@0.32.0_react@19.2.1/node_modules/react-reconciler/constants.js
119
- var require_constants = /* @__PURE__ */ __commonJSMin(((exports, module) => {
120
- if (process.env.NODE_ENV === "production") module.exports = require_react_reconciler_constants_production();
121
- else module.exports = require_react_reconciler_constants_development();
122
- }));
123
-
124
129
  //#endregion
125
130
  //#region src/dom.ts
126
131
  const createNode = (nodeName) => {
@@ -15509,9 +15514,19 @@ var Runtime = class {
15509
15514
  this.unmount(error);
15510
15515
  }
15511
15516
  async render(node) {
15512
- 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,
15513
15524
  onExit: this.onExit.bind(this),
15514
- 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,
15515
15530
  children: node
15516
15531
  });
15517
15532
  Renderer.updateContainerSync(element, _classPrivateFieldGet2(_container, this), null, null);
@@ -15524,9 +15539,19 @@ var Runtime = class {
15524
15539
  }
15525
15540
  }
15526
15541
  async renderToString(node) {
15527
- 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,
15528
15549
  onExit: this.onExit.bind(this),
15529
- 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,
15530
15555
  children: node
15531
15556
  });
15532
15557
  Renderer.updateContainerSync(element, _classPrivateFieldGet2(_container, this), null, null);
@@ -15598,5 +15623,5 @@ const reactPlugin = definePlugin({
15598
15623
  });
15599
15624
 
15600
15625
  //#endregion
15601
- export { _classPrivateFieldInitSpec as a, _classPrivateFieldGet2 as i, Runtime as n, Root as o, _classPrivateFieldSet2 as r, RootContext as s, reactPlugin as t };
15602
- //# sourceMappingURL=reactPlugin-ixOr00MK.js.map
15626
+ export { _classPrivateFieldInitSpec as a, _classPrivateFieldGet2 as i, Runtime as n, _classPrivateFieldSet2 as r, reactPlugin as t };
15627
+ //# sourceMappingURL=reactPlugin-CAtVV84d.js.map