@kubb/react-fabric 0.12.4 → 0.12.6

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 (52) hide show
  1. package/dist/globals.d.cts +8 -8
  2. package/dist/globals.d.ts +8 -8
  3. package/dist/index.cjs +37 -39
  4. package/dist/index.cjs.map +1 -1
  5. package/dist/index.d.cts +59 -37
  6. package/dist/index.d.ts +59 -37
  7. package/dist/index.js +43 -64
  8. package/dist/index.js.map +1 -1
  9. package/dist/jsx-dev-runtime.cjs.map +1 -1
  10. package/dist/jsx-dev-runtime.d.cts +4 -4
  11. package/dist/jsx-dev-runtime.d.ts +4 -4
  12. package/dist/jsx-dev-runtime.js.map +1 -1
  13. package/dist/{jsx-namespace-fB1bxOIg.d.ts → jsx-namespace-BMpcDF6T.d.ts} +8 -8
  14. package/dist/{jsx-namespace-r-JXq_rp.d.cts → jsx-namespace-BdDNwAgO.d.cts} +8 -8
  15. package/dist/jsx-runtime-6sQc68DD.cjs.map +1 -1
  16. package/dist/jsx-runtime-CpElaHq6.js.map +1 -1
  17. package/dist/jsx-runtime.d.cts +4 -4
  18. package/dist/jsx-runtime.d.ts +4 -4
  19. package/dist/plugins.cjs +1 -1
  20. package/dist/plugins.d.cts +1 -1
  21. package/dist/plugins.d.ts +2 -2
  22. package/dist/plugins.js +1 -1
  23. package/dist/{reactPlugin-CwuxUcyY.js → reactPlugin-C7_IY8_K.js} +85 -83
  24. package/dist/reactPlugin-C7_IY8_K.js.map +1 -0
  25. package/dist/{reactPlugin-BzHuVlbO.cjs → reactPlugin-DbTz9RKJ.cjs} +90 -82
  26. package/dist/reactPlugin-DbTz9RKJ.cjs.map +1 -0
  27. package/dist/{reactPlugin-CVS9VJ5P.d.ts → reactPlugin-Dl5F1rQk.d.ts} +37 -11
  28. package/dist/{reactPlugin-EQOIOEA2.d.cts → reactPlugin-fdJaWnpd.d.cts} +37 -11
  29. package/dist/{types-XiObCuPy.d.ts → types-BKnc-nPE.d.ts} +15 -15
  30. package/dist/{types-J_S-h-Ae.d.cts → types-K0AHi-aU.d.cts} +15 -15
  31. package/dist/types.d.cts +2 -2
  32. package/dist/types.d.ts +2 -2
  33. package/package.json +3 -3
  34. package/src/Renderer.ts +2 -2
  35. package/src/Runtime.tsx +6 -4
  36. package/src/components/App.tsx +4 -4
  37. package/src/components/Const.tsx +4 -4
  38. package/src/components/File.tsx +11 -11
  39. package/src/components/Function.tsx +6 -6
  40. package/src/components/Root.tsx +7 -7
  41. package/src/components/Type.tsx +4 -4
  42. package/src/composables/useLifecycle.tsx +1 -19
  43. package/src/devtools.ts +3 -3
  44. package/src/globals.ts +17 -8
  45. package/src/index.ts +4 -7
  46. package/src/jsx-dev-runtime.ts +3 -3
  47. package/src/jsx-namespace.d.ts +8 -8
  48. package/src/jsx-runtime.ts +3 -3
  49. package/src/plugins/reactPlugin.ts +5 -5
  50. package/src/types.ts +24 -15
  51. package/dist/reactPlugin-BzHuVlbO.cjs.map +0 -1
  52. package/dist/reactPlugin-CwuxUcyY.js.map +0 -1
@@ -7,6 +7,87 @@ let node_process = require("node:process");
7
7
  node_process = require_react$1.__toESM(node_process);
8
8
  let _kubb_fabric_core_parsers_typescript = require("@kubb/fabric-core/parsers/typescript");
9
9
 
