@digi-frontend/dgate-api-documentation 2.0.0 → 2.0.1-test.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/index.cjs CHANGED
@@ -943,6 +943,32 @@ const transformOpenApiToDocs = (api) => {
943
943
 
944
944
  //#endregion
945
945
  //#region src/view/layout.tsx
946
+ function ErrorBoundary({ children }) {
947
+ const [error, setError] = (0, react.useState)(null);
948
+ if (error) return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
949
+ style: {
950
+ color: "red",
951
+ padding: 24
952
+ },
953
+ children: [
954
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("h2", { children: "Something went wrong in DocumentationLayout." }),
955
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("pre", { children: error.message }),
956
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("pre", { children: error.stack })
957
+ ]
958
+ });
959
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ErrorCatcher, {
960
+ onError: setError,
961
+ children
962
+ });
963
+ }
964
+ var ErrorCatcher = class extends react.default.Component {
965
+ componentDidCatch(error) {
966
+ this.props.onError(error);
967
+ }
968
+ render() {
969
+ return this.props.children;
970
+ }
971
+ };
946
972
  const DocumentationLayout = ({ data }) => {
947
973
  const { setOriginalData } = store_default(({ view }) => view);
948
974
  const { setTransformedData } = store_default(({ view }) => view);
@@ -968,13 +994,13 @@ const DocumentationLayout = ({ data }) => {
968
994
  gap: token$1.marginLG
969
995
  }
970
996
  }));
971
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__ant_design_nextjs_registry.AntdRegistry, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
997
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ErrorBoundary, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__ant_design_nextjs_registry.AntdRegistry, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
972
998
  className: cx("container"),
973
999
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Header, {}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
974
1000
  className: cx("layout"),
975
1001
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Sidebar, {}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MainContent, {})]
976
1002
  })]
977
- }) });
1003
+ }) }) });
978
1004
  };
979
1005
 
980
1006
  //#endregion