@digi-frontend/dgate-api-documentation 4.0.0-beta.1 → 4.0.0-beta.3
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 +701 -652
- package/dist/index.cjs.map +1 -1
- package/dist/{index-Bu-W04Zg.d.cts → index.d.cts} +22 -11
- package/dist/index.d.cts.map +1 -0
- package/dist/{index-ZiBNQn4i.d.ts → index.d.mts} +22 -11
- package/dist/index.d.mts.map +1 -0
- package/dist/{index.js → index.mjs} +576 -525
- package/dist/index.mjs.map +1 -0
- package/package.json +1 -1
- package/dist/index-Bu-W04Zg.d.cts.map +0 -1
- package/dist/index-ZiBNQn4i.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
//#region \0rolldown/runtime.js
|
|
2
3
|
var __create = Object.create;
|
|
3
4
|
var __defProp = Object.defineProperty;
|
|
4
5
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -6,16 +7,12 @@ var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
|
6
7
|
var __getProtoOf = Object.getPrototypeOf;
|
|
7
8
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
9
|
var __copyProps = (to, from, except, desc) => {
|
|
9
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
16
|
-
});
|
|
17
|
-
}
|
|
18
|
-
}
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
11
|
+
key = keys[i];
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
13
|
+
get: ((k) => from[k]).bind(null, key),
|
|
14
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
15
|
+
});
|
|
19
16
|
}
|
|
20
17
|
return to;
|
|
21
18
|
};
|
|
@@ -23,29 +20,28 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
23
20
|
value: mod,
|
|
24
21
|
enumerable: true
|
|
25
22
|
}) : target, mod));
|
|
26
|
-
|
|
27
23
|
//#endregion
|
|
28
24
|
let zustand = require("zustand");
|
|
29
25
|
let zustand_middleware = require("zustand/middleware");
|
|
30
26
|
let zustand_middleware_immer = require("zustand/middleware/immer");
|
|
31
27
|
let react = require("react");
|
|
28
|
+
let react$1 = __toESM(react, 1);
|
|
32
29
|
react = __toESM(react);
|
|
33
30
|
let antd = require("antd");
|
|
34
|
-
let
|
|
31
|
+
let _ant_design_icons = require("@ant-design/icons");
|
|
35
32
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
36
|
-
let
|
|
33
|
+
let _ant_design_cssinjs = require("@ant-design/cssinjs");
|
|
37
34
|
let antd_es_typography_Text = require("antd/es/typography/Text");
|
|
38
|
-
antd_es_typography_Text = __toESM(antd_es_typography_Text);
|
|
35
|
+
antd_es_typography_Text = __toESM(antd_es_typography_Text, 1);
|
|
39
36
|
let re_resizable = require("re-resizable");
|
|
40
37
|
let antd_es_typography_Title = require("antd/es/typography/Title");
|
|
41
|
-
antd_es_typography_Title = __toESM(antd_es_typography_Title);
|
|
38
|
+
antd_es_typography_Title = __toESM(antd_es_typography_Title, 1);
|
|
42
39
|
let nanoid = require("nanoid");
|
|
43
40
|
let react_syntax_highlighter = require("react-syntax-highlighter");
|
|
44
|
-
let
|
|
45
|
-
|
|
46
|
-
let
|
|
47
|
-
|
|
48
|
-
|
|
41
|
+
let react_syntax_highlighter_dist_esm_languages_hljs_json_js = require("react-syntax-highlighter/dist/esm/languages/hljs/json.js");
|
|
42
|
+
react_syntax_highlighter_dist_esm_languages_hljs_json_js = __toESM(react_syntax_highlighter_dist_esm_languages_hljs_json_js, 1);
|
|
43
|
+
let react_syntax_highlighter_dist_esm_styles_hljs_index_js = require("react-syntax-highlighter/dist/esm/styles/hljs/index.js");
|
|
44
|
+
react_syntax_highlighter_dist_esm_styles_hljs_index_js = __toESM(react_syntax_highlighter_dist_esm_styles_hljs_index_js, 1);
|
|
49
45
|
//#region src/store/slices/view.ts
|
|
50
46
|
const createViewSlice = (set) => ({ view: {
|
|
51
47
|
selectedNodeKey: null,
|
|
@@ -101,32 +97,28 @@ const createViewSlice = (set) => ({ view: {
|
|
|
101
97
|
state.view.selectedStatusCode = code;
|
|
102
98
|
})
|
|
103
99
|
} });
|
|
104
|
-
|
|
105
100
|
//#endregion
|
|
106
101
|
//#region src/store/index.ts
|
|
107
102
|
const createStore = (set) => ({ ...createViewSlice(set) });
|
|
108
103
|
const useStore = (0, zustand.create)()((0, zustand_middleware.devtools)((0, zustand_middleware_immer.immer)(createStore), { name: "dgate-docs-store" }));
|
|
109
|
-
var store_default = useStore;
|
|
110
|
-
|
|
111
104
|
//#endregion
|
|
112
105
|
//#region src/hooks/useStyle.ts
|
|
113
106
|
function useStyle(componentName, stylesFn) {
|
|
114
|
-
const { token
|
|
107
|
+
const { token, theme, hashId } = antd.theme.useToken();
|
|
115
108
|
const scope = (className) => `.${hashId}.${componentName}-${className}`;
|
|
116
109
|
const cx = (...classes) => classes.map((cls) => `${componentName}-${cls} ${hashId}`).join(" ");
|
|
117
110
|
return {
|
|
118
|
-
wrapSSR: (0,
|
|
119
|
-
theme
|
|
120
|
-
token
|
|
111
|
+
wrapSSR: (0, _ant_design_cssinjs.useStyleRegister)({
|
|
112
|
+
theme,
|
|
113
|
+
token,
|
|
121
114
|
path: [componentName]
|
|
122
|
-
}, () => stylesFn(token
|
|
115
|
+
}, () => stylesFn(token, scope)),
|
|
123
116
|
cx,
|
|
124
117
|
scope,
|
|
125
|
-
token
|
|
118
|
+
token,
|
|
126
119
|
hashId
|
|
127
120
|
};
|
|
128
121
|
}
|
|
129
|
-
|
|
130
122
|
//#endregion
|
|
131
123
|
//#region src/theme/light.json
|
|
132
124
|
var token = {
|
|
@@ -457,7 +449,6 @@ var token = {
|
|
|
457
449
|
"marginXXXL": 60,
|
|
458
450
|
"marginXXXXL": 72
|
|
459
451
|
};
|
|
460
|
-
|
|
461
452
|
//#endregion
|
|
462
453
|
//#region src/view/helper/sidebar.utils.ts
|
|
463
454
|
const methodColors = {
|
|
@@ -670,18 +661,18 @@ const filterTreeData = (data, searchText) => {
|
|
|
670
661
|
};
|
|
671
662
|
return data.map((node) => filterNode(node)).filter((node) => node !== null);
|
|
672
663
|
};
|
|
673
|
-
const getSidebarStyles = (token
|
|
664
|
+
const getSidebarStyles = (token, scope) => ({
|
|
674
665
|
[scope("sider")]: {
|
|
675
|
-
backgroundColor: token
|
|
666
|
+
backgroundColor: token.colorBgElevated,
|
|
676
667
|
overflowX: "clip",
|
|
677
|
-
borderRadius: token
|
|
668
|
+
borderRadius: token.borderRadius,
|
|
678
669
|
height: "auto"
|
|
679
670
|
},
|
|
680
|
-
[scope("content")]: { padding: token
|
|
671
|
+
[scope("content")]: { padding: token.padding },
|
|
681
672
|
[scope("controls")]: {
|
|
682
673
|
display: "flex",
|
|
683
|
-
gap: token
|
|
684
|
-
marginBottom: token
|
|
674
|
+
gap: token.marginXS,
|
|
675
|
+
marginBottom: token.marginSM
|
|
685
676
|
},
|
|
686
677
|
[scope("search-input")]: { flex: 1 },
|
|
687
678
|
[scope("tree")]: {
|
|
@@ -707,17 +698,17 @@ const getSidebarStyles = (token$1, scope) => ({
|
|
|
707
698
|
width: "100%",
|
|
708
699
|
padding: 0
|
|
709
700
|
},
|
|
710
|
-
"& .ant-tree-switcher": { backgroundColor: token
|
|
701
|
+
"& .ant-tree-switcher": { backgroundColor: token.colorBgElevated }
|
|
711
702
|
},
|
|
712
703
|
[scope("endpoint-item")]: {
|
|
713
704
|
display: "flex",
|
|
714
705
|
alignItems: "center",
|
|
715
|
-
gap: token
|
|
706
|
+
gap: token.marginXS,
|
|
716
707
|
width: "100%",
|
|
717
708
|
maxWidth: "100%",
|
|
718
709
|
minWidth: "100%",
|
|
719
|
-
paddingLeft: token
|
|
720
|
-
paddingRight: token
|
|
710
|
+
paddingLeft: token.marginXS,
|
|
711
|
+
paddingRight: token.marginXS
|
|
721
712
|
},
|
|
722
713
|
[scope("method-tag")]: {
|
|
723
714
|
width: 51,
|
|
@@ -740,14 +731,14 @@ const getSidebarStyles = (token$1, scope) => ({
|
|
|
740
731
|
display: "block"
|
|
741
732
|
},
|
|
742
733
|
[scope("tag-title")]: {
|
|
743
|
-
color: token
|
|
734
|
+
color: token.colorText,
|
|
744
735
|
maxWidth: "100%",
|
|
745
736
|
display: "block",
|
|
746
737
|
flex: 1
|
|
747
738
|
},
|
|
748
739
|
[scope("api-title")]: {
|
|
749
740
|
flex: 1,
|
|
750
|
-
color: token
|
|
741
|
+
color: token.colorText,
|
|
751
742
|
maxWidth: "100%",
|
|
752
743
|
display: "block",
|
|
753
744
|
paddingLeft: "4px",
|
|
@@ -755,7 +746,6 @@ const getSidebarStyles = (token$1, scope) => ({
|
|
|
755
746
|
margin: 0
|
|
756
747
|
}
|
|
757
748
|
});
|
|
758
|
-
|
|
759
749
|
//#endregion
|
|
760
750
|
//#region src/view/helper/sidebar.components.tsx
|
|
761
751
|
const { Text: Text$3 } = antd.Typography;
|
|
@@ -810,7 +800,6 @@ const convertToRenderableTreeData = (treeDataStructure, selectedEndpoint, cx) =>
|
|
|
810
800
|
};
|
|
811
801
|
return treeDataStructure.map(renderNode);
|
|
812
802
|
};
|
|
813
|
-
|
|
814
803
|
//#endregion
|
|
815
804
|
//#region src/hooks/useNodeSelection.ts
|
|
816
805
|
const useNodeSelection = () => {
|
|
@@ -916,7 +905,6 @@ const useNodeSelection = () => {
|
|
|
916
905
|
selectPreSelectedApi
|
|
917
906
|
};
|
|
918
907
|
};
|
|
919
|
-
|
|
920
908
|
//#endregion
|
|
921
909
|
//#region src/assets/Minify.tsx
|
|
922
910
|
const Minify = (props) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
|
|
@@ -934,8 +922,6 @@ const Minify = (props) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
|
|
|
934
922
|
stroke: "currentcolor"
|
|
935
923
|
})]
|
|
936
924
|
});
|
|
937
|
-
var Minify_default = Minify;
|
|
938
|
-
|
|
939
925
|
//#endregion
|
|
940
926
|
//#region src/view/components/NoDataIcon.tsx
|
|
941
927
|
const NoDataIcon = ({ width = 298, height = 237, fill = "#F1F5FD", stroke = "#E0E9F9", ...props }) => {
|
|
@@ -1103,8 +1089,6 @@ const NoDataIcon = ({ width = 298, height = 237, fill = "#F1F5FD", stroke = "#E0
|
|
|
1103
1089
|
]
|
|
1104
1090
|
});
|
|
1105
1091
|
};
|
|
1106
|
-
var NoDataIcon_default = NoDataIcon;
|
|
1107
|
-
|
|
1108
1092
|
//#endregion
|
|
1109
1093
|
//#region src/view/components/Sidebar.tsx
|
|
1110
1094
|
const { useBreakpoint: useBreakpoint$4 } = antd.Grid;
|
|
@@ -1112,9 +1096,9 @@ const Sidebar = ({ searchValue, setSearchValue, onNodeSelect }) => {
|
|
|
1112
1096
|
const expandedKeys = useStore((state) => state.view.expandedKeys);
|
|
1113
1097
|
const { selectedNodeKey, selectedEndpoint, builtTreeData, setExpandedKeys, setSelectedNodeKey } = useStore(({ view }) => view);
|
|
1114
1098
|
const { selectNodeByKey, clearSelection } = useNodeSelection();
|
|
1115
|
-
const [autoExpandParent, setAutoExpandParent] = (0, react.useState)(true);
|
|
1099
|
+
const [autoExpandParent, setAutoExpandParent] = (0, react$1.useState)(true);
|
|
1116
1100
|
const isMobile = !useBreakpoint$4().md;
|
|
1117
|
-
const { wrapSSR, cx, token
|
|
1101
|
+
const { wrapSSR, cx, token } = useStyle("Sidebar", getSidebarStyles);
|
|
1118
1102
|
const handleSearch = (value) => {
|
|
1119
1103
|
if (value && builtTreeData) {
|
|
1120
1104
|
setExpandedKeys(getAllTreeKeys(builtTreeData));
|
|
@@ -1126,7 +1110,7 @@ const Sidebar = ({ searchValue, setSearchValue, onNodeSelect }) => {
|
|
|
1126
1110
|
setAutoExpandParent(false);
|
|
1127
1111
|
}
|
|
1128
1112
|
};
|
|
1129
|
-
const renderTreeData = (0, react.useMemo)(() => {
|
|
1113
|
+
const renderTreeData = (0, react$1.useMemo)(() => {
|
|
1130
1114
|
if (!builtTreeData) return [];
|
|
1131
1115
|
return convertToRenderableTreeData(builtTreeData, selectedEndpoint, cx);
|
|
1132
1116
|
}, [
|
|
@@ -1134,7 +1118,7 @@ const Sidebar = ({ searchValue, setSearchValue, onNodeSelect }) => {
|
|
|
1134
1118
|
selectedEndpoint,
|
|
1135
1119
|
cx
|
|
1136
1120
|
]);
|
|
1137
|
-
const filteredTreeData = (0, react.useMemo)(() => {
|
|
1121
|
+
const filteredTreeData = (0, react$1.useMemo)(() => {
|
|
1138
1122
|
if (!searchValue) return renderTreeData;
|
|
1139
1123
|
if (!builtTreeData) return [];
|
|
1140
1124
|
return convertToRenderableTreeData(filterTreeData(builtTreeData, searchValue), selectedEndpoint, cx);
|
|
@@ -1171,7 +1155,7 @@ const Sidebar = ({ searchValue, setSearchValue, onNodeSelect }) => {
|
|
|
1171
1155
|
onChange: (e) => handleSearch(e.target.value),
|
|
1172
1156
|
allowClear: true,
|
|
1173
1157
|
className: cx("search-input"),
|
|
1174
|
-
addonAfter: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
1158
|
+
addonAfter: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_ant_design_icons.SearchOutlined, {})
|
|
1175
1159
|
})
|
|
1176
1160
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(antd.Tooltip, {
|
|
1177
1161
|
title: "Collapse All",
|
|
@@ -1179,13 +1163,13 @@ const Sidebar = ({ searchValue, setSearchValue, onNodeSelect }) => {
|
|
|
1179
1163
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(antd.Button, {
|
|
1180
1164
|
onClick: collapseAll,
|
|
1181
1165
|
title: "Collapse All",
|
|
1182
|
-
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
1166
|
+
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Minify, {})
|
|
1183
1167
|
})
|
|
1184
1168
|
})]
|
|
1185
1169
|
}), filteredTreeData?.length ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(antd.Tree, {
|
|
1186
1170
|
showLine: { showLeafIcon: false },
|
|
1187
1171
|
showIcon: false,
|
|
1188
|
-
switcherIcon: (nodeProps) => nodeProps.isLeaf ? null : nodeProps.expanded ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
1172
|
+
switcherIcon: (nodeProps) => nodeProps.isLeaf ? null : nodeProps.expanded ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_ant_design_icons.MinusSquareOutlined, { style: { fontSize: 12 } }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_ant_design_icons.PlusSquareOutlined, { style: { fontSize: 12 } }),
|
|
1189
1173
|
expandedKeys,
|
|
1190
1174
|
autoExpandParent,
|
|
1191
1175
|
selectedKeys: [selectedNodeKey || ""],
|
|
@@ -1204,30 +1188,30 @@ const Sidebar = ({ searchValue, setSearchValue, onNodeSelect }) => {
|
|
|
1204
1188
|
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(antd.Flex, {
|
|
1205
1189
|
justify: "center",
|
|
1206
1190
|
align: "center",
|
|
1207
|
-
gap: token
|
|
1191
|
+
gap: token.marginSM,
|
|
1208
1192
|
vertical: true,
|
|
1209
|
-
style: { marginTop: token
|
|
1210
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
1211
|
-
stroke: token
|
|
1212
|
-
fill: token
|
|
1193
|
+
style: { marginTop: token.paddingXL },
|
|
1194
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(NoDataIcon, {
|
|
1195
|
+
stroke: token.colorPrimaryHover,
|
|
1196
|
+
fill: token.colorPrimaryBg,
|
|
1213
1197
|
width: "10.375rem",
|
|
1214
1198
|
height: "8.1875rem"
|
|
1215
1199
|
}), searchValue.length ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(antd_es_typography_Text.default, {
|
|
1216
1200
|
style: {
|
|
1217
1201
|
textAlign: "center",
|
|
1218
|
-
fontFamily: token
|
|
1202
|
+
fontFamily: token.fontFamily,
|
|
1219
1203
|
fontWeight: 400,
|
|
1220
|
-
fontSize: token
|
|
1221
|
-
color: token
|
|
1204
|
+
fontSize: token.fontSizeLG,
|
|
1205
|
+
color: token.colorTextTertiary
|
|
1222
1206
|
},
|
|
1223
1207
|
children: "No results found"
|
|
1224
1208
|
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(antd_es_typography_Text.default, {
|
|
1225
1209
|
style: {
|
|
1226
1210
|
textAlign: "center",
|
|
1227
|
-
fontFamily: token
|
|
1211
|
+
fontFamily: token.fontFamily,
|
|
1228
1212
|
fontWeight: 400,
|
|
1229
|
-
fontSize: token
|
|
1230
|
-
color: token
|
|
1213
|
+
fontSize: token.fontSizeLG,
|
|
1214
|
+
color: token.colorTextTertiary
|
|
1231
1215
|
},
|
|
1232
1216
|
children: [
|
|
1233
1217
|
"No API",
|
|
@@ -1267,7 +1251,6 @@ const Sidebar = ({ searchValue, setSearchValue, onNodeSelect }) => {
|
|
|
1267
1251
|
children: inner
|
|
1268
1252
|
}));
|
|
1269
1253
|
};
|
|
1270
|
-
|
|
1271
1254
|
//#endregion
|
|
1272
1255
|
//#region src/assets/link.tsx
|
|
1273
1256
|
const Link = (props) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
|
|
@@ -1285,25 +1268,23 @@ const Link = (props) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
|
|
|
1285
1268
|
fill: "#4D75D9"
|
|
1286
1269
|
})]
|
|
1287
1270
|
});
|
|
1288
|
-
var link_default = Link;
|
|
1289
|
-
|
|
1290
1271
|
//#endregion
|
|
1291
1272
|
//#region src/view/components/ApiPage/components/ApiCard.tsx
|
|
1292
1273
|
const ApiCard = ({ api, viewStyle }) => {
|
|
1293
|
-
const { wrapSSR, cx, token
|
|
1274
|
+
const { wrapSSR, cx, token } = useStyle("DocumentationApiCard", (token, scope) => ({
|
|
1294
1275
|
[scope("method-chip")]: {
|
|
1295
1276
|
minWidth: "5.375rem",
|
|
1296
1277
|
width: "fit-content",
|
|
1297
|
-
paddingLeft: token
|
|
1298
|
-
paddingRight: token
|
|
1278
|
+
paddingLeft: token.marginXS,
|
|
1279
|
+
paddingRight: token.marginXS,
|
|
1299
1280
|
display: "flex",
|
|
1300
1281
|
justifyContent: "center",
|
|
1301
1282
|
alignItems: "center",
|
|
1302
|
-
borderRadius: token
|
|
1283
|
+
borderRadius: token.borderRadius
|
|
1303
1284
|
},
|
|
1304
1285
|
[scope("list-container")]: {
|
|
1305
|
-
paddingTop: token
|
|
1306
|
-
paddingBottom: token
|
|
1286
|
+
paddingTop: token.marginXS,
|
|
1287
|
+
paddingBottom: token.marginXS
|
|
1307
1288
|
},
|
|
1308
1289
|
[scope("chip-title")]: {
|
|
1309
1290
|
alignSelf: "center",
|
|
@@ -1311,97 +1292,97 @@ const ApiCard = ({ api, viewStyle }) => {
|
|
|
1311
1292
|
padding: 0,
|
|
1312
1293
|
margin: 0,
|
|
1313
1294
|
lineHeight: "1.375rem",
|
|
1314
|
-
fontSize: token
|
|
1295
|
+
fontSize: token.fontSize
|
|
1315
1296
|
},
|
|
1316
1297
|
[scope("list-see-details")]: {
|
|
1317
1298
|
width: "6.5625rem",
|
|
1318
1299
|
height: "2rem",
|
|
1319
|
-
borderRadius: token
|
|
1320
|
-
border: `${token
|
|
1321
|
-
paddingRight: token
|
|
1322
|
-
paddingLeft: token
|
|
1323
|
-
background: token
|
|
1324
|
-
"&:hover": { background: token
|
|
1300
|
+
borderRadius: token.borderRadius,
|
|
1301
|
+
border: `${token.lineWidth}px solid ${token.Button?.defaultBorderColor}`,
|
|
1302
|
+
paddingRight: token.Button?.paddingInline,
|
|
1303
|
+
paddingLeft: token.Button?.paddingInline,
|
|
1304
|
+
background: token.Button?.defaultBg,
|
|
1305
|
+
"&:hover": { background: token.Button?.defaultBg }
|
|
1325
1306
|
},
|
|
1326
1307
|
[scope("list-content")]: {
|
|
1327
1308
|
display: "flex",
|
|
1328
|
-
paddingTop: token
|
|
1329
|
-
paddingBottom: token
|
|
1330
|
-
paddingRight: token
|
|
1331
|
-
paddingLeft: token
|
|
1309
|
+
paddingTop: token.paddingXXS,
|
|
1310
|
+
paddingBottom: token.paddingXXS,
|
|
1311
|
+
paddingRight: token.paddingXS,
|
|
1312
|
+
paddingLeft: token.paddingXS,
|
|
1332
1313
|
alignItems: "center",
|
|
1333
|
-
gap: token
|
|
1314
|
+
gap: token.marginXS,
|
|
1334
1315
|
alignSelf: "stretch",
|
|
1335
1316
|
flexDirection: "row",
|
|
1336
|
-
borderRadius: token
|
|
1337
|
-
border: `1px solid ${token
|
|
1317
|
+
borderRadius: token.borderRadiusSM,
|
|
1318
|
+
border: `1px solid ${token.colorBorderSecondary}`,
|
|
1338
1319
|
minWidth: "6.25rem",
|
|
1339
1320
|
maxWidth: "fit-content",
|
|
1340
|
-
svg: { path: { fill: token
|
|
1321
|
+
svg: { path: { fill: token.colorPrimary } }
|
|
1341
1322
|
},
|
|
1342
1323
|
[scope("list-title")]: {
|
|
1343
|
-
color: token
|
|
1344
|
-
fontSize: token
|
|
1345
|
-
fontWeight: token
|
|
1346
|
-
lineHeight: token
|
|
1324
|
+
color: token.colorTextHeading,
|
|
1325
|
+
fontSize: token.fontSizeHeading3,
|
|
1326
|
+
fontWeight: token.fontWeightStrong,
|
|
1327
|
+
lineHeight: token.lineHeightHeading3,
|
|
1347
1328
|
paddingBottom: 0,
|
|
1348
1329
|
marginBottom: 0,
|
|
1349
|
-
fontFamily: token
|
|
1330
|
+
fontFamily: token.fontFamily,
|
|
1350
1331
|
cursor: "pointer",
|
|
1351
1332
|
transition: "color 0.2s ease-in",
|
|
1352
1333
|
"&:hover": {
|
|
1353
|
-
color: `${token
|
|
1334
|
+
color: `${token.colorPrimary} !important`,
|
|
1354
1335
|
textDecoration: "underline"
|
|
1355
1336
|
}
|
|
1356
1337
|
},
|
|
1357
1338
|
[scope("path-name")]: {
|
|
1358
|
-
color: token
|
|
1359
|
-
fontSize: token
|
|
1339
|
+
color: token.colorText,
|
|
1340
|
+
fontSize: token.fontSizeSM,
|
|
1360
1341
|
fontWeight: 400,
|
|
1361
|
-
fontFamily: token
|
|
1342
|
+
fontFamily: token.fontFamily
|
|
1362
1343
|
},
|
|
1363
1344
|
[scope("grid-card")]: {
|
|
1364
1345
|
width: "17.5rem",
|
|
1365
1346
|
height: "100%",
|
|
1366
|
-
borderRadius: token
|
|
1347
|
+
borderRadius: token.borderRadiusLG
|
|
1367
1348
|
},
|
|
1368
1349
|
[scope("grid-title")]: {
|
|
1369
|
-
color: token
|
|
1370
|
-
fontSize: token
|
|
1371
|
-
fontWeight: token
|
|
1372
|
-
lineHeight: token
|
|
1350
|
+
color: token.colorTextHeading,
|
|
1351
|
+
fontSize: token.fontSizeHeading3,
|
|
1352
|
+
fontWeight: token.fontWeightStrong,
|
|
1353
|
+
lineHeight: token.lineHeightHeading3,
|
|
1373
1354
|
paddingBottom: 0,
|
|
1374
1355
|
marginBottom: 0,
|
|
1375
|
-
fontFamily: token
|
|
1356
|
+
fontFamily: token.fontFamily
|
|
1376
1357
|
},
|
|
1377
1358
|
[scope("grid-content")]: {
|
|
1378
1359
|
display: "flex",
|
|
1379
|
-
paddingTop: token
|
|
1380
|
-
paddingBottom: token
|
|
1381
|
-
paddingRight: token
|
|
1382
|
-
paddingLeft: token
|
|
1360
|
+
paddingTop: token.paddingXXS,
|
|
1361
|
+
paddingBottom: token.paddingXXS,
|
|
1362
|
+
paddingRight: token.paddingXS,
|
|
1363
|
+
paddingLeft: token.paddingXS,
|
|
1383
1364
|
alignItems: "center",
|
|
1384
|
-
gap: token
|
|
1365
|
+
gap: token.marginXS,
|
|
1385
1366
|
alignSelf: "stretch",
|
|
1386
1367
|
flexDirection: "row",
|
|
1387
|
-
borderRadius: token
|
|
1388
|
-
border: `1px solid ${token
|
|
1389
|
-
svg: { path: { fill: token
|
|
1368
|
+
borderRadius: token.borderRadiusSM,
|
|
1369
|
+
border: `1px solid ${token.colorBorderSecondary}`,
|
|
1370
|
+
svg: { path: { fill: token.colorPrimary } }
|
|
1390
1371
|
},
|
|
1391
1372
|
[scope("grid-path-name")]: {
|
|
1392
|
-
color: token
|
|
1393
|
-
fontSize: token
|
|
1373
|
+
color: token.colorText,
|
|
1374
|
+
fontSize: token.fontSizeSM,
|
|
1394
1375
|
fontWeight: 400,
|
|
1395
|
-
fontFamily: token
|
|
1376
|
+
fontFamily: token.fontFamily
|
|
1396
1377
|
},
|
|
1397
1378
|
[scope("grid-see-details")]: {
|
|
1398
1379
|
paddingTop: 0,
|
|
1399
1380
|
paddingBottom: 0,
|
|
1400
1381
|
paddingLeft: "0.4375rem",
|
|
1401
1382
|
paddingRight: "0.4375rem",
|
|
1402
|
-
borderRadius: token
|
|
1403
|
-
border: `1px solid ${token
|
|
1404
|
-
background: token
|
|
1383
|
+
borderRadius: token.borderRadiusSM,
|
|
1384
|
+
border: `1px solid ${token.Button?.defaultBorderColor}`,
|
|
1385
|
+
background: token.Button?.defaultBg,
|
|
1405
1386
|
boxShadow: `0 2px 0 0 rgba(0, 0, 0, 0.02)`,
|
|
1406
1387
|
width: "100%",
|
|
1407
1388
|
height: "1.5rem"
|
|
@@ -1445,7 +1426,7 @@ const ApiCard = ({ api, viewStyle }) => {
|
|
|
1445
1426
|
align: "center",
|
|
1446
1427
|
className: cx("list-container"),
|
|
1447
1428
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(antd.Flex, {
|
|
1448
|
-
gap: token
|
|
1429
|
+
gap: token.marginSM,
|
|
1449
1430
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(MethodChip, { method: api.method }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(antd_es_typography_Title.default, {
|
|
1450
1431
|
className: cx("list-title"),
|
|
1451
1432
|
level: 4,
|
|
@@ -1460,7 +1441,7 @@ const ApiCard = ({ api, viewStyle }) => {
|
|
|
1460
1441
|
}),
|
|
1461
1442
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1462
1443
|
className: cx("list-content"),
|
|
1463
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
1444
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Link, {}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(antd_es_typography_Text.default, {
|
|
1464
1445
|
className: cx("path-name"),
|
|
1465
1446
|
children: api?.path
|
|
1466
1447
|
})]
|
|
@@ -1475,7 +1456,7 @@ const ApiCard = ({ api, viewStyle }) => {
|
|
|
1475
1456
|
className: cx("grid-card"),
|
|
1476
1457
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(antd.Flex, {
|
|
1477
1458
|
vertical: true,
|
|
1478
|
-
gap: token
|
|
1459
|
+
gap: token.marginSM,
|
|
1479
1460
|
children: [
|
|
1480
1461
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(MethodChip, { method: api?.method }),
|
|
1481
1462
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(antd_es_typography_Title.default, {
|
|
@@ -1485,7 +1466,7 @@ const ApiCard = ({ api, viewStyle }) => {
|
|
|
1485
1466
|
}),
|
|
1486
1467
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1487
1468
|
className: cx("grid-content"),
|
|
1488
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
1469
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Link, {}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(antd_es_typography_Text.default, {
|
|
1489
1470
|
className: cx("grid-path-name"),
|
|
1490
1471
|
children: api?.path
|
|
1491
1472
|
})]
|
|
@@ -1499,8 +1480,6 @@ const ApiCard = ({ api, viewStyle }) => {
|
|
|
1499
1480
|
})
|
|
1500
1481
|
}));
|
|
1501
1482
|
};
|
|
1502
|
-
var ApiCard_default = ApiCard;
|
|
1503
|
-
|
|
1504
1483
|
//#endregion
|
|
1505
1484
|
//#region src/view/components/ApiPage/components/ViewModeApiHeader.tsx
|
|
1506
1485
|
function formatAuthType(authType) {
|
|
@@ -1514,11 +1493,11 @@ function formatAuthType(authType) {
|
|
|
1514
1493
|
}
|
|
1515
1494
|
}
|
|
1516
1495
|
const ViewModeApiHeader = ({ api, viewLayout, onViewLayoutChange }) => {
|
|
1517
|
-
const { wrapSSR, cx } = useStyle("ViewModeApiHeader", (token
|
|
1496
|
+
const { wrapSSR, cx } = useStyle("ViewModeApiHeader", (token, scope) => ({
|
|
1518
1497
|
[scope("root")]: {
|
|
1519
1498
|
display: "flex",
|
|
1520
1499
|
flexDirection: "column",
|
|
1521
|
-
gap: token
|
|
1500
|
+
gap: token.marginMD
|
|
1522
1501
|
},
|
|
1523
1502
|
[scope("meta-bar")]: {
|
|
1524
1503
|
display: "flex",
|
|
@@ -1534,20 +1513,20 @@ const ViewModeApiHeader = ({ api, viewLayout, onViewLayoutChange }) => {
|
|
|
1534
1513
|
display: "flex",
|
|
1535
1514
|
alignItems: "center",
|
|
1536
1515
|
paddingRight: 12,
|
|
1537
|
-
borderRight: `1px solid ${token
|
|
1516
|
+
borderRight: `1px solid ${token.colorBorderSecondary}`,
|
|
1538
1517
|
marginRight: 12
|
|
1539
1518
|
},
|
|
1540
1519
|
[scope("jws-tag")]: {
|
|
1541
1520
|
display: "flex",
|
|
1542
1521
|
alignItems: "center",
|
|
1543
1522
|
height: 32,
|
|
1544
|
-
background: token
|
|
1545
|
-
border: `1px solid ${token
|
|
1523
|
+
background: token.colorPrimaryBg,
|
|
1524
|
+
border: `1px solid ${token.colorPrimaryBorder}`,
|
|
1546
1525
|
borderRadius: 6,
|
|
1547
1526
|
padding: "0 8px",
|
|
1548
1527
|
fontSize: 12,
|
|
1549
1528
|
lineHeight: "20px",
|
|
1550
|
-
color: token
|
|
1529
|
+
color: token.colorPrimary,
|
|
1551
1530
|
fontWeight: 400,
|
|
1552
1531
|
margin: 0
|
|
1553
1532
|
},
|
|
@@ -1555,14 +1534,14 @@ const ViewModeApiHeader = ({ api, viewLayout, onViewLayoutChange }) => {
|
|
|
1555
1534
|
display: "inline-flex",
|
|
1556
1535
|
alignItems: "center",
|
|
1557
1536
|
gap: 4,
|
|
1558
|
-
background: token
|
|
1559
|
-
border: `1px solid ${token
|
|
1537
|
+
background: token.colorBgContainer,
|
|
1538
|
+
border: `1px solid ${token.colorBorder}`,
|
|
1560
1539
|
borderRadius: 4,
|
|
1561
1540
|
padding: "0 8px",
|
|
1562
1541
|
height: 32,
|
|
1563
1542
|
fontSize: 12,
|
|
1564
1543
|
lineHeight: "20px",
|
|
1565
|
-
color: token
|
|
1544
|
+
color: token.colorText,
|
|
1566
1545
|
margin: 0,
|
|
1567
1546
|
boxSizing: "border-box"
|
|
1568
1547
|
},
|
|
@@ -1575,8 +1554,8 @@ const ViewModeApiHeader = ({ api, viewLayout, onViewLayoutChange }) => {
|
|
|
1575
1554
|
display: "inline-flex",
|
|
1576
1555
|
alignItems: "center",
|
|
1577
1556
|
gap: 8,
|
|
1578
|
-
background: token
|
|
1579
|
-
border: `1px solid ${token
|
|
1557
|
+
background: token.colorFillTertiary,
|
|
1558
|
+
border: `1px solid ${token.colorBorder}`,
|
|
1580
1559
|
borderRadius: 6,
|
|
1581
1560
|
padding: "0 15px",
|
|
1582
1561
|
height: 32,
|
|
@@ -1585,13 +1564,13 @@ const ViewModeApiHeader = ({ api, viewLayout, onViewLayoutChange }) => {
|
|
|
1585
1564
|
},
|
|
1586
1565
|
[scope("version-icon")]: {
|
|
1587
1566
|
fontSize: 16,
|
|
1588
|
-
color: token
|
|
1567
|
+
color: token.colorTextDisabled,
|
|
1589
1568
|
display: "flex",
|
|
1590
1569
|
alignItems: "center"
|
|
1591
1570
|
},
|
|
1592
1571
|
[scope("version-text")]: {
|
|
1593
1572
|
fontSize: 14,
|
|
1594
|
-
color: token
|
|
1573
|
+
color: token.colorTextDisabled,
|
|
1595
1574
|
fontWeight: 400,
|
|
1596
1575
|
lineHeight: 1
|
|
1597
1576
|
},
|
|
@@ -1605,16 +1584,16 @@ const ViewModeApiHeader = ({ api, viewLayout, onViewLayoutChange }) => {
|
|
|
1605
1584
|
justifyContent: "center"
|
|
1606
1585
|
},
|
|
1607
1586
|
[scope("toggle-btn-active")]: {
|
|
1608
|
-
border: `1px solid ${token
|
|
1609
|
-
color: `${token
|
|
1610
|
-
backgroundColor: `${token
|
|
1587
|
+
border: `1px solid ${token.colorPrimary} !important`,
|
|
1588
|
+
color: `${token.colorPrimary} !important`,
|
|
1589
|
+
backgroundColor: `${token.colorBgContainer} !important`,
|
|
1611
1590
|
zIndex: 1
|
|
1612
1591
|
},
|
|
1613
1592
|
[scope("description")]: {
|
|
1614
|
-
fontSize: token
|
|
1615
|
-
color: token
|
|
1593
|
+
fontSize: token.fontSizeLG,
|
|
1594
|
+
color: token.colorTextTertiary
|
|
1616
1595
|
},
|
|
1617
|
-
[scope("title")]: { fontFamily: token
|
|
1596
|
+
[scope("title")]: { fontFamily: token.fontFamily }
|
|
1618
1597
|
}));
|
|
1619
1598
|
const version = api.relatedVersions?.find((v) => v.apiId === api.currentVersion)?.version || api.version;
|
|
1620
1599
|
return wrapSSR(/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
@@ -1649,7 +1628,7 @@ const ViewModeApiHeader = ({ api, viewLayout, onViewLayoutChange }) => {
|
|
|
1649
1628
|
className: cx("auth-tag"),
|
|
1650
1629
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1651
1630
|
className: cx("auth-icon"),
|
|
1652
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
1631
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_ant_design_icons.SafetyOutlined, {})
|
|
1653
1632
|
}), formatAuthType(api.authType)]
|
|
1654
1633
|
})
|
|
1655
1634
|
}),
|
|
@@ -1660,7 +1639,7 @@ const ViewModeApiHeader = ({ api, viewLayout, onViewLayoutChange }) => {
|
|
|
1660
1639
|
children: [
|
|
1661
1640
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1662
1641
|
className: cx("version-icon"),
|
|
1663
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
1642
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_ant_design_icons.InfoCircleOutlined, {})
|
|
1664
1643
|
}),
|
|
1665
1644
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1666
1645
|
className: cx("version-text"),
|
|
@@ -1668,7 +1647,7 @@ const ViewModeApiHeader = ({ api, viewLayout, onViewLayoutChange }) => {
|
|
|
1668
1647
|
}),
|
|
1669
1648
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1670
1649
|
className: cx("version-icon"),
|
|
1671
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
1650
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_ant_design_icons.DownOutlined, {})
|
|
1672
1651
|
})
|
|
1673
1652
|
]
|
|
1674
1653
|
})
|
|
@@ -1678,12 +1657,12 @@ const ViewModeApiHeader = ({ api, viewLayout, onViewLayoutChange }) => {
|
|
|
1678
1657
|
className: cx("view-toggle"),
|
|
1679
1658
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(antd.Button, {
|
|
1680
1659
|
className: cx("toggle-btn", viewLayout === "grid" ? "toggle-btn-active" : ""),
|
|
1681
|
-
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
1660
|
+
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_ant_design_icons.AppstoreOutlined, {}),
|
|
1682
1661
|
onClick: () => onViewLayoutChange("grid"),
|
|
1683
1662
|
style: { borderRadius: "4px 0 0 4px" }
|
|
1684
1663
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(antd.Button, {
|
|
1685
1664
|
className: cx("toggle-btn", viewLayout === "list" ? "toggle-btn-active" : ""),
|
|
1686
|
-
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
1665
|
+
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_ant_design_icons.BarsOutlined, {}),
|
|
1687
1666
|
onClick: () => onViewLayoutChange("list"),
|
|
1688
1667
|
style: {
|
|
1689
1668
|
borderRadius: "0 4px 4px 0",
|
|
@@ -1699,19 +1678,18 @@ const ViewModeApiHeader = ({ api, viewLayout, onViewLayoutChange }) => {
|
|
|
1699
1678
|
]
|
|
1700
1679
|
}));
|
|
1701
1680
|
};
|
|
1702
|
-
|
|
1703
1681
|
//#endregion
|
|
1704
1682
|
//#region src/view/components/ApiPage/index.tsx
|
|
1705
1683
|
const APIPage = () => {
|
|
1706
|
-
const [selectedUrl, setSelectedUrl] = (0, react.useState)("");
|
|
1707
|
-
const { view: { selectedApi, focusedTag, setFocusedTag } } =
|
|
1708
|
-
const [viewStyle, setViewStyle] = (0, react.useState)("grid");
|
|
1709
|
-
const { wrapSSR, token
|
|
1710
|
-
const urlsOptions = (0, react.useMemo)(() => selectedApi?.servers?.map((server) => ({
|
|
1684
|
+
const [selectedUrl, setSelectedUrl] = (0, react$1.useState)("");
|
|
1685
|
+
const { view: { selectedApi, focusedTag, setFocusedTag } } = useStore();
|
|
1686
|
+
const [viewStyle, setViewStyle] = (0, react$1.useState)("grid");
|
|
1687
|
+
const { wrapSSR, token } = useStyle("DocumentationApiPage", () => ({}));
|
|
1688
|
+
const urlsOptions = (0, react$1.useMemo)(() => selectedApi?.servers?.map((server) => ({
|
|
1711
1689
|
label: server?.url,
|
|
1712
1690
|
value: server?.url
|
|
1713
1691
|
})), [selectedApi?.servers]);
|
|
1714
|
-
(0, react.useEffect)(() => {
|
|
1692
|
+
(0, react$1.useEffect)(() => {
|
|
1715
1693
|
if (focusedTag && document.getElementById(focusedTag)) {
|
|
1716
1694
|
const element = document.getElementById(focusedTag);
|
|
1717
1695
|
if (element) element.scrollIntoView({ behavior: "smooth" });
|
|
@@ -1722,10 +1700,10 @@ const APIPage = () => {
|
|
|
1722
1700
|
setFocusedTag,
|
|
1723
1701
|
selectedApi
|
|
1724
1702
|
]);
|
|
1725
|
-
(0, react.useEffect)(() => {
|
|
1703
|
+
(0, react$1.useEffect)(() => {
|
|
1726
1704
|
if (!!urlsOptions?.length) setSelectedUrl(urlsOptions[0]?.value);
|
|
1727
1705
|
}, [selectedApi, urlsOptions]);
|
|
1728
|
-
(0, react.useEffect)(() => {
|
|
1706
|
+
(0, react$1.useEffect)(() => {
|
|
1729
1707
|
if (selectedApi?.servers && !selectedUrl) setSelectedUrl(selectedApi?.servers?.[0].url);
|
|
1730
1708
|
}, [selectedApi?.servers]);
|
|
1731
1709
|
const getEndpointsForSelectedUrl = () => {
|
|
@@ -1746,7 +1724,7 @@ const APIPage = () => {
|
|
|
1746
1724
|
};
|
|
1747
1725
|
return wrapSSR(/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(antd.Flex, {
|
|
1748
1726
|
vertical: true,
|
|
1749
|
-
gap: token
|
|
1727
|
+
gap: token.margin,
|
|
1750
1728
|
children: [selectedApi && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ViewModeApiHeader, {
|
|
1751
1729
|
api: selectedApi,
|
|
1752
1730
|
viewLayout: viewStyle,
|
|
@@ -1763,14 +1741,14 @@ const APIPage = () => {
|
|
|
1763
1741
|
haveUnderLine: index < arr.length - 1,
|
|
1764
1742
|
contextPath: selectedApi?.contextPath,
|
|
1765
1743
|
viewStyle,
|
|
1766
|
-
token
|
|
1744
|
+
token
|
|
1767
1745
|
}, `${selectedApi?.id}_${key}`);
|
|
1768
1746
|
})]
|
|
1769
1747
|
}));
|
|
1770
1748
|
};
|
|
1771
|
-
const APIsRenderer = ({ apis, withTitle, tagName, haveUnderLine, contextPath, viewStyle, token
|
|
1749
|
+
const APIsRenderer = ({ apis, withTitle, tagName, haveUnderLine, contextPath, viewStyle, token }) => {
|
|
1772
1750
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(antd.Flex, {
|
|
1773
|
-
gap: viewStyle === "grid" ? token
|
|
1751
|
+
gap: viewStyle === "grid" ? token.marginXS : 0,
|
|
1774
1752
|
style: {
|
|
1775
1753
|
marginBottom: 0,
|
|
1776
1754
|
paddingBottom: 0
|
|
@@ -1787,19 +1765,18 @@ const APIsRenderer = ({ apis, withTitle, tagName, haveUnderLine, contextPath, vi
|
|
|
1787
1765
|
wrap: "wrap",
|
|
1788
1766
|
gap: viewStyle === "grid" ? "1.5rem" : 0,
|
|
1789
1767
|
vertical: viewStyle === "list",
|
|
1790
|
-
children: apis.map((item) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
1768
|
+
children: apis.map((item) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ApiCard, {
|
|
1791
1769
|
api: item,
|
|
1792
1770
|
viewStyle
|
|
1793
1771
|
}, `${tagName}_renderer_${item.id}_${item.method}_${item.path}`))
|
|
1794
1772
|
}),
|
|
1795
1773
|
haveUnderLine && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(antd.Divider, { style: {
|
|
1796
|
-
marginTop: token
|
|
1797
|
-
marginBottom: token
|
|
1774
|
+
marginTop: token.marginSM,
|
|
1775
|
+
marginBottom: token.marginSM
|
|
1798
1776
|
} })
|
|
1799
1777
|
]
|
|
1800
1778
|
}, `${tagName}_renderer_${contextPath}`);
|
|
1801
1779
|
};
|
|
1802
|
-
|
|
1803
1780
|
//#endregion
|
|
1804
1781
|
//#region src/utils/index.ts
|
|
1805
1782
|
const handleStatusColor = (code) => {
|
|
@@ -1810,7 +1787,6 @@ const handleStatusColor = (code) => {
|
|
|
1810
1787
|
else if (code >= 300 && code < 400) return "orange";
|
|
1811
1788
|
else return "gray";
|
|
1812
1789
|
};
|
|
1813
|
-
|
|
1814
1790
|
//#endregion
|
|
1815
1791
|
//#region src/view/components/EndpointPage/EndpointPage.tsx
|
|
1816
1792
|
const { Title: Title$5, Paragraph } = antd.Typography;
|
|
@@ -1832,7 +1808,7 @@ const requestColumns = [
|
|
|
1832
1808
|
}
|
|
1833
1809
|
];
|
|
1834
1810
|
const responseColumns = [...requestColumns];
|
|
1835
|
-
const buildRequestData = (params, token
|
|
1811
|
+
const buildRequestData = (params, token) => [...params].sort((a, b) => a.required === b.required ? 0 : a.required ? -1 : 1).map((p, index) => {
|
|
1836
1812
|
let typeLabel = p.schema?.type;
|
|
1837
1813
|
if (p.schema?.type === "array" && p.schema?.items?.type) typeLabel = `${p.schema.type}_${p.schema.items.type}`;
|
|
1838
1814
|
return {
|
|
@@ -1841,17 +1817,17 @@ const buildRequestData = (params, token$1) => [...params].sort((a, b) => a.requi
|
|
|
1841
1817
|
p.name,
|
|
1842
1818
|
typeLabel && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1843
1819
|
style: {
|
|
1844
|
-
color: token
|
|
1820
|
+
color: token.colorTextTertiary,
|
|
1845
1821
|
marginLeft: "0.25rem",
|
|
1846
1822
|
marginRight: "0.25rem"
|
|
1847
1823
|
},
|
|
1848
1824
|
children: typeLabel
|
|
1849
1825
|
}),
|
|
1850
1826
|
p.required ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1851
|
-
style: { color: token
|
|
1827
|
+
style: { color: token.colorError },
|
|
1852
1828
|
children: "*"
|
|
1853
1829
|
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1854
|
-
style: { color: token
|
|
1830
|
+
style: { color: token.colorSuccess },
|
|
1855
1831
|
children: "Optional"
|
|
1856
1832
|
})
|
|
1857
1833
|
] }),
|
|
@@ -1859,7 +1835,7 @@ const buildRequestData = (params, token$1) => [...params].sort((a, b) => a.requi
|
|
|
1859
1835
|
enum: p.schema?.enum ? p.schema.enum.map((e) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(antd.Tag, { children: e }, e)) : "--"
|
|
1860
1836
|
};
|
|
1861
1837
|
});
|
|
1862
|
-
const buildHeaderData = (headers, token
|
|
1838
|
+
const buildHeaderData = (headers, token) => {
|
|
1863
1839
|
if (!headers) return [];
|
|
1864
1840
|
return Object.entries(headers).sort(([, a], [, b]) => a.required === b.required ? 0 : a.required ? -1 : 1).map(([name, header], idx) => {
|
|
1865
1841
|
let typeLabel = header.schema?.type;
|
|
@@ -1870,17 +1846,17 @@ const buildHeaderData = (headers, token$1) => {
|
|
|
1870
1846
|
name,
|
|
1871
1847
|
typeLabel && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1872
1848
|
style: {
|
|
1873
|
-
color: token
|
|
1849
|
+
color: token.colorTextTertiary,
|
|
1874
1850
|
marginLeft: "0.25rem",
|
|
1875
1851
|
marginRight: "0.25rem"
|
|
1876
1852
|
},
|
|
1877
1853
|
children: typeLabel
|
|
1878
1854
|
}),
|
|
1879
1855
|
header.required ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1880
|
-
style: { color: token
|
|
1856
|
+
style: { color: token.colorError },
|
|
1881
1857
|
children: "*"
|
|
1882
1858
|
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1883
|
-
style: { color: token
|
|
1859
|
+
style: { color: token.colorSuccess },
|
|
1884
1860
|
children: "Optional"
|
|
1885
1861
|
})
|
|
1886
1862
|
] }, idx),
|
|
@@ -1889,7 +1865,7 @@ const buildHeaderData = (headers, token$1) => {
|
|
|
1889
1865
|
};
|
|
1890
1866
|
});
|
|
1891
1867
|
};
|
|
1892
|
-
const buildRequestBodyData = (requestBody, token
|
|
1868
|
+
const buildRequestBodyData = (requestBody, token) => {
|
|
1893
1869
|
if (!requestBody?.content) return [];
|
|
1894
1870
|
const contentType = Object.keys(requestBody.content)[0];
|
|
1895
1871
|
const schema = requestBody.content[contentType]?.schema;
|
|
@@ -1902,17 +1878,17 @@ const buildRequestBodyData = (requestBody, token$1) => {
|
|
|
1902
1878
|
name,
|
|
1903
1879
|
prop.type && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1904
1880
|
style: {
|
|
1905
|
-
color: token
|
|
1881
|
+
color: token.colorTextTertiary,
|
|
1906
1882
|
marginLeft: "0.25rem",
|
|
1907
1883
|
marginRight: "0.25rem"
|
|
1908
1884
|
},
|
|
1909
1885
|
children: prop.type
|
|
1910
1886
|
}),
|
|
1911
1887
|
required.includes(name) ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1912
|
-
style: { color: token
|
|
1888
|
+
style: { color: token.colorError },
|
|
1913
1889
|
children: "*"
|
|
1914
1890
|
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1915
|
-
style: { color: token
|
|
1891
|
+
style: { color: token.colorSuccess },
|
|
1916
1892
|
children: "Optional"
|
|
1917
1893
|
})
|
|
1918
1894
|
] }),
|
|
@@ -1921,14 +1897,14 @@ const buildRequestBodyData = (requestBody, token$1) => {
|
|
|
1921
1897
|
}));
|
|
1922
1898
|
};
|
|
1923
1899
|
const EndpointPage = () => {
|
|
1924
|
-
const { selectedEndpoint, selectedApi, selectedStatusCode, setSelectedNodeKey, setFocusedContent, setFocusedTag, setActiveRequestTab } =
|
|
1925
|
-
const [activeTabKey, setActiveTabKey] = (0, react.useState)("header");
|
|
1926
|
-
const { token
|
|
1927
|
-
const { cx } = useStyle("EndpointPage", (token
|
|
1900
|
+
const { selectedEndpoint, selectedApi, selectedStatusCode, setSelectedNodeKey, setFocusedContent, setFocusedTag, setActiveRequestTab } = useStore(({ view }) => view);
|
|
1901
|
+
const [activeTabKey, setActiveTabKey] = (0, react$1.useState)("header");
|
|
1902
|
+
const { token } = antd.theme.useToken();
|
|
1903
|
+
const { cx } = useStyle("EndpointPage", (token, scope) => ({
|
|
1928
1904
|
[scope("docs-endpoint-container")]: {
|
|
1929
1905
|
display: "flex",
|
|
1930
1906
|
flexDirection: "column",
|
|
1931
|
-
gap: token
|
|
1907
|
+
gap: token.marginLG,
|
|
1932
1908
|
height: "100%"
|
|
1933
1909
|
},
|
|
1934
1910
|
[scope("content")]: {
|
|
@@ -1937,43 +1913,43 @@ const EndpointPage = () => {
|
|
|
1937
1913
|
},
|
|
1938
1914
|
[scope("code")]: {
|
|
1939
1915
|
background: "unset",
|
|
1940
|
-
borderRadius: token
|
|
1941
|
-
padding: token
|
|
1916
|
+
borderRadius: token.borderRadius,
|
|
1917
|
+
padding: token.paddingSM,
|
|
1942
1918
|
fontFamily: "monospace",
|
|
1943
1919
|
whiteSpace: "pre-wrap"
|
|
1944
1920
|
},
|
|
1945
1921
|
[scope("breadcrumb")]: {
|
|
1946
1922
|
display: "flex",
|
|
1947
|
-
gap: token
|
|
1923
|
+
gap: token.marginLG,
|
|
1948
1924
|
alignItems: "center",
|
|
1949
|
-
marginBottom: token
|
|
1925
|
+
marginBottom: token.marginLG
|
|
1950
1926
|
},
|
|
1951
1927
|
[scope("request-card")]: {
|
|
1952
|
-
borderRadius: token
|
|
1953
|
-
backgroundColor: token
|
|
1928
|
+
borderRadius: token.borderRadius,
|
|
1929
|
+
backgroundColor: token.colorBgBase,
|
|
1954
1930
|
".ant-card-head": {
|
|
1955
1931
|
minHeight: "unset",
|
|
1956
1932
|
borderBottom: "unset",
|
|
1957
1933
|
padding: "0.75rem",
|
|
1958
|
-
backgroundColor: token
|
|
1934
|
+
backgroundColor: token.colorBgBase
|
|
1959
1935
|
},
|
|
1960
1936
|
".ant-card-body": {
|
|
1961
1937
|
padding: "0px 0.75rem 0.75rem 0.75rem",
|
|
1962
|
-
backgroundColor: token
|
|
1938
|
+
backgroundColor: token.colorBgBase,
|
|
1963
1939
|
".ant-tabs-tab": { paddingTop: "0" }
|
|
1964
1940
|
},
|
|
1965
|
-
"& .ant-table": { backgroundColor: `${token
|
|
1966
|
-
"& .ant-table-thead > tr > th": { backgroundColor: `${token
|
|
1967
|
-
"& .ant-table-tbody > tr > td": { backgroundColor: `${token
|
|
1941
|
+
"& .ant-table": { backgroundColor: `${token.colorBgBase} !important` },
|
|
1942
|
+
"& .ant-table-thead > tr > th": { backgroundColor: `${token.colorBgBase} !important` },
|
|
1943
|
+
"& .ant-table-tbody > tr > td": { backgroundColor: `${token.colorBgBase} !important` }
|
|
1968
1944
|
},
|
|
1969
|
-
[scope("row-odd")]: { "& > td": { background: `${token
|
|
1970
|
-
[scope("row-even")]: { "& > td": { background: `${token
|
|
1945
|
+
[scope("row-odd")]: { "& > td": { background: `${token.colorBgElevated} !important` } },
|
|
1946
|
+
[scope("row-even")]: { "& > td": { background: `${token.colorBgLayout} !important` } }
|
|
1971
1947
|
}));
|
|
1972
1948
|
const methodStyle = sidebarMethodColors[selectedEndpoint?.method];
|
|
1973
|
-
const headerParams = buildRequestData(selectedEndpoint?.parameters?.filter((p) => p.in === "header") || [], token
|
|
1974
|
-
const pathParams = buildRequestData(selectedEndpoint?.parameters?.filter((p) => p.in === "path") || [], token
|
|
1975
|
-
const queryParams = buildRequestData(selectedEndpoint?.parameters?.filter((p) => p.in === "query") || [], token
|
|
1976
|
-
const requestBodyData = buildRequestBodyData(selectedEndpoint?.requestBody, token
|
|
1949
|
+
const headerParams = buildRequestData(selectedEndpoint?.parameters?.filter((p) => p.in === "header") || [], token);
|
|
1950
|
+
const pathParams = buildRequestData(selectedEndpoint?.parameters?.filter((p) => p.in === "path") || [], token);
|
|
1951
|
+
const queryParams = buildRequestData(selectedEndpoint?.parameters?.filter((p) => p.in === "query") || [], token);
|
|
1952
|
+
const requestBodyData = buildRequestBodyData(selectedEndpoint?.requestBody, token);
|
|
1977
1953
|
const requestTabs = [
|
|
1978
1954
|
{
|
|
1979
1955
|
key: "header",
|
|
@@ -2024,13 +2000,13 @@ const EndpointPage = () => {
|
|
|
2024
2000
|
})
|
|
2025
2001
|
}] : []
|
|
2026
2002
|
].filter((t) => t !== null);
|
|
2027
|
-
(0, react.useEffect)(() => {
|
|
2003
|
+
(0, react$1.useEffect)(() => {
|
|
2028
2004
|
const firstKey = requestTabs[0]?.key ?? "header";
|
|
2029
2005
|
setActiveTabKey(firstKey);
|
|
2030
2006
|
setActiveRequestTab(firstKey);
|
|
2031
2007
|
}, [selectedEndpoint?.id]);
|
|
2032
2008
|
const responseHeaders = (selectedEndpoint?.responses?.[selectedStatusCode || 200])?.headers;
|
|
2033
|
-
const responseHeaderData = buildHeaderData(responseHeaders, token
|
|
2009
|
+
const responseHeaderData = buildHeaderData(responseHeaders, token);
|
|
2034
2010
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
2035
2011
|
className: cx("docs-endpoint-container"),
|
|
2036
2012
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
@@ -2041,7 +2017,7 @@ const EndpointPage = () => {
|
|
|
2041
2017
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(antd.Button, {
|
|
2042
2018
|
color: "default",
|
|
2043
2019
|
variant: "outlined",
|
|
2044
|
-
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
2020
|
+
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_ant_design_icons.LeftOutlined, {}),
|
|
2045
2021
|
onClick: (e) => {
|
|
2046
2022
|
e.preventDefault();
|
|
2047
2023
|
setSelectedNodeKey(selectedApi?.id);
|
|
@@ -2070,7 +2046,7 @@ const EndpointPage = () => {
|
|
|
2070
2046
|
display: "flex",
|
|
2071
2047
|
flexDirection: "row",
|
|
2072
2048
|
alignItems: "center",
|
|
2073
|
-
color: token
|
|
2049
|
+
color: token.colorTextTertiary,
|
|
2074
2050
|
gap: "0.25rem"
|
|
2075
2051
|
},
|
|
2076
2052
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: selectedEndpoint?.tagName || "default" })
|
|
@@ -2124,7 +2100,7 @@ const EndpointPage = () => {
|
|
|
2124
2100
|
}),
|
|
2125
2101
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Paragraph, {
|
|
2126
2102
|
style: {
|
|
2127
|
-
color: token
|
|
2103
|
+
color: token.colorTextTertiary,
|
|
2128
2104
|
marginBottom: "1.5rem"
|
|
2129
2105
|
},
|
|
2130
2106
|
children: selectedEndpoint?.description ?? "--"
|
|
@@ -2134,9 +2110,9 @@ const EndpointPage = () => {
|
|
|
2134
2110
|
className: cx("request-card"),
|
|
2135
2111
|
style: {
|
|
2136
2112
|
marginBottom: "1.5rem",
|
|
2137
|
-
backgroundColor: token
|
|
2113
|
+
backgroundColor: token.colorBgBase
|
|
2138
2114
|
},
|
|
2139
|
-
styles: { body: { backgroundColor: token
|
|
2115
|
+
styles: { body: { backgroundColor: token.colorBgBase } },
|
|
2140
2116
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(antd.Tabs, {
|
|
2141
2117
|
activeKey: activeTabKey,
|
|
2142
2118
|
onChange: (key) => {
|
|
@@ -2170,7 +2146,6 @@ const EndpointPage = () => {
|
|
|
2170
2146
|
})
|
|
2171
2147
|
});
|
|
2172
2148
|
};
|
|
2173
|
-
|
|
2174
2149
|
//#endregion
|
|
2175
2150
|
//#region src/assets/mouseSquare.tsx
|
|
2176
2151
|
const MouseSquare = (props) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
|
|
@@ -2194,18 +2169,16 @@ const MouseSquare = (props) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg"
|
|
|
2194
2169
|
strokeLinejoin: "round"
|
|
2195
2170
|
})]
|
|
2196
2171
|
});
|
|
2197
|
-
var mouseSquare_default = MouseSquare;
|
|
2198
|
-
|
|
2199
2172
|
//#endregion
|
|
2200
2173
|
//#region src/view/components/MainContent.tsx
|
|
2201
2174
|
const MainContent = ({ searchEnabled, handleResetSearch, handleVisitLandingPage }) => {
|
|
2202
|
-
const { focusedContent, transformedData } =
|
|
2203
|
-
const { wrapSSR, cx, token
|
|
2175
|
+
const { focusedContent, transformedData } = useStore(({ view }) => view);
|
|
2176
|
+
const { wrapSSR, cx, token } = useStyle("MainContent", (token, scope) => ({
|
|
2204
2177
|
[scope("inner-doc-container")]: {
|
|
2205
2178
|
width: "100%",
|
|
2206
2179
|
height: "auto",
|
|
2207
|
-
borderRadius: token
|
|
2208
|
-
padding: token
|
|
2180
|
+
borderRadius: token.borderRadius,
|
|
2181
|
+
padding: token.paddingXL,
|
|
2209
2182
|
overflow: "hidden",
|
|
2210
2183
|
minWidth: 0
|
|
2211
2184
|
},
|
|
@@ -2218,31 +2191,31 @@ const MainContent = ({ searchEnabled, handleResetSearch, handleVisitLandingPage
|
|
|
2218
2191
|
padding: 0
|
|
2219
2192
|
},
|
|
2220
2193
|
[scope("title")]: {
|
|
2221
|
-
fontFamily: token
|
|
2194
|
+
fontFamily: token.fontFamily,
|
|
2222
2195
|
fontWeight: 600,
|
|
2223
|
-
fontSize: token
|
|
2224
|
-
color: token
|
|
2196
|
+
fontSize: token.fontSizeHeading4,
|
|
2197
|
+
color: token.colorText
|
|
2225
2198
|
},
|
|
2226
2199
|
[scope("text")]: {
|
|
2227
|
-
color: token
|
|
2228
|
-
fontFamily: token
|
|
2200
|
+
color: token.colorText,
|
|
2201
|
+
fontFamily: token.fontFamily
|
|
2229
2202
|
},
|
|
2230
2203
|
[scope("visit-landing-button")]: {
|
|
2231
2204
|
width: "12.25rem",
|
|
2232
2205
|
height: "2.5rem",
|
|
2233
|
-
borderRadius: token
|
|
2206
|
+
borderRadius: token.borderRadiusLG
|
|
2234
2207
|
},
|
|
2235
2208
|
[scope("reset-button")]: {
|
|
2236
2209
|
width: "8.125rem",
|
|
2237
2210
|
height: "2.5rem",
|
|
2238
|
-
borderRadius: token
|
|
2239
|
-
backgroundColor: token
|
|
2240
|
-
fontSize: token
|
|
2211
|
+
borderRadius: token.borderRadiusLG,
|
|
2212
|
+
backgroundColor: token?.Button?.primaryColor,
|
|
2213
|
+
fontSize: token.Button?.contentFontSizeLG
|
|
2241
2214
|
}
|
|
2242
2215
|
}));
|
|
2243
2216
|
return wrapSSR(/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
2244
2217
|
className: cx("inner-doc-container", !transformedData?.length ? "centered" : ""),
|
|
2245
|
-
style: { backgroundColor: focusedContent === "ENDPOINT" ? token
|
|
2218
|
+
style: { backgroundColor: focusedContent === "ENDPOINT" ? token.colorBgBase : token.colorBgElevated },
|
|
2246
2219
|
children: !transformedData?.length ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(antd.Flex, {
|
|
2247
2220
|
justify: "center",
|
|
2248
2221
|
align: "center",
|
|
@@ -2250,9 +2223,9 @@ const MainContent = ({ searchEnabled, handleResetSearch, handleVisitLandingPage
|
|
|
2250
2223
|
vertical: true,
|
|
2251
2224
|
flex: 1,
|
|
2252
2225
|
children: [
|
|
2253
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
2254
|
-
stroke: token
|
|
2255
|
-
fill: token
|
|
2226
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(NoDataIcon, {
|
|
2227
|
+
stroke: token.colorPrimaryHover,
|
|
2228
|
+
fill: token.colorPrimaryBg,
|
|
2256
2229
|
width: "18.625rem",
|
|
2257
2230
|
height: "14.75rem"
|
|
2258
2231
|
}),
|
|
@@ -2273,7 +2246,7 @@ const MainContent = ({ searchEnabled, handleResetSearch, handleVisitLandingPage
|
|
|
2273
2246
|
!searchEnabled ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(antd.Button, {
|
|
2274
2247
|
type: "primary",
|
|
2275
2248
|
onClick: handleVisitLandingPage,
|
|
2276
|
-
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
2249
|
+
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MouseSquare, {}),
|
|
2277
2250
|
iconPosition: "start",
|
|
2278
2251
|
className: cx("visit-landing-button"),
|
|
2279
2252
|
children: "Visit Landing Page"
|
|
@@ -2287,27 +2260,26 @@ const MainContent = ({ searchEnabled, handleResetSearch, handleVisitLandingPage
|
|
|
2287
2260
|
}) : focusedContent === "ENDPOINT" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(EndpointPage, {}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(APIPage, {})
|
|
2288
2261
|
}));
|
|
2289
2262
|
};
|
|
2290
|
-
|
|
2291
2263
|
//#endregion
|
|
2292
2264
|
//#region src/view/components/ApiPage/components/ApiDocumentationBar.tsx
|
|
2293
2265
|
const { useBreakpoint: useBreakpoint$3 } = antd.Grid;
|
|
2294
2266
|
const { Title: Title$3 } = antd.Typography;
|
|
2295
2267
|
const ApiDocumentationBar = ({ apiName, mode, onModeChange, onReset, onSave, hasChanges = false, switcherNode }) => {
|
|
2296
2268
|
const isMobile = !useBreakpoint$3().md;
|
|
2297
|
-
const { wrapSSR, cx, token
|
|
2269
|
+
const { wrapSSR, cx, token } = useStyle("ApiDocumentationBar", (token, scope) => ({
|
|
2298
2270
|
[scope("root")]: {
|
|
2299
2271
|
display: "flex",
|
|
2300
2272
|
alignItems: "center",
|
|
2301
2273
|
justifyContent: "space-between",
|
|
2302
|
-
padding: `${token
|
|
2303
|
-
background: token
|
|
2304
|
-
borderRadius: token
|
|
2274
|
+
padding: `${token.marginSM + 4}px ${token.paddingLG}px`,
|
|
2275
|
+
background: token.colorBgContainer,
|
|
2276
|
+
borderRadius: token.borderRadius,
|
|
2305
2277
|
width: "100%",
|
|
2306
|
-
["@media (max-width: 640px)"]: { padding: `${token
|
|
2278
|
+
["@media (max-width: 640px)"]: { padding: `${token.marginSM}px ${token.marginMD}px` }
|
|
2307
2279
|
},
|
|
2308
2280
|
[scope("mobileWrapper")]: {
|
|
2309
2281
|
flexDirection: "column",
|
|
2310
|
-
gap: token
|
|
2282
|
+
gap: token.marginMD
|
|
2311
2283
|
},
|
|
2312
2284
|
[scope("mobileTopRow")]: {
|
|
2313
2285
|
width: "100%",
|
|
@@ -2330,7 +2302,7 @@ const ApiDocumentationBar = ({ apiName, mode, onModeChange, onReset, onSave, has
|
|
|
2330
2302
|
flex: 1,
|
|
2331
2303
|
display: "flex",
|
|
2332
2304
|
alignItems: "center",
|
|
2333
|
-
gap: token
|
|
2305
|
+
gap: token.marginSM,
|
|
2334
2306
|
minWidth: 0,
|
|
2335
2307
|
overflow: "hidden"
|
|
2336
2308
|
},
|
|
@@ -2340,14 +2312,14 @@ const ApiDocumentationBar = ({ apiName, mode, onModeChange, onReset, onSave, has
|
|
|
2340
2312
|
display: "flex",
|
|
2341
2313
|
alignItems: "center",
|
|
2342
2314
|
justifyContent: "center",
|
|
2343
|
-
color: token
|
|
2315
|
+
color: token.colorText
|
|
2344
2316
|
},
|
|
2345
2317
|
[scope("switcher")]: {
|
|
2346
2318
|
display: "flex",
|
|
2347
2319
|
alignItems: "center",
|
|
2348
|
-
background: token
|
|
2320
|
+
background: token.colorBgLayout,
|
|
2349
2321
|
padding: "4px 4px",
|
|
2350
|
-
borderRadius: token
|
|
2322
|
+
borderRadius: token.borderRadius,
|
|
2351
2323
|
gap: 8
|
|
2352
2324
|
},
|
|
2353
2325
|
[scope("switcher-item")]: {
|
|
@@ -2358,17 +2330,17 @@ const ApiDocumentationBar = ({ apiName, mode, onModeChange, onReset, onSave, has
|
|
|
2358
2330
|
background: "transparent",
|
|
2359
2331
|
border: "none",
|
|
2360
2332
|
cursor: "pointer",
|
|
2361
|
-
fontSize: token
|
|
2333
|
+
fontSize: token.fontSizeLG,
|
|
2362
2334
|
fontWeight: 400,
|
|
2363
|
-
color: token
|
|
2364
|
-
fontFamily: token
|
|
2335
|
+
color: token.colorText,
|
|
2336
|
+
fontFamily: token.fontFamily,
|
|
2365
2337
|
transition: "all 0.2s ease"
|
|
2366
2338
|
},
|
|
2367
2339
|
[scope("switcher-item-active")]: {
|
|
2368
|
-
background: token
|
|
2369
|
-
borderRadius: token
|
|
2340
|
+
background: token.colorBgContainer,
|
|
2341
|
+
borderRadius: token.borderRadius,
|
|
2370
2342
|
boxShadow: "0px 2px 4px -2px rgba(17,12,34,0.12)",
|
|
2371
|
-
fontSize: token
|
|
2343
|
+
fontSize: token.fontSize,
|
|
2372
2344
|
fontWeight: 700
|
|
2373
2345
|
},
|
|
2374
2346
|
[scope("switcher-icon")]: {
|
|
@@ -2382,14 +2354,14 @@ const ApiDocumentationBar = ({ apiName, mode, onModeChange, onReset, onSave, has
|
|
|
2382
2354
|
[scope("actions")]: {
|
|
2383
2355
|
display: "flex",
|
|
2384
2356
|
alignItems: "center",
|
|
2385
|
-
gap: token
|
|
2357
|
+
gap: token.marginMD,
|
|
2386
2358
|
flex: 1,
|
|
2387
2359
|
justifyContent: "flex-end"
|
|
2388
2360
|
},
|
|
2389
2361
|
[scope("mobileActions")]: {
|
|
2390
2362
|
display: "flex",
|
|
2391
2363
|
alignItems: "center",
|
|
2392
|
-
gap: token
|
|
2364
|
+
gap: token.marginSM,
|
|
2393
2365
|
justifyContent: "flex-end"
|
|
2394
2366
|
}
|
|
2395
2367
|
}));
|
|
@@ -2410,13 +2382,13 @@ const ApiDocumentationBar = ({ apiName, mode, onModeChange, onReset, onSave, has
|
|
|
2410
2382
|
style: {
|
|
2411
2383
|
margin: 0,
|
|
2412
2384
|
fontWeight: 600,
|
|
2413
|
-
color: token
|
|
2385
|
+
color: token.colorTextHeading
|
|
2414
2386
|
},
|
|
2415
2387
|
children: apiName
|
|
2416
2388
|
})
|
|
2417
2389
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
2418
2390
|
className: cx("arrow-icon"),
|
|
2419
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
2391
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_ant_design_icons.RightOutlined, { style: { fontSize: 24 } })
|
|
2420
2392
|
})]
|
|
2421
2393
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2422
2394
|
className: cx("mobileActions"),
|
|
@@ -2450,7 +2422,7 @@ const ApiDocumentationBar = ({ apiName, mode, onModeChange, onReset, onSave, has
|
|
|
2450
2422
|
whiteSpace: "nowrap",
|
|
2451
2423
|
overflow: "hidden",
|
|
2452
2424
|
textOverflow: "ellipsis",
|
|
2453
|
-
color: token
|
|
2425
|
+
color: token.colorTextHeading,
|
|
2454
2426
|
minWidth: 0,
|
|
2455
2427
|
flex: 1
|
|
2456
2428
|
},
|
|
@@ -2465,14 +2437,14 @@ const ApiDocumentationBar = ({ apiName, mode, onModeChange, onReset, onSave, has
|
|
|
2465
2437
|
onClick: () => onModeChange("edit"),
|
|
2466
2438
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
2467
2439
|
className: cx("switcher-icon"),
|
|
2468
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
2440
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_ant_design_icons.EditOutlined, {})
|
|
2469
2441
|
}), "Edit"]
|
|
2470
2442
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
2471
2443
|
className: cx("switcher-item", mode === "view" ? "switcher-item-active" : ""),
|
|
2472
2444
|
onClick: () => onModeChange("view"),
|
|
2473
2445
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
2474
2446
|
className: cx("switcher-icon"),
|
|
2475
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
2447
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_ant_design_icons.EyeOutlined, {})
|
|
2476
2448
|
}), "View"]
|
|
2477
2449
|
})]
|
|
2478
2450
|
}),
|
|
@@ -2494,17 +2466,16 @@ const ApiDocumentationBar = ({ apiName, mode, onModeChange, onReset, onSave, has
|
|
|
2494
2466
|
]
|
|
2495
2467
|
}));
|
|
2496
2468
|
};
|
|
2497
|
-
|
|
2498
2469
|
//#endregion
|
|
2499
2470
|
//#region src/view/components/ApiPage/components/GeneralSection.tsx
|
|
2500
2471
|
const { useBreakpoint: useBreakpoint$2 } = antd.Grid;
|
|
2501
2472
|
const GeneralSection = ({ apiName, authType, version, description, onApiNameChange, onDescriptionChange, collapsed = false, onToggleCollapse, onChangeDetected }) => {
|
|
2502
2473
|
const isMobile = !useBreakpoint$2().md;
|
|
2503
|
-
const { wrapSSR, cx, token
|
|
2474
|
+
const { wrapSSR, cx, token } = useStyle("GeneralSection", (token, scope) => ({
|
|
2504
2475
|
[scope("root")]: {
|
|
2505
2476
|
display: "flex",
|
|
2506
2477
|
flexDirection: "column",
|
|
2507
|
-
borderRadius: token
|
|
2478
|
+
borderRadius: token.borderRadius,
|
|
2508
2479
|
overflow: "hidden",
|
|
2509
2480
|
width: "100%"
|
|
2510
2481
|
},
|
|
@@ -2512,22 +2483,22 @@ const GeneralSection = ({ apiName, authType, version, description, onApiNameChan
|
|
|
2512
2483
|
display: "flex",
|
|
2513
2484
|
alignItems: "center",
|
|
2514
2485
|
justifyContent: "space-between",
|
|
2515
|
-
padding: `${token
|
|
2516
|
-
background: token
|
|
2517
|
-
borderRadius: `${token
|
|
2486
|
+
padding: `${token.paddingXS}px ${token.paddingLG}px`,
|
|
2487
|
+
background: token.colorPrimaryBg,
|
|
2488
|
+
borderRadius: `${token.borderRadius}px ${token.borderRadius}px 0 0`
|
|
2518
2489
|
},
|
|
2519
2490
|
[scope("body")]: {
|
|
2520
2491
|
display: "flex",
|
|
2521
2492
|
flexDirection: "column",
|
|
2522
|
-
gap: token
|
|
2523
|
-
padding: token
|
|
2524
|
-
paddingBottom: token
|
|
2525
|
-
background: token
|
|
2526
|
-
borderRadius: `0 0 ${token
|
|
2493
|
+
gap: token.paddingLG,
|
|
2494
|
+
padding: token.paddingLG,
|
|
2495
|
+
paddingBottom: token.paddingXXL ?? 48,
|
|
2496
|
+
background: token.colorBgElevated,
|
|
2497
|
+
borderRadius: `0 0 ${token.borderRadius}px ${token.borderRadius}px`
|
|
2527
2498
|
},
|
|
2528
2499
|
[scope("row")]: {
|
|
2529
2500
|
display: "flex",
|
|
2530
|
-
gap: token
|
|
2501
|
+
gap: token.paddingLG,
|
|
2531
2502
|
width: "100%"
|
|
2532
2503
|
},
|
|
2533
2504
|
[scope("field")]: {
|
|
@@ -2539,22 +2510,22 @@ const GeneralSection = ({ apiName, authType, version, description, onApiNameChan
|
|
|
2539
2510
|
[scope("label")]: {
|
|
2540
2511
|
display: "flex",
|
|
2541
2512
|
alignItems: "center",
|
|
2542
|
-
gap: token
|
|
2543
|
-
fontSize: token
|
|
2513
|
+
gap: token.marginXXS,
|
|
2514
|
+
fontSize: token.fontSize,
|
|
2544
2515
|
fontWeight: 400,
|
|
2545
|
-
color: token
|
|
2546
|
-
paddingBottom: token
|
|
2516
|
+
color: token.colorText,
|
|
2517
|
+
paddingBottom: token.paddingXS,
|
|
2547
2518
|
lineHeight: "22px"
|
|
2548
2519
|
},
|
|
2549
2520
|
[scope("label-required")]: {
|
|
2550
|
-
color: token
|
|
2551
|
-
fontSize: token
|
|
2521
|
+
color: token.colorError,
|
|
2522
|
+
fontSize: token.fontSize
|
|
2552
2523
|
},
|
|
2553
2524
|
[scope("count")]: {
|
|
2554
2525
|
alignSelf: "flex-end",
|
|
2555
|
-
fontSize: token
|
|
2556
|
-
color: token
|
|
2557
|
-
marginTop: token
|
|
2526
|
+
fontSize: token.fontSize,
|
|
2527
|
+
color: token.colorTextDescription,
|
|
2528
|
+
marginTop: token.marginXXS
|
|
2558
2529
|
}
|
|
2559
2530
|
}));
|
|
2560
2531
|
return wrapSSR(/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
@@ -2565,13 +2536,13 @@ const GeneralSection = ({ apiName, authType, version, description, onApiNameChan
|
|
|
2565
2536
|
level: 4,
|
|
2566
2537
|
style: {
|
|
2567
2538
|
margin: 0,
|
|
2568
|
-
color: token
|
|
2539
|
+
color: token.colorTextHeading
|
|
2569
2540
|
},
|
|
2570
2541
|
children: "General"
|
|
2571
2542
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(antd.Button, {
|
|
2572
2543
|
type: "text",
|
|
2573
2544
|
size: "large",
|
|
2574
|
-
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
2545
|
+
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_ant_design_icons.UpCircleOutlined, { style: { fontSize: 18 } }),
|
|
2575
2546
|
onClick: onToggleCollapse,
|
|
2576
2547
|
style: {
|
|
2577
2548
|
transform: collapsed ? "rotate(180deg)" : "rotate(0deg)",
|
|
@@ -2581,8 +2552,8 @@ const GeneralSection = ({ apiName, authType, version, description, onApiNameChan
|
|
|
2581
2552
|
}), !collapsed && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2582
2553
|
className: cx("body"),
|
|
2583
2554
|
style: isMobile ? {
|
|
2584
|
-
padding: token
|
|
2585
|
-
paddingBottom: token
|
|
2555
|
+
padding: token.paddingMD,
|
|
2556
|
+
paddingBottom: token.paddingXXL ?? 48
|
|
2586
2557
|
} : void 0,
|
|
2587
2558
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2588
2559
|
className: cx("row"),
|
|
@@ -2663,7 +2634,6 @@ const GeneralSection = ({ apiName, authType, version, description, onApiNameChan
|
|
|
2663
2634
|
})]
|
|
2664
2635
|
}));
|
|
2665
2636
|
};
|
|
2666
|
-
|
|
2667
2637
|
//#endregion
|
|
2668
2638
|
//#region src/assets/trash.tsx
|
|
2669
2639
|
const Trash = (props) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
|
|
@@ -2723,8 +2693,6 @@ const Trash = (props) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
|
|
|
2723
2693
|
})
|
|
2724
2694
|
]
|
|
2725
2695
|
});
|
|
2726
|
-
var trash_default = Trash;
|
|
2727
|
-
|
|
2728
2696
|
//#endregion
|
|
2729
2697
|
//#region src/assets/info-circle.tsx
|
|
2730
2698
|
const InfoCircle = (props) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
|
|
@@ -2761,8 +2729,6 @@ const InfoCircle = (props) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg",
|
|
|
2761
2729
|
})
|
|
2762
2730
|
]
|
|
2763
2731
|
});
|
|
2764
|
-
var info_circle_default = InfoCircle;
|
|
2765
|
-
|
|
2766
2732
|
//#endregion
|
|
2767
2733
|
//#region src/hooks/useDebounce.ts
|
|
2768
2734
|
function useDebounce(value, delay = 500) {
|
|
@@ -2777,7 +2743,6 @@ function useDebounce(value, delay = 500) {
|
|
|
2777
2743
|
}, [value, delay]);
|
|
2778
2744
|
return debouncedValue;
|
|
2779
2745
|
}
|
|
2780
|
-
|
|
2781
2746
|
//#endregion
|
|
2782
2747
|
//#region src/view/components/ApiPage/components/AddParameterDrawer.tsx
|
|
2783
2748
|
const PARAM_IN_OPTIONS = [
|
|
@@ -2823,16 +2788,16 @@ const PARAM_TYPE_OPTIONS = [
|
|
|
2823
2788
|
const AddParameterDrawer = ({ open, onClose, onAdd, onEdit, mode = "add", initialValues }) => {
|
|
2824
2789
|
const [form] = antd.Form.useForm();
|
|
2825
2790
|
const [messageApi, contextHolder] = antd.message.useMessage();
|
|
2826
|
-
const [confirmModalOpen, setConfirmModalOpen] = (0, react.useState)(false);
|
|
2827
|
-
const [paramName, setParamName] = (0, react.useState)("");
|
|
2828
|
-
const [enumInput, setEnumInput] = (0, react.useState)("");
|
|
2829
|
-
const [enumValues, setEnumValues] = (0, react.useState)([]);
|
|
2791
|
+
const [confirmModalOpen, setConfirmModalOpen] = (0, react$1.useState)(false);
|
|
2792
|
+
const [paramName, setParamName] = (0, react$1.useState)("");
|
|
2793
|
+
const [enumInput, setEnumInput] = (0, react$1.useState)("");
|
|
2794
|
+
const [enumValues, setEnumValues] = (0, react$1.useState)([]);
|
|
2830
2795
|
const nameValue = antd.Form.useWatch("name", form);
|
|
2831
2796
|
const inValue = antd.Form.useWatch("in", form);
|
|
2832
2797
|
const typeValue = antd.Form.useWatch("type", form);
|
|
2833
2798
|
const requiredValue = antd.Form.useWatch("required", form);
|
|
2834
|
-
const [hasChanges, setHasChanges] = (0, react.useState)(false);
|
|
2835
|
-
(0, react.useEffect)(() => {
|
|
2799
|
+
const [hasChanges, setHasChanges] = (0, react$1.useState)(false);
|
|
2800
|
+
(0, react$1.useEffect)(() => {
|
|
2836
2801
|
if (open) {
|
|
2837
2802
|
if (mode === "edit" && initialValues) {
|
|
2838
2803
|
form.setFieldsValue({
|
|
@@ -2851,11 +2816,11 @@ const AddParameterDrawer = ({ open, onClose, onAdd, onEdit, mode = "add", initia
|
|
|
2851
2816
|
setHasChanges(false);
|
|
2852
2817
|
}
|
|
2853
2818
|
}, [open]);
|
|
2854
|
-
const { wrapSSR, cx, token
|
|
2819
|
+
const { wrapSSR, cx, token } = useStyle("AddParameterDrawer", (token, scope) => ({
|
|
2855
2820
|
[scope("title")]: {
|
|
2856
2821
|
fontSize: 16,
|
|
2857
2822
|
fontWeight: 600,
|
|
2858
|
-
color: token
|
|
2823
|
+
color: token.colorTextBase,
|
|
2859
2824
|
lineHeight: "24px",
|
|
2860
2825
|
fontFamily: "Cairo SemiBold, Cairo, sans-serif"
|
|
2861
2826
|
},
|
|
@@ -2866,21 +2831,21 @@ const AddParameterDrawer = ({ open, onClose, onAdd, onEdit, mode = "add", initia
|
|
|
2866
2831
|
"& .ant-form-item": { marginBottom: 0 }
|
|
2867
2832
|
},
|
|
2868
2833
|
[scope("label")]: {
|
|
2869
|
-
fontSize: token
|
|
2870
|
-
color: token
|
|
2834
|
+
fontSize: token.fontSize,
|
|
2835
|
+
color: token.colorText
|
|
2871
2836
|
},
|
|
2872
2837
|
[scope("asterisk")]: {
|
|
2873
|
-
color: token
|
|
2838
|
+
color: token.colorError,
|
|
2874
2839
|
marginLeft: 2
|
|
2875
2840
|
},
|
|
2876
2841
|
[scope("label-optional")]: {
|
|
2877
|
-
color: token
|
|
2842
|
+
color: token.colorTextTertiary,
|
|
2878
2843
|
marginLeft: 4,
|
|
2879
|
-
fontSize: token
|
|
2844
|
+
fontSize: token.fontSize
|
|
2880
2845
|
},
|
|
2881
2846
|
[scope("label-secondary")]: {
|
|
2882
|
-
fontSize: token
|
|
2883
|
-
color: token
|
|
2847
|
+
fontSize: token.fontSize,
|
|
2848
|
+
color: token.colorTextSecondary
|
|
2884
2849
|
},
|
|
2885
2850
|
[scope("switch-row")]: {
|
|
2886
2851
|
display: "flex",
|
|
@@ -2888,8 +2853,8 @@ const AddParameterDrawer = ({ open, onClose, onAdd, onEdit, mode = "add", initia
|
|
|
2888
2853
|
gap: 8
|
|
2889
2854
|
},
|
|
2890
2855
|
[scope("switch-label")]: {
|
|
2891
|
-
fontSize: token
|
|
2892
|
-
color: token
|
|
2856
|
+
fontSize: token.fontSize,
|
|
2857
|
+
color: token.colorText
|
|
2893
2858
|
},
|
|
2894
2859
|
[scope("enum-input-row")]: {
|
|
2895
2860
|
display: "flex",
|
|
@@ -2904,27 +2869,27 @@ const AddParameterDrawer = ({ open, onClose, onAdd, onEdit, mode = "add", initia
|
|
|
2904
2869
|
width: 32,
|
|
2905
2870
|
height: 32,
|
|
2906
2871
|
flexShrink: 0,
|
|
2907
|
-
borderColor: token
|
|
2908
|
-
color: token
|
|
2872
|
+
borderColor: token.colorPrimary,
|
|
2873
|
+
color: token.colorPrimary,
|
|
2909
2874
|
padding: 0,
|
|
2910
2875
|
display: "flex",
|
|
2911
2876
|
alignItems: "center",
|
|
2912
2877
|
justifyContent: "center",
|
|
2913
2878
|
"&:hover": {
|
|
2914
|
-
borderColor: `${token
|
|
2915
|
-
color: `${token
|
|
2879
|
+
borderColor: `${token.colorPrimary} !important`,
|
|
2880
|
+
color: `${token.colorPrimary} !important`
|
|
2916
2881
|
}
|
|
2917
2882
|
},
|
|
2918
2883
|
[scope("enum-list")]: {
|
|
2919
2884
|
display: "flex",
|
|
2920
2885
|
flexDirection: "column",
|
|
2921
|
-
gap: token
|
|
2922
|
-
marginTop: token
|
|
2886
|
+
gap: token.marginXS,
|
|
2887
|
+
marginTop: token.marginXS
|
|
2923
2888
|
},
|
|
2924
2889
|
[scope("enum-value-row")]: {
|
|
2925
2890
|
display: "flex",
|
|
2926
2891
|
alignItems: "center",
|
|
2927
|
-
gap: token
|
|
2892
|
+
gap: token.marginXS
|
|
2928
2893
|
},
|
|
2929
2894
|
[scope("enum-value-input-wrap")]: {
|
|
2930
2895
|
flex: 1,
|
|
@@ -2933,10 +2898,10 @@ const AddParameterDrawer = ({ open, onClose, onAdd, onEdit, mode = "add", initia
|
|
|
2933
2898
|
[scope("enum-value-input")]: {
|
|
2934
2899
|
height: 32,
|
|
2935
2900
|
fontSize: 14,
|
|
2936
|
-
color: token
|
|
2937
|
-
background: token
|
|
2938
|
-
border: `1px solid ${token
|
|
2939
|
-
borderRadius: token
|
|
2901
|
+
color: token.colorText,
|
|
2902
|
+
background: token.colorBgBase,
|
|
2903
|
+
border: `1px solid ${token.colorBorder}`,
|
|
2904
|
+
borderRadius: token.borderRadius,
|
|
2940
2905
|
cursor: "default",
|
|
2941
2906
|
width: "100%"
|
|
2942
2907
|
},
|
|
@@ -2948,7 +2913,7 @@ const AddParameterDrawer = ({ open, onClose, onAdd, onEdit, mode = "add", initia
|
|
|
2948
2913
|
display: "flex",
|
|
2949
2914
|
alignItems: "center",
|
|
2950
2915
|
justifyContent: "center",
|
|
2951
|
-
borderRadius: token
|
|
2916
|
+
borderRadius: token.borderRadius
|
|
2952
2917
|
},
|
|
2953
2918
|
[scope("footer")]: {
|
|
2954
2919
|
display: "flex",
|
|
@@ -2985,7 +2950,7 @@ const AddParameterDrawer = ({ open, onClose, onAdd, onEdit, mode = "add", initia
|
|
|
2985
2950
|
fontSize: 16,
|
|
2986
2951
|
fontWeight: 400,
|
|
2987
2952
|
lineHeight: "24px",
|
|
2988
|
-
color: token
|
|
2953
|
+
color: token.colorText
|
|
2989
2954
|
},
|
|
2990
2955
|
[scope("modalCloseBtn")]: {
|
|
2991
2956
|
position: "absolute",
|
|
@@ -3001,12 +2966,12 @@ const AddParameterDrawer = ({ open, onClose, onAdd, onEdit, mode = "add", initia
|
|
|
3001
2966
|
border: "none",
|
|
3002
2967
|
background: "transparent",
|
|
3003
2968
|
padding: 0,
|
|
3004
|
-
color: token
|
|
2969
|
+
color: token.colorTextTertiary,
|
|
3005
2970
|
fontSize: 16,
|
|
3006
2971
|
lineHeight: 1,
|
|
3007
2972
|
"&:hover": {
|
|
3008
|
-
color: token
|
|
3009
|
-
backgroundColor: token
|
|
2973
|
+
color: token.colorText,
|
|
2974
|
+
backgroundColor: token.colorFillSecondary
|
|
3010
2975
|
}
|
|
3011
2976
|
},
|
|
3012
2977
|
[scope("modalContent")]: {
|
|
@@ -3023,7 +2988,7 @@ const AddParameterDrawer = ({ open, onClose, onAdd, onEdit, mode = "add", initia
|
|
|
3023
2988
|
fontSize: 14,
|
|
3024
2989
|
fontWeight: 400,
|
|
3025
2990
|
lineHeight: "22px",
|
|
3026
|
-
color: token
|
|
2991
|
+
color: token.colorText
|
|
3027
2992
|
},
|
|
3028
2993
|
[scope("modalFooter")]: {
|
|
3029
2994
|
display: "flex",
|
|
@@ -3108,14 +3073,14 @@ const AddParameterDrawer = ({ open, onClose, onAdd, onEdit, mode = "add", initia
|
|
|
3108
3073
|
styles: {
|
|
3109
3074
|
header: {
|
|
3110
3075
|
padding: "16px 24px",
|
|
3111
|
-
borderBottom: `1px solid ${token
|
|
3112
|
-
background: token
|
|
3076
|
+
borderBottom: `1px solid ${token.colorFillSecondary}`,
|
|
3077
|
+
background: token.colorBgBase
|
|
3113
3078
|
},
|
|
3114
3079
|
body: { padding: "24px" },
|
|
3115
3080
|
footer: {
|
|
3116
3081
|
padding: "24px",
|
|
3117
|
-
background: token
|
|
3118
|
-
borderTop: `1px solid ${token
|
|
3082
|
+
background: token.colorPrimaryBg,
|
|
3083
|
+
borderTop: `1px solid ${token.colorFillSecondary}`
|
|
3119
3084
|
}
|
|
3120
3085
|
},
|
|
3121
3086
|
footer: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
@@ -3128,7 +3093,7 @@ const AddParameterDrawer = ({ open, onClose, onAdd, onEdit, mode = "add", initia
|
|
|
3128
3093
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(antd.Button, {
|
|
3129
3094
|
size: "large",
|
|
3130
3095
|
type: "primary",
|
|
3131
|
-
icon: mode === "edit" ? void 0 : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
3096
|
+
icon: mode === "edit" ? void 0 : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_ant_design_icons.PlusOutlined, {}),
|
|
3132
3097
|
className: cx("footer-btn"),
|
|
3133
3098
|
disabled: !isAddEnabled,
|
|
3134
3099
|
onClick: handleAddClick,
|
|
@@ -3219,7 +3184,7 @@ const AddParameterDrawer = ({ open, onClose, onAdd, onEdit, mode = "add", initia
|
|
|
3219
3184
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(antd.Switch, {
|
|
3220
3185
|
checked: requiredValue ?? true,
|
|
3221
3186
|
onChange: (checked) => form.setFieldValue("required", checked),
|
|
3222
|
-
style: { backgroundColor: requiredValue ?? true ? token
|
|
3187
|
+
style: { backgroundColor: requiredValue ?? true ? token.colorPrimary : void 0 }
|
|
3223
3188
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
3224
3189
|
className: cx("switch-label"),
|
|
3225
3190
|
children: "Required?"
|
|
@@ -3268,7 +3233,7 @@ const AddParameterDrawer = ({ open, onClose, onAdd, onEdit, mode = "add", initia
|
|
|
3268
3233
|
})
|
|
3269
3234
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(antd.Button, {
|
|
3270
3235
|
ghost: true,
|
|
3271
|
-
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
3236
|
+
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_ant_design_icons.PlusOutlined, {}),
|
|
3272
3237
|
className: cx("enum-add-btn"),
|
|
3273
3238
|
onClick: handleAddEnumValue,
|
|
3274
3239
|
disabled: !enumInput.trim()
|
|
@@ -3287,7 +3252,7 @@ const AddParameterDrawer = ({ open, onClose, onAdd, onEdit, mode = "add", initia
|
|
|
3287
3252
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(antd.Button, {
|
|
3288
3253
|
danger: true,
|
|
3289
3254
|
type: "text",
|
|
3290
|
-
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
3255
|
+
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Trash, {
|
|
3291
3256
|
width: 32,
|
|
3292
3257
|
height: 32
|
|
3293
3258
|
}),
|
|
@@ -3360,9 +3325,9 @@ const AddParameterDrawer = ({ open, onClose, onAdd, onEdit, mode = "add", initia
|
|
|
3360
3325
|
borderRadius: 8,
|
|
3361
3326
|
height: 32,
|
|
3362
3327
|
paddingInline: 16,
|
|
3363
|
-
backgroundColor: token
|
|
3364
|
-
borderColor: token
|
|
3365
|
-
boxShadow: `0px 2px 0px ${token
|
|
3328
|
+
backgroundColor: token.colorPrimary,
|
|
3329
|
+
borderColor: token.colorPrimary,
|
|
3330
|
+
boxShadow: `0px 2px 0px ${token.colorPrimaryBg}`
|
|
3366
3331
|
},
|
|
3367
3332
|
children: mode === "edit" ? "Yes, Edit" : "Yes, Add"
|
|
3368
3333
|
})]
|
|
@@ -3371,20 +3336,19 @@ const AddParameterDrawer = ({ open, onClose, onAdd, onEdit, mode = "add", initia
|
|
|
3371
3336
|
})
|
|
3372
3337
|
] }));
|
|
3373
3338
|
};
|
|
3374
|
-
|
|
3375
3339
|
//#endregion
|
|
3376
3340
|
//#region src/view/components/ApiPage/components/EndpointsSection.tsx
|
|
3377
3341
|
const { useBreakpoint: useBreakpoint$1 } = antd.Grid;
|
|
3378
3342
|
const PAGE_SIZE = 5;
|
|
3379
|
-
const getStatusCodeColor = (code, token
|
|
3343
|
+
const getStatusCodeColor = (code, token) => {
|
|
3380
3344
|
const n = parseInt(code, 10);
|
|
3381
3345
|
if (n >= 400 && n < 500) return {
|
|
3382
|
-
dot: token
|
|
3383
|
-
text: token
|
|
3346
|
+
dot: token.colorError,
|
|
3347
|
+
text: token.colorError
|
|
3384
3348
|
};
|
|
3385
3349
|
return {
|
|
3386
|
-
dot: token
|
|
3387
|
-
text: token
|
|
3350
|
+
dot: token.colorSuccess,
|
|
3351
|
+
text: token.colorText
|
|
3388
3352
|
};
|
|
3389
3353
|
};
|
|
3390
3354
|
const buildViewParamRows = (params) => params.map((p, idx) => ({
|
|
@@ -3396,28 +3360,28 @@ const buildViewParamRows = (params) => params.map((p, idx) => ({
|
|
|
3396
3360
|
enum: p.enum ?? []
|
|
3397
3361
|
}));
|
|
3398
3362
|
const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse, endpointNames, endpointDescs, endpointTags, availableTags, onEndpointNameChange, onEndpointDescChange, onEndpointTagsChange, endpointParams, onAddParameter, onEditParameter, onDeleteParameter, endpointResponseParams, onAddResponseParameter, onEditResponseParameter, onDeleteResponseParameter, mode = "edit" }) => {
|
|
3399
|
-
const [expandedId, setExpandedId] = (0, react.useState)(null);
|
|
3400
|
-
const [paramDrawerOpen, setParamDrawerOpen] = (0, react.useState)(false);
|
|
3401
|
-
const [paramDrawerEndpointId, setParamDrawerEndpointId] = (0, react.useState)(null);
|
|
3402
|
-
const [paramDrawerMode, setParamDrawerMode] = (0, react.useState)("add");
|
|
3403
|
-
const [editParamIdx, setEditParamIdx] = (0, react.useState)(null);
|
|
3404
|
-
const [deleteParamModal, setDeleteParamModal] = (0, react.useState)({
|
|
3363
|
+
const [expandedId, setExpandedId] = (0, react$1.useState)(null);
|
|
3364
|
+
const [paramDrawerOpen, setParamDrawerOpen] = (0, react$1.useState)(false);
|
|
3365
|
+
const [paramDrawerEndpointId, setParamDrawerEndpointId] = (0, react$1.useState)(null);
|
|
3366
|
+
const [paramDrawerMode, setParamDrawerMode] = (0, react$1.useState)("add");
|
|
3367
|
+
const [editParamIdx, setEditParamIdx] = (0, react$1.useState)(null);
|
|
3368
|
+
const [deleteParamModal, setDeleteParamModal] = (0, react$1.useState)({
|
|
3405
3369
|
open: false,
|
|
3406
3370
|
endpointId: "",
|
|
3407
3371
|
idx: -1,
|
|
3408
3372
|
name: "",
|
|
3409
3373
|
source: "request"
|
|
3410
3374
|
});
|
|
3411
|
-
const [openRequestPanels, setOpenRequestPanels] = (0, react.useState)(/* @__PURE__ */ new Set());
|
|
3412
|
-
const [openResponsePanels, setOpenResponsePanels] = (0, react.useState)(/* @__PURE__ */ new Set());
|
|
3413
|
-
const [selectedStatusCodes, setSelectedStatusCodes] = (0, react.useState)({});
|
|
3414
|
-
const [drawerSource, setDrawerSource] = (0, react.useState)("request");
|
|
3415
|
-
const [requestPages, setRequestPages] = (0, react.useState)(/* @__PURE__ */ new Map());
|
|
3416
|
-
const [responsePages, setResponsePages] = (0, react.useState)(/* @__PURE__ */ new Map());
|
|
3417
|
-
const [requestSearches, setRequestSearches] = (0, react.useState)({});
|
|
3418
|
-
const [responseSearches, setResponseSearches] = (0, react.useState)({});
|
|
3419
|
-
const [showRequestSearch, setShowRequestSearch] = (0, react.useState)({});
|
|
3420
|
-
const [showResponseSearch, setShowResponseSearch] = (0, react.useState)({});
|
|
3375
|
+
const [openRequestPanels, setOpenRequestPanels] = (0, react$1.useState)(/* @__PURE__ */ new Set());
|
|
3376
|
+
const [openResponsePanels, setOpenResponsePanels] = (0, react$1.useState)(/* @__PURE__ */ new Set());
|
|
3377
|
+
const [selectedStatusCodes, setSelectedStatusCodes] = (0, react$1.useState)({});
|
|
3378
|
+
const [drawerSource, setDrawerSource] = (0, react$1.useState)("request");
|
|
3379
|
+
const [requestPages, setRequestPages] = (0, react$1.useState)(/* @__PURE__ */ new Map());
|
|
3380
|
+
const [responsePages, setResponsePages] = (0, react$1.useState)(/* @__PURE__ */ new Map());
|
|
3381
|
+
const [requestSearches, setRequestSearches] = (0, react$1.useState)({});
|
|
3382
|
+
const [responseSearches, setResponseSearches] = (0, react$1.useState)({});
|
|
3383
|
+
const [showRequestSearch, setShowRequestSearch] = (0, react$1.useState)({});
|
|
3384
|
+
const [showResponseSearch, setShowResponseSearch] = (0, react$1.useState)({});
|
|
3421
3385
|
const debouncedRequestSearches = useDebounce(requestSearches);
|
|
3422
3386
|
const debouncedResponseSearches = useDebounce(responseSearches);
|
|
3423
3387
|
const { selectNodeByKey } = useNodeSelection();
|
|
@@ -3439,11 +3403,11 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
|
|
|
3439
3403
|
return next;
|
|
3440
3404
|
});
|
|
3441
3405
|
};
|
|
3442
|
-
const { wrapSSR, cx, token
|
|
3406
|
+
const { wrapSSR, cx, token } = useStyle("EndpointsSection", (token, scope) => ({
|
|
3443
3407
|
[scope("root")]: {
|
|
3444
3408
|
display: "flex",
|
|
3445
3409
|
flexDirection: "column",
|
|
3446
|
-
borderRadius: token
|
|
3410
|
+
borderRadius: token.borderRadius,
|
|
3447
3411
|
overflow: "hidden",
|
|
3448
3412
|
width: "100%",
|
|
3449
3413
|
flexShrink: 0
|
|
@@ -3452,28 +3416,28 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
|
|
|
3452
3416
|
display: "flex",
|
|
3453
3417
|
alignItems: "center",
|
|
3454
3418
|
justifyContent: "space-between",
|
|
3455
|
-
padding: `${token
|
|
3456
|
-
background: token
|
|
3457
|
-
borderRadius: `${token
|
|
3419
|
+
padding: `${token.paddingXS}px ${token.paddingLG}px`,
|
|
3420
|
+
background: token.colorPrimaryBg,
|
|
3421
|
+
borderRadius: `${token.borderRadius}px ${token.borderRadius}px 0 0`
|
|
3458
3422
|
},
|
|
3459
3423
|
[scope("body")]: {
|
|
3460
3424
|
display: "flex",
|
|
3461
3425
|
flexDirection: "column",
|
|
3462
|
-
gap: token
|
|
3463
|
-
padding: token
|
|
3464
|
-
background: token
|
|
3465
|
-
borderRadius: `0 0 ${token
|
|
3426
|
+
gap: token.margin,
|
|
3427
|
+
padding: token.paddingLG,
|
|
3428
|
+
background: token.colorBgElevated,
|
|
3429
|
+
borderRadius: `0 0 ${token.borderRadius}px ${token.borderRadius}px`
|
|
3466
3430
|
},
|
|
3467
3431
|
[scope("tag-title")]: {
|
|
3468
|
-
fontSize: token
|
|
3432
|
+
fontSize: token.fontSize,
|
|
3469
3433
|
fontWeight: 600,
|
|
3470
|
-
color: token
|
|
3471
|
-
marginBottom: token
|
|
3434
|
+
color: token.colorTextSecondary,
|
|
3435
|
+
marginBottom: token.marginXS
|
|
3472
3436
|
},
|
|
3473
3437
|
[scope("endpoint-row")]: {
|
|
3474
3438
|
display: "flex",
|
|
3475
3439
|
alignItems: "center",
|
|
3476
|
-
gap: token
|
|
3440
|
+
gap: token.marginSM,
|
|
3477
3441
|
width: "100%"
|
|
3478
3442
|
},
|
|
3479
3443
|
[scope("endpoint-card")]: {
|
|
@@ -3481,34 +3445,34 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
|
|
|
3481
3445
|
flex: "1 0 0",
|
|
3482
3446
|
alignItems: "center",
|
|
3483
3447
|
gap: 14,
|
|
3484
|
-
padding: `${token
|
|
3485
|
-
background: token
|
|
3486
|
-
borderRadius: token
|
|
3448
|
+
padding: `${token.paddingXS}px ${token.padding}px`,
|
|
3449
|
+
background: token.colorFillSecondary,
|
|
3450
|
+
borderRadius: token.borderRadius,
|
|
3487
3451
|
cursor: "pointer",
|
|
3488
3452
|
overflow: "hidden"
|
|
3489
3453
|
},
|
|
3490
3454
|
[scope("endpoint-card-active")]: {
|
|
3491
3455
|
background: "transparent",
|
|
3492
|
-
border: `1px solid ${token
|
|
3456
|
+
border: `1px solid ${token.colorPrimaryBorder}`
|
|
3493
3457
|
},
|
|
3494
3458
|
[scope("method-badge")]: {
|
|
3495
3459
|
display: "flex",
|
|
3496
3460
|
alignItems: "center",
|
|
3497
3461
|
justifyContent: "center",
|
|
3498
3462
|
width: 64,
|
|
3499
|
-
padding: `0 ${token
|
|
3500
|
-
borderRadius: token
|
|
3463
|
+
padding: `0 ${token.paddingXS}px`,
|
|
3464
|
+
borderRadius: token.borderRadius,
|
|
3501
3465
|
border: "1px solid",
|
|
3502
|
-
fontSize: token
|
|
3466
|
+
fontSize: token.fontSize,
|
|
3503
3467
|
fontWeight: 400,
|
|
3504
3468
|
lineHeight: "22px",
|
|
3505
3469
|
whiteSpace: "nowrap",
|
|
3506
3470
|
alignSelf: "stretch"
|
|
3507
3471
|
},
|
|
3508
3472
|
[scope("endpoint-path")]: {
|
|
3509
|
-
fontSize: token
|
|
3473
|
+
fontSize: token.fontSizeLG,
|
|
3510
3474
|
fontWeight: 600,
|
|
3511
|
-
color: token
|
|
3475
|
+
color: token.colorTextHeading,
|
|
3512
3476
|
lineHeight: "24px",
|
|
3513
3477
|
overflow: "hidden",
|
|
3514
3478
|
textOverflow: "ellipsis",
|
|
@@ -3517,12 +3481,12 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
|
|
|
3517
3481
|
[scope("endpoint-form")]: {
|
|
3518
3482
|
display: "flex",
|
|
3519
3483
|
flexDirection: "column",
|
|
3520
|
-
gap: token
|
|
3521
|
-
padding: token
|
|
3522
|
-
borderLeft: `3px solid ${token
|
|
3523
|
-
borderRight: `3px solid ${token
|
|
3524
|
-
borderBottom: `3px solid ${token
|
|
3525
|
-
borderRadius: `0 0 ${token
|
|
3484
|
+
gap: token.paddingLG,
|
|
3485
|
+
padding: token.paddingLG,
|
|
3486
|
+
borderLeft: `3px solid ${token.colorPrimaryBorder}`,
|
|
3487
|
+
borderRight: `3px solid ${token.colorPrimaryBorder}`,
|
|
3488
|
+
borderBottom: `3px solid ${token.colorPrimaryBorder}`,
|
|
3489
|
+
borderRadius: `0 0 ${token.borderRadius}px ${token.borderRadius}px`
|
|
3526
3490
|
},
|
|
3527
3491
|
[scope("form-row")]: {
|
|
3528
3492
|
display: "flex",
|
|
@@ -3538,41 +3502,41 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
|
|
|
3538
3502
|
[scope("field-label")]: {
|
|
3539
3503
|
display: "flex",
|
|
3540
3504
|
alignItems: "center",
|
|
3541
|
-
gap: token
|
|
3542
|
-
fontSize: token
|
|
3505
|
+
gap: token.marginXXS,
|
|
3506
|
+
fontSize: token.fontSize,
|
|
3543
3507
|
fontWeight: 400,
|
|
3544
|
-
color: token
|
|
3545
|
-
paddingBottom: token
|
|
3508
|
+
color: token.colorText,
|
|
3509
|
+
paddingBottom: token.paddingXS,
|
|
3546
3510
|
lineHeight: "22px"
|
|
3547
3511
|
},
|
|
3548
|
-
[scope("label-required")]: { color: token
|
|
3549
|
-
[scope("label-optional")]: { color: token
|
|
3512
|
+
[scope("label-required")]: { color: token.colorError },
|
|
3513
|
+
[scope("label-optional")]: { color: token.colorTextDescription },
|
|
3550
3514
|
[scope("section-header")]: {
|
|
3551
3515
|
display: "flex",
|
|
3552
3516
|
alignItems: "center",
|
|
3553
3517
|
justifyContent: "space-between",
|
|
3554
|
-
paddingBottom: token
|
|
3555
|
-
borderBottom: `1px solid ${token
|
|
3518
|
+
paddingBottom: token.marginXXS,
|
|
3519
|
+
borderBottom: `1px solid ${token.colorBorder}`,
|
|
3556
3520
|
width: "100%"
|
|
3557
3521
|
},
|
|
3558
3522
|
[scope("section-title")]: {
|
|
3559
|
-
fontSize: token
|
|
3523
|
+
fontSize: token.fontSizeLG,
|
|
3560
3524
|
fontWeight: 600,
|
|
3561
|
-
color: token
|
|
3525
|
+
color: token.colorPrimary,
|
|
3562
3526
|
lineHeight: "24px"
|
|
3563
3527
|
},
|
|
3564
3528
|
[scope("param-row")]: {
|
|
3565
3529
|
display: "flex",
|
|
3566
3530
|
alignItems: "center",
|
|
3567
|
-
gap: token
|
|
3568
|
-
padding: `${token
|
|
3569
|
-
border: `1px solid ${token
|
|
3570
|
-
borderRadius: token
|
|
3571
|
-
background: token
|
|
3531
|
+
gap: token.marginXS,
|
|
3532
|
+
padding: `${token.marginXXS}px ${token.marginSM}px`,
|
|
3533
|
+
border: `1px solid ${token.colorBorder}`,
|
|
3534
|
+
borderRadius: token.borderRadius,
|
|
3535
|
+
background: token.colorBgContainer,
|
|
3572
3536
|
width: "100%",
|
|
3573
3537
|
cursor: "pointer",
|
|
3574
3538
|
userSelect: "none",
|
|
3575
|
-
"&:hover": { background: token
|
|
3539
|
+
"&:hover": { background: token.colorFillTertiary }
|
|
3576
3540
|
},
|
|
3577
3541
|
[scope("param-row-icon")]: {
|
|
3578
3542
|
fontSize: 12,
|
|
@@ -3589,7 +3553,7 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
|
|
|
3589
3553
|
fontFamily: "Cairo, sans-serif",
|
|
3590
3554
|
fontSize: 14,
|
|
3591
3555
|
lineHeight: "20px",
|
|
3592
|
-
color: token
|
|
3556
|
+
color: token.colorTextLightSolid,
|
|
3593
3557
|
width: "100%",
|
|
3594
3558
|
whiteSpace: "pre",
|
|
3595
3559
|
overflowX: "auto",
|
|
@@ -3605,7 +3569,7 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
|
|
|
3605
3569
|
},
|
|
3606
3570
|
[scope("code-btn")]: {
|
|
3607
3571
|
borderColor: "#fff",
|
|
3608
|
-
color: token
|
|
3572
|
+
color: token.colorTextLightSolid,
|
|
3609
3573
|
"&:hover": {
|
|
3610
3574
|
borderColor: "#fff !important",
|
|
3611
3575
|
color: "#fff !important",
|
|
@@ -3623,8 +3587,8 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
|
|
|
3623
3587
|
justifyContent: "space-between",
|
|
3624
3588
|
width: "100%",
|
|
3625
3589
|
padding: `12px 24px`,
|
|
3626
|
-
borderBottom: `1px solid ${token
|
|
3627
|
-
background: token
|
|
3590
|
+
borderBottom: `1px solid ${token.colorBorderSecondary}`,
|
|
3591
|
+
background: token.colorBgContainer,
|
|
3628
3592
|
"&:last-child": { borderBottom: "none" }
|
|
3629
3593
|
},
|
|
3630
3594
|
[scope("param-details")]: {
|
|
@@ -3642,12 +3606,12 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
|
|
|
3642
3606
|
[scope("param-detail-label")]: {
|
|
3643
3607
|
fontFamily: "Cairo SemiBold, Cairo, sans-serif",
|
|
3644
3608
|
fontSize: 16,
|
|
3645
|
-
color: token
|
|
3609
|
+
color: token.colorTextSecondary
|
|
3646
3610
|
},
|
|
3647
3611
|
[scope("param-detail-value")]: {
|
|
3648
3612
|
fontFamily: "Cairo, sans-serif",
|
|
3649
3613
|
fontSize: 16,
|
|
3650
|
-
color: token
|
|
3614
|
+
color: token.colorText
|
|
3651
3615
|
},
|
|
3652
3616
|
[scope("param-detail-value--ellipsis")]: {
|
|
3653
3617
|
overflow: "hidden",
|
|
@@ -3666,13 +3630,13 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
|
|
|
3666
3630
|
display: "inline-flex",
|
|
3667
3631
|
alignItems: "center",
|
|
3668
3632
|
verticalAlign: "middle",
|
|
3669
|
-
background: token
|
|
3670
|
-
border: `1px solid ${token
|
|
3633
|
+
background: token.colorBgContainer,
|
|
3634
|
+
border: `1px solid ${token.colorBorder}`,
|
|
3671
3635
|
borderRadius: 6,
|
|
3672
3636
|
padding: "1px 8px",
|
|
3673
3637
|
fontSize: 12,
|
|
3674
3638
|
lineHeight: "20px",
|
|
3675
|
-
color: token
|
|
3639
|
+
color: token.colorText,
|
|
3676
3640
|
fontFamily: "Cairo, sans-serif",
|
|
3677
3641
|
margin: 0
|
|
3678
3642
|
},
|
|
@@ -3684,10 +3648,10 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
|
|
|
3684
3648
|
width: 20,
|
|
3685
3649
|
height: 20,
|
|
3686
3650
|
borderRadius: "50%",
|
|
3687
|
-
border: `1px solid ${token
|
|
3651
|
+
border: `1px solid ${token.colorBorder}`,
|
|
3688
3652
|
background: "white",
|
|
3689
3653
|
fontSize: 12,
|
|
3690
|
-
color: token
|
|
3654
|
+
color: token.colorText,
|
|
3691
3655
|
cursor: "default"
|
|
3692
3656
|
},
|
|
3693
3657
|
[scope("enum-tooltip-list")]: {
|
|
@@ -3695,7 +3659,7 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
|
|
|
3695
3659
|
padding: "0 0 0 16px",
|
|
3696
3660
|
fontSize: 14,
|
|
3697
3661
|
lineHeight: "22px",
|
|
3698
|
-
color: token
|
|
3662
|
+
color: token.colorTextLightSolid,
|
|
3699
3663
|
fontFamily: "Cairo, sans-serif"
|
|
3700
3664
|
},
|
|
3701
3665
|
[scope("status-label")]: {
|
|
@@ -3746,7 +3710,7 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
|
|
|
3746
3710
|
alignItems: "center",
|
|
3747
3711
|
gap: 8
|
|
3748
3712
|
},
|
|
3749
|
-
"& .ant-select-item-option-selected": { background: `${token
|
|
3713
|
+
"& .ant-select-item-option-selected": { background: `${token.colorPrimaryBg} !important` }
|
|
3750
3714
|
},
|
|
3751
3715
|
[scope("param-actions")]: {
|
|
3752
3716
|
display: "flex",
|
|
@@ -3759,11 +3723,11 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
|
|
|
3759
3723
|
display: "flex",
|
|
3760
3724
|
alignItems: "center",
|
|
3761
3725
|
justifyContent: "center",
|
|
3762
|
-
borderColor: token
|
|
3763
|
-
color: token
|
|
3726
|
+
borderColor: token.colorPrimary,
|
|
3727
|
+
color: token.colorPrimary,
|
|
3764
3728
|
"&:hover": {
|
|
3765
|
-
borderColor: `${token
|
|
3766
|
-
color: `${token
|
|
3729
|
+
borderColor: `${token.colorPrimary} !important`,
|
|
3730
|
+
color: `${token.colorPrimary} !important`
|
|
3767
3731
|
}
|
|
3768
3732
|
},
|
|
3769
3733
|
[scope("param-delete-btn")]: {
|
|
@@ -3793,7 +3757,7 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
|
|
|
3793
3757
|
fontSize: 16,
|
|
3794
3758
|
fontWeight: 400,
|
|
3795
3759
|
lineHeight: "24px",
|
|
3796
|
-
color: token
|
|
3760
|
+
color: token.colorText
|
|
3797
3761
|
},
|
|
3798
3762
|
[scope("deleteModalCloseBtn")]: {
|
|
3799
3763
|
position: "absolute",
|
|
@@ -3809,12 +3773,12 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
|
|
|
3809
3773
|
border: "none",
|
|
3810
3774
|
background: "transparent",
|
|
3811
3775
|
padding: 0,
|
|
3812
|
-
color: token
|
|
3776
|
+
color: token.colorTextSecondary,
|
|
3813
3777
|
fontSize: 16,
|
|
3814
3778
|
lineHeight: 1,
|
|
3815
3779
|
"&:hover": {
|
|
3816
|
-
color: token
|
|
3817
|
-
backgroundColor: token
|
|
3780
|
+
color: token.colorText,
|
|
3781
|
+
backgroundColor: token.colorFillSecondary
|
|
3818
3782
|
}
|
|
3819
3783
|
},
|
|
3820
3784
|
[scope("deleteModalContent")]: {
|
|
@@ -3831,7 +3795,7 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
|
|
|
3831
3795
|
fontSize: 14,
|
|
3832
3796
|
fontWeight: 400,
|
|
3833
3797
|
lineHeight: "22px",
|
|
3834
|
-
color: token
|
|
3798
|
+
color: token.colorText
|
|
3835
3799
|
},
|
|
3836
3800
|
[scope("deleteModalFooter")]: {
|
|
3837
3801
|
display: "flex",
|
|
@@ -3849,33 +3813,33 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
|
|
|
3849
3813
|
flexDirection: "column",
|
|
3850
3814
|
gap: 16,
|
|
3851
3815
|
width: "100%",
|
|
3852
|
-
borderLeft: `3px solid ${token
|
|
3853
|
-
borderRight: `3px solid ${token
|
|
3854
|
-
borderBottom: `3px solid ${token
|
|
3855
|
-
borderRadius: `0 0 ${token
|
|
3856
|
-
padding: token
|
|
3816
|
+
borderLeft: `3px solid ${token.colorPrimaryBorder}`,
|
|
3817
|
+
borderRight: `3px solid ${token.colorPrimaryBorder}`,
|
|
3818
|
+
borderBottom: `3px solid ${token.colorPrimaryBorder}`,
|
|
3819
|
+
borderRadius: `0 0 ${token.borderRadius}px ${token.borderRadius}px`,
|
|
3820
|
+
padding: token.paddingLG
|
|
3857
3821
|
},
|
|
3858
3822
|
[scope("view-params-card")]: {
|
|
3859
|
-
border: `1px solid ${token
|
|
3860
|
-
borderRadius: token
|
|
3823
|
+
border: `1px solid ${token.colorBorder}`,
|
|
3824
|
+
borderRadius: token.borderRadius,
|
|
3861
3825
|
display: "flex",
|
|
3862
3826
|
flexDirection: "column",
|
|
3863
|
-
gap: token
|
|
3827
|
+
gap: token.marginSM,
|
|
3864
3828
|
paddingTop: 12,
|
|
3865
3829
|
width: "100%",
|
|
3866
3830
|
overflow: "hidden",
|
|
3867
3831
|
"& .ant-table-thead > tr > th": {
|
|
3868
|
-
background: token
|
|
3832
|
+
background: token.colorFillSecondary,
|
|
3869
3833
|
fontWeight: 700,
|
|
3870
3834
|
fontSize: 14,
|
|
3871
|
-
padding: `${token
|
|
3872
|
-
paddingInline: `${token
|
|
3873
|
-
borderColor: `${token
|
|
3835
|
+
padding: `${token.paddingXS}px`,
|
|
3836
|
+
paddingInline: `${token.paddingXS}px`,
|
|
3837
|
+
borderColor: `${token.colorSplit} !important`
|
|
3874
3838
|
},
|
|
3875
3839
|
"& .ant-table-tbody > tr > td": {
|
|
3876
|
-
padding: `${token
|
|
3877
|
-
paddingInline: `${token
|
|
3878
|
-
borderColor: `${token
|
|
3840
|
+
padding: `${token.paddingXS}px`,
|
|
3841
|
+
paddingInline: `${token.paddingXS}px`,
|
|
3842
|
+
borderColor: `${token.colorBorder} !important`,
|
|
3879
3843
|
height: 38
|
|
3880
3844
|
},
|
|
3881
3845
|
"& .ant-table-container": {
|
|
@@ -3894,30 +3858,30 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
|
|
|
3894
3858
|
[scope("view-params-title")]: {
|
|
3895
3859
|
fontSize: 16,
|
|
3896
3860
|
fontWeight: 600,
|
|
3897
|
-
color: token
|
|
3861
|
+
color: token.colorText
|
|
3898
3862
|
},
|
|
3899
3863
|
[scope("view-status-select-sm")]: { width: 65 },
|
|
3900
3864
|
[scope("view-param-name")]: {
|
|
3901
3865
|
fontSize: 14,
|
|
3902
3866
|
fontWeight: 400,
|
|
3903
|
-
color: token
|
|
3867
|
+
color: token.colorText
|
|
3904
3868
|
},
|
|
3905
3869
|
[scope("view-param-type")]: {
|
|
3906
3870
|
fontFamily: "'Cascadia Code', sans-serif",
|
|
3907
3871
|
fontSize: 12,
|
|
3908
|
-
color: token
|
|
3872
|
+
color: token.colorTextSecondary,
|
|
3909
3873
|
marginLeft: 4,
|
|
3910
3874
|
marginRight: 4
|
|
3911
3875
|
},
|
|
3912
|
-
[scope("view-param-required")]: { color: token
|
|
3876
|
+
[scope("view-param-required")]: { color: token.colorError },
|
|
3913
3877
|
[scope("view-param-optional")]: {
|
|
3914
|
-
color: token
|
|
3878
|
+
color: token.colorSuccess,
|
|
3915
3879
|
fontSize: 12,
|
|
3916
3880
|
marginLeft: 4
|
|
3917
3881
|
},
|
|
3918
3882
|
[scope("view-param-desc")]: {
|
|
3919
3883
|
fontSize: 12,
|
|
3920
|
-
color: token
|
|
3884
|
+
color: token.colorText
|
|
3921
3885
|
},
|
|
3922
3886
|
[scope("view-enum-container")]: {
|
|
3923
3887
|
display: "inline-flex",
|
|
@@ -3926,21 +3890,21 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
|
|
|
3926
3890
|
alignItems: "center"
|
|
3927
3891
|
},
|
|
3928
3892
|
[scope("view-enum-tag")]: {
|
|
3929
|
-
background: token
|
|
3930
|
-
border: `1px solid ${token
|
|
3893
|
+
background: token.colorFillSecondary,
|
|
3894
|
+
border: `1px solid ${token.colorBorder}`,
|
|
3931
3895
|
borderRadius: 4,
|
|
3932
3896
|
padding: "1px 8px",
|
|
3933
3897
|
fontSize: 12,
|
|
3934
3898
|
lineHeight: "20px",
|
|
3935
|
-
color: token
|
|
3899
|
+
color: token.colorText,
|
|
3936
3900
|
margin: 0,
|
|
3937
3901
|
cursor: "default"
|
|
3938
3902
|
},
|
|
3939
|
-
[scope("view-row-odd")]: { "& > td": { background: `${token
|
|
3940
|
-
[scope("view-row-even")]: { "& > td": { background: `${token
|
|
3903
|
+
[scope("view-row-odd")]: { "& > td": { background: `${token.colorBgLayout} !important` } },
|
|
3904
|
+
[scope("view-row-even")]: { "& > td": { background: `${token.colorBgContainer} !important` } },
|
|
3941
3905
|
[scope("empty-wrapper")]: {
|
|
3942
|
-
background: token
|
|
3943
|
-
borderRadius: token
|
|
3906
|
+
background: token.colorBgElevated,
|
|
3907
|
+
borderRadius: token.borderRadius,
|
|
3944
3908
|
paddingTop: 16,
|
|
3945
3909
|
paddingBottom: 16,
|
|
3946
3910
|
gap: 8,
|
|
@@ -3973,25 +3937,25 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
|
|
|
3973
3937
|
[scope("empty-description")]: {
|
|
3974
3938
|
fontSize: 14,
|
|
3975
3939
|
lineHeight: "22px",
|
|
3976
|
-
color: token
|
|
3940
|
+
color: token.colorTextDescription,
|
|
3977
3941
|
textAlign: "center",
|
|
3978
3942
|
fontWeight: 400
|
|
3979
3943
|
},
|
|
3980
3944
|
[scope("pagination")]: {
|
|
3981
3945
|
display: "flex",
|
|
3982
3946
|
justifyContent: "center",
|
|
3983
|
-
marginTop: token
|
|
3947
|
+
marginTop: token.marginMD,
|
|
3984
3948
|
".ant-pagination-item-active": {
|
|
3985
|
-
backgroundColor: token
|
|
3986
|
-
borderColor: token
|
|
3987
|
-
borderRadius: token
|
|
3949
|
+
backgroundColor: token.colorBgContainer,
|
|
3950
|
+
borderColor: token.colorPrimary,
|
|
3951
|
+
borderRadius: token.borderRadius,
|
|
3988
3952
|
display: "flex",
|
|
3989
3953
|
alignItems: "center",
|
|
3990
3954
|
justifyContent: "center",
|
|
3991
3955
|
a: {
|
|
3992
|
-
color: token
|
|
3993
|
-
fontWeight: token
|
|
3994
|
-
fontSize: token
|
|
3956
|
+
color: token.colorPrimary,
|
|
3957
|
+
fontWeight: token.fontWeightStrong,
|
|
3958
|
+
fontSize: token.fontSize,
|
|
3995
3959
|
lineHeight: "22px",
|
|
3996
3960
|
display: "flex",
|
|
3997
3961
|
alignItems: "center",
|
|
@@ -4000,18 +3964,18 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
|
|
|
4000
3964
|
}
|
|
4001
3965
|
},
|
|
4002
3966
|
".ant-pagination-item": {
|
|
4003
|
-
borderRadius: token
|
|
3967
|
+
borderRadius: token.borderRadius,
|
|
4004
3968
|
minWidth: 32,
|
|
4005
3969
|
height: 32,
|
|
4006
3970
|
lineHeight: "32px",
|
|
4007
3971
|
a: {
|
|
4008
|
-
color: token
|
|
3972
|
+
color: token.colorText,
|
|
4009
3973
|
fontWeight: 400,
|
|
4010
|
-
fontSize: token
|
|
3974
|
+
fontSize: token.fontSize
|
|
4011
3975
|
}
|
|
4012
3976
|
},
|
|
4013
3977
|
".ant-pagination-prev .ant-pagination-item-link, .ant-pagination-next .ant-pagination-item-link": {
|
|
4014
|
-
borderRadius: token
|
|
3978
|
+
borderRadius: token.borderRadius,
|
|
4015
3979
|
width: 32,
|
|
4016
3980
|
height: 32,
|
|
4017
3981
|
display: "flex",
|
|
@@ -4105,13 +4069,13 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
|
|
|
4105
4069
|
level: 4,
|
|
4106
4070
|
style: {
|
|
4107
4071
|
margin: 0,
|
|
4108
|
-
color: token
|
|
4072
|
+
color: token.colorTextHeading
|
|
4109
4073
|
},
|
|
4110
4074
|
children: "Endpoints"
|
|
4111
4075
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(antd.Button, {
|
|
4112
4076
|
type: "text",
|
|
4113
4077
|
size: "large",
|
|
4114
|
-
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
4078
|
+
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_ant_design_icons.UpCircleOutlined, { style: { fontSize: 18 } }),
|
|
4115
4079
|
onClick: onToggleCollapse,
|
|
4116
4080
|
style: {
|
|
4117
4081
|
transform: collapsed ? "rotate(180deg)" : "rotate(0deg)",
|
|
@@ -4145,7 +4109,7 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
|
|
|
4145
4109
|
children: ep.path
|
|
4146
4110
|
})
|
|
4147
4111
|
})]
|
|
4148
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
4112
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_ant_design_icons.UpCircleOutlined, {
|
|
4149
4113
|
onClick: () => handleEndpointClick(ep),
|
|
4150
4114
|
style: {
|
|
4151
4115
|
fontSize: 16,
|
|
@@ -4153,7 +4117,7 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
|
|
|
4153
4117
|
transform: isExpanded ? "rotate(0deg)" : "rotate(180deg)",
|
|
4154
4118
|
transition: "transform 0.2s",
|
|
4155
4119
|
flexShrink: 0,
|
|
4156
|
-
color: isExpanded ? token
|
|
4120
|
+
color: isExpanded ? token.colorPrimary : token.colorText
|
|
4157
4121
|
}
|
|
4158
4122
|
})]
|
|
4159
4123
|
}),
|
|
@@ -4280,7 +4244,7 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
|
|
|
4280
4244
|
style: {
|
|
4281
4245
|
display: "flex",
|
|
4282
4246
|
alignItems: "center",
|
|
4283
|
-
gap: token
|
|
4247
|
+
gap: token.marginMD
|
|
4284
4248
|
},
|
|
4285
4249
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
4286
4250
|
className: cx("section-title"),
|
|
@@ -4288,7 +4252,7 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
|
|
|
4288
4252
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(antd.Button, {
|
|
4289
4253
|
ghost: true,
|
|
4290
4254
|
type: "primary",
|
|
4291
|
-
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
4255
|
+
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_ant_design_icons.SearchOutlined, {}),
|
|
4292
4256
|
size: "large",
|
|
4293
4257
|
style: {
|
|
4294
4258
|
width: 40,
|
|
@@ -4306,7 +4270,7 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
|
|
|
4306
4270
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(antd.Button, {
|
|
4307
4271
|
ghost: true,
|
|
4308
4272
|
type: "primary",
|
|
4309
|
-
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
4273
|
+
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_ant_design_icons.PlusOutlined, {}),
|
|
4310
4274
|
onClick: () => {
|
|
4311
4275
|
setDrawerSource("request");
|
|
4312
4276
|
setParamDrawerMode("add");
|
|
@@ -4342,7 +4306,7 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
|
|
|
4342
4306
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(antd.Button, {
|
|
4343
4307
|
ghost: true,
|
|
4344
4308
|
type: "primary",
|
|
4345
|
-
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
4309
|
+
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_ant_design_icons.PlusOutlined, {}),
|
|
4346
4310
|
onClick: () => {
|
|
4347
4311
|
setDrawerSource("request");
|
|
4348
4312
|
setParamDrawerMode("add");
|
|
@@ -4406,7 +4370,7 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
|
|
|
4406
4370
|
const pagedReqParams = allReqParams.slice((reqPage - 1) * PAGE_SIZE, reqPage * PAGE_SIZE);
|
|
4407
4371
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
4408
4372
|
className: cx("param-list"),
|
|
4409
|
-
style: { marginTop: token
|
|
4373
|
+
style: { marginTop: token.margin },
|
|
4410
4374
|
children: pagedReqParams.map((param, i) => {
|
|
4411
4375
|
const idx = (reqPage - 1) * PAGE_SIZE + i;
|
|
4412
4376
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
@@ -4446,16 +4410,16 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
|
|
|
4446
4410
|
style: {
|
|
4447
4411
|
display: "flex",
|
|
4448
4412
|
alignItems: "center",
|
|
4449
|
-
gap: token
|
|
4450
|
-
background: token
|
|
4451
|
-
borderRadius: token
|
|
4452
|
-
padding: `0 ${token
|
|
4413
|
+
gap: token.margin,
|
|
4414
|
+
background: token.colorFillTertiary,
|
|
4415
|
+
borderRadius: token.borderRadius,
|
|
4416
|
+
padding: `0 ${token.marginSM}px`,
|
|
4453
4417
|
height: 50,
|
|
4454
4418
|
flexShrink: 0
|
|
4455
4419
|
},
|
|
4456
4420
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(antd.Button, {
|
|
4457
4421
|
danger: true,
|
|
4458
|
-
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
4422
|
+
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Trash, {
|
|
4459
4423
|
width: 32,
|
|
4460
4424
|
height: 32
|
|
4461
4425
|
}),
|
|
@@ -4476,7 +4440,7 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
|
|
|
4476
4440
|
})
|
|
4477
4441
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(antd.Button, {
|
|
4478
4442
|
ghost: true,
|
|
4479
|
-
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
4443
|
+
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_ant_design_icons.EditOutlined, {}),
|
|
4480
4444
|
className: cx("param-edit-btn"),
|
|
4481
4445
|
onClick: () => {
|
|
4482
4446
|
setDrawerSource("request");
|
|
@@ -4574,7 +4538,7 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
|
|
|
4574
4538
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(antd.Button, {
|
|
4575
4539
|
danger: true,
|
|
4576
4540
|
type: "text",
|
|
4577
|
-
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
4541
|
+
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Trash, {
|
|
4578
4542
|
height: 32,
|
|
4579
4543
|
width: 32
|
|
4580
4544
|
}),
|
|
@@ -4592,7 +4556,7 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
|
|
|
4592
4556
|
})
|
|
4593
4557
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(antd.Button, {
|
|
4594
4558
|
ghost: true,
|
|
4595
|
-
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
4559
|
+
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_ant_design_icons.EditOutlined, {}),
|
|
4596
4560
|
className: cx("param-edit-btn"),
|
|
4597
4561
|
onClick: () => {
|
|
4598
4562
|
setDrawerSource("request");
|
|
@@ -4616,12 +4580,12 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
|
|
|
4616
4580
|
})(),
|
|
4617
4581
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
4618
4582
|
className: cx("param-row"),
|
|
4619
|
-
style: { marginTop: token
|
|
4583
|
+
style: { marginTop: token.margin },
|
|
4620
4584
|
onClick: () => toggleRequestPanel(ep.id),
|
|
4621
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
4622
|
-
style: { fontSize: token
|
|
4585
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_ant_design_icons.DownOutlined, { className: cx("param-row-icon", openRequestPanels.has(ep.id) ? "param-row-icon--open" : "") }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
4586
|
+
style: { fontSize: token.fontSize },
|
|
4623
4587
|
children: ["Request ", /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
4624
|
-
style: { color: token
|
|
4588
|
+
style: { color: token.colorError },
|
|
4625
4589
|
children: "*"
|
|
4626
4590
|
})]
|
|
4627
4591
|
})]
|
|
@@ -4665,7 +4629,7 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
|
|
|
4665
4629
|
style: {
|
|
4666
4630
|
display: "flex",
|
|
4667
4631
|
alignItems: "center",
|
|
4668
|
-
gap: token
|
|
4632
|
+
gap: token.marginMD
|
|
4669
4633
|
},
|
|
4670
4634
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
4671
4635
|
className: cx("section-title"),
|
|
@@ -4673,7 +4637,7 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
|
|
|
4673
4637
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(antd.Button, {
|
|
4674
4638
|
ghost: true,
|
|
4675
4639
|
type: "primary",
|
|
4676
|
-
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
4640
|
+
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_ant_design_icons.SearchOutlined, {}),
|
|
4677
4641
|
size: "large",
|
|
4678
4642
|
style: {
|
|
4679
4643
|
width: 40,
|
|
@@ -4691,7 +4655,7 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
|
|
|
4691
4655
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(antd.Button, {
|
|
4692
4656
|
ghost: true,
|
|
4693
4657
|
type: "primary",
|
|
4694
|
-
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
4658
|
+
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_ant_design_icons.PlusOutlined, {}),
|
|
4695
4659
|
onClick: () => {
|
|
4696
4660
|
setDrawerSource("response");
|
|
4697
4661
|
setParamDrawerMode("add");
|
|
@@ -4767,7 +4731,7 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
|
|
|
4767
4731
|
style: { color: text },
|
|
4768
4732
|
children: code
|
|
4769
4733
|
}),
|
|
4770
|
-
isSelected && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
4734
|
+
isSelected && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_ant_design_icons.CheckCircleOutlined, {
|
|
4771
4735
|
className: cx("status-checkmark"),
|
|
4772
4736
|
style: { color: text }
|
|
4773
4737
|
})
|
|
@@ -4781,7 +4745,7 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
|
|
|
4781
4745
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(antd.Button, {
|
|
4782
4746
|
ghost: true,
|
|
4783
4747
|
type: "primary",
|
|
4784
|
-
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
4748
|
+
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_ant_design_icons.PlusOutlined, {}),
|
|
4785
4749
|
onClick: () => {
|
|
4786
4750
|
setDrawerSource("response");
|
|
4787
4751
|
setParamDrawerMode("add");
|
|
@@ -4845,7 +4809,7 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
|
|
|
4845
4809
|
const pagedResParams = allResParams.slice((resPage - 1) * PAGE_SIZE, resPage * PAGE_SIZE);
|
|
4846
4810
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
4847
4811
|
className: cx("param-list"),
|
|
4848
|
-
style: { marginTop: token
|
|
4812
|
+
style: { marginTop: token.margin },
|
|
4849
4813
|
children: pagedResParams.map((param, i) => {
|
|
4850
4814
|
const idx = (resPage - 1) * PAGE_SIZE + i;
|
|
4851
4815
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
@@ -4885,16 +4849,16 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
|
|
|
4885
4849
|
style: {
|
|
4886
4850
|
display: "flex",
|
|
4887
4851
|
alignItems: "center",
|
|
4888
|
-
gap: token
|
|
4889
|
-
background: token
|
|
4890
|
-
borderRadius: token
|
|
4891
|
-
padding: `0 ${token
|
|
4852
|
+
gap: token.margin,
|
|
4853
|
+
background: token.colorFillTertiary,
|
|
4854
|
+
borderRadius: token.borderRadius,
|
|
4855
|
+
padding: `0 ${token.marginSM}px`,
|
|
4892
4856
|
height: 50,
|
|
4893
4857
|
flexShrink: 0
|
|
4894
4858
|
},
|
|
4895
4859
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(antd.Button, {
|
|
4896
4860
|
danger: true,
|
|
4897
|
-
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
4861
|
+
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Trash, {
|
|
4898
4862
|
width: 32,
|
|
4899
4863
|
height: 32
|
|
4900
4864
|
}),
|
|
@@ -4915,7 +4879,7 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
|
|
|
4915
4879
|
})
|
|
4916
4880
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(antd.Button, {
|
|
4917
4881
|
ghost: true,
|
|
4918
|
-
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
4882
|
+
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_ant_design_icons.EditOutlined, {}),
|
|
4919
4883
|
className: cx("param-edit-btn"),
|
|
4920
4884
|
onClick: () => {
|
|
4921
4885
|
setDrawerSource("response");
|
|
@@ -5012,7 +4976,7 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
|
|
|
5012
4976
|
className: cx("param-actions"),
|
|
5013
4977
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(antd.Button, {
|
|
5014
4978
|
ghost: true,
|
|
5015
|
-
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
4979
|
+
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_ant_design_icons.EditOutlined, {}),
|
|
5016
4980
|
className: cx("param-edit-btn"),
|
|
5017
4981
|
onClick: () => {
|
|
5018
4982
|
setDrawerSource("response");
|
|
@@ -5024,7 +4988,7 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
|
|
|
5024
4988
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(antd.Button, {
|
|
5025
4989
|
danger: true,
|
|
5026
4990
|
type: "text",
|
|
5027
|
-
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
4991
|
+
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Trash, {
|
|
5028
4992
|
height: 18,
|
|
5029
4993
|
width: 18
|
|
5030
4994
|
}),
|
|
@@ -5055,18 +5019,18 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
|
|
|
5055
5019
|
})(),
|
|
5056
5020
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
5057
5021
|
className: cx("param-row"),
|
|
5058
|
-
style: { marginTop: token
|
|
5022
|
+
style: { marginTop: token.margin },
|
|
5059
5023
|
onClick: () => toggleResponsePanel(ep.id),
|
|
5060
5024
|
children: [
|
|
5061
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
5025
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_ant_design_icons.DownOutlined, { className: cx("param-row-icon", openResponsePanels.has(ep.id) ? "param-row-icon--open" : "") }),
|
|
5062
5026
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
5063
|
-
style: { fontSize: token
|
|
5027
|
+
style: { fontSize: token.fontSize },
|
|
5064
5028
|
children: ["Response ", /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
5065
|
-
style: { color: token
|
|
5029
|
+
style: { color: token.colorError },
|
|
5066
5030
|
children: "*"
|
|
5067
5031
|
})]
|
|
5068
5032
|
}),
|
|
5069
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
5033
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(InfoCircle, { style: {
|
|
5070
5034
|
width: 24,
|
|
5071
5035
|
height: 24
|
|
5072
5036
|
} })
|
|
@@ -5248,11 +5212,10 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
|
|
|
5248
5212
|
]
|
|
5249
5213
|
}));
|
|
5250
5214
|
};
|
|
5251
|
-
|
|
5252
5215
|
//#endregion
|
|
5253
5216
|
//#region src/view/components/ApiPage/components/UnsavedChangesBanner.tsx
|
|
5254
5217
|
const UnsavedChangesBanner = ({ onClose }) => {
|
|
5255
|
-
const { wrapSSR, cx } = useStyle("UnsavedChangesBanner", (token
|
|
5218
|
+
const { wrapSSR, cx } = useStyle("UnsavedChangesBanner", (token, scope) => ({
|
|
5256
5219
|
[scope("root")]: {
|
|
5257
5220
|
position: "sticky",
|
|
5258
5221
|
top: 0,
|
|
@@ -5262,7 +5225,7 @@ const UnsavedChangesBanner = ({ onClose }) => {
|
|
|
5262
5225
|
},
|
|
5263
5226
|
[scope("alert")]: {
|
|
5264
5227
|
padding: "8px 12px",
|
|
5265
|
-
fontSize: token
|
|
5228
|
+
fontSize: token.fontSize,
|
|
5266
5229
|
fontWeight: 400,
|
|
5267
5230
|
borderRadius: 0
|
|
5268
5231
|
}
|
|
@@ -5275,22 +5238,21 @@ const UnsavedChangesBanner = ({ onClose }) => {
|
|
|
5275
5238
|
message: "There are changes you made may not be saved",
|
|
5276
5239
|
closable: true,
|
|
5277
5240
|
onClose,
|
|
5278
|
-
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
5241
|
+
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_ant_design_icons.ExclamationCircleFilled, {}),
|
|
5279
5242
|
showIcon: true
|
|
5280
5243
|
})
|
|
5281
5244
|
}));
|
|
5282
5245
|
};
|
|
5283
|
-
|
|
5284
5246
|
//#endregion
|
|
5285
5247
|
//#region src/view/components/ApiPage/components/TagsSection.tsx
|
|
5286
5248
|
const { useBreakpoint } = antd.Grid;
|
|
5287
5249
|
const TagsSection = ({ tags, collapsed = false, onToggleCollapse, onAddTag, onEditTag, onDeleteTag }) => {
|
|
5288
5250
|
const isMobile = !useBreakpoint().md;
|
|
5289
|
-
const { wrapSSR, cx, token
|
|
5251
|
+
const { wrapSSR, cx, token } = useStyle("TagsSection", (token, scope) => ({
|
|
5290
5252
|
[scope("root")]: {
|
|
5291
5253
|
display: "flex",
|
|
5292
5254
|
flexDirection: "column",
|
|
5293
|
-
borderRadius: token
|
|
5255
|
+
borderRadius: token.borderRadius,
|
|
5294
5256
|
overflow: "hidden",
|
|
5295
5257
|
width: "100%",
|
|
5296
5258
|
flexShrink: 0
|
|
@@ -5299,37 +5261,37 @@ const TagsSection = ({ tags, collapsed = false, onToggleCollapse, onAddTag, onEd
|
|
|
5299
5261
|
display: "flex",
|
|
5300
5262
|
alignItems: "center",
|
|
5301
5263
|
justifyContent: "space-between",
|
|
5302
|
-
padding: `${token
|
|
5303
|
-
background: token
|
|
5304
|
-
borderRadius: `${token
|
|
5264
|
+
padding: `${token.paddingXS}px ${token.paddingLG}px`,
|
|
5265
|
+
background: token.colorPrimaryBg,
|
|
5266
|
+
borderRadius: `${token.borderRadius}px ${token.borderRadius}px 0 0`
|
|
5305
5267
|
},
|
|
5306
5268
|
[scope("head-actions")]: {
|
|
5307
5269
|
display: "flex",
|
|
5308
5270
|
alignItems: "center",
|
|
5309
|
-
gap: token
|
|
5271
|
+
gap: token.margin
|
|
5310
5272
|
},
|
|
5311
5273
|
[scope("body")]: {
|
|
5312
5274
|
display: "flex",
|
|
5313
5275
|
flexDirection: "column",
|
|
5314
5276
|
gap: 0,
|
|
5315
|
-
padding: token
|
|
5316
|
-
background: token
|
|
5317
|
-
borderRadius: `0 0 ${token
|
|
5277
|
+
padding: token.paddingLG,
|
|
5278
|
+
background: token.colorBgElevated,
|
|
5279
|
+
borderRadius: `0 0 ${token.borderRadius}px ${token.borderRadius}px`
|
|
5318
5280
|
},
|
|
5319
5281
|
[scope("tag-row")]: {
|
|
5320
5282
|
display: "flex",
|
|
5321
5283
|
alignItems: "center",
|
|
5322
5284
|
justifyContent: "space-between",
|
|
5323
5285
|
height: 50,
|
|
5324
|
-
paddingTop: token
|
|
5325
|
-
paddingBottom: token
|
|
5326
|
-
paddingRight: token
|
|
5327
|
-
borderBottom: `1px solid ${token
|
|
5286
|
+
paddingTop: token.controlHeightLG,
|
|
5287
|
+
paddingBottom: token.controlHeightLG,
|
|
5288
|
+
paddingRight: token.paddingLG,
|
|
5289
|
+
borderBottom: `1px solid ${token.colorBorder}`,
|
|
5328
5290
|
width: "100%"
|
|
5329
5291
|
},
|
|
5330
5292
|
[scope("tag-row-last")]: {
|
|
5331
5293
|
borderBottom: "none",
|
|
5332
|
-
paddingBottom: token
|
|
5294
|
+
paddingBottom: token.marginLG
|
|
5333
5295
|
},
|
|
5334
5296
|
[scope("tag-info")]: {
|
|
5335
5297
|
display: "flex",
|
|
@@ -5341,26 +5303,26 @@ const TagsSection = ({ tags, collapsed = false, onToggleCollapse, onAddTag, onEd
|
|
|
5341
5303
|
[scope("tag-col")]: {
|
|
5342
5304
|
display: "flex",
|
|
5343
5305
|
flexDirection: "column",
|
|
5344
|
-
gap: token
|
|
5306
|
+
gap: token.marginXXS
|
|
5345
5307
|
},
|
|
5346
5308
|
[scope("col-label")]: {
|
|
5347
|
-
fontSize: token
|
|
5309
|
+
fontSize: token.fontSizeLG,
|
|
5348
5310
|
fontWeight: 600,
|
|
5349
|
-
color: token
|
|
5311
|
+
color: token.colorTextTertiary,
|
|
5350
5312
|
lineHeight: "24px",
|
|
5351
5313
|
whiteSpace: "nowrap"
|
|
5352
5314
|
},
|
|
5353
5315
|
[scope("col-value")]: {
|
|
5354
|
-
fontSize: token
|
|
5316
|
+
fontSize: token.fontSizeLG,
|
|
5355
5317
|
fontWeight: 400,
|
|
5356
|
-
color: token
|
|
5318
|
+
color: token.colorText,
|
|
5357
5319
|
lineHeight: "24px",
|
|
5358
5320
|
whiteSpace: "nowrap"
|
|
5359
5321
|
},
|
|
5360
5322
|
[scope("col-value-link")]: {
|
|
5361
|
-
fontSize: token
|
|
5323
|
+
fontSize: token.fontSize,
|
|
5362
5324
|
fontWeight: 400,
|
|
5363
|
-
color: token
|
|
5325
|
+
color: token.colorPrimary,
|
|
5364
5326
|
lineHeight: "22px",
|
|
5365
5327
|
textDecoration: "underline",
|
|
5366
5328
|
whiteSpace: "nowrap"
|
|
@@ -5368,13 +5330,13 @@ const TagsSection = ({ tags, collapsed = false, onToggleCollapse, onAddTag, onEd
|
|
|
5368
5330
|
[scope("tag-actions")]: {
|
|
5369
5331
|
display: "flex",
|
|
5370
5332
|
alignItems: "center",
|
|
5371
|
-
gap: token
|
|
5333
|
+
gap: token.margin
|
|
5372
5334
|
},
|
|
5373
5335
|
[scope("btn-delete")]: {
|
|
5374
5336
|
width: 40,
|
|
5375
5337
|
height: 40,
|
|
5376
|
-
border: `1px solid ${token
|
|
5377
|
-
borderRadius: token
|
|
5338
|
+
border: `1px solid ${token.colorError}`,
|
|
5339
|
+
borderRadius: token.borderRadius,
|
|
5378
5340
|
display: "flex",
|
|
5379
5341
|
alignItems: "center",
|
|
5380
5342
|
justifyContent: "center"
|
|
@@ -5382,9 +5344,9 @@ const TagsSection = ({ tags, collapsed = false, onToggleCollapse, onAddTag, onEd
|
|
|
5382
5344
|
[scope("btn-edit")]: {
|
|
5383
5345
|
width: 40,
|
|
5384
5346
|
height: 40,
|
|
5385
|
-
border: `1px solid ${token
|
|
5386
|
-
borderRadius: token
|
|
5387
|
-
background: token
|
|
5347
|
+
border: `1px solid ${token.colorBorder}`,
|
|
5348
|
+
borderRadius: token.borderRadius,
|
|
5349
|
+
background: token.colorBgContainer,
|
|
5388
5350
|
boxShadow: "0px 2px 0px 0px rgba(0,0,0,0.02)",
|
|
5389
5351
|
display: "flex",
|
|
5390
5352
|
alignItems: "center",
|
|
@@ -5396,8 +5358,8 @@ const TagsSection = ({ tags, collapsed = false, onToggleCollapse, onAddTag, onEd
|
|
|
5396
5358
|
alignItems: "flex-start",
|
|
5397
5359
|
justifyContent: "space-between",
|
|
5398
5360
|
gap: 8,
|
|
5399
|
-
paddingBottom: token
|
|
5400
|
-
borderBottom: `1px solid ${token
|
|
5361
|
+
paddingBottom: token.margin,
|
|
5362
|
+
borderBottom: `1px solid ${token.colorBorder}`,
|
|
5401
5363
|
width: "100%",
|
|
5402
5364
|
minHeight: 50
|
|
5403
5365
|
},
|
|
@@ -5425,9 +5387,9 @@ const TagsSection = ({ tags, collapsed = false, onToggleCollapse, onAddTag, onEd
|
|
|
5425
5387
|
display: "flex",
|
|
5426
5388
|
flexDirection: "column",
|
|
5427
5389
|
gap: 0,
|
|
5428
|
-
padding: token
|
|
5429
|
-
background: token
|
|
5430
|
-
borderRadius: `0 0 ${token
|
|
5390
|
+
padding: token.paddingMD,
|
|
5391
|
+
background: token.colorBgElevated,
|
|
5392
|
+
borderRadius: `0 0 ${token.borderRadius}px ${token.borderRadius}px`,
|
|
5431
5393
|
overflowX: "auto"
|
|
5432
5394
|
}
|
|
5433
5395
|
}));
|
|
@@ -5439,7 +5401,7 @@ const TagsSection = ({ tags, collapsed = false, onToggleCollapse, onAddTag, onEd
|
|
|
5439
5401
|
level: 4,
|
|
5440
5402
|
style: {
|
|
5441
5403
|
margin: 0,
|
|
5442
|
-
color: token
|
|
5404
|
+
color: token.colorTextHeading
|
|
5443
5405
|
},
|
|
5444
5406
|
children: "Tags"
|
|
5445
5407
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
@@ -5447,14 +5409,14 @@ const TagsSection = ({ tags, collapsed = false, onToggleCollapse, onAddTag, onEd
|
|
|
5447
5409
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(antd.Button, {
|
|
5448
5410
|
ghost: true,
|
|
5449
5411
|
type: "primary",
|
|
5450
|
-
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
5412
|
+
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_ant_design_icons.PlusOutlined, {}),
|
|
5451
5413
|
onClick: onAddTag,
|
|
5452
|
-
style: { borderRadius: token
|
|
5414
|
+
style: { borderRadius: token.borderRadius },
|
|
5453
5415
|
children: "Add Tag"
|
|
5454
5416
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(antd.Button, {
|
|
5455
5417
|
type: "text",
|
|
5456
5418
|
size: "large",
|
|
5457
|
-
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
5419
|
+
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_ant_design_icons.UpCircleOutlined, { style: { fontSize: 18 } }),
|
|
5458
5420
|
onClick: onToggleCollapse,
|
|
5459
5421
|
style: {
|
|
5460
5422
|
transform: collapsed ? "rotate(180deg)" : "rotate(0deg)",
|
|
@@ -5474,14 +5436,14 @@ const TagsSection = ({ tags, collapsed = false, onToggleCollapse, onAddTag, onEd
|
|
|
5474
5436
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
5475
5437
|
className: cx("col-label"),
|
|
5476
5438
|
style: {
|
|
5477
|
-
fontSize: token
|
|
5439
|
+
fontSize: token.fontSize,
|
|
5478
5440
|
lineHeight: "20px"
|
|
5479
5441
|
},
|
|
5480
5442
|
children: "Tag Name:"
|
|
5481
5443
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
5482
5444
|
className: cx("col-value"),
|
|
5483
5445
|
style: {
|
|
5484
|
-
fontSize: token
|
|
5446
|
+
fontSize: token.fontSize,
|
|
5485
5447
|
lineHeight: "20px",
|
|
5486
5448
|
overflow: "hidden",
|
|
5487
5449
|
textOverflow: "ellipsis",
|
|
@@ -5494,7 +5456,7 @@ const TagsSection = ({ tags, collapsed = false, onToggleCollapse, onAddTag, onEd
|
|
|
5494
5456
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
5495
5457
|
className: cx("col-label"),
|
|
5496
5458
|
style: {
|
|
5497
|
-
fontSize: token
|
|
5459
|
+
fontSize: token.fontSize,
|
|
5498
5460
|
lineHeight: "20px"
|
|
5499
5461
|
},
|
|
5500
5462
|
children: "Description:"
|
|
@@ -5503,7 +5465,7 @@ const TagsSection = ({ tags, collapsed = false, onToggleCollapse, onAddTag, onEd
|
|
|
5503
5465
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
5504
5466
|
className: cx("col-value"),
|
|
5505
5467
|
style: {
|
|
5506
|
-
fontSize: token
|
|
5468
|
+
fontSize: token.fontSize,
|
|
5507
5469
|
lineHeight: "20px",
|
|
5508
5470
|
overflow: "hidden",
|
|
5509
5471
|
textOverflow: "ellipsis",
|
|
@@ -5526,7 +5488,7 @@ const TagsSection = ({ tags, collapsed = false, onToggleCollapse, onAddTag, onEd
|
|
|
5526
5488
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(antd.Button, {
|
|
5527
5489
|
danger: true,
|
|
5528
5490
|
type: "text",
|
|
5529
|
-
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
5491
|
+
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Trash, {
|
|
5530
5492
|
width: 32,
|
|
5531
5493
|
height: 32
|
|
5532
5494
|
}),
|
|
@@ -5542,7 +5504,7 @@ const TagsSection = ({ tags, collapsed = false, onToggleCollapse, onAddTag, onEd
|
|
|
5542
5504
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(antd.Tooltip, {
|
|
5543
5505
|
title: tag.isDefault ? "The default tag cannot be deleted or edited" : "",
|
|
5544
5506
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(antd.Button, {
|
|
5545
|
-
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
5507
|
+
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_ant_design_icons.EditOutlined, { style: { fontSize: 18 } }),
|
|
5546
5508
|
disabled: tag.isDefault,
|
|
5547
5509
|
onClick: () => !tag.isDefault && onEditTag?.(tag),
|
|
5548
5510
|
style: {
|
|
@@ -5633,7 +5595,7 @@ const TagsSection = ({ tags, collapsed = false, onToggleCollapse, onAddTag, onEd
|
|
|
5633
5595
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(antd.Button, {
|
|
5634
5596
|
danger: true,
|
|
5635
5597
|
type: "text",
|
|
5636
|
-
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
5598
|
+
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Trash, {
|
|
5637
5599
|
width: 32,
|
|
5638
5600
|
height: 32
|
|
5639
5601
|
}),
|
|
@@ -5649,7 +5611,7 @@ const TagsSection = ({ tags, collapsed = false, onToggleCollapse, onAddTag, onEd
|
|
|
5649
5611
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(antd.Tooltip, {
|
|
5650
5612
|
title: tag.isDefault ? "The default tag cannot be deleted or edited" : "",
|
|
5651
5613
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(antd.Button, {
|
|
5652
|
-
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
5614
|
+
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_ant_design_icons.EditOutlined, { style: { fontSize: 18 } }),
|
|
5653
5615
|
disabled: tag.isDefault,
|
|
5654
5616
|
onClick: () => !tag.isDefault && onEditTag?.(tag),
|
|
5655
5617
|
style: {
|
|
@@ -5666,7 +5628,6 @@ const TagsSection = ({ tags, collapsed = false, onToggleCollapse, onAddTag, onEd
|
|
|
5666
5628
|
}))]
|
|
5667
5629
|
}));
|
|
5668
5630
|
};
|
|
5669
|
-
|
|
5670
5631
|
//#endregion
|
|
5671
5632
|
//#region src/view/components/ApiPage/components/AddTagDrawer.tsx
|
|
5672
5633
|
const TAG_NAME_REGEX = /^[A-Za-z0-9_-]+$/;
|
|
@@ -5675,16 +5636,16 @@ const EXT_DESC_REGEX = /^[A-Za-z0-9_-]+$/;
|
|
|
5675
5636
|
const AddTagDrawer = ({ open, onClose, mode, initialValues, onAddTag, onEditTag }) => {
|
|
5676
5637
|
const [form] = antd.Form.useForm();
|
|
5677
5638
|
const [messageApi, contextHolder] = antd.message.useMessage();
|
|
5678
|
-
const [confirmModalOpen, setConfirmModalOpen] = (0, react.useState)(false);
|
|
5679
|
-
const [tagName, setTagName] = (0, react.useState)("");
|
|
5639
|
+
const [confirmModalOpen, setConfirmModalOpen] = (0, react$1.useState)(false);
|
|
5640
|
+
const [tagName, setTagName] = (0, react$1.useState)("");
|
|
5680
5641
|
const tagNameValue = antd.Form.useWatch("name", form);
|
|
5681
5642
|
const extDocsDesc = antd.Form.useWatch("externalDocsDescription", form);
|
|
5682
5643
|
const extDocsLink = antd.Form.useWatch("externalDocsLink", form);
|
|
5683
|
-
const { wrapSSR, cx, token
|
|
5644
|
+
const { wrapSSR, cx, token } = useStyle("AddTagDrawer", (token, scope) => ({
|
|
5684
5645
|
[scope("title")]: {
|
|
5685
5646
|
fontSize: 16,
|
|
5686
5647
|
fontWeight: 600,
|
|
5687
|
-
color: token
|
|
5648
|
+
color: token.colorTextBase,
|
|
5688
5649
|
lineHeight: "24px",
|
|
5689
5650
|
fontFamily: "Cairo SemiBold, Cairo, sans-serif"
|
|
5690
5651
|
},
|
|
@@ -5695,25 +5656,25 @@ const AddTagDrawer = ({ open, onClose, mode, initialValues, onAddTag, onEditTag
|
|
|
5695
5656
|
"& .ant-form-item": { marginBottom: 0 }
|
|
5696
5657
|
},
|
|
5697
5658
|
[scope("label")]: {
|
|
5698
|
-
fontSize: token
|
|
5699
|
-
color: token
|
|
5659
|
+
fontSize: token.fontSize,
|
|
5660
|
+
color: token.colorText
|
|
5700
5661
|
},
|
|
5701
5662
|
[scope("asterisk")]: {
|
|
5702
|
-
color: token
|
|
5663
|
+
color: token.colorError,
|
|
5703
5664
|
marginLeft: 2
|
|
5704
5665
|
},
|
|
5705
5666
|
[scope("label-optional")]: {
|
|
5706
|
-
color: token
|
|
5667
|
+
color: token.colorTextTertiary,
|
|
5707
5668
|
marginLeft: 4,
|
|
5708
|
-
fontSize: token
|
|
5669
|
+
fontSize: token.fontSize
|
|
5709
5670
|
},
|
|
5710
5671
|
[scope("label-secondary")]: {
|
|
5711
|
-
fontSize: token
|
|
5712
|
-
color: token
|
|
5672
|
+
fontSize: token.fontSize,
|
|
5673
|
+
color: token.colorTextSecondary
|
|
5713
5674
|
},
|
|
5714
5675
|
[scope("label-disabled")]: {
|
|
5715
|
-
fontSize: token
|
|
5716
|
-
color: token
|
|
5676
|
+
fontSize: token.fontSize,
|
|
5677
|
+
color: token.colorTextDisabled
|
|
5717
5678
|
},
|
|
5718
5679
|
[scope("footer")]: {
|
|
5719
5680
|
display: "flex",
|
|
@@ -5750,7 +5711,7 @@ const AddTagDrawer = ({ open, onClose, mode, initialValues, onAddTag, onEditTag
|
|
|
5750
5711
|
fontSize: 16,
|
|
5751
5712
|
fontWeight: 400,
|
|
5752
5713
|
lineHeight: "24px",
|
|
5753
|
-
color: token
|
|
5714
|
+
color: token.colorText
|
|
5754
5715
|
},
|
|
5755
5716
|
[scope("modalCloseBtn")]: {
|
|
5756
5717
|
position: "absolute",
|
|
@@ -5766,12 +5727,12 @@ const AddTagDrawer = ({ open, onClose, mode, initialValues, onAddTag, onEditTag
|
|
|
5766
5727
|
border: "none",
|
|
5767
5728
|
background: "transparent",
|
|
5768
5729
|
padding: 0,
|
|
5769
|
-
color: token
|
|
5730
|
+
color: token.colorTextTertiary,
|
|
5770
5731
|
fontSize: 16,
|
|
5771
5732
|
lineHeight: 1,
|
|
5772
5733
|
"&:hover": {
|
|
5773
|
-
color: token
|
|
5774
|
-
backgroundColor: token
|
|
5734
|
+
color: token.colorText,
|
|
5735
|
+
backgroundColor: token.colorFillSecondary
|
|
5775
5736
|
}
|
|
5776
5737
|
},
|
|
5777
5738
|
[scope("modalContent")]: {
|
|
@@ -5788,7 +5749,7 @@ const AddTagDrawer = ({ open, onClose, mode, initialValues, onAddTag, onEditTag
|
|
|
5788
5749
|
fontSize: 14,
|
|
5789
5750
|
fontWeight: 400,
|
|
5790
5751
|
lineHeight: "22px",
|
|
5791
|
-
color: token
|
|
5752
|
+
color: token.colorText
|
|
5792
5753
|
},
|
|
5793
5754
|
[scope("modalFooter")]: {
|
|
5794
5755
|
display: "flex",
|
|
@@ -5804,18 +5765,18 @@ const AddTagDrawer = ({ open, onClose, mode, initialValues, onAddTag, onEditTag
|
|
|
5804
5765
|
}));
|
|
5805
5766
|
const isLinkEnabled = Boolean(extDocsDesc?.trim());
|
|
5806
5767
|
const isAddEnabled = !!(tagNameValue && TAG_NAME_REGEX.test(tagNameValue));
|
|
5807
|
-
(0, react.useEffect)(() => {
|
|
5768
|
+
(0, react$1.useEffect)(() => {
|
|
5808
5769
|
if (open && mode === "edit" && initialValues) form.setFieldsValue(initialValues);
|
|
5809
5770
|
if (!open) form.resetFields();
|
|
5810
5771
|
}, [open]);
|
|
5811
|
-
(0, react.useEffect)(() => {
|
|
5772
|
+
(0, react$1.useEffect)(() => {
|
|
5812
5773
|
if (!extDocsDesc?.trim()) form.setFields([{
|
|
5813
5774
|
name: "externalDocsLink",
|
|
5814
5775
|
value: void 0,
|
|
5815
5776
|
errors: []
|
|
5816
5777
|
}]);
|
|
5817
5778
|
}, [extDocsDesc]);
|
|
5818
|
-
(0, react.useEffect)(() => {
|
|
5779
|
+
(0, react$1.useEffect)(() => {
|
|
5819
5780
|
if (extDocsDesc?.trim()) form.validateFields(["externalDocsLink"]).catch(() => {});
|
|
5820
5781
|
}, [extDocsLink, extDocsDesc]);
|
|
5821
5782
|
const handleClose = () => {
|
|
@@ -5865,14 +5826,14 @@ const AddTagDrawer = ({ open, onClose, mode, initialValues, onAddTag, onEditTag
|
|
|
5865
5826
|
styles: {
|
|
5866
5827
|
header: {
|
|
5867
5828
|
padding: "16px 24px",
|
|
5868
|
-
borderBottom: `1px solid ${token
|
|
5869
|
-
background: token
|
|
5829
|
+
borderBottom: `1px solid ${token.colorFillSecondary}`,
|
|
5830
|
+
background: token.colorBgBase
|
|
5870
5831
|
},
|
|
5871
5832
|
body: { padding: "24px" },
|
|
5872
5833
|
footer: {
|
|
5873
5834
|
padding: "24px",
|
|
5874
|
-
background: token
|
|
5875
|
-
borderTop: `1px solid ${token
|
|
5835
|
+
background: token.colorPrimaryBg,
|
|
5836
|
+
borderTop: `1px solid ${token.colorFillSecondary}`
|
|
5876
5837
|
}
|
|
5877
5838
|
},
|
|
5878
5839
|
footer: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
@@ -5885,7 +5846,7 @@ const AddTagDrawer = ({ open, onClose, mode, initialValues, onAddTag, onEditTag
|
|
|
5885
5846
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(antd.Button, {
|
|
5886
5847
|
size: "large",
|
|
5887
5848
|
type: "primary",
|
|
5888
|
-
icon: mode === "add" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
5849
|
+
icon: mode === "add" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_ant_design_icons.PlusOutlined, {}) : void 0,
|
|
5889
5850
|
className: cx("footer-btn"),
|
|
5890
5851
|
disabled: !isAddEnabled,
|
|
5891
5852
|
onClick: handleAddTagClick,
|
|
@@ -6073,9 +6034,9 @@ const AddTagDrawer = ({ open, onClose, mode, initialValues, onAddTag, onEditTag
|
|
|
6073
6034
|
borderRadius: 8,
|
|
6074
6035
|
height: 32,
|
|
6075
6036
|
paddingInline: 16,
|
|
6076
|
-
backgroundColor: token
|
|
6077
|
-
borderColor: token
|
|
6078
|
-
boxShadow: `0px 2px 0px ${token
|
|
6037
|
+
backgroundColor: token.colorPrimary,
|
|
6038
|
+
borderColor: token.colorPrimary,
|
|
6039
|
+
boxShadow: `0px 2px 0px ${token.colorPrimaryBg}`
|
|
6079
6040
|
},
|
|
6080
6041
|
children: confirmBtnLabel
|
|
6081
6042
|
})]
|
|
@@ -6084,7 +6045,6 @@ const AddTagDrawer = ({ open, onClose, mode, initialValues, onAddTag, onEditTag
|
|
|
6084
6045
|
})
|
|
6085
6046
|
] }));
|
|
6086
6047
|
};
|
|
6087
|
-
|
|
6088
6048
|
//#endregion
|
|
6089
6049
|
//#region src/view/helper/mutate.ts
|
|
6090
6050
|
const resolveSchema = (schema, components) => {
|
|
@@ -6169,7 +6129,6 @@ const transformOpenApiToDocs = (api) => {
|
|
|
6169
6129
|
curl
|
|
6170
6130
|
};
|
|
6171
6131
|
};
|
|
6172
|
-
|
|
6173
6132
|
//#endregion
|
|
6174
6133
|
//#region src/assets/copy.tsx
|
|
6175
6134
|
const Copy = (props) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
|
|
@@ -6187,17 +6146,15 @@ const Copy = (props) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
|
|
|
6187
6146
|
fill: "currentcolor"
|
|
6188
6147
|
})]
|
|
6189
6148
|
});
|
|
6190
|
-
var copy_default = Copy;
|
|
6191
|
-
|
|
6192
6149
|
//#endregion
|
|
6193
6150
|
//#region src/view/components/EndpointPage/Codebox/Codebox.tsx
|
|
6194
|
-
react_syntax_highlighter.Light.registerLanguage("json",
|
|
6151
|
+
react_syntax_highlighter.Light.registerLanguage("json", react_syntax_highlighter_dist_esm_languages_hljs_json_js.default);
|
|
6195
6152
|
const Codebox = ({ code, language, wrapLongLines }) => {
|
|
6196
|
-
const [appTheme] = (0, react.useState)("DARK");
|
|
6197
|
-
const { token
|
|
6198
|
-
const bodyBg = themeConfig.id == 1 ? token
|
|
6199
|
-
const { cx } = useStyle("codeBox", (token
|
|
6200
|
-
borderRadius: token
|
|
6153
|
+
const [appTheme] = (0, react$1.useState)("DARK");
|
|
6154
|
+
const { token, theme: themeConfig } = antd.theme.useToken();
|
|
6155
|
+
const bodyBg = themeConfig.id == 1 ? token.colorBgContainer : "#1d2856";
|
|
6156
|
+
const { cx } = useStyle("codeBox", (token, scope) => ({ [scope("codebox")]: {
|
|
6157
|
+
borderRadius: token.borderRadius,
|
|
6201
6158
|
height: "100%",
|
|
6202
6159
|
maxHeight: "100%",
|
|
6203
6160
|
overflow: "auto",
|
|
@@ -6207,7 +6164,7 @@ const Codebox = ({ code, language, wrapLongLines }) => {
|
|
|
6207
6164
|
className: cx("codebox"),
|
|
6208
6165
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_syntax_highlighter.Light, {
|
|
6209
6166
|
language: language || "json",
|
|
6210
|
-
style: appTheme === "LIGHT" ?
|
|
6167
|
+
style: appTheme === "LIGHT" ? react_syntax_highlighter_dist_esm_styles_hljs_index_js.stackoverflowLight : react_syntax_highlighter_dist_esm_styles_hljs_index_js.stackoverflowDark,
|
|
6211
6168
|
showLineNumbers: true,
|
|
6212
6169
|
wrapLines: true,
|
|
6213
6170
|
wrapLongLines,
|
|
@@ -6224,13 +6181,11 @@ const Codebox = ({ code, language, wrapLongLines }) => {
|
|
|
6224
6181
|
})
|
|
6225
6182
|
});
|
|
6226
6183
|
};
|
|
6227
|
-
var Codebox_default = Codebox;
|
|
6228
|
-
|
|
6229
6184
|
//#endregion
|
|
6230
6185
|
//#region src/view/components/CodeboxSidebar.tsx
|
|
6231
6186
|
function CodeboxSidebar() {
|
|
6232
|
-
const { selectedEndpoint, selectedApi, activeRequestTab, selectedStatusCode, statusCodeOptions, setSelectedStatusCode } =
|
|
6233
|
-
const httpStatusOptions = (0, react.useMemo)(() => statusCodeOptions.map((code) => ({
|
|
6187
|
+
const { selectedEndpoint, selectedApi, activeRequestTab, selectedStatusCode, statusCodeOptions, setSelectedStatusCode } = useStore(({ view }) => view);
|
|
6188
|
+
const httpStatusOptions = (0, react$1.useMemo)(() => statusCodeOptions.map((code) => ({
|
|
6234
6189
|
value: code,
|
|
6235
6190
|
label: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
6236
6191
|
style: {
|
|
@@ -6249,7 +6204,7 @@ function CodeboxSidebar() {
|
|
|
6249
6204
|
} }), code]
|
|
6250
6205
|
})
|
|
6251
6206
|
})), [statusCodeOptions]);
|
|
6252
|
-
const [curlTooltip, setCurlTooltip] = (0, react.useState)("Copy Request");
|
|
6207
|
+
const [curlTooltip, setCurlTooltip] = (0, react$1.useState)("Copy Request");
|
|
6253
6208
|
const curlCommand = (() => {
|
|
6254
6209
|
if (!selectedEndpoint || !Array.isArray(selectedApi?.curl)) return "";
|
|
6255
6210
|
return selectedApi.curl.find((c) => c.path === selectedEndpoint.path && c.method?.toUpperCase() === selectedEndpoint.method.toUpperCase())?.curlCommand ?? "";
|
|
@@ -6403,7 +6358,7 @@ function CodeboxSidebar() {
|
|
|
6403
6358
|
setCurlTooltip("Copied!");
|
|
6404
6359
|
setTimeout(() => setCurlTooltip("Copy cURL"), 1500);
|
|
6405
6360
|
},
|
|
6406
|
-
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
6361
|
+
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Copy, { style: { color: "white" } })
|
|
6407
6362
|
})
|
|
6408
6363
|
})]
|
|
6409
6364
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
@@ -6433,47 +6388,45 @@ function CodeboxSidebar() {
|
|
|
6433
6388
|
open: httpStatusOptions.length === 1 ? false : void 0,
|
|
6434
6389
|
suffixIcon: httpStatusOptions.length > 1 ? void 0 : false
|
|
6435
6390
|
})]
|
|
6436
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
6391
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Codebox, { code: JSON.stringify(selectedEndpoint?.responses[selectedStatusCode], null, 2) || "" })]
|
|
6437
6392
|
})]
|
|
6438
6393
|
});
|
|
6439
6394
|
}
|
|
6440
|
-
var CodeboxSidebar_default = CodeboxSidebar;
|
|
6441
|
-
|
|
6442
6395
|
//#endregion
|
|
6443
6396
|
//#region src/view/layout.tsx
|
|
6444
6397
|
const DocumentationLayout = ({ data, preSelectedApi, handleVisitLandingPage, onSave }) => {
|
|
6445
|
-
const [searchValue, setSearchValue] = (0, react.useState)("");
|
|
6446
|
-
const [mode, setMode] = (0, react.useState)("edit");
|
|
6447
|
-
const [hasChanges, setHasChanges] = (0, react.useState)(false);
|
|
6448
|
-
const [bannerVisible, setBannerVisible] = (0, react.useState)(false);
|
|
6449
|
-
const [resetKey, setResetKey] = (0, react.useState)(0);
|
|
6450
|
-
const [generalCollapsed, setGeneralCollapsed] = (0, react.useState)(false);
|
|
6451
|
-
const [tagsCollapsed, setTagsCollapsed] = (0, react.useState)(false);
|
|
6452
|
-
const [endpointsCollapsed, setEndpointsCollapsed] = (0, react.useState)(false);
|
|
6453
|
-
const [localApiName, setLocalApiName] = (0, react.useState)("");
|
|
6454
|
-
const [localDescription, setLocalDescription] = (0, react.useState)("");
|
|
6455
|
-
const [selectedUrl, setSelectedUrl] = (0, react.useState)("");
|
|
6456
|
-
const [endpointNames, setEndpointNames] = (0, react.useState)({});
|
|
6457
|
-
const [endpointDescs, setEndpointDescs] = (0, react.useState)({});
|
|
6458
|
-
const [endpointTags, setEndpointTags] = (0, react.useState)({});
|
|
6459
|
-
const [endpointParams, setEndpointParams] = (0, react.useState)({});
|
|
6460
|
-
const [endpointResponseParams, setEndpointResponseParams] = (0, react.useState)({});
|
|
6461
|
-
const [tagDrawerState, setTagDrawerState] = (0, react.useState)({
|
|
6398
|
+
const [searchValue, setSearchValue] = (0, react$1.useState)("");
|
|
6399
|
+
const [mode, setMode] = (0, react$1.useState)("edit");
|
|
6400
|
+
const [hasChanges, setHasChanges] = (0, react$1.useState)(false);
|
|
6401
|
+
const [bannerVisible, setBannerVisible] = (0, react$1.useState)(false);
|
|
6402
|
+
const [resetKey, setResetKey] = (0, react$1.useState)(0);
|
|
6403
|
+
const [generalCollapsed, setGeneralCollapsed] = (0, react$1.useState)(false);
|
|
6404
|
+
const [tagsCollapsed, setTagsCollapsed] = (0, react$1.useState)(false);
|
|
6405
|
+
const [endpointsCollapsed, setEndpointsCollapsed] = (0, react$1.useState)(false);
|
|
6406
|
+
const [localApiName, setLocalApiName] = (0, react$1.useState)("");
|
|
6407
|
+
const [localDescription, setLocalDescription] = (0, react$1.useState)("");
|
|
6408
|
+
const [selectedUrl, setSelectedUrl] = (0, react$1.useState)("");
|
|
6409
|
+
const [endpointNames, setEndpointNames] = (0, react$1.useState)({});
|
|
6410
|
+
const [endpointDescs, setEndpointDescs] = (0, react$1.useState)({});
|
|
6411
|
+
const [endpointTags, setEndpointTags] = (0, react$1.useState)({});
|
|
6412
|
+
const [endpointParams, setEndpointParams] = (0, react$1.useState)({});
|
|
6413
|
+
const [endpointResponseParams, setEndpointResponseParams] = (0, react$1.useState)({});
|
|
6414
|
+
const [tagDrawerState, setTagDrawerState] = (0, react$1.useState)({
|
|
6462
6415
|
open: false,
|
|
6463
6416
|
mode: "add"
|
|
6464
6417
|
});
|
|
6465
|
-
const [deleteTagModal, setDeleteTagModal] = (0, react.useState)({
|
|
6418
|
+
const [deleteTagModal, setDeleteTagModal] = (0, react$1.useState)({
|
|
6466
6419
|
open: false,
|
|
6467
6420
|
tagName: ""
|
|
6468
6421
|
});
|
|
6469
|
-
const [localTags, setLocalTags] = (0, react.useState)([]);
|
|
6422
|
+
const [localTags, setLocalTags] = (0, react$1.useState)([]);
|
|
6470
6423
|
const [messageApi, contextHolder] = antd.message.useMessage();
|
|
6471
|
-
const { focusedContent, selectedNodeKey, selectedApi, originalData, builtTreeData, selectedEndpoint, setOriginalData, setTransformedData, setBuiltTreeData, setFocusedContent, setExpandedKeys, setSelectedEndpoint } =
|
|
6424
|
+
const { focusedContent, selectedNodeKey, selectedApi, originalData, builtTreeData, selectedEndpoint, setOriginalData, setTransformedData, setBuiltTreeData, setFocusedContent, setExpandedKeys, setSelectedEndpoint } = useStore(({ view }) => view);
|
|
6472
6425
|
const { selectFirstApi, selectPreSelectedApi, clearSelection } = useNodeSelection();
|
|
6473
|
-
const hasInitializedRef = (0, react.useRef)(false);
|
|
6474
|
-
const { useBreakpoint
|
|
6475
|
-
const isMobile = !useBreakpoint
|
|
6476
|
-
(0, react.useEffect)(() => {
|
|
6426
|
+
const hasInitializedRef = (0, react$1.useRef)(false);
|
|
6427
|
+
const { useBreakpoint } = antd.Grid;
|
|
6428
|
+
const isMobile = !useBreakpoint().md;
|
|
6429
|
+
(0, react$1.useEffect)(() => {
|
|
6477
6430
|
return () => {
|
|
6478
6431
|
resetStore();
|
|
6479
6432
|
};
|
|
@@ -6488,7 +6441,7 @@ const DocumentationLayout = ({ data, preSelectedApi, handleVisitLandingPage, onS
|
|
|
6488
6441
|
clearSelection();
|
|
6489
6442
|
hasInitializedRef.current = false;
|
|
6490
6443
|
};
|
|
6491
|
-
(0, react.useEffect)(() => {
|
|
6444
|
+
(0, react$1.useEffect)(() => {
|
|
6492
6445
|
if (!hasInitializedRef.current && data.length > 0) {
|
|
6493
6446
|
setOriginalData(data);
|
|
6494
6447
|
const transformedData = data.map(transformOpenApiToDocs).sort((a, b) => a.title.localeCompare(b.title));
|
|
@@ -6502,7 +6455,7 @@ const DocumentationLayout = ({ data, preSelectedApi, handleVisitLandingPage, onS
|
|
|
6502
6455
|
setTransformedData,
|
|
6503
6456
|
setBuiltTreeData
|
|
6504
6457
|
]);
|
|
6505
|
-
(0, react.useEffect)(() => {
|
|
6458
|
+
(0, react$1.useEffect)(() => {
|
|
6506
6459
|
if (builtTreeData && builtTreeData.length > 0 && !selectedApi && !selectedNodeKey && hasInitializedRef.current) {
|
|
6507
6460
|
if (!preSelectedApi) selectFirstApi(builtTreeData);
|
|
6508
6461
|
else selectPreSelectedApi(builtTreeData, preSelectedApi);
|
|
@@ -6514,11 +6467,11 @@ const DocumentationLayout = ({ data, preSelectedApi, handleVisitLandingPage, onS
|
|
|
6514
6467
|
selectedApi,
|
|
6515
6468
|
selectFirstApi
|
|
6516
6469
|
]);
|
|
6517
|
-
const { cx, token
|
|
6470
|
+
const { cx, token } = useStyle("APIDocumentationLayout", (token, scope) => ({
|
|
6518
6471
|
[scope("documentation-container")]: {
|
|
6519
6472
|
display: "flex",
|
|
6520
6473
|
flexDirection: "column",
|
|
6521
|
-
gap: token
|
|
6474
|
+
gap: token.marginLG,
|
|
6522
6475
|
height: "100%",
|
|
6523
6476
|
overflowY: "auto"
|
|
6524
6477
|
},
|
|
@@ -6530,7 +6483,7 @@ const DocumentationLayout = ({ data, preSelectedApi, handleVisitLandingPage, onS
|
|
|
6530
6483
|
display: "flex",
|
|
6531
6484
|
flexShrink: 0,
|
|
6532
6485
|
height: "auto",
|
|
6533
|
-
gap: token
|
|
6486
|
+
gap: token.marginLG,
|
|
6534
6487
|
width: "100%"
|
|
6535
6488
|
},
|
|
6536
6489
|
[".delete-tag-confirm-modal .ant-modal-container"]: {
|
|
@@ -6552,7 +6505,7 @@ const DocumentationLayout = ({ data, preSelectedApi, handleVisitLandingPage, onS
|
|
|
6552
6505
|
fontSize: 16,
|
|
6553
6506
|
fontWeight: 400,
|
|
6554
6507
|
lineHeight: "24px",
|
|
6555
|
-
color: token
|
|
6508
|
+
color: token.colorText
|
|
6556
6509
|
},
|
|
6557
6510
|
[scope("deleteModalCloseBtn")]: {
|
|
6558
6511
|
position: "absolute",
|
|
@@ -6568,12 +6521,12 @@ const DocumentationLayout = ({ data, preSelectedApi, handleVisitLandingPage, onS
|
|
|
6568
6521
|
border: "none",
|
|
6569
6522
|
background: "transparent",
|
|
6570
6523
|
padding: 0,
|
|
6571
|
-
color: token
|
|
6524
|
+
color: token.colorTextTertiary,
|
|
6572
6525
|
fontSize: 16,
|
|
6573
6526
|
lineHeight: 1,
|
|
6574
6527
|
"&:hover": {
|
|
6575
|
-
color: token
|
|
6576
|
-
backgroundColor: token
|
|
6528
|
+
color: token.colorText,
|
|
6529
|
+
backgroundColor: token.colorFillSecondary
|
|
6577
6530
|
}
|
|
6578
6531
|
},
|
|
6579
6532
|
[scope("deleteModalContent")]: {
|
|
@@ -6590,7 +6543,7 @@ const DocumentationLayout = ({ data, preSelectedApi, handleVisitLandingPage, onS
|
|
|
6590
6543
|
fontSize: 14,
|
|
6591
6544
|
fontWeight: 400,
|
|
6592
6545
|
lineHeight: "22px",
|
|
6593
|
-
color: token
|
|
6546
|
+
color: token.colorText
|
|
6594
6547
|
},
|
|
6595
6548
|
[scope("deleteModalFooter")]: {
|
|
6596
6549
|
display: "flex",
|
|
@@ -6604,12 +6557,12 @@ const DocumentationLayout = ({ data, preSelectedApi, handleVisitLandingPage, onS
|
|
|
6604
6557
|
backgroundColor: "transparent"
|
|
6605
6558
|
}
|
|
6606
6559
|
}));
|
|
6607
|
-
(0, react.useEffect)(() => {
|
|
6560
|
+
(0, react$1.useEffect)(() => {
|
|
6608
6561
|
setLocalApiName(selectedApi?.title || "");
|
|
6609
6562
|
setLocalDescription(selectedApi?.description || "");
|
|
6610
6563
|
if (selectedApi?.servers?.length) setSelectedUrl(selectedApi.servers[0].url);
|
|
6611
6564
|
}, [selectedApi]);
|
|
6612
|
-
const tagMetadata = (0, react.useMemo)(() => {
|
|
6565
|
+
const tagMetadata = (0, react$1.useMemo)(() => {
|
|
6613
6566
|
if (!originalData || !selectedApi) return [];
|
|
6614
6567
|
const rawFile = originalData.find((f) => Object.keys(f.paths)[0] === selectedApi.contextPath);
|
|
6615
6568
|
if (!rawFile?.tags) return [];
|
|
@@ -6621,7 +6574,7 @@ const DocumentationLayout = ({ data, preSelectedApi, handleVisitLandingPage, onS
|
|
|
6621
6574
|
isDefault: t.name.toLowerCase() === "default"
|
|
6622
6575
|
}));
|
|
6623
6576
|
}, [originalData, selectedApi]);
|
|
6624
|
-
const initialEndpointResponseParams = (0, react.useMemo)(() => {
|
|
6577
|
+
const initialEndpointResponseParams = (0, react$1.useMemo)(() => {
|
|
6625
6578
|
if (!originalData || !selectedApi) return {};
|
|
6626
6579
|
const rawFile = originalData.find((f) => Object.keys(f.paths)[0] === selectedApi.contextPath);
|
|
6627
6580
|
if (!rawFile) return {};
|
|
@@ -6651,7 +6604,7 @@ const DocumentationLayout = ({ data, preSelectedApi, handleVisitLandingPage, onS
|
|
|
6651
6604
|
});
|
|
6652
6605
|
return result;
|
|
6653
6606
|
}, [originalData, selectedApi]);
|
|
6654
|
-
const initialEndpointParams = (0, react.useMemo)(() => {
|
|
6607
|
+
const initialEndpointParams = (0, react$1.useMemo)(() => {
|
|
6655
6608
|
if (!originalData || !selectedApi) return {};
|
|
6656
6609
|
const rawFile = originalData.find((f) => Object.keys(f.paths)[0] === selectedApi.contextPath);
|
|
6657
6610
|
if (!rawFile) return {};
|
|
@@ -6681,12 +6634,12 @@ const DocumentationLayout = ({ data, preSelectedApi, handleVisitLandingPage, onS
|
|
|
6681
6634
|
});
|
|
6682
6635
|
return result;
|
|
6683
6636
|
}, [originalData, selectedApi]);
|
|
6684
|
-
(0, react.useEffect)(() => {
|
|
6637
|
+
(0, react$1.useEffect)(() => {
|
|
6685
6638
|
setLocalTags(tagMetadata);
|
|
6686
6639
|
setEndpointParams(initialEndpointParams);
|
|
6687
6640
|
setEndpointResponseParams(initialEndpointResponseParams);
|
|
6688
6641
|
}, [selectedApi]);
|
|
6689
|
-
(0, react.useEffect)(() => {
|
|
6642
|
+
(0, react$1.useEffect)(() => {
|
|
6690
6643
|
if (mode !== "view" || !selectedEndpoint) return;
|
|
6691
6644
|
const epId = selectedEndpoint.id;
|
|
6692
6645
|
const openApiParams = (endpointParams[epId] ?? []).map((p) => ({
|
|
@@ -6879,7 +6832,7 @@ const DocumentationLayout = ({ data, preSelectedApi, handleVisitLandingPage, onS
|
|
|
6879
6832
|
style: {
|
|
6880
6833
|
display: "flex",
|
|
6881
6834
|
alignItems: "center",
|
|
6882
|
-
background: token
|
|
6835
|
+
background: token.colorBgLayout,
|
|
6883
6836
|
padding: "4px",
|
|
6884
6837
|
borderRadius: 8,
|
|
6885
6838
|
gap: 8
|
|
@@ -6894,14 +6847,14 @@ const DocumentationLayout = ({ data, preSelectedApi, handleVisitLandingPage, onS
|
|
|
6894
6847
|
border: "none",
|
|
6895
6848
|
cursor: "pointer",
|
|
6896
6849
|
borderRadius: 8,
|
|
6897
|
-
fontFamily: token
|
|
6898
|
-
background: mode === "edit" ? token
|
|
6850
|
+
fontFamily: token.fontFamily,
|
|
6851
|
+
background: mode === "edit" ? token.colorBgContainer : "transparent",
|
|
6899
6852
|
boxShadow: mode === "edit" ? "0px 2px 4px -2px rgba(17,12,34,0.12)" : "none",
|
|
6900
6853
|
fontWeight: mode === "edit" ? 700 : 400,
|
|
6901
|
-
fontSize: mode === "edit" ? token
|
|
6902
|
-
color: token
|
|
6854
|
+
fontSize: mode === "edit" ? token.fontSize : token.fontSizeLG,
|
|
6855
|
+
color: token.colorText
|
|
6903
6856
|
},
|
|
6904
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
6857
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_ant_design_icons.EditOutlined, { style: { fontSize: 18 } }), "Edit"]
|
|
6905
6858
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
6906
6859
|
onClick: () => setMode("view"),
|
|
6907
6860
|
style: {
|
|
@@ -6912,14 +6865,14 @@ const DocumentationLayout = ({ data, preSelectedApi, handleVisitLandingPage, onS
|
|
|
6912
6865
|
border: "none",
|
|
6913
6866
|
cursor: "pointer",
|
|
6914
6867
|
borderRadius: 8,
|
|
6915
|
-
fontFamily: token
|
|
6916
|
-
background: mode === "view" ? token
|
|
6868
|
+
fontFamily: token.fontFamily,
|
|
6869
|
+
background: mode === "view" ? token.colorBgContainer : "transparent",
|
|
6917
6870
|
boxShadow: mode === "view" ? "0px 2px 4px -2px rgba(17,12,34,0.12)" : "none",
|
|
6918
6871
|
fontWeight: mode === "view" ? 700 : 400,
|
|
6919
|
-
fontSize: mode === "view" ? token
|
|
6920
|
-
color: token
|
|
6872
|
+
fontSize: mode === "view" ? token.fontSize : token.fontSizeLG,
|
|
6873
|
+
color: token.colorText
|
|
6921
6874
|
},
|
|
6922
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
6875
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_ant_design_icons.EyeOutlined, { style: { fontSize: 18 } }), "View"]
|
|
6923
6876
|
})]
|
|
6924
6877
|
});
|
|
6925
6878
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
@@ -7082,7 +7035,7 @@ const DocumentationLayout = ({ data, preSelectedApi, handleVisitLandingPage, onS
|
|
|
7082
7035
|
handleResetSearch,
|
|
7083
7036
|
searchEnabled: !!searchValue
|
|
7084
7037
|
}),
|
|
7085
|
-
!isMobile && focusedContent === "ENDPOINT" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
7038
|
+
!isMobile && focusedContent === "ENDPOINT" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CodeboxSidebar, {})
|
|
7086
7039
|
]
|
|
7087
7040
|
}),
|
|
7088
7041
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(AddTagDrawer, {
|
|
@@ -7182,9 +7135,105 @@ const DocumentationLayout = ({ data, preSelectedApi, handleVisitLandingPage, onS
|
|
|
7182
7135
|
]
|
|
7183
7136
|
});
|
|
7184
7137
|
};
|
|
7185
|
-
|
|
7138
|
+
//#endregion
|
|
7139
|
+
//#region src/view/devportal-layout.tsx
|
|
7140
|
+
const DevportalDocumentationLayout = ({ data, preSelectedApi, handleVisitLandingPage }) => {
|
|
7141
|
+
const [searchValue, setSearchValue] = (0, react$1.useState)("");
|
|
7142
|
+
const { focusedContent, selectedNodeKey, selectedApi, builtTreeData, setOriginalData, setTransformedData, setBuiltTreeData, setFocusedContent, setExpandedKeys } = useStore(({ view }) => view);
|
|
7143
|
+
const { selectFirstApi, selectPreSelectedApi, clearSelection } = useNodeSelection();
|
|
7144
|
+
const hasInitializedRef = (0, react$1.useRef)(false);
|
|
7145
|
+
(0, react$1.useEffect)(() => {
|
|
7146
|
+
return () => {
|
|
7147
|
+
resetStore();
|
|
7148
|
+
};
|
|
7149
|
+
}, []);
|
|
7150
|
+
const resetStore = () => {
|
|
7151
|
+
setExpandedKeys([]);
|
|
7152
|
+
setFocusedContent(null);
|
|
7153
|
+
setBuiltTreeData([]);
|
|
7154
|
+
setTransformedData([]);
|
|
7155
|
+
setOriginalData([]);
|
|
7156
|
+
setSearchValue("");
|
|
7157
|
+
clearSelection();
|
|
7158
|
+
hasInitializedRef.current = false;
|
|
7159
|
+
};
|
|
7160
|
+
(0, react$1.useEffect)(() => {
|
|
7161
|
+
if (!hasInitializedRef.current && data.length > 0) {
|
|
7162
|
+
setOriginalData(data);
|
|
7163
|
+
const transformedData = data.map(transformOpenApiToDocs).sort((a, b) => a.title.localeCompare(b.title));
|
|
7164
|
+
setTransformedData(transformedData);
|
|
7165
|
+
setBuiltTreeData(buildTreeDataStructure(transformedData));
|
|
7166
|
+
hasInitializedRef.current = true;
|
|
7167
|
+
}
|
|
7168
|
+
}, [
|
|
7169
|
+
data,
|
|
7170
|
+
setOriginalData,
|
|
7171
|
+
setTransformedData,
|
|
7172
|
+
setBuiltTreeData
|
|
7173
|
+
]);
|
|
7174
|
+
(0, react$1.useEffect)(() => {
|
|
7175
|
+
if (builtTreeData && builtTreeData.length > 0 && !selectedApi && !selectedNodeKey && hasInitializedRef.current) {
|
|
7176
|
+
if (!preSelectedApi) selectFirstApi(builtTreeData);
|
|
7177
|
+
else selectPreSelectedApi(builtTreeData, preSelectedApi);
|
|
7178
|
+
hasInitializedRef.current = false;
|
|
7179
|
+
}
|
|
7180
|
+
}, [
|
|
7181
|
+
builtTreeData,
|
|
7182
|
+
selectedNodeKey,
|
|
7183
|
+
selectedApi,
|
|
7184
|
+
selectFirstApi
|
|
7185
|
+
]);
|
|
7186
|
+
const { cx } = useStyle("APIDocumentationLayout", (token, scope) => ({
|
|
7187
|
+
[scope("documentation-container")]: {
|
|
7188
|
+
display: "flex",
|
|
7189
|
+
flexDirection: "column",
|
|
7190
|
+
gap: token.marginLG,
|
|
7191
|
+
height: "100%",
|
|
7192
|
+
maxHeight: "100%",
|
|
7193
|
+
overflow: "hidden"
|
|
7194
|
+
},
|
|
7195
|
+
[scope("docs-layout")]: {
|
|
7196
|
+
display: "flex",
|
|
7197
|
+
height: "100%",
|
|
7198
|
+
maxHeight: "100%",
|
|
7199
|
+
overflow: "hidden",
|
|
7200
|
+
gap: token.marginLG,
|
|
7201
|
+
width: "100%"
|
|
7202
|
+
}
|
|
7203
|
+
}));
|
|
7204
|
+
const handleResetSearch = () => {
|
|
7205
|
+
setSearchValue("");
|
|
7206
|
+
};
|
|
7207
|
+
const _handleVisitLandingPage = () => {
|
|
7208
|
+
if (handleVisitLandingPage) {
|
|
7209
|
+
handleVisitLandingPage();
|
|
7210
|
+
return;
|
|
7211
|
+
}
|
|
7212
|
+
window.location.pathname = "/";
|
|
7213
|
+
};
|
|
7214
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
7215
|
+
className: cx("documentation-container"),
|
|
7216
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
7217
|
+
className: cx("docs-layout"),
|
|
7218
|
+
children: [
|
|
7219
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Sidebar, {
|
|
7220
|
+
searchValue,
|
|
7221
|
+
setSearchValue
|
|
7222
|
+
}),
|
|
7223
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(MainContent, {
|
|
7224
|
+
handleVisitLandingPage: _handleVisitLandingPage,
|
|
7225
|
+
handleResetSearch,
|
|
7226
|
+
searchEnabled: !!searchValue
|
|
7227
|
+
}),
|
|
7228
|
+
focusedContent === "ENDPOINT" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CodeboxSidebar, {})
|
|
7229
|
+
]
|
|
7230
|
+
})
|
|
7231
|
+
});
|
|
7232
|
+
};
|
|
7186
7233
|
//#endregion
|
|
7187
7234
|
exports.ApiDocumentationBar = ApiDocumentationBar;
|
|
7235
|
+
exports.DevportalDocumentationLayout = DevportalDocumentationLayout;
|
|
7188
7236
|
exports.DocumentationLayout = DocumentationLayout;
|
|
7189
7237
|
exports.useStore = useStore;
|
|
7238
|
+
|
|
7190
7239
|
//# sourceMappingURL=index.cjs.map
|