10
+ //#region \0@oxc-project+runtime@0.110.0/helpers/typeof.js
11
+ function _typeof(o) {
12
+ "@babel/helpers - typeof";
13
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
14
+ return typeof o;
15
+ } : function(o) {
16
+ return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
17
+ }, _typeof(o);
18
+ }
19
+
20
+ //#endregion
21
+ //#region \0@oxc-project+runtime@0.110.0/helpers/toPrimitive.js
22
+ function toPrimitive(t, r) {
23
+ if ("object" != _typeof(t) || !t) return t;
24
+ var e = t[Symbol.toPrimitive];
25
+ if (void 0 !== e) {
26
+ var i = e.call(t, r || "default");
27
+ if ("object" != _typeof(i)) return i;
28
+ throw new TypeError("@@toPrimitive must return a primitive value.");
29
+ }
30
+ return ("string" === r ? String : Number)(t);
31
+ }
32
+
33
+ //#endregion
34
+ //#region \0@oxc-project+runtime@0.110.0/helpers/toPropertyKey.js
35
+ function toPropertyKey(t) {
36
+ var i = toPrimitive(t, "string");
37
+ return "symbol" == _typeof(i) ? i : i + "";
38
+ }
39
+
40
+ //#endregion
41
+ //#region \0@oxc-project+runtime@0.110.0/helpers/defineProperty.js
42
+ function _defineProperty(e, r, t) {
43
+ return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
44
+ value: t,
45
+ enumerable: !0,
46
+ configurable: !0,
47
+ writable: !0
48
+ }) : e[r] = t, e;
49
+ }
50
+
51
+ //#endregion
52
+ //#region src/components/Root.tsx
53
+ var import_react = /* @__PURE__ */ require_react$1.__toESM(require_react$1.require_react());
54
+ var ErrorBoundary = class extends import_react.Component {
55
+ constructor(..._args) {
56
+ super(..._args);
57
+ _defineProperty(this, "state", { hasError: false });
58
+ }
59
+ static getDerivedStateFromError(_error) {
60
+ return { hasError: true };
61
+ }
62
+ componentDidCatch(error) {
63
+ if (error) this.props.onError(error);
64
+ }
65
+ render() {
66
+ if (this.state.hasError) return null;
67
+ return this.props.children;
68
+ }
69
+ };
70
+ _defineProperty(ErrorBoundary, "displayName", "ErrorBoundary");
71
+ /**
72
+ * This component provides the root behavior for the Fabric runtime.
73
+ */
74
+ function Root({ onError, onExit, treeNode, fileManager, children }) {
75
+ (0, _kubb_fabric_core.provide)(_kubb_fabric_core.RootContext, {
76
+ exit: onExit,
77
+ treeNode,
78
+ fileManager
79
+ });
80
+ (0, _kubb_fabric_core.provide)(_kubb_fabric_core.NodeTreeContext, treeNode);
81
+ return /* @__PURE__ */ require_jsx_runtime.jsx(ErrorBoundary, {
82
+ onError: (error) => {
83
+ onError(error);
84
+ },
85
+ children
86
+ });
87
+ }
88
+ Root.displayName = "Root";
89
+
90
+ //#endregion
10
91
  //#region ../../node_modules/.pnpm/scheduler@0.27.0/node_modules/scheduler/cjs/scheduler.production.js
11
92
  /**
12
93
  * @license React
@@ -17321,7 +17402,6 @@ const nodeNames = new Set([
17321
17402
 
17322
17403
  //#endregion
17323
17404
  //#region src/Renderer.ts
17324
- var import_react = /* @__PURE__ */ require_react$1.__toESM(require_react$1.require_react(), 1);
17325
17405
  var import_react_reconciler = /* @__PURE__ */ require_react$1.__toESM(require_react_reconciler(), 1);
17326
17406
  var import_constants = require_constants();
17327
17407
  let currentUpdatePriority = import_constants.NoEventPriority;
@@ -17446,86 +17526,6 @@ const Renderer = (0, import_react_reconciler.default)({
17446
17526
  }
17447
17527
  });
17448
17528
 
