@kubb/react-fabric 0.9.0 → 0.9.2

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/index.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  const require_chunk = require('./chunk-BrXtsOCC.cjs');
2
2
  const require_react$1 = require('./react-CWV4qQg2.cjs');
3
- const require_reactPlugin = require('./reactPlugin-DPkN8GTg.cjs');
3
+ const require_reactPlugin = require('./reactPlugin-CXaAO13f.cjs');
4
4
  const require_jsx_runtime = require('./jsx-runtime-BEVcoJUm.cjs');
5
5
  const require_devtools = require('./devtools-CRkwwngz.cjs');
6
6
  let _kubb_fabric_core = require("@kubb/fabric-core");
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { r as __toESM } from "./chunk-BCPZiDLE.js";
2
2
  import { t as require_react } from "./react-DfIUVisP.js";
3
- import { a as _classPrivateFieldInitSpec, i as _classPrivateFieldGet2, n as Runtime, o as Root, r as _classPrivateFieldSet2, s as RootContext, t as reactPlugin } from "./reactPlugin-CNfZ6eQk.js";
3
+ import { a as _classPrivateFieldInitSpec, i as _classPrivateFieldGet2, n as Runtime, o as Root, r as _classPrivateFieldSet2, s as RootContext, t as reactPlugin } from "./reactPlugin-ixOr00MK.js";
4
4
  import { i as jsxs, n as jsx, t as Fragment$1 } from "./jsx-runtime-DDu0mFTI.js";
5
5
  import { t as open } from "./devtools-D6dZodXp.js";
6
6
  import { createFabric } from "@kubb/fabric-core";
@@ -1,11 +1,11 @@
1
1
  import "./Fabric-DitK3IEP.js";
2
2
  import { d as KubbNode, s as KubbElement } from "./types-CSUzVTpn.js";
3
3
  import { t as JSX } from "./jsx-namespace-BAkGpU6g.js";
4
- import * as react1 from "react";
4
+ import * as react0 from "react";
5
5
  import * as React$1 from "react/jsx-dev-runtime";
6
6
 
7
7
  //#region src/jsx-dev-runtime.d.ts
8
- declare const Fragment: react1.ExoticComponent<react1.FragmentProps>;
8
+ declare const Fragment: react0.ExoticComponent<react0.FragmentProps>;
9
9
  declare const jsxDEV: typeof React$1.jsxDEV;
10
10
  type JSXElement = KubbElement;
11
11
  type ReactNode = KubbNode;
@@ -1,11 +1,11 @@
1
1
  import "./Fabric-DitK3IEP.js";
2
2
  import { d as KubbNode, s as KubbElement } from "./types-CSUzVTpn.js";
3
3
  import { t as JSX } from "./jsx-namespace-BAkGpU6g.js";
4
- import * as react0 from "react";
4
+ import * as react1 from "react";
5
5
  import * as React$1 from "react/jsx-runtime";
6
6
 
7
7
  //#region src/jsx-runtime.d.ts
8
- declare const Fragment: react0.ExoticComponent<react0.FragmentProps>;
8
+ declare const Fragment: react1.ExoticComponent<react1.FragmentProps>;
9
9
  declare const jsx: typeof React$1.jsx;
10
10
  declare const jsxDEV: typeof React$1.jsx;
11
11
  declare const jsxs: typeof React$1.jsxs;
package/dist/plugins.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  require('./react-CWV4qQg2.cjs');
2
- const require_reactPlugin = require('./reactPlugin-DPkN8GTg.cjs');
2
+ const require_reactPlugin = require('./reactPlugin-CXaAO13f.cjs');
3
3
  require('./jsx-runtime-BEVcoJUm.cjs');
4
4
 
5
5
  exports.reactPlugin = require_reactPlugin.reactPlugin;
package/dist/plugins.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import "./react-DfIUVisP.js";
2
- import { t as reactPlugin } from "./reactPlugin-CNfZ6eQk.js";
2
+ import { t as reactPlugin } from "./reactPlugin-ixOr00MK.js";
3
3
  import "./jsx-runtime-DDu0mFTI.js";
4
4
 
5
5
  export * from "@kubb/fabric-core/plugins"
