@digi-frontend/dgate-api-documentation 2.0.1-test.11 → 2.0.1-test.12
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 +51 -97
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts.map +1 -1
- package/dist/index.js +51 -97
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -819,59 +819,34 @@ var init_helper = __esm({ "src/view/helper/index.ts": (() => {
|
|
|
819
819
|
//#endregion
|
|
820
820
|
//#region src/view/components/Sidebar.tsx
|
|
821
821
|
const { Sider } = antd.Layout;
|
|
822
|
-
const
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
822
|
+
const FallbackSidebar = ({ message, color = "#ff4d4f" }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Sider, {
|
|
823
|
+
width: 280,
|
|
824
|
+
style: {
|
|
825
|
+
backgroundColor: "#f5f5f5",
|
|
826
|
+
border: `1px solid ${color}`
|
|
827
|
+
},
|
|
828
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
829
|
+
style: { padding: 16 },
|
|
830
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("h4", {
|
|
831
|
+
style: {
|
|
832
|
+
color,
|
|
833
|
+
margin: 0
|
|
834
|
+
},
|
|
835
|
+
children: "Sidebar Error"
|
|
836
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
837
|
+
style: {
|
|
838
|
+
fontSize: "12px",
|
|
839
|
+
color: "#666",
|
|
840
|
+
margin: "8px 0 0 0"
|
|
841
|
+
},
|
|
842
|
+
children: message
|
|
843
|
+
})]
|
|
844
|
+
})
|
|
845
|
+
});
|
|
846
|
+
const SidebarWithHelpers = () => {
|
|
837
847
|
try {
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
const helperImports = (init_helper(), __toCommonJS(helper_exports));
|
|
841
|
-
getAllTreeKeys$1 = helperImports.getAllTreeKeys;
|
|
842
|
-
filterTreeData$1 = helperImports.filterTreeData;
|
|
843
|
-
getSidebarStyles$1 = helperImports.getSidebarStyles;
|
|
844
|
-
convertToRenderableTreeData$1 = helperImports.convertToRenderableTreeData;
|
|
845
|
-
buildTreeDataStructure$1 = helperImports.buildTreeDataStructure;
|
|
846
|
-
findNodeByKey$1 = helperImports.findNodeByKey;
|
|
847
|
-
console.log("[Sidebar] Helper functions imported successfully");
|
|
848
|
-
} catch (error) {
|
|
849
|
-
console.error("[Sidebar] Error importing helper functions:", error);
|
|
850
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Sider, {
|
|
851
|
-
width: 280,
|
|
852
|
-
style: {
|
|
853
|
-
backgroundColor: "#f5f5f5",
|
|
854
|
-
border: "1px solid orange"
|
|
855
|
-
},
|
|
856
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
857
|
-
style: { padding: 16 },
|
|
858
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("h4", {
|
|
859
|
-
style: {
|
|
860
|
-
color: "#fa8c16",
|
|
861
|
-
margin: 0
|
|
862
|
-
},
|
|
863
|
-
children: "Import Error"
|
|
864
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
865
|
-
style: {
|
|
866
|
-
fontSize: "12px",
|
|
867
|
-
color: "#666",
|
|
868
|
-
margin: "8px 0 0 0"
|
|
869
|
-
},
|
|
870
|
-
children: "Could not import helper functions. Check console."
|
|
871
|
-
})]
|
|
872
|
-
})
|
|
873
|
-
});
|
|
874
|
-
}
|
|
848
|
+
const { getAllTreeKeys: getAllTreeKeys$1, filterTreeData: filterTreeData$1, getSidebarStyles: getSidebarStyles$1, convertToRenderableTreeData: convertToRenderableTreeData$1, buildTreeDataStructure: buildTreeDataStructure$1, findNodeByKey: findNodeByKey$1 } = (init_helper(), __toCommonJS(helper_exports));
|
|
849
|
+
console.log("[Sidebar] Helper functions imported successfully");
|
|
875
850
|
const expandedKeys = useStore((state) => state.view.expandedKeys);
|
|
876
851
|
const setExpandedKeys = useStore((state) => state.view.setExpandedKeys);
|
|
877
852
|
const setSelectedApi = useStore((state) => state.view.setSelectedApi);
|
|
@@ -881,8 +856,13 @@ const Sidebar = () => {
|
|
|
881
856
|
console.log("[Sidebar] Store access successful, transformedData:", transformedData);
|
|
882
857
|
const builtTreeData = (0, react.useMemo)(() => {
|
|
883
858
|
console.log("[Sidebar] Building tree data...");
|
|
884
|
-
|
|
885
|
-
|
|
859
|
+
try {
|
|
860
|
+
return buildTreeDataStructure$1(transformedData) || [];
|
|
861
|
+
} catch (error) {
|
|
862
|
+
console.error("[Sidebar] Error in buildTreeDataStructure:", error);
|
|
863
|
+
return [];
|
|
864
|
+
}
|
|
865
|
+
}, [transformedData]);
|
|
886
866
|
const [searchValue, setSearchValue] = (0, react.useState)("");
|
|
887
867
|
const [autoExpandParent, setAutoExpandParent] = (0, react.useState)(true);
|
|
888
868
|
let wrapSSR, cx;
|
|
@@ -899,7 +879,7 @@ const Sidebar = () => {
|
|
|
899
879
|
const handleSearch = (value) => {
|
|
900
880
|
try {
|
|
901
881
|
if (value) {
|
|
902
|
-
const allKeys =
|
|
882
|
+
const allKeys = getAllTreeKeys$1(builtTreeData) || [];
|
|
903
883
|
setExpandedKeys(allKeys);
|
|
904
884
|
setSearchValue(value);
|
|
905
885
|
setAutoExpandParent(true);
|
|
@@ -913,27 +893,23 @@ const Sidebar = () => {
|
|
|
913
893
|
};
|
|
914
894
|
const renderTreeData = (0, react.useMemo)(() => {
|
|
915
895
|
console.log("[Sidebar] Converting to renderable tree data...");
|
|
916
|
-
|
|
917
|
-
builtTreeData,
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
896
|
+
try {
|
|
897
|
+
return convertToRenderableTreeData$1(builtTreeData, selectedNode, cx) || [];
|
|
898
|
+
} catch (error) {
|
|
899
|
+
console.error("[Sidebar] Error in convertToRenderableTreeData:", error);
|
|
900
|
+
return [];
|
|
901
|
+
}
|
|
921
902
|
}, [
|
|
922
903
|
builtTreeData,
|
|
923
904
|
selectedNode,
|
|
924
|
-
cx
|
|
925
|
-
convertToRenderableTreeData$1
|
|
905
|
+
cx
|
|
926
906
|
]);
|
|
927
907
|
const filteredTreeData = (0, react.useMemo)(() => {
|
|
928
908
|
try {
|
|
929
909
|
if (!searchValue) return renderTreeData;
|
|
930
910
|
console.log("[Sidebar] Filtering tree data...");
|
|
931
|
-
const filteredOriginal =
|
|
932
|
-
return
|
|
933
|
-
filteredOriginal,
|
|
934
|
-
selectedNode,
|
|
935
|
-
cx
|
|
936
|
-
], "convertToRenderableTreeData for filtered") || [];
|
|
911
|
+
const filteredOriginal = filterTreeData$1(builtTreeData, searchValue) || [];
|
|
912
|
+
return convertToRenderableTreeData$1(filteredOriginal, selectedNode, cx) || [];
|
|
937
913
|
} catch (error) {
|
|
938
914
|
console.error("[Sidebar] Error in filteredTreeData:", error);
|
|
939
915
|
return [];
|
|
@@ -943,9 +919,7 @@ const Sidebar = () => {
|
|
|
943
919
|
searchValue,
|
|
944
920
|
selectedNode,
|
|
945
921
|
cx,
|
|
946
|
-
renderTreeData
|
|
947
|
-
filterTreeData$1,
|
|
948
|
-
convertToRenderableTreeData$1
|
|
922
|
+
renderTreeData
|
|
949
923
|
]);
|
|
950
924
|
const collapseAll = () => {
|
|
951
925
|
try {
|
|
@@ -999,7 +973,7 @@ const Sidebar = () => {
|
|
|
999
973
|
return;
|
|
1000
974
|
}
|
|
1001
975
|
const selectedKey = stringKeys[0];
|
|
1002
|
-
const selectedNode$1 =
|
|
976
|
+
const selectedNode$1 = findNodeByKey$1(builtTreeData, selectedKey);
|
|
1003
977
|
if (selectedNode$1) handleNodeSelection(selectedNode$1.data, selectedKey);
|
|
1004
978
|
setSelectedNodeState(stringKeys);
|
|
1005
979
|
} catch (error) {
|
|
@@ -1045,33 +1019,13 @@ const Sidebar = () => {
|
|
|
1045
1019
|
})
|
|
1046
1020
|
}));
|
|
1047
1021
|
} catch (error) {
|
|
1048
|
-
console.error("[Sidebar]
|
|
1049
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
1050
|
-
width: 280,
|
|
1051
|
-
style: {
|
|
1052
|
-
backgroundColor: "#f5f5f5",
|
|
1053
|
-
border: "1px solid red"
|
|
1054
|
-
},
|
|
1055
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1056
|
-
style: { padding: 16 },
|
|
1057
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("h4", {
|
|
1058
|
-
style: {
|
|
1059
|
-
color: "#ff4d4f",
|
|
1060
|
-
margin: 0
|
|
1061
|
-
},
|
|
1062
|
-
children: "Sidebar Error"
|
|
1063
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
1064
|
-
style: {
|
|
1065
|
-
fontSize: "12px",
|
|
1066
|
-
color: "#666",
|
|
1067
|
-
margin: "8px 0 0 0"
|
|
1068
|
-
},
|
|
1069
|
-
children: "Critical error occurred. Check console."
|
|
1070
|
-
})]
|
|
1071
|
-
})
|
|
1072
|
-
});
|
|
1022
|
+
console.error("[Sidebar] Error in SidebarWithHelpers:", error);
|
|
1023
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(FallbackSidebar, { message: "Helper function error. Check console." });
|
|
1073
1024
|
}
|
|
1074
1025
|
};
|
|
1026
|
+
const Sidebar = () => {
|
|
1027
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SidebarWithHelpers, {});
|
|
1028
|
+
};
|
|
1075
1029
|
|
|
1076
1030
|
//#endregion
|
|
1077
1031
|
//#region src/view/components/MainContent.tsx
|