@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
|
@@ -11,9 +11,8 @@ import { Resizable } from "re-resizable";
|
|
|
11
11
|
import Title from "antd/es/typography/Title";
|
|
12
12
|
import { nanoid } from "nanoid";
|
|
13
13
|
import { Light } from "react-syntax-highlighter";
|
|
14
|
-
import json from "react-syntax-highlighter/dist/esm/languages/hljs/json";
|
|
15
|
-
import * as hljs from "react-syntax-highlighter/dist/esm/styles/hljs";
|
|
16
|
-
|
|
14
|
+
import json from "react-syntax-highlighter/dist/esm/languages/hljs/json.js";
|
|
15
|
+
import * as hljs from "react-syntax-highlighter/dist/esm/styles/hljs/index.js";
|
|
17
16
|
//#region src/store/slices/view.ts
|
|
18
17
|
const createViewSlice = (set) => ({ view: {
|
|
19
18
|
selectedNodeKey: null,
|
|
@@ -69,32 +68,28 @@ const createViewSlice = (set) => ({ view: {
|
|
|
69
68
|
state.view.selectedStatusCode = code;
|
|
70
69
|
})
|
|
71
70
|
} });
|
|
72
|
-
|
|
73
71
|
//#endregion
|
|
74
72
|
//#region src/store/index.ts
|
|
75
73
|
const createStore = (set) => ({ ...createViewSlice(set) });
|
|
76
74
|
const useStore = create()(devtools(immer(createStore), { name: "dgate-docs-store" }));
|
|
77
|
-
var store_default = useStore;
|
|
78
|
-
|
|
79
75
|
//#endregion
|
|
80
76
|
//#region src/hooks/useStyle.ts
|
|
81
77
|
function useStyle(componentName, stylesFn) {
|
|
82
|
-
const { token
|
|
78
|
+
const { token, theme: theme$1, hashId } = theme.useToken();
|
|
83
79
|
const scope = (className) => `.${hashId}.${componentName}-${className}`;
|
|
84
80
|
const cx = (...classes) => classes.map((cls) => `${componentName}-${cls} ${hashId}`).join(" ");
|
|
85
81
|
return {
|
|
86
82
|
wrapSSR: useStyleRegister({
|
|
87
83
|
theme: theme$1,
|
|
88
|
-
token
|
|
84
|
+
token,
|
|
89
85
|
path: [componentName]
|
|
90
|
-
}, () => stylesFn(token
|
|
86
|
+
}, () => stylesFn(token, scope)),
|
|
91
87
|
cx,
|
|
92
88
|
scope,
|
|
93
|
-
token
|
|
89
|
+
token,
|
|
94
90
|
hashId
|
|
95
91
|
};
|
|
96
92
|
}
|
|
97
|
-
|
|
98
93
|
//#endregion
|
|
99
94
|
//#region src/theme/light.json
|
|
100
95
|
var token = {
|
|
@@ -425,7 +420,6 @@ var token = {
|
|
|
425
420
|
"marginXXXL": 60,
|
|
426
421
|
"marginXXXXL": 72
|
|
427
422
|
};
|
|
428
|
-
|
|
429
423
|
//#endregion
|
|
430
424
|
//#region src/view/helper/sidebar.utils.ts
|
|
431
425
|
const methodColors = {
|
|
@@ -638,18 +632,18 @@ const filterTreeData = (data, searchText) => {
|
|
|
638
632
|
};
|
|
639
633
|
return data.map((node) => filterNode(node)).filter((node) => node !== null);
|
|
640
634
|
};
|
|
641
|
-
const getSidebarStyles = (token
|
|
635
|
+
const getSidebarStyles = (token, scope) => ({
|
|
642
636
|
[scope("sider")]: {
|
|
643
|
-
backgroundColor: token
|
|
637
|
+
backgroundColor: token.colorBgElevated,
|
|
644
638
|
overflowX: "clip",
|
|
645
|
-
borderRadius: token
|
|
639
|
+
borderRadius: token.borderRadius,
|
|
646
640
|
height: "auto"
|
|
647
641
|
},
|
|
648
|
-
[scope("content")]: { padding: token
|
|
642
|
+
[scope("content")]: { padding: token.padding },
|
|
649
643
|
[scope("controls")]: {
|
|
650
644
|
display: "flex",
|
|
651
|
-
gap: token
|
|
652
|
-
marginBottom: token
|
|
645
|
+
gap: token.marginXS,
|
|
646
|
+
marginBottom: token.marginSM
|
|
653
647
|
},
|
|
654
648
|
[scope("search-input")]: { flex: 1 },
|
|
655
649
|
[scope("tree")]: {
|
|
@@ -675,17 +669,17 @@ const getSidebarStyles = (token$1, scope) => ({
|
|
|
675
669
|
width: "100%",
|
|
676
670
|
padding: 0
|
|
677
671
|
},
|
|
678
|
-
"& .ant-tree-switcher": { backgroundColor: token
|
|
672
|
+
"& .ant-tree-switcher": { backgroundColor: token.colorBgElevated }
|
|
679
673
|
},
|
|
680
674
|
[scope("endpoint-item")]: {
|
|
681
675
|
display: "flex",
|
|
682
676
|
alignItems: "center",
|
|
683
|
-
gap: token
|
|
677
|
+
gap: token.marginXS,
|
|
684
678
|
width: "100%",
|
|
685
679
|
maxWidth: "100%",
|
|
686
680
|
minWidth: "100%",
|
|
687
|
-
paddingLeft: token
|
|
688
|
-
paddingRight: token
|
|
681
|
+
paddingLeft: token.marginXS,
|
|
682
|
+
paddingRight: token.marginXS
|
|
689
683
|
},
|
|
690
684
|
[scope("method-tag")]: {
|
|
691
685
|
width: 51,
|
|
@@ -708,14 +702,14 @@ const getSidebarStyles = (token$1, scope) => ({
|
|
|
708
702
|
display: "block"
|
|
709
703
|
},
|
|
710
704
|
[scope("tag-title")]: {
|
|
711
|
-
color: token
|
|
705
|
+
color: token.colorText,
|
|
712
706
|
maxWidth: "100%",
|
|
713
707
|
display: "block",
|
|
714
708
|
flex: 1
|
|
715
709
|
},
|
|
716
710
|
[scope("api-title")]: {
|
|
717
711
|
flex: 1,
|
|
718
|
-
color: token
|
|
712
|
+
color: token.colorText,
|
|
719
713
|
maxWidth: "100%",
|
|
720
714
|
display: "block",
|
|
721
715
|
paddingLeft: "4px",
|
|
@@ -723,7 +717,6 @@ const getSidebarStyles = (token$1, scope) => ({
|
|
|
723
717
|
margin: 0
|
|
724
718
|
}
|
|
725
719
|
});
|
|
726
|
-
|
|
727
720
|
//#endregion
|
|
728
721
|
//#region src/view/helper/sidebar.components.tsx
|
|
729
722
|
const { Text: Text$1 } = Typography;
|
|
@@ -778,7 +771,6 @@ const convertToRenderableTreeData = (treeDataStructure, selectedEndpoint, cx) =>
|
|
|
778
771
|
};
|
|
779
772
|
return treeDataStructure.map(renderNode);
|
|
780
773
|
};
|
|
781
|
-
|
|
782
774
|
//#endregion
|
|
783
775
|
//#region src/hooks/useNodeSelection.ts
|
|
784
776
|
const useNodeSelection = () => {
|
|
@@ -884,7 +876,6 @@ const useNodeSelection = () => {
|
|
|
884
876
|
selectPreSelectedApi
|
|
885
877
|
};
|
|
886
878
|
};
|
|
887
|
-
|
|
888
879
|
//#endregion
|
|
889
880
|
//#region src/assets/Minify.tsx
|
|
890
881
|
const Minify = (props) => /* @__PURE__ */ jsxs("svg", {
|
|
@@ -902,8 +893,6 @@ const Minify = (props) => /* @__PURE__ */ jsxs("svg", {
|
|
|
902
893
|
stroke: "currentcolor"
|
|
903
894
|
})]
|
|
904
895
|
});
|
|
905
|
-
var Minify_default = Minify;
|
|
906
|
-
|
|
907
896
|
//#endregion
|
|
908
897
|
//#region src/view/components/NoDataIcon.tsx
|
|
909
898
|
const NoDataIcon = ({ width = 298, height = 237, fill = "#F1F5FD", stroke = "#E0E9F9", ...props }) => {
|
|
@@ -1071,8 +1060,6 @@ const NoDataIcon = ({ width = 298, height = 237, fill = "#F1F5FD", stroke = "#E0
|
|
|
1071
1060
|
]
|
|
1072
1061
|
});
|
|
1073
1062
|
};
|
|
1074
|
-
var NoDataIcon_default = NoDataIcon;
|
|
1075
|
-
|
|
1076
1063
|
//#endregion
|
|
1077
1064
|
//#region src/view/components/Sidebar.tsx
|
|
1078
1065
|
const { useBreakpoint: useBreakpoint$4 } = Grid;
|
|
@@ -1082,7 +1069,7 @@ const Sidebar = ({ searchValue, setSearchValue, onNodeSelect }) => {
|
|
|
1082
1069
|
const { selectNodeByKey, clearSelection } = useNodeSelection();
|
|
1083
1070
|
const [autoExpandParent, setAutoExpandParent] = useState(true);
|
|
1084
1071
|
const isMobile = !useBreakpoint$4().md;
|
|
1085
|
-
const { wrapSSR, cx, token
|
|
1072
|
+
const { wrapSSR, cx, token } = useStyle("Sidebar", getSidebarStyles);
|
|
1086
1073
|
const handleSearch = (value) => {
|
|
1087
1074
|
if (value && builtTreeData) {
|
|
1088
1075
|
setExpandedKeys(getAllTreeKeys(builtTreeData));
|
|
@@ -1147,7 +1134,7 @@ const Sidebar = ({ searchValue, setSearchValue, onNodeSelect }) => {
|
|
|
1147
1134
|
children: /* @__PURE__ */ jsx(Button, {
|
|
1148
1135
|
onClick: collapseAll,
|
|
1149
1136
|
title: "Collapse All",
|
|
1150
|
-
icon: /* @__PURE__ */ jsx(
|
|
1137
|
+
icon: /* @__PURE__ */ jsx(Minify, {})
|
|
1151
1138
|
})
|
|
1152
1139
|
})]
|
|
1153
1140
|
}), filteredTreeData?.length ? /* @__PURE__ */ jsx(Tree, {
|
|
@@ -1172,30 +1159,30 @@ const Sidebar = ({ searchValue, setSearchValue, onNodeSelect }) => {
|
|
|
1172
1159
|
}) : /* @__PURE__ */ jsxs(Flex, {
|
|
1173
1160
|
justify: "center",
|
|
1174
1161
|
align: "center",
|
|
1175
|
-
gap: token
|
|
1162
|
+
gap: token.marginSM,
|
|
1176
1163
|
vertical: true,
|
|
1177
|
-
style: { marginTop: token
|
|
1178
|
-
children: [/* @__PURE__ */ jsx(
|
|
1179
|
-
stroke: token
|
|
1180
|
-
fill: token
|
|
1164
|
+
style: { marginTop: token.paddingXL },
|
|
1165
|
+
children: [/* @__PURE__ */ jsx(NoDataIcon, {
|
|
1166
|
+
stroke: token.colorPrimaryHover,
|
|
1167
|
+
fill: token.colorPrimaryBg,
|
|
1181
1168
|
width: "10.375rem",
|
|
1182
1169
|
height: "8.1875rem"
|
|
1183
1170
|
}), searchValue.length ? /* @__PURE__ */ jsx(Text, {
|
|
1184
1171
|
style: {
|
|
1185
1172
|
textAlign: "center",
|
|
1186
|
-
fontFamily: token
|
|
1173
|
+
fontFamily: token.fontFamily,
|
|
1187
1174
|
fontWeight: 400,
|
|
1188
|
-
fontSize: token
|
|
1189
|
-
color: token
|
|
1175
|
+
fontSize: token.fontSizeLG,
|
|
1176
|
+
color: token.colorTextTertiary
|
|
1190
1177
|
},
|
|
1191
1178
|
children: "No results found"
|
|
1192
1179
|
}) : /* @__PURE__ */ jsxs(Text, {
|
|
1193
1180
|
style: {
|
|
1194
1181
|
textAlign: "center",
|
|
1195
|
-
fontFamily: token
|
|
1182
|
+
fontFamily: token.fontFamily,
|
|
1196
1183
|
fontWeight: 400,
|
|
1197
|
-
fontSize: token
|
|
1198
|
-
color: token
|
|
1184
|
+
fontSize: token.fontSizeLG,
|
|
1185
|
+
color: token.colorTextTertiary
|
|
1199
1186
|
},
|
|
1200
1187
|
children: [
|
|
1201
1188
|
"No API",
|
|
@@ -1235,7 +1222,6 @@ const Sidebar = ({ searchValue, setSearchValue, onNodeSelect }) => {
|
|
|
1235
1222
|
children: inner
|
|
1236
1223
|
}));
|
|
1237
1224
|
};
|
|
1238
|
-
|
|
1239
1225
|
//#endregion
|
|
1240
1226
|
//#region src/assets/link.tsx
|
|
1241
1227
|
const Link = (props) => /* @__PURE__ */ jsxs("svg", {
|
|
@@ -1253,25 +1239,23 @@ const Link = (props) => /* @__PURE__ */ jsxs("svg", {
|
|
|
1253
1239
|
fill: "#4D75D9"
|
|
1254
1240
|
})]
|
|
1255
1241
|
});
|
|
1256
|
-
var link_default = Link;
|
|
1257
|
-
|
|
1258
1242
|
//#endregion
|
|
1259
1243
|
//#region src/view/components/ApiPage/components/ApiCard.tsx
|
|
1260
1244
|
const ApiCard = ({ api, viewStyle }) => {
|
|
1261
|
-
const { wrapSSR, cx, token
|
|
1245
|
+
const { wrapSSR, cx, token } = useStyle("DocumentationApiCard", (token, scope) => ({
|
|
1262
1246
|
[scope("method-chip")]: {
|
|
1263
1247
|
minWidth: "5.375rem",
|
|
1264
1248
|
width: "fit-content",
|
|
1265
|
-
paddingLeft: token
|
|
1266
|
-
paddingRight: token
|
|
1249
|
+
paddingLeft: token.marginXS,
|
|
1250
|
+
paddingRight: token.marginXS,
|
|
1267
1251
|
display: "flex",
|
|
1268
1252
|
justifyContent: "center",
|
|
1269
1253
|
alignItems: "center",
|
|
1270
|
-
borderRadius: token
|
|
1254
|
+
borderRadius: token.borderRadius
|
|
1271
1255
|
},
|
|
1272
1256
|
[scope("list-container")]: {
|
|
1273
|
-
paddingTop: token
|
|
1274
|
-
paddingBottom: token
|
|
1257
|
+
paddingTop: token.marginXS,
|
|
1258
|
+
paddingBottom: token.marginXS
|
|
1275
1259
|
},
|
|
1276
1260
|
[scope("chip-title")]: {
|
|
1277
1261
|
alignSelf: "center",
|
|
@@ -1279,97 +1263,97 @@ const ApiCard = ({ api, viewStyle }) => {
|
|
|
1279
1263
|
padding: 0,
|
|
1280
1264
|
margin: 0,
|
|
1281
1265
|
lineHeight: "1.375rem",
|
|
1282
|
-
fontSize: token
|
|
1266
|
+
fontSize: token.fontSize
|
|
1283
1267
|
},
|
|
1284
1268
|
[scope("list-see-details")]: {
|
|
1285
1269
|
width: "6.5625rem",
|
|
1286
1270
|
height: "2rem",
|
|
1287
|
-
borderRadius: token
|
|
1288
|
-
border: `${token
|
|
1289
|
-
paddingRight: token
|
|
1290
|
-
paddingLeft: token
|
|
1291
|
-
background: token
|
|
1292
|
-
"&:hover": { background: token
|
|
1271
|
+
borderRadius: token.borderRadius,
|
|
1272
|
+
border: `${token.lineWidth}px solid ${token.Button?.defaultBorderColor}`,
|
|
1273
|
+
paddingRight: token.Button?.paddingInline,
|
|
1274
|
+
paddingLeft: token.Button?.paddingInline,
|
|
1275
|
+
background: token.Button?.defaultBg,
|
|
1276
|
+
"&:hover": { background: token.Button?.defaultBg }
|
|
1293
1277
|
},
|
|
1294
1278
|
[scope("list-content")]: {
|
|
1295
1279
|
display: "flex",
|
|
1296
|
-
paddingTop: token
|
|
1297
|
-
paddingBottom: token
|
|
1298
|
-
paddingRight: token
|
|
1299
|
-
paddingLeft: token
|
|
1280
|
+
paddingTop: token.paddingXXS,
|
|
1281
|
+
paddingBottom: token.paddingXXS,
|
|
1282
|
+
paddingRight: token.paddingXS,
|
|
1283
|
+
paddingLeft: token.paddingXS,
|
|
1300
1284
|
alignItems: "center",
|
|
1301
|
-
gap: token
|
|
1285
|
+
gap: token.marginXS,
|
|
1302
1286
|
alignSelf: "stretch",
|
|
1303
1287
|
flexDirection: "row",
|
|
1304
|
-
borderRadius: token
|
|
1305
|
-
border: `1px solid ${token
|
|
1288
|
+
borderRadius: token.borderRadiusSM,
|
|
1289
|
+
border: `1px solid ${token.colorBorderSecondary}`,
|
|
1306
1290
|
minWidth: "6.25rem",
|
|
1307
1291
|
maxWidth: "fit-content",
|
|
1308
|
-
svg: { path: { fill: token
|
|
1292
|
+
svg: { path: { fill: token.colorPrimary } }
|
|
1309
1293
|
},
|
|
1310
1294
|
[scope("list-title")]: {
|
|
1311
|
-
color: token
|
|
1312
|
-
fontSize: token
|
|
1313
|
-
fontWeight: token
|
|
1314
|
-
lineHeight: token
|
|
1295
|
+
color: token.colorTextHeading,
|
|
1296
|
+
fontSize: token.fontSizeHeading3,
|
|
1297
|
+
fontWeight: token.fontWeightStrong,
|
|
1298
|
+
lineHeight: token.lineHeightHeading3,
|
|
1315
1299
|
paddingBottom: 0,
|
|
1316
1300
|
marginBottom: 0,
|
|
1317
|
-
fontFamily: token
|
|
1301
|
+
fontFamily: token.fontFamily,
|
|
1318
1302
|
cursor: "pointer",
|
|
1319
1303
|
transition: "color 0.2s ease-in",
|
|
1320
1304
|
"&:hover": {
|
|
1321
|
-
color: `${token
|
|
1305
|
+
color: `${token.colorPrimary} !important`,
|
|
1322
1306
|
textDecoration: "underline"
|
|
1323
1307
|
}
|
|
1324
1308
|
},
|
|
1325
1309
|
[scope("path-name")]: {
|
|
1326
|
-
color: token
|
|
1327
|
-
fontSize: token
|
|
1310
|
+
color: token.colorText,
|
|
1311
|
+
fontSize: token.fontSizeSM,
|
|
1328
1312
|
fontWeight: 400,
|
|
1329
|
-
fontFamily: token
|
|
1313
|
+
fontFamily: token.fontFamily
|
|
1330
1314
|
},
|
|
1331
1315
|
[scope("grid-card")]: {
|
|
1332
1316
|
width: "17.5rem",
|
|
1333
1317
|
height: "100%",
|
|
1334
|
-
borderRadius: token
|
|
1318
|
+
borderRadius: token.borderRadiusLG
|
|
1335
1319
|
},
|
|
1336
1320
|
[scope("grid-title")]: {
|
|
1337
|
-
color: token
|
|
1338
|
-
fontSize: token
|
|
1339
|
-
fontWeight: token
|
|
1340
|
-
lineHeight: token
|
|
1321
|
+
color: token.colorTextHeading,
|
|
1322
|
+
fontSize: token.fontSizeHeading3,
|
|
1323
|
+
fontWeight: token.fontWeightStrong,
|
|
1324
|
+
lineHeight: token.lineHeightHeading3,
|
|
1341
1325
|
paddingBottom: 0,
|
|
1342
1326
|
marginBottom: 0,
|
|
1343
|
-
fontFamily: token
|
|
1327
|
+
fontFamily: token.fontFamily
|
|
1344
1328
|
},
|
|
1345
1329
|
[scope("grid-content")]: {
|
|
1346
1330
|
display: "flex",
|
|
1347
|
-
paddingTop: token
|
|
1348
|
-
paddingBottom: token
|
|
1349
|
-
paddingRight: token
|
|
1350
|
-
paddingLeft: token
|
|
1331
|
+
paddingTop: token.paddingXXS,
|
|
1332
|
+
paddingBottom: token.paddingXXS,
|
|
1333
|
+
paddingRight: token.paddingXS,
|
|
1334
|
+
paddingLeft: token.paddingXS,
|
|
1351
1335
|
alignItems: "center",
|
|
1352
|
-
gap: token
|
|
1336
|
+
gap: token.marginXS,
|
|
1353
1337
|
alignSelf: "stretch",
|
|
1354
1338
|
flexDirection: "row",
|
|
1355
|
-
borderRadius: token
|
|
1356
|
-
border: `1px solid ${token
|
|
1357
|
-
svg: { path: { fill: token
|
|
1339
|
+
borderRadius: token.borderRadiusSM,
|
|
1340
|
+
border: `1px solid ${token.colorBorderSecondary}`,
|
|
1341
|
+
svg: { path: { fill: token.colorPrimary } }
|
|
1358
1342
|
},
|
|
1359
1343
|
[scope("grid-path-name")]: {
|
|
1360
|
-
color: token
|
|
1361
|
-
fontSize: token
|
|
1344
|
+
color: token.colorText,
|
|
1345
|
+
fontSize: token.fontSizeSM,
|
|
1362
1346
|
fontWeight: 400,
|
|
1363
|
-
fontFamily: token
|
|
1347
|
+
fontFamily: token.fontFamily
|
|
1364
1348
|
},
|
|
1365
1349
|
[scope("grid-see-details")]: {
|
|
1366
1350
|
paddingTop: 0,
|
|
1367
1351
|
paddingBottom: 0,
|
|
1368
1352
|
paddingLeft: "0.4375rem",
|
|
1369
1353
|
paddingRight: "0.4375rem",
|
|
1370
|
-
borderRadius: token
|
|
1371
|
-
border: `1px solid ${token
|
|
1372
|
-
background: token
|
|
1354
|
+
borderRadius: token.borderRadiusSM,
|
|
1355
|
+
border: `1px solid ${token.Button?.defaultBorderColor}`,
|
|
1356
|
+
background: token.Button?.defaultBg,
|
|
1373
1357
|
boxShadow: `0 2px 0 0 rgba(0, 0, 0, 0.02)`,
|
|
1374
1358
|
width: "100%",
|
|
1375
1359
|
height: "1.5rem"
|
|
@@ -1413,7 +1397,7 @@ const ApiCard = ({ api, viewStyle }) => {
|
|
|
1413
1397
|
align: "center",
|
|
1414
1398
|
className: cx("list-container"),
|
|
1415
1399
|
children: [/* @__PURE__ */ jsxs(Flex, {
|
|
1416
|
-
gap: token
|
|
1400
|
+
gap: token.marginSM,
|
|
1417
1401
|
children: [/* @__PURE__ */ jsx(MethodChip, { method: api.method }), /* @__PURE__ */ jsx(Title, {
|
|
1418
1402
|
className: cx("list-title"),
|
|
1419
1403
|
level: 4,
|
|
@@ -1428,7 +1412,7 @@ const ApiCard = ({ api, viewStyle }) => {
|
|
|
1428
1412
|
}),
|
|
1429
1413
|
/* @__PURE__ */ jsxs("div", {
|
|
1430
1414
|
className: cx("list-content"),
|
|
1431
|
-
children: [/* @__PURE__ */ jsx(
|
|
1415
|
+
children: [/* @__PURE__ */ jsx(Link, {}), /* @__PURE__ */ jsx(Text, {
|
|
1432
1416
|
className: cx("path-name"),
|
|
1433
1417
|
children: api?.path
|
|
1434
1418
|
})]
|
|
@@ -1443,7 +1427,7 @@ const ApiCard = ({ api, viewStyle }) => {
|
|
|
1443
1427
|
className: cx("grid-card"),
|
|
1444
1428
|
children: /* @__PURE__ */ jsxs(Flex, {
|
|
1445
1429
|
vertical: true,
|
|
1446
|
-
gap: token
|
|
1430
|
+
gap: token.marginSM,
|
|
1447
1431
|
children: [
|
|
1448
1432
|
/* @__PURE__ */ jsx(MethodChip, { method: api?.method }),
|
|
1449
1433
|
/* @__PURE__ */ jsx(Title, {
|
|
@@ -1453,7 +1437,7 @@ const ApiCard = ({ api, viewStyle }) => {
|
|
|
1453
1437
|
}),
|
|
1454
1438
|
/* @__PURE__ */ jsxs("div", {
|
|
1455
1439
|
className: cx("grid-content"),
|
|
1456
|
-
children: [/* @__PURE__ */ jsx(
|
|
1440
|
+
children: [/* @__PURE__ */ jsx(Link, {}), /* @__PURE__ */ jsx(Text, {
|
|
1457
1441
|
className: cx("grid-path-name"),
|
|
1458
1442
|
children: api?.path
|
|
1459
1443
|
})]
|
|
@@ -1467,8 +1451,6 @@ const ApiCard = ({ api, viewStyle }) => {
|
|
|
1467
1451
|
})
|
|
1468
1452
|
}));
|
|
1469
1453
|
};
|
|
1470
|
-
var ApiCard_default = ApiCard;
|
|
1471
|
-
|
|
1472
1454
|
//#endregion
|
|
1473
1455
|
//#region src/view/components/ApiPage/components/ViewModeApiHeader.tsx
|
|
1474
1456
|
function formatAuthType(authType) {
|
|
@@ -1482,11 +1464,11 @@ function formatAuthType(authType) {
|
|
|
1482
1464
|
}
|
|
1483
1465
|
}
|
|
1484
1466
|
const ViewModeApiHeader = ({ api, viewLayout, onViewLayoutChange }) => {
|
|
1485
|
-
const { wrapSSR, cx } = useStyle("ViewModeApiHeader", (token
|
|
1467
|
+
const { wrapSSR, cx } = useStyle("ViewModeApiHeader", (token, scope) => ({
|
|
1486
1468
|
[scope("root")]: {
|
|
1487
1469
|
display: "flex",
|
|
1488
1470
|
flexDirection: "column",
|
|
1489
|
-
gap: token
|
|
1471
|
+
gap: token.marginMD
|
|
1490
1472
|
},
|
|
1491
1473
|
[scope("meta-bar")]: {
|
|
1492
1474
|
display: "flex",
|
|
@@ -1502,20 +1484,20 @@ const ViewModeApiHeader = ({ api, viewLayout, onViewLayoutChange }) => {
|
|
|
1502
1484
|
display: "flex",
|
|
1503
1485
|
alignItems: "center",
|
|
1504
1486
|
paddingRight: 12,
|
|
1505
|
-
borderRight: `1px solid ${token
|
|
1487
|
+
borderRight: `1px solid ${token.colorBorderSecondary}`,
|
|
1506
1488
|
marginRight: 12
|
|
1507
1489
|
},
|
|
1508
1490
|
[scope("jws-tag")]: {
|
|
1509
1491
|
display: "flex",
|
|
1510
1492
|
alignItems: "center",
|
|
1511
1493
|
height: 32,
|
|
1512
|
-
background: token
|
|
1513
|
-
border: `1px solid ${token
|
|
1494
|
+
background: token.colorPrimaryBg,
|
|
1495
|
+
border: `1px solid ${token.colorPrimaryBorder}`,
|
|
1514
1496
|
borderRadius: 6,
|
|
1515
1497
|
padding: "0 8px",
|
|
1516
1498
|
fontSize: 12,
|
|
1517
1499
|
lineHeight: "20px",
|
|
1518
|
-
color: token
|
|
1500
|
+
color: token.colorPrimary,
|
|
1519
1501
|
fontWeight: 400,
|
|
1520
1502
|
margin: 0
|
|
1521
1503
|
},
|
|
@@ -1523,14 +1505,14 @@ const ViewModeApiHeader = ({ api, viewLayout, onViewLayoutChange }) => {
|
|
|
1523
1505
|
display: "inline-flex",
|
|
1524
1506
|
alignItems: "center",
|
|
1525
1507
|
gap: 4,
|
|
1526
|
-
background: token
|
|
1527
|
-
border: `1px solid ${token
|
|
1508
|
+
background: token.colorBgContainer,
|
|
1509
|
+
border: `1px solid ${token.colorBorder}`,
|
|
1528
1510
|
borderRadius: 4,
|
|
1529
1511
|
padding: "0 8px",
|
|
1530
1512
|
height: 32,
|
|
1531
1513
|
fontSize: 12,
|
|
1532
1514
|
lineHeight: "20px",
|
|
1533
|
-
color: token
|
|
1515
|
+
color: token.colorText,
|
|
1534
1516
|
margin: 0,
|
|
1535
1517
|
boxSizing: "border-box"
|
|
1536
1518
|
},
|
|
@@ -1543,8 +1525,8 @@ const ViewModeApiHeader = ({ api, viewLayout, onViewLayoutChange }) => {
|
|
|
1543
1525
|
display: "inline-flex",
|
|
1544
1526
|
alignItems: "center",
|
|
1545
1527
|
gap: 8,
|
|
1546
|
-
background: token
|
|
1547
|
-
border: `1px solid ${token
|
|
1528
|
+
background: token.colorFillTertiary,
|
|
1529
|
+
border: `1px solid ${token.colorBorder}`,
|
|
1548
1530
|
borderRadius: 6,
|
|
1549
1531
|
padding: "0 15px",
|
|
1550
1532
|
height: 32,
|
|
@@ -1553,13 +1535,13 @@ const ViewModeApiHeader = ({ api, viewLayout, onViewLayoutChange }) => {
|
|
|
1553
1535
|
},
|
|
1554
1536
|
[scope("version-icon")]: {
|
|
1555
1537
|
fontSize: 16,
|
|
1556
|
-
color: token
|
|
1538
|
+
color: token.colorTextDisabled,
|
|
1557
1539
|
display: "flex",
|
|
1558
1540
|
alignItems: "center"
|
|
1559
1541
|
},
|
|
1560
1542
|
[scope("version-text")]: {
|
|
1561
1543
|
fontSize: 14,
|
|
1562
|
-
color: token
|
|
1544
|
+
color: token.colorTextDisabled,
|
|
1563
1545
|
fontWeight: 400,
|
|
1564
1546
|
lineHeight: 1
|
|
1565
1547
|
},
|
|
@@ -1573,16 +1555,16 @@ const ViewModeApiHeader = ({ api, viewLayout, onViewLayoutChange }) => {
|
|
|
1573
1555
|
justifyContent: "center"
|
|
1574
1556
|
},
|
|
1575
1557
|
[scope("toggle-btn-active")]: {
|
|
1576
|
-
border: `1px solid ${token
|
|
1577
|
-
color: `${token
|
|
1578
|
-
backgroundColor: `${token
|
|
1558
|
+
border: `1px solid ${token.colorPrimary} !important`,
|
|
1559
|
+
color: `${token.colorPrimary} !important`,
|
|
1560
|
+
backgroundColor: `${token.colorBgContainer} !important`,
|
|
1579
1561
|
zIndex: 1
|
|
1580
1562
|
},
|
|
1581
1563
|
[scope("description")]: {
|
|
1582
|
-
fontSize: token
|
|
1583
|
-
color: token
|
|
1564
|
+
fontSize: token.fontSizeLG,
|
|
1565
|
+
color: token.colorTextTertiary
|
|
1584
1566
|
},
|
|
1585
|
-
[scope("title")]: { fontFamily: token
|
|
1567
|
+
[scope("title")]: { fontFamily: token.fontFamily }
|
|
1586
1568
|
}));
|
|
1587
1569
|
const version = api.relatedVersions?.find((v) => v.apiId === api.currentVersion)?.version || api.version;
|
|
1588
1570
|
return wrapSSR(/* @__PURE__ */ jsxs("div", {
|
|
@@ -1667,14 +1649,13 @@ const ViewModeApiHeader = ({ api, viewLayout, onViewLayoutChange }) => {
|
|
|
1667
1649
|
]
|
|
1668
1650
|
}));
|
|
1669
1651
|
};
|
|
1670
|
-
|
|
1671
1652
|
//#endregion
|
|
1672
1653
|
//#region src/view/components/ApiPage/index.tsx
|
|
1673
1654
|
const APIPage = () => {
|
|
1674
1655
|
const [selectedUrl, setSelectedUrl] = useState("");
|
|
1675
|
-
const { view: { selectedApi, focusedTag, setFocusedTag } } =
|
|
1656
|
+
const { view: { selectedApi, focusedTag, setFocusedTag } } = useStore();
|
|
1676
1657
|
const [viewStyle, setViewStyle] = useState("grid");
|
|
1677
|
-
const { wrapSSR, token
|
|
1658
|
+
const { wrapSSR, token } = useStyle("DocumentationApiPage", () => ({}));
|
|
1678
1659
|
const urlsOptions = useMemo(() => selectedApi?.servers?.map((server) => ({
|
|
1679
1660
|
label: server?.url,
|
|
1680
1661
|
value: server?.url
|
|
@@ -1714,7 +1695,7 @@ const APIPage = () => {
|
|
|
1714
1695
|
};
|
|
1715
1696
|
return wrapSSR(/* @__PURE__ */ jsxs(Flex, {
|
|
1716
1697
|
vertical: true,
|
|
1717
|
-
gap: token
|
|
1698
|
+
gap: token.margin,
|
|
1718
1699
|
children: [selectedApi && /* @__PURE__ */ jsx(ViewModeApiHeader, {
|
|
1719
1700
|
api: selectedApi,
|
|
1720
1701
|
viewLayout: viewStyle,
|
|
@@ -1731,14 +1712,14 @@ const APIPage = () => {
|
|
|
1731
1712
|
haveUnderLine: index < arr.length - 1,
|
|
1732
1713
|
contextPath: selectedApi?.contextPath,
|
|
1733
1714
|
viewStyle,
|
|
1734
|
-
token
|
|
1715
|
+
token
|
|
1735
1716
|
}, `${selectedApi?.id}_${key}`);
|
|
1736
1717
|
})]
|
|
1737
1718
|
}));
|
|
1738
1719
|
};
|
|
1739
|
-
const APIsRenderer = ({ apis, withTitle, tagName, haveUnderLine, contextPath, viewStyle, token
|
|
1720
|
+
const APIsRenderer = ({ apis, withTitle, tagName, haveUnderLine, contextPath, viewStyle, token }) => {
|
|
1740
1721
|
return /* @__PURE__ */ jsxs(Flex, {
|
|
1741
|
-
gap: viewStyle === "grid" ? token
|
|
1722
|
+
gap: viewStyle === "grid" ? token.marginXS : 0,
|
|
1742
1723
|
style: {
|
|
1743
1724
|
marginBottom: 0,
|
|
1744
1725
|
paddingBottom: 0
|
|
@@ -1755,19 +1736,18 @@ const APIsRenderer = ({ apis, withTitle, tagName, haveUnderLine, contextPath, vi
|
|
|
1755
1736
|
wrap: "wrap",
|
|
1756
1737
|
gap: viewStyle === "grid" ? "1.5rem" : 0,
|
|
1757
1738
|
vertical: viewStyle === "list",
|
|
1758
|
-
children: apis.map((item) => /* @__PURE__ */ jsx(
|
|
1739
|
+
children: apis.map((item) => /* @__PURE__ */ jsx(ApiCard, {
|
|
1759
1740
|
api: item,
|
|
1760
1741
|
viewStyle
|
|
1761
1742
|
}, `${tagName}_renderer_${item.id}_${item.method}_${item.path}`))
|
|
1762
1743
|
}),
|
|
1763
1744
|
haveUnderLine && /* @__PURE__ */ jsx(Divider, { style: {
|
|
1764
|
-
marginTop: token
|
|
1765
|
-
marginBottom: token
|
|
1745
|
+
marginTop: token.marginSM,
|
|
1746
|
+
marginBottom: token.marginSM
|
|
1766
1747
|
} })
|
|
1767
1748
|
]
|
|
1768
1749
|
}, `${tagName}_renderer_${contextPath}`);
|
|
1769
1750
|
};
|
|
1770
|
-
|
|
1771
1751
|
//#endregion
|
|
1772
1752
|
//#region src/utils/index.ts
|
|
1773
1753
|
const handleStatusColor = (code) => {
|
|
@@ -1778,7 +1758,6 @@ const handleStatusColor = (code) => {
|
|
|
1778
1758
|
else if (code >= 300 && code < 400) return "orange";
|
|
1779
1759
|
else return "gray";
|
|
1780
1760
|
};
|
|
1781
|
-
|
|
1782
1761
|
//#endregion
|
|
1783
1762
|
//#region src/view/components/EndpointPage/EndpointPage.tsx
|
|
1784
1763
|
const { Title: Title$2, Paragraph } = Typography;
|
|
@@ -1800,7 +1779,7 @@ const requestColumns = [
|
|
|
1800
1779
|
}
|
|
1801
1780
|
];
|
|
1802
1781
|
const responseColumns = [...requestColumns];
|
|
1803
|
-
const buildRequestData = (params, token
|
|
1782
|
+
const buildRequestData = (params, token) => [...params].sort((a, b) => a.required === b.required ? 0 : a.required ? -1 : 1).map((p, index) => {
|
|
1804
1783
|
let typeLabel = p.schema?.type;
|
|
1805
1784
|
if (p.schema?.type === "array" && p.schema?.items?.type) typeLabel = `${p.schema.type}_${p.schema.items.type}`;
|
|
1806
1785
|
return {
|
|
@@ -1809,17 +1788,17 @@ const buildRequestData = (params, token$1) => [...params].sort((a, b) => a.requi
|
|
|
1809
1788
|
p.name,
|
|
1810
1789
|
typeLabel && /* @__PURE__ */ jsx("span", {
|
|
1811
1790
|
style: {
|
|
1812
|
-
color: token
|
|
1791
|
+
color: token.colorTextTertiary,
|
|
1813
1792
|
marginLeft: "0.25rem",
|
|
1814
1793
|
marginRight: "0.25rem"
|
|
1815
1794
|
},
|
|
1816
1795
|
children: typeLabel
|
|
1817
1796
|
}),
|
|
1818
1797
|
p.required ? /* @__PURE__ */ jsx("span", {
|
|
1819
|
-
style: { color: token
|
|
1798
|
+
style: { color: token.colorError },
|
|
1820
1799
|
children: "*"
|
|
1821
1800
|
}) : /* @__PURE__ */ jsx("span", {
|
|
1822
|
-
style: { color: token
|
|
1801
|
+
style: { color: token.colorSuccess },
|
|
1823
1802
|
children: "Optional"
|
|
1824
1803
|
})
|
|
1825
1804
|
] }),
|
|
@@ -1827,7 +1806,7 @@ const buildRequestData = (params, token$1) => [...params].sort((a, b) => a.requi
|
|
|
1827
1806
|
enum: p.schema?.enum ? p.schema.enum.map((e) => /* @__PURE__ */ jsx(Tag, { children: e }, e)) : "--"
|
|
1828
1807
|
};
|
|
1829
1808
|
});
|
|
1830
|
-
const buildHeaderData = (headers, token
|
|
1809
|
+
const buildHeaderData = (headers, token) => {
|
|
1831
1810
|
if (!headers) return [];
|
|
1832
1811
|
return Object.entries(headers).sort(([, a], [, b]) => a.required === b.required ? 0 : a.required ? -1 : 1).map(([name, header], idx) => {
|
|
1833
1812
|
let typeLabel = header.schema?.type;
|
|
@@ -1838,17 +1817,17 @@ const buildHeaderData = (headers, token$1) => {
|
|
|
1838
1817
|
name,
|
|
1839
1818
|
typeLabel && /* @__PURE__ */ jsx("span", {
|
|
1840
1819
|
style: {
|
|
1841
|
-
color: token
|
|
1820
|
+
color: token.colorTextTertiary,
|
|
1842
1821
|
marginLeft: "0.25rem",
|
|
1843
1822
|
marginRight: "0.25rem"
|
|
1844
1823
|
},
|
|
1845
1824
|
children: typeLabel
|
|
1846
1825
|
}),
|
|
1847
1826
|
header.required ? /* @__PURE__ */ jsx("span", {
|
|
1848
|
-
style: { color: token
|
|
1827
|
+
style: { color: token.colorError },
|
|
1849
1828
|
children: "*"
|
|
1850
1829
|
}) : /* @__PURE__ */ jsx("span", {
|
|
1851
|
-
style: { color: token
|
|
1830
|
+
style: { color: token.colorSuccess },
|
|
1852
1831
|
children: "Optional"
|
|
1853
1832
|
})
|
|
1854
1833
|
] }, idx),
|
|
@@ -1857,7 +1836,7 @@ const buildHeaderData = (headers, token$1) => {
|
|
|
1857
1836
|
};
|
|
1858
1837
|
});
|
|
1859
1838
|
};
|
|
1860
|
-
const buildRequestBodyData = (requestBody, token
|
|
1839
|
+
const buildRequestBodyData = (requestBody, token) => {
|
|
1861
1840
|
if (!requestBody?.content) return [];
|
|
1862
1841
|
const contentType = Object.keys(requestBody.content)[0];
|
|
1863
1842
|
const schema = requestBody.content[contentType]?.schema;
|
|
@@ -1870,17 +1849,17 @@ const buildRequestBodyData = (requestBody, token$1) => {
|
|
|
1870
1849
|
name,
|
|
1871
1850
|
prop.type && /* @__PURE__ */ jsx("span", {
|
|
1872
1851
|
style: {
|
|
1873
|
-
color: token
|
|
1852
|
+
color: token.colorTextTertiary,
|
|
1874
1853
|
marginLeft: "0.25rem",
|
|
1875
1854
|
marginRight: "0.25rem"
|
|
1876
1855
|
},
|
|
1877
1856
|
children: prop.type
|
|
1878
1857
|
}),
|
|
1879
1858
|
required.includes(name) ? /* @__PURE__ */ jsx("span", {
|
|
1880
|
-
style: { color: token
|
|
1859
|
+
style: { color: token.colorError },
|
|
1881
1860
|
children: "*"
|
|
1882
1861
|
}) : /* @__PURE__ */ jsx("span", {
|
|
1883
|
-
style: { color: token
|
|
1862
|
+
style: { color: token.colorSuccess },
|
|
1884
1863
|
children: "Optional"
|
|
1885
1864
|
})
|
|
1886
1865
|
] }),
|
|
@@ -1889,14 +1868,14 @@ const buildRequestBodyData = (requestBody, token$1) => {
|
|
|
1889
1868
|
}));
|
|
1890
1869
|
};
|
|
1891
1870
|
const EndpointPage = () => {
|
|
1892
|
-
const { selectedEndpoint, selectedApi, selectedStatusCode, setSelectedNodeKey, setFocusedContent, setFocusedTag, setActiveRequestTab } =
|
|
1871
|
+
const { selectedEndpoint, selectedApi, selectedStatusCode, setSelectedNodeKey, setFocusedContent, setFocusedTag, setActiveRequestTab } = useStore(({ view }) => view);
|
|
1893
1872
|
const [activeTabKey, setActiveTabKey] = useState("header");
|
|
1894
|
-
const { token
|
|
1895
|
-
const { cx } = useStyle("EndpointPage", (token
|
|
1873
|
+
const { token } = theme.useToken();
|
|
1874
|
+
const { cx } = useStyle("EndpointPage", (token, scope) => ({
|
|
1896
1875
|
[scope("docs-endpoint-container")]: {
|
|
1897
1876
|
display: "flex",
|
|
1898
1877
|
flexDirection: "column",
|
|
1899
|
-
gap: token
|
|
1878
|
+
gap: token.marginLG,
|
|
1900
1879
|
height: "100%"
|
|
1901
1880
|
},
|
|
1902
1881
|
[scope("content")]: {
|
|
@@ -1905,43 +1884,43 @@ const EndpointPage = () => {
|
|
|
1905
1884
|
},
|
|
1906
1885
|
[scope("code")]: {
|
|
1907
1886
|
background: "unset",
|
|
1908
|
-
borderRadius: token
|
|
1909
|
-
padding: token
|
|
1887
|
+
borderRadius: token.borderRadius,
|
|
1888
|
+
padding: token.paddingSM,
|
|
1910
1889
|
fontFamily: "monospace",
|
|
1911
1890
|
whiteSpace: "pre-wrap"
|
|
1912
1891
|
},
|
|
1913
1892
|
[scope("breadcrumb")]: {
|
|
1914
1893
|
display: "flex",
|
|
1915
|
-
gap: token
|
|
1894
|
+
gap: token.marginLG,
|
|
1916
1895
|
alignItems: "center",
|
|
1917
|
-
marginBottom: token
|
|
1896
|
+
marginBottom: token.marginLG
|
|
1918
1897
|
},
|
|
1919
1898
|
[scope("request-card")]: {
|
|
1920
|
-
borderRadius: token
|
|
1921
|
-
backgroundColor: token
|
|
1899
|
+
borderRadius: token.borderRadius,
|
|
1900
|
+
backgroundColor: token.colorBgBase,
|
|
1922
1901
|
".ant-card-head": {
|
|
1923
1902
|
minHeight: "unset",
|
|
1924
1903
|
borderBottom: "unset",
|
|
1925
1904
|
padding: "0.75rem",
|
|
1926
|
-
backgroundColor: token
|
|
1905
|
+
backgroundColor: token.colorBgBase
|
|
1927
1906
|
},
|
|
1928
1907
|
".ant-card-body": {
|
|
1929
1908
|
padding: "0px 0.75rem 0.75rem 0.75rem",
|
|
1930
|
-
backgroundColor: token
|
|
1909
|
+
backgroundColor: token.colorBgBase,
|
|
1931
1910
|
".ant-tabs-tab": { paddingTop: "0" }
|
|
1932
1911
|
},
|
|
1933
|
-
"& .ant-table": { backgroundColor: `${token
|
|
1934
|
-
"& .ant-table-thead > tr > th": { backgroundColor: `${token
|
|
1935
|
-
"& .ant-table-tbody > tr > td": { backgroundColor: `${token
|
|
1912
|
+
"& .ant-table": { backgroundColor: `${token.colorBgBase} !important` },
|
|
1913
|
+
"& .ant-table-thead > tr > th": { backgroundColor: `${token.colorBgBase} !important` },
|
|
1914
|
+
"& .ant-table-tbody > tr > td": { backgroundColor: `${token.colorBgBase} !important` }
|
|
1936
1915
|
},
|
|
1937
|
-
[scope("row-odd")]: { "& > td": { background: `${token
|
|
1938
|
-
[scope("row-even")]: { "& > td": { background: `${token
|
|
1916
|
+
[scope("row-odd")]: { "& > td": { background: `${token.colorBgElevated} !important` } },
|
|
1917
|
+
[scope("row-even")]: { "& > td": { background: `${token.colorBgLayout} !important` } }
|
|
1939
1918
|
}));
|
|
1940
1919
|
const methodStyle = sidebarMethodColors[selectedEndpoint?.method];
|
|
1941
|
-
const headerParams = buildRequestData(selectedEndpoint?.parameters?.filter((p) => p.in === "header") || [], token
|
|
1942
|
-
const pathParams = buildRequestData(selectedEndpoint?.parameters?.filter((p) => p.in === "path") || [], token
|
|
1943
|
-
const queryParams = buildRequestData(selectedEndpoint?.parameters?.filter((p) => p.in === "query") || [], token
|
|
1944
|
-
const requestBodyData = buildRequestBodyData(selectedEndpoint?.requestBody, token
|
|
1920
|
+
const headerParams = buildRequestData(selectedEndpoint?.parameters?.filter((p) => p.in === "header") || [], token);
|
|
1921
|
+
const pathParams = buildRequestData(selectedEndpoint?.parameters?.filter((p) => p.in === "path") || [], token);
|
|
1922
|
+
const queryParams = buildRequestData(selectedEndpoint?.parameters?.filter((p) => p.in === "query") || [], token);
|
|
1923
|
+
const requestBodyData = buildRequestBodyData(selectedEndpoint?.requestBody, token);
|
|
1945
1924
|
const requestTabs = [
|
|
1946
1925
|
{
|
|
1947
1926
|
key: "header",
|
|
@@ -1998,7 +1977,7 @@ const EndpointPage = () => {
|
|
|
1998
1977
|
setActiveRequestTab(firstKey);
|
|
1999
1978
|
}, [selectedEndpoint?.id]);
|
|
2000
1979
|
const responseHeaders = (selectedEndpoint?.responses?.[selectedStatusCode || 200])?.headers;
|
|
2001
|
-
const responseHeaderData = buildHeaderData(responseHeaders, token
|
|
1980
|
+
const responseHeaderData = buildHeaderData(responseHeaders, token);
|
|
2002
1981
|
return /* @__PURE__ */ jsx("div", {
|
|
2003
1982
|
className: cx("docs-endpoint-container"),
|
|
2004
1983
|
children: /* @__PURE__ */ jsxs("div", {
|
|
@@ -2038,7 +2017,7 @@ const EndpointPage = () => {
|
|
|
2038
2017
|
display: "flex",
|
|
2039
2018
|
flexDirection: "row",
|
|
2040
2019
|
alignItems: "center",
|
|
2041
|
-
color: token
|
|
2020
|
+
color: token.colorTextTertiary,
|
|
2042
2021
|
gap: "0.25rem"
|
|
2043
2022
|
},
|
|
2044
2023
|
children: /* @__PURE__ */ jsx("span", { children: selectedEndpoint?.tagName || "default" })
|
|
@@ -2092,7 +2071,7 @@ const EndpointPage = () => {
|
|
|
2092
2071
|
}),
|
|
2093
2072
|
/* @__PURE__ */ jsx(Paragraph, {
|
|
2094
2073
|
style: {
|
|
2095
|
-
color: token
|
|
2074
|
+
color: token.colorTextTertiary,
|
|
2096
2075
|
marginBottom: "1.5rem"
|
|
2097
2076
|
},
|
|
2098
2077
|
children: selectedEndpoint?.description ?? "--"
|
|
@@ -2102,9 +2081,9 @@ const EndpointPage = () => {
|
|
|
2102
2081
|
className: cx("request-card"),
|
|
2103
2082
|
style: {
|
|
2104
2083
|
marginBottom: "1.5rem",
|
|
2105
|
-
backgroundColor: token
|
|
2084
|
+
backgroundColor: token.colorBgBase
|
|
2106
2085
|
},
|
|
2107
|
-
styles: { body: { backgroundColor: token
|
|
2086
|
+
styles: { body: { backgroundColor: token.colorBgBase } },
|
|
2108
2087
|
children: /* @__PURE__ */ jsx(Tabs, {
|
|
2109
2088
|
activeKey: activeTabKey,
|
|
2110
2089
|
onChange: (key) => {
|
|
@@ -2138,7 +2117,6 @@ const EndpointPage = () => {
|
|
|
2138
2117
|
})
|
|
2139
2118
|
});
|
|
2140
2119
|
};
|
|
2141
|
-
|
|
2142
2120
|
//#endregion
|
|
2143
2121
|
//#region src/assets/mouseSquare.tsx
|
|
2144
2122
|
const MouseSquare = (props) => /* @__PURE__ */ jsxs("svg", {
|
|
@@ -2162,18 +2140,16 @@ const MouseSquare = (props) => /* @__PURE__ */ jsxs("svg", {
|
|
|
2162
2140
|
strokeLinejoin: "round"
|
|
2163
2141
|
})]
|
|
2164
2142
|
});
|
|
2165
|
-
var mouseSquare_default = MouseSquare;
|
|
2166
|
-
|
|
2167
2143
|
//#endregion
|
|
2168
2144
|
//#region src/view/components/MainContent.tsx
|
|
2169
2145
|
const MainContent = ({ searchEnabled, handleResetSearch, handleVisitLandingPage }) => {
|
|
2170
|
-
const { focusedContent, transformedData } =
|
|
2171
|
-
const { wrapSSR, cx, token
|
|
2146
|
+
const { focusedContent, transformedData } = useStore(({ view }) => view);
|
|
2147
|
+
const { wrapSSR, cx, token } = useStyle("MainContent", (token, scope) => ({
|
|
2172
2148
|
[scope("inner-doc-container")]: {
|
|
2173
2149
|
width: "100%",
|
|
2174
2150
|
height: "auto",
|
|
2175
|
-
borderRadius: token
|
|
2176
|
-
padding: token
|
|
2151
|
+
borderRadius: token.borderRadius,
|
|
2152
|
+
padding: token.paddingXL,
|
|
2177
2153
|
overflow: "hidden",
|
|
2178
2154
|
minWidth: 0
|
|
2179
2155
|
},
|
|
@@ -2186,31 +2162,31 @@ const MainContent = ({ searchEnabled, handleResetSearch, handleVisitLandingPage
|
|
|
2186
2162
|
padding: 0
|
|
2187
2163
|
},
|
|
2188
2164
|
[scope("title")]: {
|
|
2189
|
-
fontFamily: token
|
|
2165
|
+
fontFamily: token.fontFamily,
|
|
2190
2166
|
fontWeight: 600,
|
|
2191
|
-
fontSize: token
|
|
2192
|
-
color: token
|
|
2167
|
+
fontSize: token.fontSizeHeading4,
|
|
2168
|
+
color: token.colorText
|
|
2193
2169
|
},
|
|
2194
2170
|
[scope("text")]: {
|
|
2195
|
-
color: token
|
|
2196
|
-
fontFamily: token
|
|
2171
|
+
color: token.colorText,
|
|
2172
|
+
fontFamily: token.fontFamily
|
|
2197
2173
|
},
|
|
2198
2174
|
[scope("visit-landing-button")]: {
|
|
2199
2175
|
width: "12.25rem",
|
|
2200
2176
|
height: "2.5rem",
|
|
2201
|
-
borderRadius: token
|
|
2177
|
+
borderRadius: token.borderRadiusLG
|
|
2202
2178
|
},
|
|
2203
2179
|
[scope("reset-button")]: {
|
|
2204
2180
|
width: "8.125rem",
|
|
2205
2181
|
height: "2.5rem",
|
|
2206
|
-
borderRadius: token
|
|
2207
|
-
backgroundColor: token
|
|
2208
|
-
fontSize: token
|
|
2182
|
+
borderRadius: token.borderRadiusLG,
|
|
2183
|
+
backgroundColor: token?.Button?.primaryColor,
|
|
2184
|
+
fontSize: token.Button?.contentFontSizeLG
|
|
2209
2185
|
}
|
|
2210
2186
|
}));
|
|
2211
2187
|
return wrapSSR(/* @__PURE__ */ jsx("div", {
|
|
2212
2188
|
className: cx("inner-doc-container", !transformedData?.length ? "centered" : ""),
|
|
2213
|
-
style: { backgroundColor: focusedContent === "ENDPOINT" ? token
|
|
2189
|
+
style: { backgroundColor: focusedContent === "ENDPOINT" ? token.colorBgBase : token.colorBgElevated },
|
|
2214
2190
|
children: !transformedData?.length ? /* @__PURE__ */ jsxs(Flex, {
|
|
2215
2191
|
justify: "center",
|
|
2216
2192
|
align: "center",
|
|
@@ -2218,9 +2194,9 @@ const MainContent = ({ searchEnabled, handleResetSearch, handleVisitLandingPage
|
|
|
2218
2194
|
vertical: true,
|
|
2219
2195
|
flex: 1,
|
|
2220
2196
|
children: [
|
|
2221
|
-
/* @__PURE__ */ jsx(
|
|
2222
|
-
stroke: token
|
|
2223
|
-
fill: token
|
|
2197
|
+
/* @__PURE__ */ jsx(NoDataIcon, {
|
|
2198
|
+
stroke: token.colorPrimaryHover,
|
|
2199
|
+
fill: token.colorPrimaryBg,
|
|
2224
2200
|
width: "18.625rem",
|
|
2225
2201
|
height: "14.75rem"
|
|
2226
2202
|
}),
|
|
@@ -2241,7 +2217,7 @@ const MainContent = ({ searchEnabled, handleResetSearch, handleVisitLandingPage
|
|
|
2241
2217
|
!searchEnabled ? /* @__PURE__ */ jsx(Button, {
|
|
2242
2218
|
type: "primary",
|
|
2243
2219
|
onClick: handleVisitLandingPage,
|
|
2244
|
-
icon: /* @__PURE__ */ jsx(
|
|
2220
|
+
icon: /* @__PURE__ */ jsx(MouseSquare, {}),
|
|
2245
2221
|
iconPosition: "start",
|
|
2246
2222
|
className: cx("visit-landing-button"),
|
|
2247
2223
|
children: "Visit Landing Page"
|
|
@@ -2255,27 +2231,26 @@ const MainContent = ({ searchEnabled, handleResetSearch, handleVisitLandingPage
|
|
|
2255
2231
|
}) : focusedContent === "ENDPOINT" ? /* @__PURE__ */ jsx(EndpointPage, {}) : /* @__PURE__ */ jsx(APIPage, {})
|
|
2256
2232
|
}));
|
|
2257
2233
|
};
|
|
2258
|
-
|
|
2259
2234
|
//#endregion
|
|
2260
2235
|
//#region src/view/components/ApiPage/components/ApiDocumentationBar.tsx
|
|
2261
2236
|
const { useBreakpoint: useBreakpoint$3 } = Grid;
|
|
2262
2237
|
const { Title: Title$1 } = Typography;
|
|
2263
2238
|
const ApiDocumentationBar = ({ apiName, mode, onModeChange, onReset, onSave, hasChanges = false, switcherNode }) => {
|
|
2264
2239
|
const isMobile = !useBreakpoint$3().md;
|
|
2265
|
-
const { wrapSSR, cx, token
|
|
2240
|
+
const { wrapSSR, cx, token } = useStyle("ApiDocumentationBar", (token, scope) => ({
|
|
2266
2241
|
[scope("root")]: {
|
|
2267
2242
|
display: "flex",
|
|
2268
2243
|
alignItems: "center",
|
|
2269
2244
|
justifyContent: "space-between",
|
|
2270
|
-
padding: `${token
|
|
2271
|
-
background: token
|
|
2272
|
-
borderRadius: token
|
|
2245
|
+
padding: `${token.marginSM + 4}px ${token.paddingLG}px`,
|
|
2246
|
+
background: token.colorBgContainer,
|
|
2247
|
+
borderRadius: token.borderRadius,
|
|
2273
2248
|
width: "100%",
|
|
2274
|
-
["@media (max-width: 640px)"]: { padding: `${token
|
|
2249
|
+
["@media (max-width: 640px)"]: { padding: `${token.marginSM}px ${token.marginMD}px` }
|
|
2275
2250
|
},
|
|
2276
2251
|
[scope("mobileWrapper")]: {
|
|
2277
2252
|
flexDirection: "column",
|
|
2278
|
-
gap: token
|
|
2253
|
+
gap: token.marginMD
|
|
2279
2254
|
},
|
|
2280
2255
|
[scope("mobileTopRow")]: {
|
|
2281
2256
|
width: "100%",
|
|
@@ -2298,7 +2273,7 @@ const ApiDocumentationBar = ({ apiName, mode, onModeChange, onReset, onSave, has
|
|
|
2298
2273
|
flex: 1,
|
|
2299
2274
|
display: "flex",
|
|
2300
2275
|
alignItems: "center",
|
|
2301
|
-
gap: token
|
|
2276
|
+
gap: token.marginSM,
|
|
2302
2277
|
minWidth: 0,
|
|
2303
2278
|
overflow: "hidden"
|
|
2304
2279
|
},
|
|
@@ -2308,14 +2283,14 @@ const ApiDocumentationBar = ({ apiName, mode, onModeChange, onReset, onSave, has
|
|
|
2308
2283
|
display: "flex",
|
|
2309
2284
|
alignItems: "center",
|
|
2310
2285
|
justifyContent: "center",
|
|
2311
|
-
color: token
|
|
2286
|
+
color: token.colorText
|
|
2312
2287
|
},
|
|
2313
2288
|
[scope("switcher")]: {
|
|
2314
2289
|
display: "flex",
|
|
2315
2290
|
alignItems: "center",
|
|
2316
|
-
background: token
|
|
2291
|
+
background: token.colorBgLayout,
|
|
2317
2292
|
padding: "4px 4px",
|
|
2318
|
-
borderRadius: token
|
|
2293
|
+
borderRadius: token.borderRadius,
|
|
2319
2294
|
gap: 8
|
|
2320
2295
|
},
|
|
2321
2296
|
[scope("switcher-item")]: {
|
|
@@ -2326,17 +2301,17 @@ const ApiDocumentationBar = ({ apiName, mode, onModeChange, onReset, onSave, has
|
|
|
2326
2301
|
background: "transparent",
|
|
2327
2302
|
border: "none",
|
|
2328
2303
|
cursor: "pointer",
|
|
2329
|
-
fontSize: token
|
|
2304
|
+
fontSize: token.fontSizeLG,
|
|
2330
2305
|
fontWeight: 400,
|
|
2331
|
-
color: token
|
|
2332
|
-
fontFamily: token
|
|
2306
|
+
color: token.colorText,
|
|
2307
|
+
fontFamily: token.fontFamily,
|
|
2333
2308
|
transition: "all 0.2s ease"
|
|
2334
2309
|
},
|
|
2335
2310
|
[scope("switcher-item-active")]: {
|
|
2336
|
-
background: token
|
|
2337
|
-
borderRadius: token
|
|
2311
|
+
background: token.colorBgContainer,
|
|
2312
|
+
borderRadius: token.borderRadius,
|
|
2338
2313
|
boxShadow: "0px 2px 4px -2px rgba(17,12,34,0.12)",
|
|
2339
|
-
fontSize: token
|
|
2314
|
+
fontSize: token.fontSize,
|
|
2340
2315
|
fontWeight: 700
|
|
2341
2316
|
},
|
|
2342
2317
|
[scope("switcher-icon")]: {
|
|
@@ -2350,14 +2325,14 @@ const ApiDocumentationBar = ({ apiName, mode, onModeChange, onReset, onSave, has
|
|
|
2350
2325
|
[scope("actions")]: {
|
|
2351
2326
|
display: "flex",
|
|
2352
2327
|
alignItems: "center",
|
|
2353
|
-
gap: token
|
|
2328
|
+
gap: token.marginMD,
|
|
2354
2329
|
flex: 1,
|
|
2355
2330
|
justifyContent: "flex-end"
|
|
2356
2331
|
},
|
|
2357
2332
|
[scope("mobileActions")]: {
|
|
2358
2333
|
display: "flex",
|
|
2359
2334
|
alignItems: "center",
|
|
2360
|
-
gap: token
|
|
2335
|
+
gap: token.marginSM,
|
|
2361
2336
|
justifyContent: "flex-end"
|
|
2362
2337
|
}
|
|
2363
2338
|
}));
|
|
@@ -2378,7 +2353,7 @@ const ApiDocumentationBar = ({ apiName, mode, onModeChange, onReset, onSave, has
|
|
|
2378
2353
|
style: {
|
|
2379
2354
|
margin: 0,
|
|
2380
2355
|
fontWeight: 600,
|
|
2381
|
-
color: token
|
|
2356
|
+
color: token.colorTextHeading
|
|
2382
2357
|
},
|
|
2383
2358
|
children: apiName
|
|
2384
2359
|
})
|
|
@@ -2418,7 +2393,7 @@ const ApiDocumentationBar = ({ apiName, mode, onModeChange, onReset, onSave, has
|
|
|
2418
2393
|
whiteSpace: "nowrap",
|
|
2419
2394
|
overflow: "hidden",
|
|
2420
2395
|
textOverflow: "ellipsis",
|
|
2421
|
-
color: token
|
|
2396
|
+
color: token.colorTextHeading,
|
|
2422
2397
|
minWidth: 0,
|
|
2423
2398
|
flex: 1
|
|
2424
2399
|
},
|
|
@@ -2462,17 +2437,16 @@ const ApiDocumentationBar = ({ apiName, mode, onModeChange, onReset, onSave, has
|
|
|
2462
2437
|
]
|
|
2463
2438
|
}));
|
|
2464
2439
|
};
|
|
2465
|
-
|
|
2466
2440
|
//#endregion
|
|
2467
2441
|
//#region src/view/components/ApiPage/components/GeneralSection.tsx
|
|
2468
2442
|
const { useBreakpoint: useBreakpoint$2 } = Grid;
|
|
2469
2443
|
const GeneralSection = ({ apiName, authType, version, description, onApiNameChange, onDescriptionChange, collapsed = false, onToggleCollapse, onChangeDetected }) => {
|
|
2470
2444
|
const isMobile = !useBreakpoint$2().md;
|
|
2471
|
-
const { wrapSSR, cx, token
|
|
2445
|
+
const { wrapSSR, cx, token } = useStyle("GeneralSection", (token, scope) => ({
|
|
2472
2446
|
[scope("root")]: {
|
|
2473
2447
|
display: "flex",
|
|
2474
2448
|
flexDirection: "column",
|
|
2475
|
-
borderRadius: token
|
|
2449
|
+
borderRadius: token.borderRadius,
|
|
2476
2450
|
overflow: "hidden",
|
|
2477
2451
|
width: "100%"
|
|
2478
2452
|
},
|
|
@@ -2480,22 +2454,22 @@ const GeneralSection = ({ apiName, authType, version, description, onApiNameChan
|
|
|
2480
2454
|
display: "flex",
|
|
2481
2455
|
alignItems: "center",
|
|
2482
2456
|
justifyContent: "space-between",
|
|
2483
|
-
padding: `${token
|
|
2484
|
-
background: token
|
|
2485
|
-
borderRadius: `${token
|
|
2457
|
+
padding: `${token.paddingXS}px ${token.paddingLG}px`,
|
|
2458
|
+
background: token.colorPrimaryBg,
|
|
2459
|
+
borderRadius: `${token.borderRadius}px ${token.borderRadius}px 0 0`
|
|
2486
2460
|
},
|
|
2487
2461
|
[scope("body")]: {
|
|
2488
2462
|
display: "flex",
|
|
2489
2463
|
flexDirection: "column",
|
|
2490
|
-
gap: token
|
|
2491
|
-
padding: token
|
|
2492
|
-
paddingBottom: token
|
|
2493
|
-
background: token
|
|
2494
|
-
borderRadius: `0 0 ${token
|
|
2464
|
+
gap: token.paddingLG,
|
|
2465
|
+
padding: token.paddingLG,
|
|
2466
|
+
paddingBottom: token.paddingXXL ?? 48,
|
|
2467
|
+
background: token.colorBgElevated,
|
|
2468
|
+
borderRadius: `0 0 ${token.borderRadius}px ${token.borderRadius}px`
|
|
2495
2469
|
},
|
|
2496
2470
|
[scope("row")]: {
|
|
2497
2471
|
display: "flex",
|
|
2498
|
-
gap: token
|
|
2472
|
+
gap: token.paddingLG,
|
|
2499
2473
|
width: "100%"
|
|
2500
2474
|
},
|
|
2501
2475
|
[scope("field")]: {
|
|
@@ -2507,22 +2481,22 @@ const GeneralSection = ({ apiName, authType, version, description, onApiNameChan
|
|
|
2507
2481
|
[scope("label")]: {
|
|
2508
2482
|
display: "flex",
|
|
2509
2483
|
alignItems: "center",
|
|
2510
|
-
gap: token
|
|
2511
|
-
fontSize: token
|
|
2484
|
+
gap: token.marginXXS,
|
|
2485
|
+
fontSize: token.fontSize,
|
|
2512
2486
|
fontWeight: 400,
|
|
2513
|
-
color: token
|
|
2514
|
-
paddingBottom: token
|
|
2487
|
+
color: token.colorText,
|
|
2488
|
+
paddingBottom: token.paddingXS,
|
|
2515
2489
|
lineHeight: "22px"
|
|
2516
2490
|
},
|
|
2517
2491
|
[scope("label-required")]: {
|
|
2518
|
-
color: token
|
|
2519
|
-
fontSize: token
|
|
2492
|
+
color: token.colorError,
|
|
2493
|
+
fontSize: token.fontSize
|
|
2520
2494
|
},
|
|
2521
2495
|
[scope("count")]: {
|
|
2522
2496
|
alignSelf: "flex-end",
|
|
2523
|
-
fontSize: token
|
|
2524
|
-
color: token
|
|
2525
|
-
marginTop: token
|
|
2497
|
+
fontSize: token.fontSize,
|
|
2498
|
+
color: token.colorTextDescription,
|
|
2499
|
+
marginTop: token.marginXXS
|
|
2526
2500
|
}
|
|
2527
2501
|
}));
|
|
2528
2502
|
return wrapSSR(/* @__PURE__ */ jsxs("div", {
|
|
@@ -2533,7 +2507,7 @@ const GeneralSection = ({ apiName, authType, version, description, onApiNameChan
|
|
|
2533
2507
|
level: 4,
|
|
2534
2508
|
style: {
|
|
2535
2509
|
margin: 0,
|
|
2536
|
-
color: token
|
|
2510
|
+
color: token.colorTextHeading
|
|
2537
2511
|
},
|
|
2538
2512
|
children: "General"
|
|
2539
2513
|
}), /* @__PURE__ */ jsx(Button, {
|
|
@@ -2549,8 +2523,8 @@ const GeneralSection = ({ apiName, authType, version, description, onApiNameChan
|
|
|
2549
2523
|
}), !collapsed && /* @__PURE__ */ jsxs("div", {
|
|
2550
2524
|
className: cx("body"),
|
|
2551
2525
|
style: isMobile ? {
|
|
2552
|
-
padding: token
|
|
2553
|
-
paddingBottom: token
|
|
2526
|
+
padding: token.paddingMD,
|
|
2527
|
+
paddingBottom: token.paddingXXL ?? 48
|
|
2554
2528
|
} : void 0,
|
|
2555
2529
|
children: [/* @__PURE__ */ jsxs("div", {
|
|
2556
2530
|
className: cx("row"),
|
|
@@ -2631,7 +2605,6 @@ const GeneralSection = ({ apiName, authType, version, description, onApiNameChan
|
|
|
2631
2605
|
})]
|
|
2632
2606
|
}));
|
|
2633
2607
|
};
|
|
2634
|
-
|
|
2635
2608
|
//#endregion
|
|
2636
2609
|
//#region src/assets/trash.tsx
|
|
2637
2610
|
const Trash = (props) => /* @__PURE__ */ jsxs("svg", {
|
|
@@ -2691,8 +2664,6 @@ const Trash = (props) => /* @__PURE__ */ jsxs("svg", {
|
|
|
2691
2664
|
})
|
|
2692
2665
|
]
|
|
2693
2666
|
});
|
|
2694
|
-
var trash_default = Trash;
|
|
2695
|
-
|
|
2696
2667
|
//#endregion
|
|
2697
2668
|
//#region src/assets/info-circle.tsx
|
|
2698
2669
|
const InfoCircle = (props) => /* @__PURE__ */ jsxs("svg", {
|
|
@@ -2729,8 +2700,6 @@ const InfoCircle = (props) => /* @__PURE__ */ jsxs("svg", {
|
|
|
2729
2700
|
})
|
|
2730
2701
|
]
|
|
2731
2702
|
});
|
|
2732
|
-
var info_circle_default = InfoCircle;
|
|
2733
|
-
|
|
2734
2703
|
//#endregion
|
|
2735
2704
|
//#region src/hooks/useDebounce.ts
|
|
2736
2705
|
function useDebounce(value, delay = 500) {
|
|
@@ -2745,7 +2714,6 @@ function useDebounce(value, delay = 500) {
|
|
|
2745
2714
|
}, [value, delay]);
|
|
2746
2715
|
return debouncedValue;
|
|
2747
2716
|
}
|
|
2748
|
-
|
|
2749
2717
|
//#endregion
|
|
2750
2718
|
//#region src/view/components/ApiPage/components/AddParameterDrawer.tsx
|
|
2751
2719
|
const PARAM_IN_OPTIONS = [
|
|
@@ -2819,11 +2787,11 @@ const AddParameterDrawer = ({ open, onClose, onAdd, onEdit, mode = "add", initia
|
|
|
2819
2787
|
setHasChanges(false);
|
|
2820
2788
|
}
|
|
2821
2789
|
}, [open]);
|
|
2822
|
-
const { wrapSSR, cx, token
|
|
2790
|
+
const { wrapSSR, cx, token } = useStyle("AddParameterDrawer", (token, scope) => ({
|
|
2823
2791
|
[scope("title")]: {
|
|
2824
2792
|
fontSize: 16,
|
|
2825
2793
|
fontWeight: 600,
|
|
2826
|
-
color: token
|
|
2794
|
+
color: token.colorTextBase,
|
|
2827
2795
|
lineHeight: "24px",
|
|
2828
2796
|
fontFamily: "Cairo SemiBold, Cairo, sans-serif"
|
|
2829
2797
|
},
|
|
@@ -2834,21 +2802,21 @@ const AddParameterDrawer = ({ open, onClose, onAdd, onEdit, mode = "add", initia
|
|
|
2834
2802
|
"& .ant-form-item": { marginBottom: 0 }
|
|
2835
2803
|
},
|
|
2836
2804
|
[scope("label")]: {
|
|
2837
|
-
fontSize: token
|
|
2838
|
-
color: token
|
|
2805
|
+
fontSize: token.fontSize,
|
|
2806
|
+
color: token.colorText
|
|
2839
2807
|
},
|
|
2840
2808
|
[scope("asterisk")]: {
|
|
2841
|
-
color: token
|
|
2809
|
+
color: token.colorError,
|
|
2842
2810
|
marginLeft: 2
|
|
2843
2811
|
},
|
|
2844
2812
|
[scope("label-optional")]: {
|
|
2845
|
-
color: token
|
|
2813
|
+
color: token.colorTextTertiary,
|
|
2846
2814
|
marginLeft: 4,
|
|
2847
|
-
fontSize: token
|
|
2815
|
+
fontSize: token.fontSize
|
|
2848
2816
|
},
|
|
2849
2817
|
[scope("label-secondary")]: {
|
|
2850
|
-
fontSize: token
|
|
2851
|
-
color: token
|
|
2818
|
+
fontSize: token.fontSize,
|
|
2819
|
+
color: token.colorTextSecondary
|
|
2852
2820
|
},
|
|
2853
2821
|
[scope("switch-row")]: {
|
|
2854
2822
|
display: "flex",
|
|
@@ -2856,8 +2824,8 @@ const AddParameterDrawer = ({ open, onClose, onAdd, onEdit, mode = "add", initia
|
|
|
2856
2824
|
gap: 8
|
|
2857
2825
|
},
|
|
2858
2826
|
[scope("switch-label")]: {
|
|
2859
|
-
fontSize: token
|
|
2860
|
-
color: token
|
|
2827
|
+
fontSize: token.fontSize,
|
|
2828
|
+
color: token.colorText
|
|
2861
2829
|
},
|
|
2862
2830
|
[scope("enum-input-row")]: {
|
|
2863
2831
|
display: "flex",
|
|
@@ -2872,27 +2840,27 @@ const AddParameterDrawer = ({ open, onClose, onAdd, onEdit, mode = "add", initia
|
|
|
2872
2840
|
width: 32,
|
|
2873
2841
|
height: 32,
|
|
2874
2842
|
flexShrink: 0,
|
|
2875
|
-
borderColor: token
|
|
2876
|
-
color: token
|
|
2843
|
+
borderColor: token.colorPrimary,
|
|
2844
|
+
color: token.colorPrimary,
|
|
2877
2845
|
padding: 0,
|
|
2878
2846
|
display: "flex",
|
|
2879
2847
|
alignItems: "center",
|
|
2880
2848
|
justifyContent: "center",
|
|
2881
2849
|
"&:hover": {
|
|
2882
|
-
borderColor: `${token
|
|
2883
|
-
color: `${token
|
|
2850
|
+
borderColor: `${token.colorPrimary} !important`,
|
|
2851
|
+
color: `${token.colorPrimary} !important`
|
|
2884
2852
|
}
|
|
2885
2853
|
},
|
|
2886
2854
|
[scope("enum-list")]: {
|
|
2887
2855
|
display: "flex",
|
|
2888
2856
|
flexDirection: "column",
|
|
2889
|
-
gap: token
|
|
2890
|
-
marginTop: token
|
|
2857
|
+
gap: token.marginXS,
|
|
2858
|
+
marginTop: token.marginXS
|
|
2891
2859
|
},
|
|
2892
2860
|
[scope("enum-value-row")]: {
|
|
2893
2861
|
display: "flex",
|
|
2894
2862
|
alignItems: "center",
|
|
2895
|
-
gap: token
|
|
2863
|
+
gap: token.marginXS
|
|
2896
2864
|
},
|
|
2897
2865
|
[scope("enum-value-input-wrap")]: {
|
|
2898
2866
|
flex: 1,
|
|
@@ -2901,10 +2869,10 @@ const AddParameterDrawer = ({ open, onClose, onAdd, onEdit, mode = "add", initia
|
|
|
2901
2869
|
[scope("enum-value-input")]: {
|
|
2902
2870
|
height: 32,
|
|
2903
2871
|
fontSize: 14,
|
|
2904
|
-
color: token
|
|
2905
|
-
background: token
|
|
2906
|
-
border: `1px solid ${token
|
|
2907
|
-
borderRadius: token
|
|
2872
|
+
color: token.colorText,
|
|
2873
|
+
background: token.colorBgBase,
|
|
2874
|
+
border: `1px solid ${token.colorBorder}`,
|
|
2875
|
+
borderRadius: token.borderRadius,
|
|
2908
2876
|
cursor: "default",
|
|
2909
2877
|
width: "100%"
|
|
2910
2878
|
},
|
|
@@ -2916,7 +2884,7 @@ const AddParameterDrawer = ({ open, onClose, onAdd, onEdit, mode = "add", initia
|
|
|
2916
2884
|
display: "flex",
|
|
2917
2885
|
alignItems: "center",
|
|
2918
2886
|
justifyContent: "center",
|
|
2919
|
-
borderRadius: token
|
|
2887
|
+
borderRadius: token.borderRadius
|
|
2920
2888
|
},
|
|
2921
2889
|
[scope("footer")]: {
|
|
2922
2890
|
display: "flex",
|
|
@@ -2953,7 +2921,7 @@ const AddParameterDrawer = ({ open, onClose, onAdd, onEdit, mode = "add", initia
|
|
|
2953
2921
|
fontSize: 16,
|
|
2954
2922
|
fontWeight: 400,
|
|
2955
2923
|
lineHeight: "24px",
|
|
2956
|
-
color: token
|
|
2924
|
+
color: token.colorText
|
|
2957
2925
|
},
|
|
2958
2926
|
[scope("modalCloseBtn")]: {
|
|
2959
2927
|
position: "absolute",
|
|
@@ -2969,12 +2937,12 @@ const AddParameterDrawer = ({ open, onClose, onAdd, onEdit, mode = "add", initia
|
|
|
2969
2937
|
border: "none",
|
|
2970
2938
|
background: "transparent",
|
|
2971
2939
|
padding: 0,
|
|
2972
|
-
color: token
|
|
2940
|
+
color: token.colorTextTertiary,
|
|
2973
2941
|
fontSize: 16,
|
|
2974
2942
|
lineHeight: 1,
|
|
2975
2943
|
"&:hover": {
|
|
2976
|
-
color: token
|
|
2977
|
-
backgroundColor: token
|
|
2944
|
+
color: token.colorText,
|
|
2945
|
+
backgroundColor: token.colorFillSecondary
|
|
2978
2946
|
}
|
|
2979
2947
|
},
|
|
2980
2948
|
[scope("modalContent")]: {
|
|
@@ -2991,7 +2959,7 @@ const AddParameterDrawer = ({ open, onClose, onAdd, onEdit, mode = "add", initia
|
|
|
2991
2959
|
fontSize: 14,
|
|
2992
2960
|
fontWeight: 400,
|
|
2993
2961
|
lineHeight: "22px",
|
|
2994
|
-
color: token
|
|
2962
|
+
color: token.colorText
|
|
2995
2963
|
},
|
|
2996
2964
|
[scope("modalFooter")]: {
|
|
2997
2965
|
display: "flex",
|
|
@@ -3076,14 +3044,14 @@ const AddParameterDrawer = ({ open, onClose, onAdd, onEdit, mode = "add", initia
|
|
|
3076
3044
|
styles: {
|
|
3077
3045
|
header: {
|
|
3078
3046
|
padding: "16px 24px",
|
|
3079
|
-
borderBottom: `1px solid ${token
|
|
3080
|
-
background: token
|
|
3047
|
+
borderBottom: `1px solid ${token.colorFillSecondary}`,
|
|
3048
|
+
background: token.colorBgBase
|
|
3081
3049
|
},
|
|
3082
3050
|
body: { padding: "24px" },
|
|
3083
3051
|
footer: {
|
|
3084
3052
|
padding: "24px",
|
|
3085
|
-
background: token
|
|
3086
|
-
borderTop: `1px solid ${token
|
|
3053
|
+
background: token.colorPrimaryBg,
|
|
3054
|
+
borderTop: `1px solid ${token.colorFillSecondary}`
|
|
3087
3055
|
}
|
|
3088
3056
|
},
|
|
3089
3057
|
footer: /* @__PURE__ */ jsxs("div", {
|
|
@@ -3187,7 +3155,7 @@ const AddParameterDrawer = ({ open, onClose, onAdd, onEdit, mode = "add", initia
|
|
|
3187
3155
|
children: [/* @__PURE__ */ jsx(Switch, {
|
|
3188
3156
|
checked: requiredValue ?? true,
|
|
3189
3157
|
onChange: (checked) => form.setFieldValue("required", checked),
|
|
3190
|
-
style: { backgroundColor: requiredValue ?? true ? token
|
|
3158
|
+
style: { backgroundColor: requiredValue ?? true ? token.colorPrimary : void 0 }
|
|
3191
3159
|
}), /* @__PURE__ */ jsx("span", {
|
|
3192
3160
|
className: cx("switch-label"),
|
|
3193
3161
|
children: "Required?"
|
|
@@ -3255,7 +3223,7 @@ const AddParameterDrawer = ({ open, onClose, onAdd, onEdit, mode = "add", initia
|
|
|
3255
3223
|
}), /* @__PURE__ */ jsx(Button, {
|
|
3256
3224
|
danger: true,
|
|
3257
3225
|
type: "text",
|
|
3258
|
-
icon: /* @__PURE__ */ jsx(
|
|
3226
|
+
icon: /* @__PURE__ */ jsx(Trash, {
|
|
3259
3227
|
width: 32,
|
|
3260
3228
|
height: 32
|
|
3261
3229
|
}),
|
|
@@ -3328,9 +3296,9 @@ const AddParameterDrawer = ({ open, onClose, onAdd, onEdit, mode = "add", initia
|
|
|
3328
3296
|
borderRadius: 8,
|
|
3329
3297
|
height: 32,
|
|
3330
3298
|
paddingInline: 16,
|
|
3331
|
-
backgroundColor: token
|
|
3332
|
-
borderColor: token
|
|
3333
|
-
boxShadow: `0px 2px 0px ${token
|
|
3299
|
+
backgroundColor: token.colorPrimary,
|
|
3300
|
+
borderColor: token.colorPrimary,
|
|
3301
|
+
boxShadow: `0px 2px 0px ${token.colorPrimaryBg}`
|
|
3334
3302
|
},
|
|
3335
3303
|
children: mode === "edit" ? "Yes, Edit" : "Yes, Add"
|
|
3336
3304
|
})]
|
|
@@ -3339,20 +3307,19 @@ const AddParameterDrawer = ({ open, onClose, onAdd, onEdit, mode = "add", initia
|
|
|
3339
3307
|
})
|
|
3340
3308
|
] }));
|
|
3341
3309
|
};
|
|
3342
|
-
|
|
3343
3310
|
//#endregion
|
|
3344
3311
|
//#region src/view/components/ApiPage/components/EndpointsSection.tsx
|
|
3345
3312
|
const { useBreakpoint: useBreakpoint$1 } = Grid;
|
|
3346
3313
|
const PAGE_SIZE = 5;
|
|
3347
|
-
const getStatusCodeColor = (code, token
|
|
3314
|
+
const getStatusCodeColor = (code, token) => {
|
|
3348
3315
|
const n = parseInt(code, 10);
|
|
3349
3316
|
if (n >= 400 && n < 500) return {
|
|
3350
|
-
dot: token
|
|
3351
|
-
text: token
|
|
3317
|
+
dot: token.colorError,
|
|
3318
|
+
text: token.colorError
|
|
3352
3319
|
};
|
|
3353
3320
|
return {
|
|
3354
|
-
dot: token
|
|
3355
|
-
text: token
|
|
3321
|
+
dot: token.colorSuccess,
|
|
3322
|
+
text: token.colorText
|
|
3356
3323
|
};
|
|
3357
3324
|
};
|
|
3358
3325
|
const buildViewParamRows = (params) => params.map((p, idx) => ({
|
|
@@ -3407,11 +3374,11 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
|
|
|
3407
3374
|
return next;
|
|
3408
3375
|
});
|
|
3409
3376
|
};
|
|
3410
|
-
const { wrapSSR, cx, token
|
|
3377
|
+
const { wrapSSR, cx, token } = useStyle("EndpointsSection", (token, scope) => ({
|
|
3411
3378
|
[scope("root")]: {
|
|
3412
3379
|
display: "flex",
|
|
3413
3380
|
flexDirection: "column",
|
|
3414
|
-
borderRadius: token
|
|
3381
|
+
borderRadius: token.borderRadius,
|
|
3415
3382
|
overflow: "hidden",
|
|
3416
3383
|
width: "100%",
|
|
3417
3384
|
flexShrink: 0
|
|
@@ -3420,28 +3387,28 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
|
|
|
3420
3387
|
display: "flex",
|
|
3421
3388
|
alignItems: "center",
|
|
3422
3389
|
justifyContent: "space-between",
|
|
3423
|
-
padding: `${token
|
|
3424
|
-
background: token
|
|
3425
|
-
borderRadius: `${token
|
|
3390
|
+
padding: `${token.paddingXS}px ${token.paddingLG}px`,
|
|
3391
|
+
background: token.colorPrimaryBg,
|
|
3392
|
+
borderRadius: `${token.borderRadius}px ${token.borderRadius}px 0 0`
|
|
3426
3393
|
},
|
|
3427
3394
|
[scope("body")]: {
|
|
3428
3395
|
display: "flex",
|
|
3429
3396
|
flexDirection: "column",
|
|
3430
|
-
gap: token
|
|
3431
|
-
padding: token
|
|
3432
|
-
background: token
|
|
3433
|
-
borderRadius: `0 0 ${token
|
|
3397
|
+
gap: token.margin,
|
|
3398
|
+
padding: token.paddingLG,
|
|
3399
|
+
background: token.colorBgElevated,
|
|
3400
|
+
borderRadius: `0 0 ${token.borderRadius}px ${token.borderRadius}px`
|
|
3434
3401
|
},
|
|
3435
3402
|
[scope("tag-title")]: {
|
|
3436
|
-
fontSize: token
|
|
3403
|
+
fontSize: token.fontSize,
|
|
3437
3404
|
fontWeight: 600,
|
|
3438
|
-
color: token
|
|
3439
|
-
marginBottom: token
|
|
3405
|
+
color: token.colorTextSecondary,
|
|
3406
|
+
marginBottom: token.marginXS
|
|
3440
3407
|
},
|
|
3441
3408
|
[scope("endpoint-row")]: {
|
|
3442
3409
|
display: "flex",
|
|
3443
3410
|
alignItems: "center",
|
|
3444
|
-
gap: token
|
|
3411
|
+
gap: token.marginSM,
|
|
3445
3412
|
width: "100%"
|
|
3446
3413
|
},
|
|
3447
3414
|
[scope("endpoint-card")]: {
|
|
@@ -3449,34 +3416,34 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
|
|
|
3449
3416
|
flex: "1 0 0",
|
|
3450
3417
|
alignItems: "center",
|
|
3451
3418
|
gap: 14,
|
|
3452
|
-
padding: `${token
|
|
3453
|
-
background: token
|
|
3454
|
-
borderRadius: token
|
|
3419
|
+
padding: `${token.paddingXS}px ${token.padding}px`,
|
|
3420
|
+
background: token.colorFillSecondary,
|
|
3421
|
+
borderRadius: token.borderRadius,
|
|
3455
3422
|
cursor: "pointer",
|
|
3456
3423
|
overflow: "hidden"
|
|
3457
3424
|
},
|
|
3458
3425
|
[scope("endpoint-card-active")]: {
|
|
3459
3426
|
background: "transparent",
|
|
3460
|
-
border: `1px solid ${token
|
|
3427
|
+
border: `1px solid ${token.colorPrimaryBorder}`
|
|
3461
3428
|
},
|
|
3462
3429
|
[scope("method-badge")]: {
|
|
3463
3430
|
display: "flex",
|
|
3464
3431
|
alignItems: "center",
|
|
3465
3432
|
justifyContent: "center",
|
|
3466
3433
|
width: 64,
|
|
3467
|
-
padding: `0 ${token
|
|
3468
|
-
borderRadius: token
|
|
3434
|
+
padding: `0 ${token.paddingXS}px`,
|
|
3435
|
+
borderRadius: token.borderRadius,
|
|
3469
3436
|
border: "1px solid",
|
|
3470
|
-
fontSize: token
|
|
3437
|
+
fontSize: token.fontSize,
|
|
3471
3438
|
fontWeight: 400,
|
|
3472
3439
|
lineHeight: "22px",
|
|
3473
3440
|
whiteSpace: "nowrap",
|
|
3474
3441
|
alignSelf: "stretch"
|
|
3475
3442
|
},
|
|
3476
3443
|
[scope("endpoint-path")]: {
|
|
3477
|
-
fontSize: token
|
|
3444
|
+
fontSize: token.fontSizeLG,
|
|
3478
3445
|
fontWeight: 600,
|
|
3479
|
-
color: token
|
|
3446
|
+
color: token.colorTextHeading,
|
|
3480
3447
|
lineHeight: "24px",
|
|
3481
3448
|
overflow: "hidden",
|
|
3482
3449
|
textOverflow: "ellipsis",
|
|
@@ -3485,12 +3452,12 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
|
|
|
3485
3452
|
[scope("endpoint-form")]: {
|
|
3486
3453
|
display: "flex",
|
|
3487
3454
|
flexDirection: "column",
|
|
3488
|
-
gap: token
|
|
3489
|
-
padding: token
|
|
3490
|
-
borderLeft: `3px solid ${token
|
|
3491
|
-
borderRight: `3px solid ${token
|
|
3492
|
-
borderBottom: `3px solid ${token
|
|
3493
|
-
borderRadius: `0 0 ${token
|
|
3455
|
+
gap: token.paddingLG,
|
|
3456
|
+
padding: token.paddingLG,
|
|
3457
|
+
borderLeft: `3px solid ${token.colorPrimaryBorder}`,
|
|
3458
|
+
borderRight: `3px solid ${token.colorPrimaryBorder}`,
|
|
3459
|
+
borderBottom: `3px solid ${token.colorPrimaryBorder}`,
|
|
3460
|
+
borderRadius: `0 0 ${token.borderRadius}px ${token.borderRadius}px`
|
|
3494
3461
|
},
|
|
3495
3462
|
[scope("form-row")]: {
|
|
3496
3463
|
display: "flex",
|
|
@@ -3506,41 +3473,41 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
|
|
|
3506
3473
|
[scope("field-label")]: {
|
|
3507
3474
|
display: "flex",
|
|
3508
3475
|
alignItems: "center",
|
|
3509
|
-
gap: token
|
|
3510
|
-
fontSize: token
|
|
3476
|
+
gap: token.marginXXS,
|
|
3477
|
+
fontSize: token.fontSize,
|
|
3511
3478
|
fontWeight: 400,
|
|
3512
|
-
color: token
|
|
3513
|
-
paddingBottom: token
|
|
3479
|
+
color: token.colorText,
|
|
3480
|
+
paddingBottom: token.paddingXS,
|
|
3514
3481
|
lineHeight: "22px"
|
|
3515
3482
|
},
|
|
3516
|
-
[scope("label-required")]: { color: token
|
|
3517
|
-
[scope("label-optional")]: { color: token
|
|
3483
|
+
[scope("label-required")]: { color: token.colorError },
|
|
3484
|
+
[scope("label-optional")]: { color: token.colorTextDescription },
|
|
3518
3485
|
[scope("section-header")]: {
|
|
3519
3486
|
display: "flex",
|
|
3520
3487
|
alignItems: "center",
|
|
3521
3488
|
justifyContent: "space-between",
|
|
3522
|
-
paddingBottom: token
|
|
3523
|
-
borderBottom: `1px solid ${token
|
|
3489
|
+
paddingBottom: token.marginXXS,
|
|
3490
|
+
borderBottom: `1px solid ${token.colorBorder}`,
|
|
3524
3491
|
width: "100%"
|
|
3525
3492
|
},
|
|
3526
3493
|
[scope("section-title")]: {
|
|
3527
|
-
fontSize: token
|
|
3494
|
+
fontSize: token.fontSizeLG,
|
|
3528
3495
|
fontWeight: 600,
|
|
3529
|
-
color: token
|
|
3496
|
+
color: token.colorPrimary,
|
|
3530
3497
|
lineHeight: "24px"
|
|
3531
3498
|
},
|
|
3532
3499
|
[scope("param-row")]: {
|
|
3533
3500
|
display: "flex",
|
|
3534
3501
|
alignItems: "center",
|
|
3535
|
-
gap: token
|
|
3536
|
-
padding: `${token
|
|
3537
|
-
border: `1px solid ${token
|
|
3538
|
-
borderRadius: token
|
|
3539
|
-
background: token
|
|
3502
|
+
gap: token.marginXS,
|
|
3503
|
+
padding: `${token.marginXXS}px ${token.marginSM}px`,
|
|
3504
|
+
border: `1px solid ${token.colorBorder}`,
|
|
3505
|
+
borderRadius: token.borderRadius,
|
|
3506
|
+
background: token.colorBgContainer,
|
|
3540
3507
|
width: "100%",
|
|
3541
3508
|
cursor: "pointer",
|
|
3542
3509
|
userSelect: "none",
|
|
3543
|
-
"&:hover": { background: token
|
|
3510
|
+
"&:hover": { background: token.colorFillTertiary }
|
|
3544
3511
|
},
|
|
3545
3512
|
[scope("param-row-icon")]: {
|
|
3546
3513
|
fontSize: 12,
|
|
@@ -3557,7 +3524,7 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
|
|
|
3557
3524
|
fontFamily: "Cairo, sans-serif",
|
|
3558
3525
|
fontSize: 14,
|
|
3559
3526
|
lineHeight: "20px",
|
|
3560
|
-
color: token
|
|
3527
|
+
color: token.colorTextLightSolid,
|
|
3561
3528
|
width: "100%",
|
|
3562
3529
|
whiteSpace: "pre",
|
|
3563
3530
|
overflowX: "auto",
|
|
@@ -3573,7 +3540,7 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
|
|
|
3573
3540
|
},
|
|
3574
3541
|
[scope("code-btn")]: {
|
|
3575
3542
|
borderColor: "#fff",
|
|
3576
|
-
color: token
|
|
3543
|
+
color: token.colorTextLightSolid,
|
|
3577
3544
|
"&:hover": {
|
|
3578
3545
|
borderColor: "#fff !important",
|
|
3579
3546
|
color: "#fff !important",
|
|
@@ -3591,8 +3558,8 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
|
|
|
3591
3558
|
justifyContent: "space-between",
|
|
3592
3559
|
width: "100%",
|
|
3593
3560
|
padding: `12px 24px`,
|
|
3594
|
-
borderBottom: `1px solid ${token
|
|
3595
|
-
background: token
|
|
3561
|
+
borderBottom: `1px solid ${token.colorBorderSecondary}`,
|
|
3562
|
+
background: token.colorBgContainer,
|
|
3596
3563
|
"&:last-child": { borderBottom: "none" }
|
|
3597
3564
|
},
|
|
3598
3565
|
[scope("param-details")]: {
|
|
@@ -3610,12 +3577,12 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
|
|
|
3610
3577
|
[scope("param-detail-label")]: {
|
|
3611
3578
|
fontFamily: "Cairo SemiBold, Cairo, sans-serif",
|
|
3612
3579
|
fontSize: 16,
|
|
3613
|
-
color: token
|
|
3580
|
+
color: token.colorTextSecondary
|
|
3614
3581
|
},
|
|
3615
3582
|
[scope("param-detail-value")]: {
|
|
3616
3583
|
fontFamily: "Cairo, sans-serif",
|
|
3617
3584
|
fontSize: 16,
|
|
3618
|
-
color: token
|
|
3585
|
+
color: token.colorText
|
|
3619
3586
|
},
|
|
3620
3587
|
[scope("param-detail-value--ellipsis")]: {
|
|
3621
3588
|
overflow: "hidden",
|
|
@@ -3634,13 +3601,13 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
|
|
|
3634
3601
|
display: "inline-flex",
|
|
3635
3602
|
alignItems: "center",
|
|
3636
3603
|
verticalAlign: "middle",
|
|
3637
|
-
background: token
|
|
3638
|
-
border: `1px solid ${token
|
|
3604
|
+
background: token.colorBgContainer,
|
|
3605
|
+
border: `1px solid ${token.colorBorder}`,
|
|
3639
3606
|
borderRadius: 6,
|
|
3640
3607
|
padding: "1px 8px",
|
|
3641
3608
|
fontSize: 12,
|
|
3642
3609
|
lineHeight: "20px",
|
|
3643
|
-
color: token
|
|
3610
|
+
color: token.colorText,
|
|
3644
3611
|
fontFamily: "Cairo, sans-serif",
|
|
3645
3612
|
margin: 0
|
|
3646
3613
|
},
|
|
@@ -3652,10 +3619,10 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
|
|
|
3652
3619
|
width: 20,
|
|
3653
3620
|
height: 20,
|
|
3654
3621
|
borderRadius: "50%",
|
|
3655
|
-
border: `1px solid ${token
|
|
3622
|
+
border: `1px solid ${token.colorBorder}`,
|
|
3656
3623
|
background: "white",
|
|
3657
3624
|
fontSize: 12,
|
|
3658
|
-
color: token
|
|
3625
|
+
color: token.colorText,
|
|
3659
3626
|
cursor: "default"
|
|
3660
3627
|
},
|
|
3661
3628
|
[scope("enum-tooltip-list")]: {
|
|
@@ -3663,7 +3630,7 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
|
|
|
3663
3630
|
padding: "0 0 0 16px",
|
|
3664
3631
|
fontSize: 14,
|
|
3665
3632
|
lineHeight: "22px",
|
|
3666
|
-
color: token
|
|
3633
|
+
color: token.colorTextLightSolid,
|
|
3667
3634
|
fontFamily: "Cairo, sans-serif"
|
|
3668
3635
|
},
|
|
3669
3636
|
[scope("status-label")]: {
|
|
@@ -3714,7 +3681,7 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
|
|
|
3714
3681
|
alignItems: "center",
|
|
3715
3682
|
gap: 8
|
|
3716
3683
|
},
|
|
3717
|
-
"& .ant-select-item-option-selected": { background: `${token
|
|
3684
|
+
"& .ant-select-item-option-selected": { background: `${token.colorPrimaryBg} !important` }
|
|
3718
3685
|
},
|
|
3719
3686
|
[scope("param-actions")]: {
|
|
3720
3687
|
display: "flex",
|
|
@@ -3727,11 +3694,11 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
|
|
|
3727
3694
|
display: "flex",
|
|
3728
3695
|
alignItems: "center",
|
|
3729
3696
|
justifyContent: "center",
|
|
3730
|
-
borderColor: token
|
|
3731
|
-
color: token
|
|
3697
|
+
borderColor: token.colorPrimary,
|
|
3698
|
+
color: token.colorPrimary,
|
|
3732
3699
|
"&:hover": {
|
|
3733
|
-
borderColor: `${token
|
|
3734
|
-
color: `${token
|
|
3700
|
+
borderColor: `${token.colorPrimary} !important`,
|
|
3701
|
+
color: `${token.colorPrimary} !important`
|
|
3735
3702
|
}
|
|
3736
3703
|
},
|
|
3737
3704
|
[scope("param-delete-btn")]: {
|
|
@@ -3761,7 +3728,7 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
|
|
|
3761
3728
|
fontSize: 16,
|
|
3762
3729
|
fontWeight: 400,
|
|
3763
3730
|
lineHeight: "24px",
|
|
3764
|
-
color: token
|
|
3731
|
+
color: token.colorText
|
|
3765
3732
|
},
|
|
3766
3733
|
[scope("deleteModalCloseBtn")]: {
|
|
3767
3734
|
position: "absolute",
|
|
@@ -3777,12 +3744,12 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
|
|
|
3777
3744
|
border: "none",
|
|
3778
3745
|
background: "transparent",
|
|
3779
3746
|
padding: 0,
|
|
3780
|
-
color: token
|
|
3747
|
+
color: token.colorTextSecondary,
|
|
3781
3748
|
fontSize: 16,
|
|
3782
3749
|
lineHeight: 1,
|
|
3783
3750
|
"&:hover": {
|
|
3784
|
-
color: token
|
|
3785
|
-
backgroundColor: token
|
|
3751
|
+
color: token.colorText,
|
|
3752
|
+
backgroundColor: token.colorFillSecondary
|
|
3786
3753
|
}
|
|
3787
3754
|
},
|
|
3788
3755
|
[scope("deleteModalContent")]: {
|
|
@@ -3799,7 +3766,7 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
|
|
|
3799
3766
|
fontSize: 14,
|
|
3800
3767
|
fontWeight: 400,
|
|
3801
3768
|
lineHeight: "22px",
|
|
3802
|
-
color: token
|
|
3769
|
+
color: token.colorText
|
|
3803
3770
|
},
|
|
3804
3771
|
[scope("deleteModalFooter")]: {
|
|
3805
3772
|
display: "flex",
|
|
@@ -3817,33 +3784,33 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
|
|
|
3817
3784
|
flexDirection: "column",
|
|
3818
3785
|
gap: 16,
|
|
3819
3786
|
width: "100%",
|
|
3820
|
-
borderLeft: `3px solid ${token
|
|
3821
|
-
borderRight: `3px solid ${token
|
|
3822
|
-
borderBottom: `3px solid ${token
|
|
3823
|
-
borderRadius: `0 0 ${token
|
|
3824
|
-
padding: token
|
|
3787
|
+
borderLeft: `3px solid ${token.colorPrimaryBorder}`,
|
|
3788
|
+
borderRight: `3px solid ${token.colorPrimaryBorder}`,
|
|
3789
|
+
borderBottom: `3px solid ${token.colorPrimaryBorder}`,
|
|
3790
|
+
borderRadius: `0 0 ${token.borderRadius}px ${token.borderRadius}px`,
|
|
3791
|
+
padding: token.paddingLG
|
|
3825
3792
|
},
|
|
3826
3793
|
[scope("view-params-card")]: {
|
|
3827
|
-
border: `1px solid ${token
|
|
3828
|
-
borderRadius: token
|
|
3794
|
+
border: `1px solid ${token.colorBorder}`,
|
|
3795
|
+
borderRadius: token.borderRadius,
|
|
3829
3796
|
display: "flex",
|
|
3830
3797
|
flexDirection: "column",
|
|
3831
|
-
gap: token
|
|
3798
|
+
gap: token.marginSM,
|
|
3832
3799
|
paddingTop: 12,
|
|
3833
3800
|
width: "100%",
|
|
3834
3801
|
overflow: "hidden",
|
|
3835
3802
|
"& .ant-table-thead > tr > th": {
|
|
3836
|
-
background: token
|
|
3803
|
+
background: token.colorFillSecondary,
|
|
3837
3804
|
fontWeight: 700,
|
|
3838
3805
|
fontSize: 14,
|
|
3839
|
-
padding: `${token
|
|
3840
|
-
paddingInline: `${token
|
|
3841
|
-
borderColor: `${token
|
|
3806
|
+
padding: `${token.paddingXS}px`,
|
|
3807
|
+
paddingInline: `${token.paddingXS}px`,
|
|
3808
|
+
borderColor: `${token.colorSplit} !important`
|
|
3842
3809
|
},
|
|
3843
3810
|
"& .ant-table-tbody > tr > td": {
|
|
3844
|
-
padding: `${token
|
|
3845
|
-
paddingInline: `${token
|
|
3846
|
-
borderColor: `${token
|
|
3811
|
+
padding: `${token.paddingXS}px`,
|
|
3812
|
+
paddingInline: `${token.paddingXS}px`,
|
|
3813
|
+
borderColor: `${token.colorBorder} !important`,
|
|
3847
3814
|
height: 38
|
|
3848
3815
|
},
|
|
3849
3816
|
"& .ant-table-container": {
|
|
@@ -3862,30 +3829,30 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
|
|
|
3862
3829
|
[scope("view-params-title")]: {
|
|
3863
3830
|
fontSize: 16,
|
|
3864
3831
|
fontWeight: 600,
|
|
3865
|
-
color: token
|
|
3832
|
+
color: token.colorText
|
|
3866
3833
|
},
|
|
3867
3834
|
[scope("view-status-select-sm")]: { width: 65 },
|
|
3868
3835
|
[scope("view-param-name")]: {
|
|
3869
3836
|
fontSize: 14,
|
|
3870
3837
|
fontWeight: 400,
|
|
3871
|
-
color: token
|
|
3838
|
+
color: token.colorText
|
|
3872
3839
|
},
|
|
3873
3840
|
[scope("view-param-type")]: {
|
|
3874
3841
|
fontFamily: "'Cascadia Code', sans-serif",
|
|
3875
3842
|
fontSize: 12,
|
|
3876
|
-
color: token
|
|
3843
|
+
color: token.colorTextSecondary,
|
|
3877
3844
|
marginLeft: 4,
|
|
3878
3845
|
marginRight: 4
|
|
3879
3846
|
},
|
|
3880
|
-
[scope("view-param-required")]: { color: token
|
|
3847
|
+
[scope("view-param-required")]: { color: token.colorError },
|
|
3881
3848
|
[scope("view-param-optional")]: {
|
|
3882
|
-
color: token
|
|
3849
|
+
color: token.colorSuccess,
|
|
3883
3850
|
fontSize: 12,
|
|
3884
3851
|
marginLeft: 4
|
|
3885
3852
|
},
|
|
3886
3853
|
[scope("view-param-desc")]: {
|
|
3887
3854
|
fontSize: 12,
|
|
3888
|
-
color: token
|
|
3855
|
+
color: token.colorText
|
|
3889
3856
|
},
|
|
3890
3857
|
[scope("view-enum-container")]: {
|
|
3891
3858
|
display: "inline-flex",
|
|
@@ -3894,21 +3861,21 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
|
|
|
3894
3861
|
alignItems: "center"
|
|
3895
3862
|
},
|
|
3896
3863
|
[scope("view-enum-tag")]: {
|
|
3897
|
-
background: token
|
|
3898
|
-
border: `1px solid ${token
|
|
3864
|
+
background: token.colorFillSecondary,
|
|
3865
|
+
border: `1px solid ${token.colorBorder}`,
|
|
3899
3866
|
borderRadius: 4,
|
|
3900
3867
|
padding: "1px 8px",
|
|
3901
3868
|
fontSize: 12,
|
|
3902
3869
|
lineHeight: "20px",
|
|
3903
|
-
color: token
|
|
3870
|
+
color: token.colorText,
|
|
3904
3871
|
margin: 0,
|
|
3905
3872
|
cursor: "default"
|
|
3906
3873
|
},
|
|
3907
|
-
[scope("view-row-odd")]: { "& > td": { background: `${token
|
|
3908
|
-
[scope("view-row-even")]: { "& > td": { background: `${token
|
|
3874
|
+
[scope("view-row-odd")]: { "& > td": { background: `${token.colorBgLayout} !important` } },
|
|
3875
|
+
[scope("view-row-even")]: { "& > td": { background: `${token.colorBgContainer} !important` } },
|
|
3909
3876
|
[scope("empty-wrapper")]: {
|
|
3910
|
-
background: token
|
|
3911
|
-
borderRadius: token
|
|
3877
|
+
background: token.colorBgElevated,
|
|
3878
|
+
borderRadius: token.borderRadius,
|
|
3912
3879
|
paddingTop: 16,
|
|
3913
3880
|
paddingBottom: 16,
|
|
3914
3881
|
gap: 8,
|
|
@@ -3941,25 +3908,25 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
|
|
|
3941
3908
|
[scope("empty-description")]: {
|
|
3942
3909
|
fontSize: 14,
|
|
3943
3910
|
lineHeight: "22px",
|
|
3944
|
-
color: token
|
|
3911
|
+
color: token.colorTextDescription,
|
|
3945
3912
|
textAlign: "center",
|
|
3946
3913
|
fontWeight: 400
|
|
3947
3914
|
},
|
|
3948
3915
|
[scope("pagination")]: {
|
|
3949
3916
|
display: "flex",
|
|
3950
3917
|
justifyContent: "center",
|
|
3951
|
-
marginTop: token
|
|
3918
|
+
marginTop: token.marginMD,
|
|
3952
3919
|
".ant-pagination-item-active": {
|
|
3953
|
-
backgroundColor: token
|
|
3954
|
-
borderColor: token
|
|
3955
|
-
borderRadius: token
|
|
3920
|
+
backgroundColor: token.colorBgContainer,
|
|
3921
|
+
borderColor: token.colorPrimary,
|
|
3922
|
+
borderRadius: token.borderRadius,
|
|
3956
3923
|
display: "flex",
|
|
3957
3924
|
alignItems: "center",
|
|
3958
3925
|
justifyContent: "center",
|
|
3959
3926
|
a: {
|
|
3960
|
-
color: token
|
|
3961
|
-
fontWeight: token
|
|
3962
|
-
fontSize: token
|
|
3927
|
+
color: token.colorPrimary,
|
|
3928
|
+
fontWeight: token.fontWeightStrong,
|
|
3929
|
+
fontSize: token.fontSize,
|
|
3963
3930
|
lineHeight: "22px",
|
|
3964
3931
|
display: "flex",
|
|
3965
3932
|
alignItems: "center",
|
|
@@ -3968,18 +3935,18 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
|
|
|
3968
3935
|
}
|
|
3969
3936
|
},
|
|
3970
3937
|
".ant-pagination-item": {
|
|
3971
|
-
borderRadius: token
|
|
3938
|
+
borderRadius: token.borderRadius,
|
|
3972
3939
|
minWidth: 32,
|
|
3973
3940
|
height: 32,
|
|
3974
3941
|
lineHeight: "32px",
|
|
3975
3942
|
a: {
|
|
3976
|
-
color: token
|
|
3943
|
+
color: token.colorText,
|
|
3977
3944
|
fontWeight: 400,
|
|
3978
|
-
fontSize: token
|
|
3945
|
+
fontSize: token.fontSize
|
|
3979
3946
|
}
|
|
3980
3947
|
},
|
|
3981
3948
|
".ant-pagination-prev .ant-pagination-item-link, .ant-pagination-next .ant-pagination-item-link": {
|
|
3982
|
-
borderRadius: token
|
|
3949
|
+
borderRadius: token.borderRadius,
|
|
3983
3950
|
width: 32,
|
|
3984
3951
|
height: 32,
|
|
3985
3952
|
display: "flex",
|
|
@@ -4073,7 +4040,7 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
|
|
|
4073
4040
|
level: 4,
|
|
4074
4041
|
style: {
|
|
4075
4042
|
margin: 0,
|
|
4076
|
-
color: token
|
|
4043
|
+
color: token.colorTextHeading
|
|
4077
4044
|
},
|
|
4078
4045
|
children: "Endpoints"
|
|
4079
4046
|
}), /* @__PURE__ */ jsx(Button, {
|
|
@@ -4121,7 +4088,7 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
|
|
|
4121
4088
|
transform: isExpanded ? "rotate(0deg)" : "rotate(180deg)",
|
|
4122
4089
|
transition: "transform 0.2s",
|
|
4123
4090
|
flexShrink: 0,
|
|
4124
|
-
color: isExpanded ? token
|
|
4091
|
+
color: isExpanded ? token.colorPrimary : token.colorText
|
|
4125
4092
|
}
|
|
4126
4093
|
})]
|
|
4127
4094
|
}),
|
|
@@ -4248,7 +4215,7 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
|
|
|
4248
4215
|
style: {
|
|
4249
4216
|
display: "flex",
|
|
4250
4217
|
alignItems: "center",
|
|
4251
|
-
gap: token
|
|
4218
|
+
gap: token.marginMD
|
|
4252
4219
|
},
|
|
4253
4220
|
children: [/* @__PURE__ */ jsx("span", {
|
|
4254
4221
|
className: cx("section-title"),
|
|
@@ -4374,7 +4341,7 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
|
|
|
4374
4341
|
const pagedReqParams = allReqParams.slice((reqPage - 1) * PAGE_SIZE, reqPage * PAGE_SIZE);
|
|
4375
4342
|
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("div", {
|
|
4376
4343
|
className: cx("param-list"),
|
|
4377
|
-
style: { marginTop: token
|
|
4344
|
+
style: { marginTop: token.margin },
|
|
4378
4345
|
children: pagedReqParams.map((param, i) => {
|
|
4379
4346
|
const idx = (reqPage - 1) * PAGE_SIZE + i;
|
|
4380
4347
|
return /* @__PURE__ */ jsx("div", {
|
|
@@ -4414,16 +4381,16 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
|
|
|
4414
4381
|
style: {
|
|
4415
4382
|
display: "flex",
|
|
4416
4383
|
alignItems: "center",
|
|
4417
|
-
gap: token
|
|
4418
|
-
background: token
|
|
4419
|
-
borderRadius: token
|
|
4420
|
-
padding: `0 ${token
|
|
4384
|
+
gap: token.margin,
|
|
4385
|
+
background: token.colorFillTertiary,
|
|
4386
|
+
borderRadius: token.borderRadius,
|
|
4387
|
+
padding: `0 ${token.marginSM}px`,
|
|
4421
4388
|
height: 50,
|
|
4422
4389
|
flexShrink: 0
|
|
4423
4390
|
},
|
|
4424
4391
|
children: [/* @__PURE__ */ jsx(Button, {
|
|
4425
4392
|
danger: true,
|
|
4426
|
-
icon: /* @__PURE__ */ jsx(
|
|
4393
|
+
icon: /* @__PURE__ */ jsx(Trash, {
|
|
4427
4394
|
width: 32,
|
|
4428
4395
|
height: 32
|
|
4429
4396
|
}),
|
|
@@ -4542,7 +4509,7 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
|
|
|
4542
4509
|
children: [/* @__PURE__ */ jsx(Button, {
|
|
4543
4510
|
danger: true,
|
|
4544
4511
|
type: "text",
|
|
4545
|
-
icon: /* @__PURE__ */ jsx(
|
|
4512
|
+
icon: /* @__PURE__ */ jsx(Trash, {
|
|
4546
4513
|
height: 32,
|
|
4547
4514
|
width: 32
|
|
4548
4515
|
}),
|
|
@@ -4584,12 +4551,12 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
|
|
|
4584
4551
|
})(),
|
|
4585
4552
|
/* @__PURE__ */ jsxs("div", {
|
|
4586
4553
|
className: cx("param-row"),
|
|
4587
|
-
style: { marginTop: token
|
|
4554
|
+
style: { marginTop: token.margin },
|
|
4588
4555
|
onClick: () => toggleRequestPanel(ep.id),
|
|
4589
4556
|
children: [/* @__PURE__ */ jsx(DownOutlined, { className: cx("param-row-icon", openRequestPanels.has(ep.id) ? "param-row-icon--open" : "") }), /* @__PURE__ */ jsxs("span", {
|
|
4590
|
-
style: { fontSize: token
|
|
4557
|
+
style: { fontSize: token.fontSize },
|
|
4591
4558
|
children: ["Request ", /* @__PURE__ */ jsx("span", {
|
|
4592
|
-
style: { color: token
|
|
4559
|
+
style: { color: token.colorError },
|
|
4593
4560
|
children: "*"
|
|
4594
4561
|
})]
|
|
4595
4562
|
})]
|
|
@@ -4633,7 +4600,7 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
|
|
|
4633
4600
|
style: {
|
|
4634
4601
|
display: "flex",
|
|
4635
4602
|
alignItems: "center",
|
|
4636
|
-
gap: token
|
|
4603
|
+
gap: token.marginMD
|
|
4637
4604
|
},
|
|
4638
4605
|
children: [/* @__PURE__ */ jsx("span", {
|
|
4639
4606
|
className: cx("section-title"),
|
|
@@ -4813,7 +4780,7 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
|
|
|
4813
4780
|
const pagedResParams = allResParams.slice((resPage - 1) * PAGE_SIZE, resPage * PAGE_SIZE);
|
|
4814
4781
|
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("div", {
|
|
4815
4782
|
className: cx("param-list"),
|
|
4816
|
-
style: { marginTop: token
|
|
4783
|
+
style: { marginTop: token.margin },
|
|
4817
4784
|
children: pagedResParams.map((param, i) => {
|
|
4818
4785
|
const idx = (resPage - 1) * PAGE_SIZE + i;
|
|
4819
4786
|
return /* @__PURE__ */ jsx("div", {
|
|
@@ -4853,16 +4820,16 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
|
|
|
4853
4820
|
style: {
|
|
4854
4821
|
display: "flex",
|
|
4855
4822
|
alignItems: "center",
|
|
4856
|
-
gap: token
|
|
4857
|
-
background: token
|
|
4858
|
-
borderRadius: token
|
|
4859
|
-
padding: `0 ${token
|
|
4823
|
+
gap: token.margin,
|
|
4824
|
+
background: token.colorFillTertiary,
|
|
4825
|
+
borderRadius: token.borderRadius,
|
|
4826
|
+
padding: `0 ${token.marginSM}px`,
|
|
4860
4827
|
height: 50,
|
|
4861
4828
|
flexShrink: 0
|
|
4862
4829
|
},
|
|
4863
4830
|
children: [/* @__PURE__ */ jsx(Button, {
|
|
4864
4831
|
danger: true,
|
|
4865
|
-
icon: /* @__PURE__ */ jsx(
|
|
4832
|
+
icon: /* @__PURE__ */ jsx(Trash, {
|
|
4866
4833
|
width: 32,
|
|
4867
4834
|
height: 32
|
|
4868
4835
|
}),
|
|
@@ -4992,7 +4959,7 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
|
|
|
4992
4959
|
}), /* @__PURE__ */ jsx(Button, {
|
|
4993
4960
|
danger: true,
|
|
4994
4961
|
type: "text",
|
|
4995
|
-
icon: /* @__PURE__ */ jsx(
|
|
4962
|
+
icon: /* @__PURE__ */ jsx(Trash, {
|
|
4996
4963
|
height: 18,
|
|
4997
4964
|
width: 18
|
|
4998
4965
|
}),
|
|
@@ -5023,18 +4990,18 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
|
|
|
5023
4990
|
})(),
|
|
5024
4991
|
/* @__PURE__ */ jsxs("div", {
|
|
5025
4992
|
className: cx("param-row"),
|
|
5026
|
-
style: { marginTop: token
|
|
4993
|
+
style: { marginTop: token.margin },
|
|
5027
4994
|
onClick: () => toggleResponsePanel(ep.id),
|
|
5028
4995
|
children: [
|
|
5029
4996
|
/* @__PURE__ */ jsx(DownOutlined, { className: cx("param-row-icon", openResponsePanels.has(ep.id) ? "param-row-icon--open" : "") }),
|
|
5030
4997
|
/* @__PURE__ */ jsxs("span", {
|
|
5031
|
-
style: { fontSize: token
|
|
4998
|
+
style: { fontSize: token.fontSize },
|
|
5032
4999
|
children: ["Response ", /* @__PURE__ */ jsx("span", {
|
|
5033
|
-
style: { color: token
|
|
5000
|
+
style: { color: token.colorError },
|
|
5034
5001
|
children: "*"
|
|
5035
5002
|
})]
|
|
5036
5003
|
}),
|
|
5037
|
-
/* @__PURE__ */ jsx(
|
|
5004
|
+
/* @__PURE__ */ jsx(InfoCircle, { style: {
|
|
5038
5005
|
width: 24,
|
|
5039
5006
|
height: 24
|
|
5040
5007
|
} })
|
|
@@ -5216,11 +5183,10 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
|
|
|
5216
5183
|
]
|
|
5217
5184
|
}));
|
|
5218
5185
|
};
|
|
5219
|
-
|
|
5220
5186
|
//#endregion
|
|
5221
5187
|
//#region src/view/components/ApiPage/components/UnsavedChangesBanner.tsx
|
|
5222
5188
|
const UnsavedChangesBanner = ({ onClose }) => {
|
|
5223
|
-
const { wrapSSR, cx } = useStyle("UnsavedChangesBanner", (token
|
|
5189
|
+
const { wrapSSR, cx } = useStyle("UnsavedChangesBanner", (token, scope) => ({
|
|
5224
5190
|
[scope("root")]: {
|
|
5225
5191
|
position: "sticky",
|
|
5226
5192
|
top: 0,
|
|
@@ -5230,7 +5196,7 @@ const UnsavedChangesBanner = ({ onClose }) => {
|
|
|
5230
5196
|
},
|
|
5231
5197
|
[scope("alert")]: {
|
|
5232
5198
|
padding: "8px 12px",
|
|
5233
|
-
fontSize: token
|
|
5199
|
+
fontSize: token.fontSize,
|
|
5234
5200
|
fontWeight: 400,
|
|
5235
5201
|
borderRadius: 0
|
|
5236
5202
|
}
|
|
@@ -5248,17 +5214,16 @@ const UnsavedChangesBanner = ({ onClose }) => {
|
|
|
5248
5214
|
})
|
|
5249
5215
|
}));
|
|
5250
5216
|
};
|
|
5251
|
-
|
|
5252
5217
|
//#endregion
|
|
5253
5218
|
//#region src/view/components/ApiPage/components/TagsSection.tsx
|
|
5254
5219
|
const { useBreakpoint } = Grid;
|
|
5255
5220
|
const TagsSection = ({ tags, collapsed = false, onToggleCollapse, onAddTag, onEditTag, onDeleteTag }) => {
|
|
5256
5221
|
const isMobile = !useBreakpoint().md;
|
|
5257
|
-
const { wrapSSR, cx, token
|
|
5222
|
+
const { wrapSSR, cx, token } = useStyle("TagsSection", (token, scope) => ({
|
|
5258
5223
|
[scope("root")]: {
|
|
5259
5224
|
display: "flex",
|
|
5260
5225
|
flexDirection: "column",
|
|
5261
|
-
borderRadius: token
|
|
5226
|
+
borderRadius: token.borderRadius,
|
|
5262
5227
|
overflow: "hidden",
|
|
5263
5228
|
width: "100%",
|
|
5264
5229
|
flexShrink: 0
|
|
@@ -5267,37 +5232,37 @@ const TagsSection = ({ tags, collapsed = false, onToggleCollapse, onAddTag, onEd
|
|
|
5267
5232
|
display: "flex",
|
|
5268
5233
|
alignItems: "center",
|
|
5269
5234
|
justifyContent: "space-between",
|
|
5270
|
-
padding: `${token
|
|
5271
|
-
background: token
|
|
5272
|
-
borderRadius: `${token
|
|
5235
|
+
padding: `${token.paddingXS}px ${token.paddingLG}px`,
|
|
5236
|
+
background: token.colorPrimaryBg,
|
|
5237
|
+
borderRadius: `${token.borderRadius}px ${token.borderRadius}px 0 0`
|
|
5273
5238
|
},
|
|
5274
5239
|
[scope("head-actions")]: {
|
|
5275
5240
|
display: "flex",
|
|
5276
5241
|
alignItems: "center",
|
|
5277
|
-
gap: token
|
|
5242
|
+
gap: token.margin
|
|
5278
5243
|
},
|
|
5279
5244
|
[scope("body")]: {
|
|
5280
5245
|
display: "flex",
|
|
5281
5246
|
flexDirection: "column",
|
|
5282
5247
|
gap: 0,
|
|
5283
|
-
padding: token
|
|
5284
|
-
background: token
|
|
5285
|
-
borderRadius: `0 0 ${token
|
|
5248
|
+
padding: token.paddingLG,
|
|
5249
|
+
background: token.colorBgElevated,
|
|
5250
|
+
borderRadius: `0 0 ${token.borderRadius}px ${token.borderRadius}px`
|
|
5286
5251
|
},
|
|
5287
5252
|
[scope("tag-row")]: {
|
|
5288
5253
|
display: "flex",
|
|
5289
5254
|
alignItems: "center",
|
|
5290
5255
|
justifyContent: "space-between",
|
|
5291
5256
|
height: 50,
|
|
5292
|
-
paddingTop: token
|
|
5293
|
-
paddingBottom: token
|
|
5294
|
-
paddingRight: token
|
|
5295
|
-
borderBottom: `1px solid ${token
|
|
5257
|
+
paddingTop: token.controlHeightLG,
|
|
5258
|
+
paddingBottom: token.controlHeightLG,
|
|
5259
|
+
paddingRight: token.paddingLG,
|
|
5260
|
+
borderBottom: `1px solid ${token.colorBorder}`,
|
|
5296
5261
|
width: "100%"
|
|
5297
5262
|
},
|
|
5298
5263
|
[scope("tag-row-last")]: {
|
|
5299
5264
|
borderBottom: "none",
|
|
5300
|
-
paddingBottom: token
|
|
5265
|
+
paddingBottom: token.marginLG
|
|
5301
5266
|
},
|
|
5302
5267
|
[scope("tag-info")]: {
|
|
5303
5268
|
display: "flex",
|
|
@@ -5309,26 +5274,26 @@ const TagsSection = ({ tags, collapsed = false, onToggleCollapse, onAddTag, onEd
|
|
|
5309
5274
|
[scope("tag-col")]: {
|
|
5310
5275
|
display: "flex",
|
|
5311
5276
|
flexDirection: "column",
|
|
5312
|
-
gap: token
|
|
5277
|
+
gap: token.marginXXS
|
|
5313
5278
|
},
|
|
5314
5279
|
[scope("col-label")]: {
|
|
5315
|
-
fontSize: token
|
|
5280
|
+
fontSize: token.fontSizeLG,
|
|
5316
5281
|
fontWeight: 600,
|
|
5317
|
-
color: token
|
|
5282
|
+
color: token.colorTextTertiary,
|
|
5318
5283
|
lineHeight: "24px",
|
|
5319
5284
|
whiteSpace: "nowrap"
|
|
5320
5285
|
},
|
|
5321
5286
|
[scope("col-value")]: {
|
|
5322
|
-
fontSize: token
|
|
5287
|
+
fontSize: token.fontSizeLG,
|
|
5323
5288
|
fontWeight: 400,
|
|
5324
|
-
color: token
|
|
5289
|
+
color: token.colorText,
|
|
5325
5290
|
lineHeight: "24px",
|
|
5326
5291
|
whiteSpace: "nowrap"
|
|
5327
5292
|
},
|
|
5328
5293
|
[scope("col-value-link")]: {
|
|
5329
|
-
fontSize: token
|
|
5294
|
+
fontSize: token.fontSize,
|
|
5330
5295
|
fontWeight: 400,
|
|
5331
|
-
color: token
|
|
5296
|
+
color: token.colorPrimary,
|
|
5332
5297
|
lineHeight: "22px",
|
|
5333
5298
|
textDecoration: "underline",
|
|
5334
5299
|
whiteSpace: "nowrap"
|
|
@@ -5336,13 +5301,13 @@ const TagsSection = ({ tags, collapsed = false, onToggleCollapse, onAddTag, onEd
|
|
|
5336
5301
|
[scope("tag-actions")]: {
|
|
5337
5302
|
display: "flex",
|
|
5338
5303
|
alignItems: "center",
|
|
5339
|
-
gap: token
|
|
5304
|
+
gap: token.margin
|
|
5340
5305
|
},
|
|
5341
5306
|
[scope("btn-delete")]: {
|
|
5342
5307
|
width: 40,
|
|
5343
5308
|
height: 40,
|
|
5344
|
-
border: `1px solid ${token
|
|
5345
|
-
borderRadius: token
|
|
5309
|
+
border: `1px solid ${token.colorError}`,
|
|
5310
|
+
borderRadius: token.borderRadius,
|
|
5346
5311
|
display: "flex",
|
|
5347
5312
|
alignItems: "center",
|
|
5348
5313
|
justifyContent: "center"
|
|
@@ -5350,9 +5315,9 @@ const TagsSection = ({ tags, collapsed = false, onToggleCollapse, onAddTag, onEd
|
|
|
5350
5315
|
[scope("btn-edit")]: {
|
|
5351
5316
|
width: 40,
|
|
5352
5317
|
height: 40,
|
|
5353
|
-
border: `1px solid ${token
|
|
5354
|
-
borderRadius: token
|
|
5355
|
-
background: token
|
|
5318
|
+
border: `1px solid ${token.colorBorder}`,
|
|
5319
|
+
borderRadius: token.borderRadius,
|
|
5320
|
+
background: token.colorBgContainer,
|
|
5356
5321
|
boxShadow: "0px 2px 0px 0px rgba(0,0,0,0.02)",
|
|
5357
5322
|
display: "flex",
|
|
5358
5323
|
alignItems: "center",
|
|
@@ -5364,8 +5329,8 @@ const TagsSection = ({ tags, collapsed = false, onToggleCollapse, onAddTag, onEd
|
|
|
5364
5329
|
alignItems: "flex-start",
|
|
5365
5330
|
justifyContent: "space-between",
|
|
5366
5331
|
gap: 8,
|
|
5367
|
-
paddingBottom: token
|
|
5368
|
-
borderBottom: `1px solid ${token
|
|
5332
|
+
paddingBottom: token.margin,
|
|
5333
|
+
borderBottom: `1px solid ${token.colorBorder}`,
|
|
5369
5334
|
width: "100%",
|
|
5370
5335
|
minHeight: 50
|
|
5371
5336
|
},
|
|
@@ -5393,9 +5358,9 @@ const TagsSection = ({ tags, collapsed = false, onToggleCollapse, onAddTag, onEd
|
|
|
5393
5358
|
display: "flex",
|
|
5394
5359
|
flexDirection: "column",
|
|
5395
5360
|
gap: 0,
|
|
5396
|
-
padding: token
|
|
5397
|
-
background: token
|
|
5398
|
-
borderRadius: `0 0 ${token
|
|
5361
|
+
padding: token.paddingMD,
|
|
5362
|
+
background: token.colorBgElevated,
|
|
5363
|
+
borderRadius: `0 0 ${token.borderRadius}px ${token.borderRadius}px`,
|
|
5399
5364
|
overflowX: "auto"
|
|
5400
5365
|
}
|
|
5401
5366
|
}));
|
|
@@ -5407,7 +5372,7 @@ const TagsSection = ({ tags, collapsed = false, onToggleCollapse, onAddTag, onEd
|
|
|
5407
5372
|
level: 4,
|
|
5408
5373
|
style: {
|
|
5409
5374
|
margin: 0,
|
|
5410
|
-
color: token
|
|
5375
|
+
color: token.colorTextHeading
|
|
5411
5376
|
},
|
|
5412
5377
|
children: "Tags"
|
|
5413
5378
|
}), /* @__PURE__ */ jsxs("div", {
|
|
@@ -5417,7 +5382,7 @@ const TagsSection = ({ tags, collapsed = false, onToggleCollapse, onAddTag, onEd
|
|
|
5417
5382
|
type: "primary",
|
|
5418
5383
|
icon: /* @__PURE__ */ jsx(PlusOutlined, {}),
|
|
5419
5384
|
onClick: onAddTag,
|
|
5420
|
-
style: { borderRadius: token
|
|
5385
|
+
style: { borderRadius: token.borderRadius },
|
|
5421
5386
|
children: "Add Tag"
|
|
5422
5387
|
}), /* @__PURE__ */ jsx(Button, {
|
|
5423
5388
|
type: "text",
|
|
@@ -5442,14 +5407,14 @@ const TagsSection = ({ tags, collapsed = false, onToggleCollapse, onAddTag, onEd
|
|
|
5442
5407
|
children: [/* @__PURE__ */ jsx("span", {
|
|
5443
5408
|
className: cx("col-label"),
|
|
5444
5409
|
style: {
|
|
5445
|
-
fontSize: token
|
|
5410
|
+
fontSize: token.fontSize,
|
|
5446
5411
|
lineHeight: "20px"
|
|
5447
5412
|
},
|
|
5448
5413
|
children: "Tag Name:"
|
|
5449
5414
|
}), /* @__PURE__ */ jsx("span", {
|
|
5450
5415
|
className: cx("col-value"),
|
|
5451
5416
|
style: {
|
|
5452
|
-
fontSize: token
|
|
5417
|
+
fontSize: token.fontSize,
|
|
5453
5418
|
lineHeight: "20px",
|
|
5454
5419
|
overflow: "hidden",
|
|
5455
5420
|
textOverflow: "ellipsis",
|
|
@@ -5462,7 +5427,7 @@ const TagsSection = ({ tags, collapsed = false, onToggleCollapse, onAddTag, onEd
|
|
|
5462
5427
|
children: [/* @__PURE__ */ jsx("span", {
|
|
5463
5428
|
className: cx("col-label"),
|
|
5464
5429
|
style: {
|
|
5465
|
-
fontSize: token
|
|
5430
|
+
fontSize: token.fontSize,
|
|
5466
5431
|
lineHeight: "20px"
|
|
5467
5432
|
},
|
|
5468
5433
|
children: "Description:"
|
|
@@ -5471,7 +5436,7 @@ const TagsSection = ({ tags, collapsed = false, onToggleCollapse, onAddTag, onEd
|
|
|
5471
5436
|
children: /* @__PURE__ */ jsx("span", {
|
|
5472
5437
|
className: cx("col-value"),
|
|
5473
5438
|
style: {
|
|
5474
|
-
fontSize: token
|
|
5439
|
+
fontSize: token.fontSize,
|
|
5475
5440
|
lineHeight: "20px",
|
|
5476
5441
|
overflow: "hidden",
|
|
5477
5442
|
textOverflow: "ellipsis",
|
|
@@ -5494,7 +5459,7 @@ const TagsSection = ({ tags, collapsed = false, onToggleCollapse, onAddTag, onEd
|
|
|
5494
5459
|
children: /* @__PURE__ */ jsx(Button, {
|
|
5495
5460
|
danger: true,
|
|
5496
5461
|
type: "text",
|
|
5497
|
-
icon: /* @__PURE__ */ jsx(
|
|
5462
|
+
icon: /* @__PURE__ */ jsx(Trash, {
|
|
5498
5463
|
width: 32,
|
|
5499
5464
|
height: 32
|
|
5500
5465
|
}),
|
|
@@ -5601,7 +5566,7 @@ const TagsSection = ({ tags, collapsed = false, onToggleCollapse, onAddTag, onEd
|
|
|
5601
5566
|
children: /* @__PURE__ */ jsx(Button, {
|
|
5602
5567
|
danger: true,
|
|
5603
5568
|
type: "text",
|
|
5604
|
-
icon: /* @__PURE__ */ jsx(
|
|
5569
|
+
icon: /* @__PURE__ */ jsx(Trash, {
|
|
5605
5570
|
width: 32,
|
|
5606
5571
|
height: 32
|
|
5607
5572
|
}),
|
|
@@ -5634,7 +5599,6 @@ const TagsSection = ({ tags, collapsed = false, onToggleCollapse, onAddTag, onEd
|
|
|
5634
5599
|
}))]
|
|
5635
5600
|
}));
|
|
5636
5601
|
};
|
|
5637
|
-
|
|
5638
5602
|
//#endregion
|
|
5639
5603
|
//#region src/view/components/ApiPage/components/AddTagDrawer.tsx
|
|
5640
5604
|
const TAG_NAME_REGEX = /^[A-Za-z0-9_-]+$/;
|
|
@@ -5648,11 +5612,11 @@ const AddTagDrawer = ({ open, onClose, mode, initialValues, onAddTag, onEditTag
|
|
|
5648
5612
|
const tagNameValue = Form.useWatch("name", form);
|
|
5649
5613
|
const extDocsDesc = Form.useWatch("externalDocsDescription", form);
|
|
5650
5614
|
const extDocsLink = Form.useWatch("externalDocsLink", form);
|
|
5651
|
-
const { wrapSSR, cx, token
|
|
5615
|
+
const { wrapSSR, cx, token } = useStyle("AddTagDrawer", (token, scope) => ({
|
|
5652
5616
|
[scope("title")]: {
|
|
5653
5617
|
fontSize: 16,
|
|
5654
5618
|
fontWeight: 600,
|
|
5655
|
-
color: token
|
|
5619
|
+
color: token.colorTextBase,
|
|
5656
5620
|
lineHeight: "24px",
|
|
5657
5621
|
fontFamily: "Cairo SemiBold, Cairo, sans-serif"
|
|
5658
5622
|
},
|
|
@@ -5663,25 +5627,25 @@ const AddTagDrawer = ({ open, onClose, mode, initialValues, onAddTag, onEditTag
|
|
|
5663
5627
|
"& .ant-form-item": { marginBottom: 0 }
|
|
5664
5628
|
},
|
|
5665
5629
|
[scope("label")]: {
|
|
5666
|
-
fontSize: token
|
|
5667
|
-
color: token
|
|
5630
|
+
fontSize: token.fontSize,
|
|
5631
|
+
color: token.colorText
|
|
5668
5632
|
},
|
|
5669
5633
|
[scope("asterisk")]: {
|
|
5670
|
-
color: token
|
|
5634
|
+
color: token.colorError,
|
|
5671
5635
|
marginLeft: 2
|
|
5672
5636
|
},
|
|
5673
5637
|
[scope("label-optional")]: {
|
|
5674
|
-
color: token
|
|
5638
|
+
color: token.colorTextTertiary,
|
|
5675
5639
|
marginLeft: 4,
|
|
5676
|
-
fontSize: token
|
|
5640
|
+
fontSize: token.fontSize
|
|
5677
5641
|
},
|
|
5678
5642
|
[scope("label-secondary")]: {
|
|
5679
|
-
fontSize: token
|
|
5680
|
-
color: token
|
|
5643
|
+
fontSize: token.fontSize,
|
|
5644
|
+
color: token.colorTextSecondary
|
|
5681
5645
|
},
|
|
5682
5646
|
[scope("label-disabled")]: {
|
|
5683
|
-
fontSize: token
|
|
5684
|
-
color: token
|
|
5647
|
+
fontSize: token.fontSize,
|
|
5648
|
+
color: token.colorTextDisabled
|
|
5685
5649
|
},
|
|
5686
5650
|
[scope("footer")]: {
|
|
5687
5651
|
display: "flex",
|
|
@@ -5718,7 +5682,7 @@ const AddTagDrawer = ({ open, onClose, mode, initialValues, onAddTag, onEditTag
|
|
|
5718
5682
|
fontSize: 16,
|
|
5719
5683
|
fontWeight: 400,
|
|
5720
5684
|
lineHeight: "24px",
|
|
5721
|
-
color: token
|
|
5685
|
+
color: token.colorText
|
|
5722
5686
|
},
|
|
5723
5687
|
[scope("modalCloseBtn")]: {
|
|
5724
5688
|
position: "absolute",
|
|
@@ -5734,12 +5698,12 @@ const AddTagDrawer = ({ open, onClose, mode, initialValues, onAddTag, onEditTag
|
|
|
5734
5698
|
border: "none",
|
|
5735
5699
|
background: "transparent",
|
|
5736
5700
|
padding: 0,
|
|
5737
|
-
color: token
|
|
5701
|
+
color: token.colorTextTertiary,
|
|
5738
5702
|
fontSize: 16,
|
|
5739
5703
|
lineHeight: 1,
|
|
5740
5704
|
"&:hover": {
|
|
5741
|
-
color: token
|
|
5742
|
-
backgroundColor: token
|
|
5705
|
+
color: token.colorText,
|
|
5706
|
+
backgroundColor: token.colorFillSecondary
|
|
5743
5707
|
}
|
|
5744
5708
|
},
|
|
5745
5709
|
[scope("modalContent")]: {
|
|
@@ -5756,7 +5720,7 @@ const AddTagDrawer = ({ open, onClose, mode, initialValues, onAddTag, onEditTag
|
|
|
5756
5720
|
fontSize: 14,
|
|
5757
5721
|
fontWeight: 400,
|
|
5758
5722
|
lineHeight: "22px",
|
|
5759
|
-
color: token
|
|
5723
|
+
color: token.colorText
|
|
5760
5724
|
},
|
|
5761
5725
|
[scope("modalFooter")]: {
|
|
5762
5726
|
display: "flex",
|
|
@@ -5833,14 +5797,14 @@ const AddTagDrawer = ({ open, onClose, mode, initialValues, onAddTag, onEditTag
|
|
|
5833
5797
|
styles: {
|
|
5834
5798
|
header: {
|
|
5835
5799
|
padding: "16px 24px",
|
|
5836
|
-
borderBottom: `1px solid ${token
|
|
5837
|
-
background: token
|
|
5800
|
+
borderBottom: `1px solid ${token.colorFillSecondary}`,
|
|
5801
|
+
background: token.colorBgBase
|
|
5838
5802
|
},
|
|
5839
5803
|
body: { padding: "24px" },
|
|
5840
5804
|
footer: {
|
|
5841
5805
|
padding: "24px",
|
|
5842
|
-
background: token
|
|
5843
|
-
borderTop: `1px solid ${token
|
|
5806
|
+
background: token.colorPrimaryBg,
|
|
5807
|
+
borderTop: `1px solid ${token.colorFillSecondary}`
|
|
5844
5808
|
}
|
|
5845
5809
|
},
|
|
5846
5810
|
footer: /* @__PURE__ */ jsxs("div", {
|
|
@@ -6041,9 +6005,9 @@ const AddTagDrawer = ({ open, onClose, mode, initialValues, onAddTag, onEditTag
|
|
|
6041
6005
|
borderRadius: 8,
|
|
6042
6006
|
height: 32,
|
|
6043
6007
|
paddingInline: 16,
|
|
6044
|
-
backgroundColor: token
|
|
6045
|
-
borderColor: token
|
|
6046
|
-
boxShadow: `0px 2px 0px ${token
|
|
6008
|
+
backgroundColor: token.colorPrimary,
|
|
6009
|
+
borderColor: token.colorPrimary,
|
|
6010
|
+
boxShadow: `0px 2px 0px ${token.colorPrimaryBg}`
|
|
6047
6011
|
},
|
|
6048
6012
|
children: confirmBtnLabel
|
|
6049
6013
|
})]
|
|
@@ -6052,7 +6016,6 @@ const AddTagDrawer = ({ open, onClose, mode, initialValues, onAddTag, onEditTag
|
|
|
6052
6016
|
})
|
|
6053
6017
|
] }));
|
|
6054
6018
|
};
|
|
6055
|
-
|
|
6056
6019
|
//#endregion
|
|
6057
6020
|
//#region src/view/helper/mutate.ts
|
|
6058
6021
|
const resolveSchema = (schema, components) => {
|
|
@@ -6137,7 +6100,6 @@ const transformOpenApiToDocs = (api) => {
|
|
|
6137
6100
|
curl
|
|
6138
6101
|
};
|
|
6139
6102
|
};
|
|
6140
|
-
|
|
6141
6103
|
//#endregion
|
|
6142
6104
|
//#region src/assets/copy.tsx
|
|
6143
6105
|
const Copy = (props) => /* @__PURE__ */ jsxs("svg", {
|
|
@@ -6155,17 +6117,15 @@ const Copy = (props) => /* @__PURE__ */ jsxs("svg", {
|
|
|
6155
6117
|
fill: "currentcolor"
|
|
6156
6118
|
})]
|
|
6157
6119
|
});
|
|
6158
|
-
var copy_default = Copy;
|
|
6159
|
-
|
|
6160
6120
|
//#endregion
|
|
6161
6121
|
//#region src/view/components/EndpointPage/Codebox/Codebox.tsx
|
|
6162
6122
|
Light.registerLanguage("json", json);
|
|
6163
6123
|
const Codebox = ({ code, language, wrapLongLines }) => {
|
|
6164
6124
|
const [appTheme] = useState("DARK");
|
|
6165
|
-
const { token
|
|
6166
|
-
const bodyBg = themeConfig.id == 1 ? token
|
|
6167
|
-
const { cx } = useStyle("codeBox", (token
|
|
6168
|
-
borderRadius: token
|
|
6125
|
+
const { token, theme: themeConfig } = theme.useToken();
|
|
6126
|
+
const bodyBg = themeConfig.id == 1 ? token.colorBgContainer : "#1d2856";
|
|
6127
|
+
const { cx } = useStyle("codeBox", (token, scope) => ({ [scope("codebox")]: {
|
|
6128
|
+
borderRadius: token.borderRadius,
|
|
6169
6129
|
height: "100%",
|
|
6170
6130
|
maxHeight: "100%",
|
|
6171
6131
|
overflow: "auto",
|
|
@@ -6192,12 +6152,10 @@ const Codebox = ({ code, language, wrapLongLines }) => {
|
|
|
6192
6152
|
})
|
|
6193
6153
|
});
|
|
6194
6154
|
};
|
|
6195
|
-
var Codebox_default = Codebox;
|
|
6196
|
-
|
|
6197
6155
|
//#endregion
|
|
6198
6156
|
//#region src/view/components/CodeboxSidebar.tsx
|
|
6199
6157
|
function CodeboxSidebar() {
|
|
6200
|
-
const { selectedEndpoint, selectedApi, activeRequestTab, selectedStatusCode, statusCodeOptions, setSelectedStatusCode } =
|
|
6158
|
+
const { selectedEndpoint, selectedApi, activeRequestTab, selectedStatusCode, statusCodeOptions, setSelectedStatusCode } = useStore(({ view }) => view);
|
|
6201
6159
|
const httpStatusOptions = useMemo(() => statusCodeOptions.map((code) => ({
|
|
6202
6160
|
value: code,
|
|
6203
6161
|
label: /* @__PURE__ */ jsxs("span", {
|
|
@@ -6371,7 +6329,7 @@ function CodeboxSidebar() {
|
|
|
6371
6329
|
setCurlTooltip("Copied!");
|
|
6372
6330
|
setTimeout(() => setCurlTooltip("Copy cURL"), 1500);
|
|
6373
6331
|
},
|
|
6374
|
-
icon: /* @__PURE__ */ jsx(
|
|
6332
|
+
icon: /* @__PURE__ */ jsx(Copy, { style: { color: "white" } })
|
|
6375
6333
|
})
|
|
6376
6334
|
})]
|
|
6377
6335
|
}), /* @__PURE__ */ jsx("div", {
|
|
@@ -6401,12 +6359,10 @@ function CodeboxSidebar() {
|
|
|
6401
6359
|
open: httpStatusOptions.length === 1 ? false : void 0,
|
|
6402
6360
|
suffixIcon: httpStatusOptions.length > 1 ? void 0 : false
|
|
6403
6361
|
})]
|
|
6404
|
-
}), /* @__PURE__ */ jsx(
|
|
6362
|
+
}), /* @__PURE__ */ jsx(Codebox, { code: JSON.stringify(selectedEndpoint?.responses[selectedStatusCode], null, 2) || "" })]
|
|
6405
6363
|
})]
|
|
6406
6364
|
});
|
|
6407
6365
|
}
|
|
6408
|
-
var CodeboxSidebar_default = CodeboxSidebar;
|
|
6409
|
-
|
|
6410
6366
|
//#endregion
|
|
6411
6367
|
//#region src/view/layout.tsx
|
|
6412
6368
|
const DocumentationLayout = ({ data, preSelectedApi, handleVisitLandingPage, onSave }) => {
|
|
@@ -6436,11 +6392,11 @@ const DocumentationLayout = ({ data, preSelectedApi, handleVisitLandingPage, onS
|
|
|
6436
6392
|
});
|
|
6437
6393
|
const [localTags, setLocalTags] = useState([]);
|
|
6438
6394
|
const [messageApi, contextHolder] = message.useMessage();
|
|
6439
|
-
const { focusedContent, selectedNodeKey, selectedApi, originalData, builtTreeData, selectedEndpoint, setOriginalData, setTransformedData, setBuiltTreeData, setFocusedContent, setExpandedKeys, setSelectedEndpoint } =
|
|
6395
|
+
const { focusedContent, selectedNodeKey, selectedApi, originalData, builtTreeData, selectedEndpoint, setOriginalData, setTransformedData, setBuiltTreeData, setFocusedContent, setExpandedKeys, setSelectedEndpoint } = useStore(({ view }) => view);
|
|
6440
6396
|
const { selectFirstApi, selectPreSelectedApi, clearSelection } = useNodeSelection();
|
|
6441
6397
|
const hasInitializedRef = useRef(false);
|
|
6442
|
-
const { useBreakpoint
|
|
6443
|
-
const isMobile = !useBreakpoint
|
|
6398
|
+
const { useBreakpoint } = Grid;
|
|
6399
|
+
const isMobile = !useBreakpoint().md;
|
|
6444
6400
|
useEffect(() => {
|
|
6445
6401
|
return () => {
|
|
6446
6402
|
resetStore();
|
|
@@ -6482,11 +6438,11 @@ const DocumentationLayout = ({ data, preSelectedApi, handleVisitLandingPage, onS
|
|
|
6482
6438
|
selectedApi,
|
|
6483
6439
|
selectFirstApi
|
|
6484
6440
|
]);
|
|
6485
|
-
const { cx, token
|
|
6441
|
+
const { cx, token } = useStyle("APIDocumentationLayout", (token, scope) => ({
|
|
6486
6442
|
[scope("documentation-container")]: {
|
|
6487
6443
|
display: "flex",
|
|
6488
6444
|
flexDirection: "column",
|
|
6489
|
-
gap: token
|
|
6445
|
+
gap: token.marginLG,
|
|
6490
6446
|
height: "100%",
|
|
6491
6447
|
overflowY: "auto"
|
|
6492
6448
|
},
|
|
@@ -6498,7 +6454,7 @@ const DocumentationLayout = ({ data, preSelectedApi, handleVisitLandingPage, onS
|
|
|
6498
6454
|
display: "flex",
|
|
6499
6455
|
flexShrink: 0,
|
|
6500
6456
|
height: "auto",
|
|
6501
|
-
gap: token
|
|
6457
|
+
gap: token.marginLG,
|
|
6502
6458
|
width: "100%"
|
|
6503
6459
|
},
|
|
6504
6460
|
[".delete-tag-confirm-modal .ant-modal-container"]: {
|
|
@@ -6520,7 +6476,7 @@ const DocumentationLayout = ({ data, preSelectedApi, handleVisitLandingPage, onS
|
|
|
6520
6476
|
fontSize: 16,
|
|
6521
6477
|
fontWeight: 400,
|
|
6522
6478
|
lineHeight: "24px",
|
|
6523
|
-
color: token
|
|
6479
|
+
color: token.colorText
|
|
6524
6480
|
},
|
|
6525
6481
|
[scope("deleteModalCloseBtn")]: {
|
|
6526
6482
|
position: "absolute",
|
|
@@ -6536,12 +6492,12 @@ const DocumentationLayout = ({ data, preSelectedApi, handleVisitLandingPage, onS
|
|
|
6536
6492
|
border: "none",
|
|
6537
6493
|
background: "transparent",
|
|
6538
6494
|
padding: 0,
|
|
6539
|
-
color: token
|
|
6495
|
+
color: token.colorTextTertiary,
|
|
6540
6496
|
fontSize: 16,
|
|
6541
6497
|
lineHeight: 1,
|
|
6542
6498
|
"&:hover": {
|
|
6543
|
-
color: token
|
|
6544
|
-
backgroundColor: token
|
|
6499
|
+
color: token.colorText,
|
|
6500
|
+
backgroundColor: token.colorFillSecondary
|
|
6545
6501
|
}
|
|
6546
6502
|
},
|
|
6547
6503
|
[scope("deleteModalContent")]: {
|
|
@@ -6558,7 +6514,7 @@ const DocumentationLayout = ({ data, preSelectedApi, handleVisitLandingPage, onS
|
|
|
6558
6514
|
fontSize: 14,
|
|
6559
6515
|
fontWeight: 400,
|
|
6560
6516
|
lineHeight: "22px",
|
|
6561
|
-
color: token
|
|
6517
|
+
color: token.colorText
|
|
6562
6518
|
},
|
|
6563
6519
|
[scope("deleteModalFooter")]: {
|
|
6564
6520
|
display: "flex",
|
|
@@ -6847,7 +6803,7 @@ const DocumentationLayout = ({ data, preSelectedApi, handleVisitLandingPage, onS
|
|
|
6847
6803
|
style: {
|
|
6848
6804
|
display: "flex",
|
|
6849
6805
|
alignItems: "center",
|
|
6850
|
-
background: token
|
|
6806
|
+
background: token.colorBgLayout,
|
|
6851
6807
|
padding: "4px",
|
|
6852
6808
|
borderRadius: 8,
|
|
6853
6809
|
gap: 8
|
|
@@ -6862,12 +6818,12 @@ const DocumentationLayout = ({ data, preSelectedApi, handleVisitLandingPage, onS
|
|
|
6862
6818
|
border: "none",
|
|
6863
6819
|
cursor: "pointer",
|
|
6864
6820
|
borderRadius: 8,
|
|
6865
|
-
fontFamily: token
|
|
6866
|
-
background: mode === "edit" ? token
|
|
6821
|
+
fontFamily: token.fontFamily,
|
|
6822
|
+
background: mode === "edit" ? token.colorBgContainer : "transparent",
|
|
6867
6823
|
boxShadow: mode === "edit" ? "0px 2px 4px -2px rgba(17,12,34,0.12)" : "none",
|
|
6868
6824
|
fontWeight: mode === "edit" ? 700 : 400,
|
|
6869
|
-
fontSize: mode === "edit" ? token
|
|
6870
|
-
color: token
|
|
6825
|
+
fontSize: mode === "edit" ? token.fontSize : token.fontSizeLG,
|
|
6826
|
+
color: token.colorText
|
|
6871
6827
|
},
|
|
6872
6828
|
children: [/* @__PURE__ */ jsx(EditOutlined, { style: { fontSize: 18 } }), "Edit"]
|
|
6873
6829
|
}), /* @__PURE__ */ jsxs("button", {
|
|
@@ -6880,12 +6836,12 @@ const DocumentationLayout = ({ data, preSelectedApi, handleVisitLandingPage, onS
|
|
|
6880
6836
|
border: "none",
|
|
6881
6837
|
cursor: "pointer",
|
|
6882
6838
|
borderRadius: 8,
|
|
6883
|
-
fontFamily: token
|
|
6884
|
-
background: mode === "view" ? token
|
|
6839
|
+
fontFamily: token.fontFamily,
|
|
6840
|
+
background: mode === "view" ? token.colorBgContainer : "transparent",
|
|
6885
6841
|
boxShadow: mode === "view" ? "0px 2px 4px -2px rgba(17,12,34,0.12)" : "none",
|
|
6886
6842
|
fontWeight: mode === "view" ? 700 : 400,
|
|
6887
|
-
fontSize: mode === "view" ? token
|
|
6888
|
-
color: token
|
|
6843
|
+
fontSize: mode === "view" ? token.fontSize : token.fontSizeLG,
|
|
6844
|
+
color: token.colorText
|
|
6889
6845
|
},
|
|
6890
6846
|
children: [/* @__PURE__ */ jsx(EyeOutlined, { style: { fontSize: 18 } }), "View"]
|
|
6891
6847
|
})]
|
|
@@ -7050,7 +7006,7 @@ const DocumentationLayout = ({ data, preSelectedApi, handleVisitLandingPage, onS
|
|
|
7050
7006
|
handleResetSearch,
|
|
7051
7007
|
searchEnabled: !!searchValue
|
|
7052
7008
|
}),
|
|
7053
|
-
!isMobile && focusedContent === "ENDPOINT" && /* @__PURE__ */ jsx(
|
|
7009
|
+
!isMobile && focusedContent === "ENDPOINT" && /* @__PURE__ */ jsx(CodeboxSidebar, {})
|
|
7054
7010
|
]
|
|
7055
7011
|
}),
|
|
7056
7012
|
/* @__PURE__ */ jsx(AddTagDrawer, {
|
|
@@ -7150,7 +7106,102 @@ const DocumentationLayout = ({ data, preSelectedApi, handleVisitLandingPage, onS
|
|
|
7150
7106
|
]
|
|
7151
7107
|
});
|
|
7152
7108
|
};
|
|
7153
|
-
|
|
7154
7109
|
//#endregion
|
|
7155
|
-
|
|
7156
|
-
|
|
7110
|
+
//#region src/view/devportal-layout.tsx
|
|
7111
|
+
const DevportalDocumentationLayout = ({ data, preSelectedApi, handleVisitLandingPage }) => {
|
|
7112
|
+
const [searchValue, setSearchValue] = useState("");
|
|
7113
|
+
const { focusedContent, selectedNodeKey, selectedApi, builtTreeData, setOriginalData, setTransformedData, setBuiltTreeData, setFocusedContent, setExpandedKeys } = useStore(({ view }) => view);
|
|
7114
|
+
const { selectFirstApi, selectPreSelectedApi, clearSelection } = useNodeSelection();
|
|
7115
|
+
const hasInitializedRef = useRef(false);
|
|
7116
|
+
useEffect(() => {
|
|
7117
|
+
return () => {
|
|
7118
|
+
resetStore();
|
|
7119
|
+
};
|
|
7120
|
+
}, []);
|
|
7121
|
+
const resetStore = () => {
|
|
7122
|
+
setExpandedKeys([]);
|
|
7123
|
+
setFocusedContent(null);
|
|
7124
|
+
setBuiltTreeData([]);
|
|
7125
|
+
setTransformedData([]);
|
|
7126
|
+
setOriginalData([]);
|
|
7127
|
+
setSearchValue("");
|
|
7128
|
+
clearSelection();
|
|
7129
|
+
hasInitializedRef.current = false;
|
|
7130
|
+
};
|
|
7131
|
+
useEffect(() => {
|
|
7132
|
+
if (!hasInitializedRef.current && data.length > 0) {
|
|
7133
|
+
setOriginalData(data);
|
|
7134
|
+
const transformedData = data.map(transformOpenApiToDocs).sort((a, b) => a.title.localeCompare(b.title));
|
|
7135
|
+
setTransformedData(transformedData);
|
|
7136
|
+
setBuiltTreeData(buildTreeDataStructure(transformedData));
|
|
7137
|
+
hasInitializedRef.current = true;
|
|
7138
|
+
}
|
|
7139
|
+
}, [
|
|
7140
|
+
data,
|
|
7141
|
+
setOriginalData,
|
|
7142
|
+
setTransformedData,
|
|
7143
|
+
setBuiltTreeData
|
|
7144
|
+
]);
|
|
7145
|
+
useEffect(() => {
|
|
7146
|
+
if (builtTreeData && builtTreeData.length > 0 && !selectedApi && !selectedNodeKey && hasInitializedRef.current) {
|
|
7147
|
+
if (!preSelectedApi) selectFirstApi(builtTreeData);
|
|
7148
|
+
else selectPreSelectedApi(builtTreeData, preSelectedApi);
|
|
7149
|
+
hasInitializedRef.current = false;
|
|
7150
|
+
}
|
|
7151
|
+
}, [
|
|
7152
|
+
builtTreeData,
|
|
7153
|
+
selectedNodeKey,
|
|
7154
|
+
selectedApi,
|
|
7155
|
+
selectFirstApi
|
|
7156
|
+
]);
|
|
7157
|
+
const { cx } = useStyle("APIDocumentationLayout", (token, scope) => ({
|
|
7158
|
+
[scope("documentation-container")]: {
|
|
7159
|
+
display: "flex",
|
|
7160
|
+
flexDirection: "column",
|
|
7161
|
+
gap: token.marginLG,
|
|
7162
|
+
height: "100%",
|
|
7163
|
+
maxHeight: "100%",
|
|
7164
|
+
overflow: "hidden"
|
|
7165
|
+
},
|
|
7166
|
+
[scope("docs-layout")]: {
|
|
7167
|
+
display: "flex",
|
|
7168
|
+
height: "100%",
|
|
7169
|
+
maxHeight: "100%",
|
|
7170
|
+
overflow: "hidden",
|
|
7171
|
+
gap: token.marginLG,
|
|
7172
|
+
width: "100%"
|
|
7173
|
+
}
|
|
7174
|
+
}));
|
|
7175
|
+
const handleResetSearch = () => {
|
|
7176
|
+
setSearchValue("");
|
|
7177
|
+
};
|
|
7178
|
+
const _handleVisitLandingPage = () => {
|
|
7179
|
+
if (handleVisitLandingPage) {
|
|
7180
|
+
handleVisitLandingPage();
|
|
7181
|
+
return;
|
|
7182
|
+
}
|
|
7183
|
+
window.location.pathname = "/";
|
|
7184
|
+
};
|
|
7185
|
+
return /* @__PURE__ */ jsx("div", {
|
|
7186
|
+
className: cx("documentation-container"),
|
|
7187
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
7188
|
+
className: cx("docs-layout"),
|
|
7189
|
+
children: [
|
|
7190
|
+
/* @__PURE__ */ jsx(Sidebar, {
|
|
7191
|
+
searchValue,
|
|
7192
|
+
setSearchValue
|
|
7193
|
+
}),
|
|
7194
|
+
/* @__PURE__ */ jsx(MainContent, {
|
|
7195
|
+
handleVisitLandingPage: _handleVisitLandingPage,
|
|
7196
|
+
handleResetSearch,
|
|
7197
|
+
searchEnabled: !!searchValue
|
|
7198
|
+
}),
|
|
7199
|
+
focusedContent === "ENDPOINT" && /* @__PURE__ */ jsx(CodeboxSidebar, {})
|
|
7200
|
+
]
|
|
7201
|
+
})
|
|
7202
|
+
});
|
|
7203
|
+
};
|
|
7204
|
+
//#endregion
|
|
7205
|
+
export { ApiDocumentationBar, DevportalDocumentationLayout, DocumentationLayout, useStore };
|
|
7206
|
+
|
|
7207
|
+
//# sourceMappingURL=index.mjs.map
|