@@ -70,19 +70,15 @@ var ErrorBoundary = class extends import_react.Component {
70
70
  _defineProperty(ErrorBoundary, "displayName", "KubbErrorBoundary");
71
71
  const RootContext = (0, import_react.createContext)({ exit: () => {} });
72
72
  function Root({ onError, onExit: onExit$1, children }) {
73
- try {
74
- return /* @__PURE__ */ require_jsx_runtime.jsx(ErrorBoundary, {
75
- onError: (error) => {
76
- onError(error);
77
- },
78
- children: /* @__PURE__ */ require_jsx_runtime.jsx(RootContext.Provider, {
79
- value: { exit: onExit$1 },
80
- children
81
- })
82
- });
83
- } catch (_e) {
84
- return null;
85
- }
73
+ return /* @__PURE__ */ require_jsx_runtime.jsx(ErrorBoundary, {
74
+ onError: (error) => {
75
+ onError(error);
76
+ },
77
+ children: /* @__PURE__ */ require_jsx_runtime.jsx(RootContext.Provider, {
78
+ value: { exit: onExit$1 },
79
+ children
80
+ })
81
+ });
86
82
  }
87
83
  Root.Context = RootContext;
88
84
  Root.displayName = "KubbRoot";
@@ -15439,6 +15435,7 @@ function _classPrivateFieldSet2(s, a, r) {
15439
15435
  //#region src/Runtime.tsx
15440
15436
  var _options = /* @__PURE__ */ new WeakMap();
15441
15437
  var _isUnmounted = /* @__PURE__ */ new WeakMap();
15438
+ var _renderError = /* @__PURE__ */ new WeakMap();
15442
15439
  var _container = /* @__PURE__ */ new WeakMap();
15443
15440
  var _rootNode = /* @__PURE__ */ new WeakMap();
15444
15441
  var _renderPromise = /* @__PURE__ */ new WeakMap();
@@ -15448,6 +15445,7 @@ var Runtime = class {
15448
15445
  _classPrivateMethodInitSpec(this, _Runtime_brand);
15449
15446
  _classPrivateFieldInitSpec(this, _options, void 0);
15450
15447
  _classPrivateFieldInitSpec(this, _isUnmounted, void 0);
15448
+ _classPrivateFieldInitSpec(this, _renderError, void 0);
15451
15449
  _defineProperty(this, "exitPromise", void 0);
15452
15450
  _classPrivateFieldInitSpec(this, _container, void 0);
15453
15451
  _classPrivateFieldInitSpec(this, _rootNode, void 0);
@@ -15475,7 +15473,6 @@ var Runtime = class {
15475
15473
  });
15476
15474
  _classPrivateFieldSet2(_renderPromise, this, task.catch((error) => {
15477
15475
  this.onError(error);
15478
- throw error;
15479
15476
  }));
15480
15477
  return _classPrivateFieldGet2(_renderPromise, this);
15481
15478
  });
@@ -15485,11 +15482,10 @@ var Runtime = class {
15485
15482
  _classPrivateFieldGet2(_rootNode, this).onImmediateRender = this.onRender;
15486
15483
  _classPrivateFieldSet2(_isUnmounted, this, false);
15487
15484
  this.unmount.bind(this);
15488
- const originalError = console.error;
15489
15485
  console.error = (data) => {
15490
15486
  const message = typeof data === "string" ? data : data === null || data === void 0 ? void 0 : data.message;
15491
15487
  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;
15492
- originalError(data);
15488
+ console.log(data);
15493
15489
  };
15494
15490
  const logRecoverableError = typeof reportError === "function" ? reportError : console.error;
15495
15491
  const rootTag = import_constants.ConcurrentRoot;
@@ -15508,7 +15504,7 @@ var Runtime = class {
15508
15504
  }
15509
15505
  onError(error) {
15510
15506
  if (node_process.default.env.NODE_ENV === "test") console.warn(error);
15511
- throw error;
15507
+ _classPrivateFieldSet2(_renderError, this, error);
15512
15508
  }
15513
15509
  onExit(error) {
15514
15510
  this.unmount(error);
@@ -15522,6 +15518,11 @@ var Runtime = class {
15522
15518
  Renderer.updateContainerSync(element, _classPrivateFieldGet2(_container, this), null, null);
15523
15519
  Renderer.flushSyncWork();
15524
15520
  await _classPrivateFieldGet2(_renderPromise, this);
15521
+ if (_classPrivateFieldGet2(_renderError, this)) {
15522
+ const error = _classPrivateFieldGet2(_renderError, this);
15523
+ _classPrivateFieldSet2(_renderError, this, void 0);
15524
+ throw error;
15525
+ }
15525
15526
  }
15526
15527
  async renderToString(node) {
15527
15528
  const element = /* @__PURE__ */ require_jsx_runtime.jsx(Root, {
@@ -15533,6 +15534,11 @@ var Runtime = class {
15533
15534
  Renderer.flushSyncWork();
15534
15535
  await _classPrivateFieldGet2(_renderPromise, this);
15535
15536
  this.fileManager.clear();
15537
+ if (_classPrivateFieldGet2(_renderError, this)) {
15538
+ const error = _classPrivateFieldGet2(_renderError, this);
15539
+ _classPrivateFieldSet2(_renderError, this, void 0);
15540
+ throw error;
15541
+ }
15536
15542
  return _assertClassBrand(_Runtime_brand, this, _getOutput).call(this, _classPrivateFieldGet2(_rootNode, this));
15537
15543
  }
15538
15544
  unmount(error) {
@@ -15635,4 +15641,4 @@ Object.defineProperty(exports, 'reactPlugin', {
15635
15641
  return reactPlugin;
15636
15642
  }
15637
15643
  });
15638
- //# sourceMappingURL=reactPlugin-DPkN8GTg.cjs.map
15644
+ //# sourceMappingURL=reactPlugin-CXaAO13f.cjs.map