@digi-frontend/dgate-api-documentation 2.0.0 → 2.0.1-test.1
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 +28 -45
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -5
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.ts +1 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +29 -46
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -112,7 +112,6 @@ const createStore = (set) => ({
|
|
|
112
112
|
...createEditorSlice(set)
|
|
113
113
|
});
|
|
114
114
|
const useStore = (0, zustand.create)()((0, zustand_middleware.devtools)((0, zustand_middleware_immer.immer)(createStore), { name: "dgate-docs-store" }));
|
|
115
|
-
var store_default = useStore;
|
|
116
115
|
|
|
117
116
|
//#endregion
|
|
118
117
|
//#region src/hooks/useStyle.ts
|
|
@@ -907,50 +906,34 @@ const MainContent = () => {
|
|
|
907
906
|
};
|
|
908
907
|
|
|
909
908
|
//#endregion
|
|
910
|
-
//#region src/view/
|
|
911
|
-
|
|
912
|
-
const
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
909
|
+
//#region src/view/layout.tsx
|
|
910
|
+
function ErrorBoundary({ children }) {
|
|
911
|
+
const [error, setError] = (0, react.useState)(null);
|
|
912
|
+
if (error) return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
913
|
+
style: {
|
|
914
|
+
color: "red",
|
|
915
|
+
padding: 24
|
|
916
|
+
},
|
|
917
|
+
children: [
|
|
918
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("h2", { children: "Something went wrong in DocumentationLayout." }),
|
|
919
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("pre", { children: error.message }),
|
|
920
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("pre", { children: error.stack })
|
|
921
|
+
]
|
|
922
|
+
});
|
|
923
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ErrorCatcher, {
|
|
924
|
+
onError: setError,
|
|
925
|
+
children
|
|
926
|
+
});
|
|
927
|
+
}
|
|
928
|
+
var ErrorCatcher = class extends react.default.Component {
|
|
929
|
+
componentDidCatch(error) {
|
|
930
|
+
this.props.onError(error);
|
|
931
|
+
}
|
|
932
|
+
render() {
|
|
933
|
+
return this.props.children;
|
|
934
934
|
}
|
|
935
|
-
return {
|
|
936
|
-
...api.info,
|
|
937
|
-
id: `api-${(0, nanoid.nanoid)(8)}`,
|
|
938
|
-
contextPath,
|
|
939
|
-
tags: groupedPathsByTags,
|
|
940
|
-
servers: api.servers
|
|
941
|
-
};
|
|
942
935
|
};
|
|
943
|
-
|
|
944
|
-
//#endregion
|
|
945
|
-
//#region src/view/layout.tsx
|
|
946
|
-
const DocumentationLayout = ({ data }) => {
|
|
947
|
-
const { setOriginalData } = store_default(({ view }) => view);
|
|
948
|
-
const { setTransformedData } = store_default(({ view }) => view);
|
|
949
|
-
(0, react.useEffect)(() => {
|
|
950
|
-
setOriginalData(data);
|
|
951
|
-
const transformedData = data.map(transformOpenApiToDocs);
|
|
952
|
-
setTransformedData(transformedData);
|
|
953
|
-
}, [data]);
|
|
936
|
+
const DocumentationLayout = () => {
|
|
954
937
|
const { cx } = useStyle("DocumentationLayout", (token$1, scope) => ({
|
|
955
938
|
[scope("container")]: {
|
|
956
939
|
display: "flex",
|
|
@@ -968,13 +951,13 @@ const DocumentationLayout = ({ data }) => {
|
|
|
968
951
|
gap: token$1.marginLG
|
|
969
952
|
}
|
|
970
953
|
}));
|
|
971
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__ant_design_nextjs_registry.AntdRegistry, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
954
|
+
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
955
|
className: cx("container"),
|
|
973
956
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Header, {}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
974
957
|
className: cx("layout"),
|
|
975
958
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Sidebar, {}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MainContent, {})]
|
|
976
959
|
})]
|
|
977
|
-
}) });
|
|
960
|
+
}) }) });
|
|
978
961
|
};
|
|
979
962
|
|
|
980
963
|
//#endregion
|