17449
- //#endregion
17450
- //#region \0@oxc-project+runtime@0.110.0/helpers/typeof.js
17451
- function _typeof(o) {
17452
- "@babel/helpers - typeof";
17453
- return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
17454
- return typeof o;
17455
- } : function(o) {
17456
- return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
17457
- }, _typeof(o);
17458
- }
17459
-
17460
- //#endregion
17461
- //#region \0@oxc-project+runtime@0.110.0/helpers/toPrimitive.js
17462
- function toPrimitive(t, r) {
17463
- if ("object" != _typeof(t) || !t) return t;
17464
- var e = t[Symbol.toPrimitive];
17465
- if (void 0 !== e) {
17466
- var i = e.call(t, r || "default");
17467
- if ("object" != _typeof(i)) return i;
17468
- throw new TypeError("@@toPrimitive must return a primitive value.");
17469
- }
17470
- return ("string" === r ? String : Number)(t);
17471
- }
17472
-
17473
- //#endregion
17474
- //#region \0@oxc-project+runtime@0.110.0/helpers/toPropertyKey.js
17475
- function toPropertyKey(t) {
17476
- var i = toPrimitive(t, "string");
17477
- return "symbol" == _typeof(i) ? i : i + "";
17478
- }
17479
-
17480
- //#endregion
17481
- //#region \0@oxc-project+runtime@0.110.0/helpers/defineProperty.js
17482
- function _defineProperty(e, r, t) {
17483
- return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
17484
- value: t,
17485
- enumerable: !0,
17486
- configurable: !0,
17487
- writable: !0
17488
- }) : e[r] = t, e;
17489
- }
17490
-
17491
- //#endregion
17492
- //#region src/components/Root.tsx
17493
- var ErrorBoundary = class extends import_react.Component {
17494
- constructor(..._args) {
17495
- super(..._args);
17496
- _defineProperty(this, "state", { hasError: false });
17497
- }
17498
- static getDerivedStateFromError(_error) {
17499
- return { hasError: true };
17500
- }
17501
- componentDidCatch(error) {
17502
- if (error) this.props.onError(error);
17503
- }
17504
- render() {
17505
- if (this.state.hasError) return null;
17506
- return this.props.children;
17507
- }
17508
- };
17509
- _defineProperty(ErrorBoundary, "displayName", "KubbErrorBoundary");
17510
- /**
17511
- * This component provides the root behavior for the Fabric runtime.
17512
- */
17513
- function Root({ onError, onExit, treeNode, fileManager, children }) {
17514
- (0, _kubb_fabric_core.provide)(_kubb_fabric_core.RootContext, {
17515
- exit: onExit,
17516
- treeNode,
17517
- fileManager
17518
- });
17519
- (0, _kubb_fabric_core.provide)(_kubb_fabric_core.NodeTreeContext, treeNode);
17520
- return /* @__PURE__ */ require_jsx_runtime.jsx(ErrorBoundary, {
17521
- onError: (error) => {
17522
- onError(error);
17523
- },
17524
- children
17525
- });
17526
- }
17527
- Root.displayName = "KubbRoot";
17528
-
17529
17529
  //#endregion
17530
17530
  //#region src/utils/squashExportNodes.ts
17531
17531
  function squashExportNodes(node) {
@@ -17812,7 +17812,9 @@ var Runtime = class {
17812
17812
  _classPrivateFieldSet2(_renderError, this, error);
17813
17813
  }
17814
17814
  onExit(error) {
17815
- this.unmount(error);
17815
+ setTimeout(() => {
17816
+ this.unmount(error);
17817
+ }, 0);
17816
17818
  }
17817
17819
  async render(node) {
17818
17820
  const treeNode = _classPrivateFieldGet2(_options, this).treeNode || new _kubb_fabric_core.TreeNode({
@@ -17930,6 +17932,12 @@ Object.defineProperty(exports, 'Renderer', {
17930
17932
  return Renderer;
17931
17933
  }
17932
17934
  });
17935
+ Object.defineProperty(exports, 'Root', {
17936
+ enumerable: true,
17937
+ get: function () {
17938
+ return Root;
17939
+ }
17940
+ });
17933
17941
  Object.defineProperty(exports, 'Runtime', {
17934
17942
  enumerable: true,
17935
17943
  get: function () {