@digi-frontend/dgate-api-documentation 4.1.3 → 4.1.5

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.mjs CHANGED
@@ -75,8 +75,10 @@ const useStore = create()(devtools(immer(createStore), { name: "dgate-docs-store
75
75
  //#region src/hooks/useStyle.ts
76
76
  function useStyle(componentName, stylesFn) {
77
77
  const { token, theme: theme$1, hashId } = theme.useToken();
78
- const scope = (className) => `.${hashId}.${componentName}-${className}`;
79
- const cx = (...classes) => classes.map((cls) => `${componentName}-${cls} ${hashId}`).join(" ");
78
+ const tokenKey = token._tokenKey;
79
+ const themeId = tokenKey ? `tk-${tokenKey.slice(-6)}` : "tk-default";
80
+ const scope = (className) => `.${hashId}.${themeId}.${componentName}-${className}`;
81
+ const cx = (...classes) => classes.map((cls) => `${componentName}-${cls} ${hashId} ${themeId}`).join(" ");
80
82
  return {
81
83
  wrapSSR: useStyleRegister({
82
84
  theme: theme$1,
@@ -1231,7 +1233,7 @@ const ApiCard = ({ api, viewStyle }) => {
1231
1233
  border: `1px solid ${token.colorBorderSecondary}`,
1232
1234
  minWidth: "6.25rem",
1233
1235
  maxWidth: "fit-content",
1234
- svg: { path: { fill: token.colorPrimary } }
1236
+ svg: { path: { fill: "#4D75D9" } }
1235
1237
  },
1236
1238
  [scope("list-title")]: {
1237
1239
  color: token.colorTextHeading,
@@ -1279,7 +1281,7 @@ const ApiCard = ({ api, viewStyle }) => {
1279
1281
  flexDirection: "row",
1280
1282
  borderRadius: token.borderRadiusSM,
1281
1283
  border: `1px solid ${token.colorBorderSecondary}`,
1282
- svg: { path: { fill: token.colorPrimary } }
1284
+ svg: { path: { fill: "#4D75D9" } }
1283
1285
  },
1284
1286
  [scope("grid-path-name")]: {
1285
1287
  color: token.colorText,
@@ -2124,7 +2126,7 @@ const ApiDocumentationBar = ({ apiName, mode, onModeChange, onReset, onSave, has
2124
2126
  },
2125
2127
  [scope("mobileWrapper")]: {
2126
2128
  flexDirection: "column",
2127
- gap: token.marginMD
2129
+ gap: 16
2128
2130
  },
2129
2131
  [scope("mobileTopRow")]: {
2130
2132
  width: "100%",
@@ -2199,14 +2201,14 @@ const ApiDocumentationBar = ({ apiName, mode, onModeChange, onReset, onSave, has
2199
2201
  [scope("actions")]: {
2200
2202
  display: "flex",
2201
2203
  alignItems: "center",
2202
- gap: token.marginMD,
2204
+ gap: 16,
2203
2205
  flex: 1,
2204
2206
  justifyContent: "flex-end"
2205
2207
  },
2206
2208
  [scope("mobileActions")]: {
2207
2209
  display: "flex",
2208
2210
  alignItems: "center",
2209
- gap: token.marginSM,
2211
+ gap: 16,
2210
2212
  justifyContent: "flex-end"
2211
2213
  }
2212
2214
  }));
@@ -2603,42 +2605,6 @@ const EditTag = (props) => /* @__PURE__ */ jsxs("svg", {
2603
2605
  ]
2604
2606
  });
2605
2607
  //#endregion
2606
- //#region src/assets/info-circle.tsx
2607
- const InfoCircle = (props) => /* @__PURE__ */ jsxs("svg", {
2608
- width: "24",
2609
- height: "24",
2610
- viewBox: "0 0 24 24",
2611
- fill: "none",
2612
- xmlns: "http://www.w3.org/2000/svg",
2613
- ...props,
2614
- children: [
2615
- /* @__PURE__ */ jsx("path", {
2616
- d: "M12 22C17.5 22 22 17.5 22 12C22 6.5 17.5 2 12 2C6.5 2 2 6.5 2 12C2 17.5 6.5 22 12 22Z",
2617
- stroke: "black",
2618
- strokeOpacity: "0.45",
2619
- strokeWidth: "1.5",
2620
- strokeLinecap: "round",
2621
- strokeLinejoin: "round"
2622
- }),
2623
- /* @__PURE__ */ jsx("path", {
2624
- d: "M12 8V13",
2625
- stroke: "black",
2626
- strokeOpacity: "0.45",
2627
- strokeWidth: "1.5",
2628
- strokeLinecap: "round",
2629
- strokeLinejoin: "round"
2630
- }),
2631
- /* @__PURE__ */ jsx("path", {
2632
- d: "M11.9946 16H12.0036",
2633
- stroke: "black",
2634
- strokeOpacity: "0.45",
2635
- strokeWidth: "1.5",
2636
- strokeLinecap: "round",
2637
- strokeLinejoin: "round"
2638
- })
2639
- ]
2640
- });
2641
- //#endregion
2642
2608
  //#region src/hooks/useDebounce.ts
2643
2609
  function useDebounce(value, delay = 500) {
2644
2610
  const [debouncedValue, setDebouncedValue] = useState(value);
@@ -2656,42 +2622,42 @@ function useDebounce(value, delay = 500) {
2656
2622
  //#region src/view/components/ApiPage/components/AddParameterDrawer.tsx
2657
2623
  const PARAM_IN_OPTIONS = [
2658
2624
  {
2659
- label: "query",
2625
+ label: "QUERY",
2660
2626
  value: "query"
2661
2627
  },
2662
2628
  {
2663
- label: "header",
2629
+ label: "HEADER",
2664
2630
  value: "header"
2665
2631
  },
2666
2632
  {
2667
- label: "path",
2633
+ label: "PATH",
2668
2634
  value: "path"
2669
2635
  }
2670
2636
  ];
2671
2637
  const RESPONSE_PARAM_IN_OPTIONS = PARAM_IN_OPTIONS.filter((o) => o.value === "header");
2672
2638
  const PARAM_TYPE_OPTIONS = [
2673
2639
  {
2674
- label: "string",
2640
+ label: "STRING",
2675
2641
  value: "string"
2676
2642
  },
2677
2643
  {
2678
- label: "number",
2644
+ label: "NUMBER",
2679
2645
  value: "number"
2680
2646
  },
2681
2647
  {
2682
- label: "integer",
2648
+ label: "INTEGER",
2683
2649
  value: "integer"
2684
2650
  },
2685
2651
  {
2686
- label: "boolean",
2652
+ label: "BOOLEAN",
2687
2653
  value: "boolean"
2688
2654
  },
2689
2655
  {
2690
- label: "array",
2656
+ label: "ARRAY",
2691
2657
  value: "array"
2692
2658
  },
2693
2659
  {
2694
- label: "object",
2660
+ label: "OBJECT",
2695
2661
  value: "object"
2696
2662
  }
2697
2663
  ];
@@ -3219,14 +3185,9 @@ const AddParameterDrawer = ({ open, onClose, onAdd, onEdit, mode = "add", initia
3219
3185
  children: [
3220
3186
  /* @__PURE__ */ jsxs("div", {
3221
3187
  className: cx("modalHead"),
3222
- children: [/* @__PURE__ */ jsxs("span", {
3188
+ children: [/* @__PURE__ */ jsx("span", {
3223
3189
  className: cx("modalTitle"),
3224
- children: [
3225
- mode === "edit" ? "Edit" : "Add",
3226
- " Parameter to ",
3227
- endpointName,
3228
- " endpoint"
3229
- ]
3190
+ children: mode === "edit" ? `Edit ${paramName} parameter` : `Add Parameter to ${endpointName} endpoint`
3230
3191
  }), /* @__PURE__ */ jsx("button", {
3231
3192
  className: cx("modalCloseBtn"),
3232
3193
  onClick: () => setConfirmModalOpen(false),
@@ -3243,10 +3204,9 @@ const AddParameterDrawer = ({ open, onClose, onAdd, onEdit, mode = "add", initia
3243
3204
  mode === "edit" ? "edit" : "add",
3244
3205
  " ",
3245
3206
  paramName,
3246
- " parameter to",
3247
- " ",
3248
- endpointName,
3249
- " endpoint?"
3207
+ " parameter",
3208
+ mode === "add" ? ` to ${endpointName} endpoint` : "",
3209
+ "?"
3250
3210
  ]
3251
3211
  })
3252
3212
  }),
@@ -3304,7 +3264,7 @@ const buildViewParamRows = (params) => params.map((p, idx) => ({
3304
3264
  description: p.description ?? "",
3305
3265
  enum: p.enum ?? []
3306
3266
  }));
3307
- const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse, endpointNames, endpointDescs, endpointTags, availableTags, onEndpointNameChange, onEndpointDescChange, onEndpointTagsChange, endpointParams, onAddParameter, onEditParameter, onDeleteParameter, endpointResponseParams, onAddResponseParameter, onEditResponseParameter, onDeleteResponseParameter, onRequestContentChange, onResponseContentChange, requestBodySchemas, responseBodySchemas, mode = "edit", selectedEndpointKey }) => {
3267
+ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse, endpointNames, endpointDescs, endpointTags, availableTags, onEndpointNameChange, onEndpointDescChange, onEndpointTagsChange, endpointParams, onAddParameter, onEditParameter, onDeleteParameter, endpointResponseParams, onAddResponseParameter, onEditResponseParameter, onDeleteResponseParameter, onRequestContentChange, onResponseContentChange, resetKey, requestBodySchemas, responseBodySchemas, mode = "edit", selectedEndpointKey }) => {
3308
3268
  const [expandedId, setExpandedId] = useState(null);
3309
3269
  const [activeTab, setActiveTab] = useState("general");
3310
3270
  useEffect(() => {
@@ -3356,6 +3316,30 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
3356
3316
  const debouncedResponseSearches = useDebounce(responseSearches);
3357
3317
  const [editableRequestContent, setEditableRequestContent] = useState({});
3358
3318
  const [editableResponseContent, setEditableResponseContent] = useState({});
3319
+ useEffect(() => {
3320
+ openRequestPanels.forEach((epId) => {
3321
+ const val = requestBodySchemas?.[epId];
3322
+ const json = val ? JSON.stringify(val, null, 2) : "";
3323
+ setEditableRequestContent((prev) => ({
3324
+ ...prev,
3325
+ [epId]: json
3326
+ }));
3327
+ });
3328
+ openResponsePanels.forEach((epId) => {
3329
+ const val = responseBodySchemas?.[epId];
3330
+ const json = val ? JSON.stringify(val, null, 2) : "";
3331
+ setEditableResponseContent((prev) => ({
3332
+ ...prev,
3333
+ [epId]: json
3334
+ }));
3335
+ });
3336
+ }, [
3337
+ resetKey,
3338
+ openRequestPanels,
3339
+ openResponsePanels,
3340
+ requestBodySchemas,
3341
+ responseBodySchemas
3342
+ ]);
3359
3343
  useEffect(() => {
3360
3344
  if (!openRequestPanels.size) return;
3361
3345
  openRequestPanels.forEach((epId) => {
@@ -3421,10 +3405,29 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
3421
3405
  flexDirection: "column",
3422
3406
  width: "100%",
3423
3407
  flexShrink: 0,
3408
+ flex: 1,
3409
+ minHeight: 0,
3410
+ "& .ant-tabs": {
3411
+ height: "100%",
3412
+ display: "flex",
3413
+ flexDirection: "column"
3414
+ },
3424
3415
  "& .ant-tabs-content-holder": {
3416
+ flex: 1,
3417
+ display: "flex",
3418
+ flexDirection: "column",
3425
3419
  background: token.colorBgElevated,
3426
3420
  borderRadius: token.borderRadiusLG,
3427
3421
  padding: `${token.paddingLG}px ${token.paddingLG}px 48px`
3422
+ },
3423
+ "& .ant-tabs-content": {
3424
+ flex: 1,
3425
+ minHeight: 0
3426
+ },
3427
+ "& .ant-tabs-tabpane-active": {
3428
+ height: "100%",
3429
+ display: "flex",
3430
+ flexDirection: "column"
3428
3431
  }
3429
3432
  },
3430
3433
  [scope("head")]: {
@@ -3527,7 +3530,7 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
3527
3530
  display: "flex",
3528
3531
  alignItems: "center",
3529
3532
  justifyContent: "space-between",
3530
- paddingBottom: token.marginXXS,
3533
+ paddingBottom: "18.5px",
3531
3534
  borderBottom: `1px solid ${token.colorBorder}`,
3532
3535
  width: "100%"
3533
3536
  },
@@ -3602,7 +3605,7 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
3602
3605
  alignItems: "center",
3603
3606
  justifyContent: "space-between",
3604
3607
  width: "100%",
3605
- padding: `12px 24px`,
3608
+ padding: `12px 0px`,
3606
3609
  borderBottom: `1px solid ${token.colorBorderSecondary}`,
3607
3610
  background: token.colorBgContainer,
3608
3611
  "&:last-child": { borderBottom: "none" }
@@ -3635,6 +3638,13 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
3635
3638
  whiteSpace: "nowrap",
3636
3639
  maxWidth: 160
3637
3640
  },
3641
+ [scope("param-detail-value-name")]: {
3642
+ overflow: "hidden",
3643
+ textOverflow: "ellipsis",
3644
+ whiteSpace: "nowrap",
3645
+ maxWidth: 200,
3646
+ display: "block"
3647
+ },
3638
3648
  [scope("param-enum-container")]: {
3639
3649
  display: "inline-flex",
3640
3650
  flexDirection: "row",
@@ -3773,7 +3783,6 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
3773
3783
  alignItems: "center",
3774
3784
  position: "relative",
3775
3785
  paddingTop: 20,
3776
- paddingBottom: 8,
3777
3786
  paddingLeft: 24,
3778
3787
  paddingRight: 24,
3779
3788
  width: "100%"
@@ -3799,7 +3808,7 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
3799
3808
  border: "none",
3800
3809
  background: "transparent",
3801
3810
  padding: 0,
3802
- color: token.colorTextSecondary,
3811
+ color: token.colorTextTertiary,
3803
3812
  fontSize: 16,
3804
3813
  lineHeight: 1,
3805
3814
  "&:hover": {
@@ -3812,7 +3821,6 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
3812
3821
  alignItems: "center",
3813
3822
  paddingLeft: 24,
3814
3823
  paddingRight: 24,
3815
- paddingBottom: 12,
3816
3824
  height: 56,
3817
3825
  width: "100%"
3818
3826
  },
@@ -3939,6 +3947,8 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
3939
3947
  alignItems: "center",
3940
3948
  justifyContent: "center",
3941
3949
  width: "100%",
3950
+ flex: 1,
3951
+ minHeight: 0,
3942
3952
  "& .ant-empty": {
3943
3953
  margin: 0,
3944
3954
  display: "flex",
@@ -4034,9 +4044,21 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
4034
4044
  title: "Parameter",
4035
4045
  key: "parameter",
4036
4046
  render: (_, row) => /* @__PURE__ */ jsxs("span", { children: [
4037
- /* @__PURE__ */ jsx("span", {
4038
- className: cx("view-param-name"),
4039
- children: row.name
4047
+ /* @__PURE__ */ jsx(Tooltip, {
4048
+ title: row.name,
4049
+ placement: "bottom",
4050
+ children: /* @__PURE__ */ jsx("span", {
4051
+ className: cx("view-param-name"),
4052
+ style: {
4053
+ display: "inline-block",
4054
+ maxWidth: 200,
4055
+ overflow: "hidden",
4056
+ textOverflow: "ellipsis",
4057
+ whiteSpace: "nowrap",
4058
+ verticalAlign: "bottom"
4059
+ },
4060
+ children: row.name
4061
+ })
4040
4062
  }),
4041
4063
  row.type && /* @__PURE__ */ jsx("span", {
4042
4064
  className: cx("view-param-type"),
@@ -4054,9 +4076,21 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
4054
4076
  {
4055
4077
  title: "Description",
4056
4078
  key: "description",
4057
- render: (_, row) => /* @__PURE__ */ jsx("span", {
4058
- className: cx("view-param-desc"),
4059
- children: row.description || "--"
4079
+ render: (_, row) => /* @__PURE__ */ jsx(Tooltip, {
4080
+ title: row.description || "--",
4081
+ placement: "bottom",
4082
+ children: /* @__PURE__ */ jsx("span", {
4083
+ className: cx("view-param-desc"),
4084
+ style: {
4085
+ display: "inline-block",
4086
+ maxWidth: 200,
4087
+ overflow: "hidden",
4088
+ textOverflow: "ellipsis",
4089
+ whiteSpace: "nowrap",
4090
+ verticalAlign: "bottom"
4091
+ },
4092
+ children: row.description || "--"
4093
+ })
4060
4094
  })
4061
4095
  },
4062
4096
  {
@@ -4235,6 +4269,10 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
4235
4269
  ghost: true,
4236
4270
  type: "primary",
4237
4271
  icon: /* @__PURE__ */ jsx(PlusOutlined, {}),
4272
+ style: {
4273
+ height: 32,
4274
+ paddingInline: 8
4275
+ },
4238
4276
  onClick: () => {
4239
4277
  setDrawerSource("request");
4240
4278
  setParamDrawerMode("add");
@@ -4271,6 +4309,10 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
4271
4309
  ghost: true,
4272
4310
  type: "primary",
4273
4311
  icon: /* @__PURE__ */ jsx(PlusOutlined, {}),
4312
+ style: {
4313
+ height: 32,
4314
+ paddingInline: 8
4315
+ },
4274
4316
  onClick: () => {
4275
4317
  setDrawerSource("request");
4276
4318
  setParamDrawerMode("add");
@@ -4352,9 +4394,13 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
4352
4394
  children: [/* @__PURE__ */ jsx("span", {
4353
4395
  className: cx("param-detail-label"),
4354
4396
  children: "Parameter Name"
4355
- }), /* @__PURE__ */ jsx("span", {
4356
- className: cx("param-detail-value"),
4357
- children: param.name
4397
+ }), /* @__PURE__ */ jsx(Tooltip, {
4398
+ title: param.name,
4399
+ placement: "bottom",
4400
+ children: /* @__PURE__ */ jsx("span", {
4401
+ className: cx("param-detail-value", "param-detail-value-name"),
4402
+ children: param.name
4403
+ })
4358
4404
  })]
4359
4405
  }), /* @__PURE__ */ jsxs("div", {
4360
4406
  className: cx("param-detail-cell"),
@@ -4430,9 +4476,13 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
4430
4476
  children: [/* @__PURE__ */ jsx("span", {
4431
4477
  className: cx("param-detail-label"),
4432
4478
  children: "Parameter Name"
4433
- }), /* @__PURE__ */ jsx("span", {
4434
- className: cx("param-detail-value"),
4435
- children: param.name
4479
+ }), /* @__PURE__ */ jsx(Tooltip, {
4480
+ title: param.name,
4481
+ placement: "bottom",
4482
+ children: /* @__PURE__ */ jsx("span", {
4483
+ className: cx("param-detail-value", "param-detail-value-name"),
4484
+ children: param.name
4485
+ })
4436
4486
  })]
4437
4487
  }),
4438
4488
  /* @__PURE__ */ jsxs("div", {
@@ -4471,7 +4521,7 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
4471
4521
  margin: 0,
4472
4522
  paddingLeft: 16
4473
4523
  },
4474
- children: param.enum.map((e) => /* @__PURE__ */ jsx("li", { children: e }, e))
4524
+ children: param.enum.slice(1).map((e) => /* @__PURE__ */ jsx("li", { children: e }, e))
4475
4525
  }),
4476
4526
  placement: "bottom",
4477
4527
  children: /* @__PURE__ */ jsxs("span", {
@@ -4499,9 +4549,13 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
4499
4549
  children: [/* @__PURE__ */ jsx("span", {
4500
4550
  className: cx("param-detail-label"),
4501
4551
  children: "Description"
4502
- }), /* @__PURE__ */ jsx("span", {
4503
- className: cx("param-detail-value", "param-detail-value--ellipsis"),
4504
- children: param.description || ""
4552
+ }), /* @__PURE__ */ jsx(Tooltip, {
4553
+ title: param.description || "",
4554
+ placement: "bottom",
4555
+ children: /* @__PURE__ */ jsx("span", {
4556
+ className: cx("param-detail-value", "param-detail-value--ellipsis"),
4557
+ children: param.description || "—"
4558
+ })
4505
4559
  })]
4506
4560
  })
4507
4561
  ]
@@ -4654,6 +4708,10 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
4654
4708
  ghost: true,
4655
4709
  type: "primary",
4656
4710
  icon: /* @__PURE__ */ jsx(PlusOutlined, {}),
4711
+ style: {
4712
+ height: 32,
4713
+ paddingInline: 8
4714
+ },
4657
4715
  onClick: () => {
4658
4716
  setDrawerSource("response");
4659
4717
  setParamDrawerMode("add");
@@ -4744,6 +4802,10 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
4744
4802
  ghost: true,
4745
4803
  type: "primary",
4746
4804
  icon: /* @__PURE__ */ jsx(PlusOutlined, {}),
4805
+ style: {
4806
+ height: 32,
4807
+ paddingInline: 8
4808
+ },
4747
4809
  onClick: () => {
4748
4810
  setDrawerSource("response");
4749
4811
  setParamDrawerMode("add");
@@ -4903,9 +4965,13 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
4903
4965
  children: [/* @__PURE__ */ jsx("span", {
4904
4966
  className: cx("param-detail-label"),
4905
4967
  children: "Parameter Name"
4906
- }), /* @__PURE__ */ jsx("span", {
4907
- className: cx("param-detail-value"),
4908
- children: param.name
4968
+ }), /* @__PURE__ */ jsx(Tooltip, {
4969
+ title: param.name,
4970
+ placement: "bottom",
4971
+ children: /* @__PURE__ */ jsx("span", {
4972
+ className: cx("param-detail-value", "param-detail-value-name"),
4973
+ children: param.name
4974
+ })
4909
4975
  })]
4910
4976
  }),
4911
4977
  /* @__PURE__ */ jsxs("div", {
@@ -4944,7 +5010,7 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
4944
5010
  margin: 0,
4945
5011
  paddingLeft: 16
4946
5012
  },
4947
- children: param.enum.map((e) => /* @__PURE__ */ jsx("li", { children: e }, e))
5013
+ children: param.enum.slice(1).map((e) => /* @__PURE__ */ jsx("li", { children: e }, e))
4948
5014
  }),
4949
5015
  placement: "bottom",
4950
5016
  children: /* @__PURE__ */ jsxs("span", {
@@ -4972,9 +5038,13 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
4972
5038
  children: [/* @__PURE__ */ jsx("span", {
4973
5039
  className: cx("param-detail-label"),
4974
5040
  children: "Description"
4975
- }), /* @__PURE__ */ jsx("span", {
4976
- className: cx("param-detail-value", "param-detail-value--ellipsis"),
4977
- children: param.description || ""
5041
+ }), /* @__PURE__ */ jsx(Tooltip, {
5042
+ title: param.description || "",
5043
+ placement: "bottom",
5044
+ children: /* @__PURE__ */ jsx("span", {
5045
+ className: cx("param-detail-value", "param-detail-value--ellipsis"),
5046
+ children: param.description || "—"
5047
+ })
4978
5048
  })]
4979
5049
  })
4980
5050
  ]
@@ -5037,20 +5107,13 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
5037
5107
  className: cx("param-row", openResponsePanels.has(ep.id) ? "param-row--open" : ""),
5038
5108
  style: { marginTop: token.margin },
5039
5109
  onClick: () => toggleResponsePanel(ep.id),
5040
- children: [
5041
- /* @__PURE__ */ jsx(DownOutlined, { className: cx("param-row-icon", openResponsePanels.has(ep.id) ? "param-row-icon--open" : "") }),
5042
- /* @__PURE__ */ jsxs("span", {
5043
- style: { fontSize: token.fontSize },
5044
- children: ["Response ", /* @__PURE__ */ jsx("span", {
5045
- style: { color: token.colorError },
5046
- children: "*"
5047
- })]
5048
- }),
5049
- /* @__PURE__ */ jsx(InfoCircle, { style: {
5050
- width: 24,
5051
- height: 24
5052
- } })
5053
- ]
5110
+ children: [/* @__PURE__ */ jsx(DownOutlined, { className: cx("param-row-icon", openResponsePanels.has(ep.id) ? "param-row-icon--open" : "") }), /* @__PURE__ */ jsxs("span", {
5111
+ style: { fontSize: token.fontSize },
5112
+ children: ["Response ", /* @__PURE__ */ jsx("span", {
5113
+ style: { color: token.colorError },
5114
+ children: "*"
5115
+ })]
5116
+ })]
5054
5117
  }),
5055
5118
  openResponsePanels.has(ep.id) && /* @__PURE__ */ jsxs("div", {
5056
5119
  className: cx("code-panel"),
@@ -5501,6 +5564,10 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
5501
5564
  ghost: true,
5502
5565
  type: "primary",
5503
5566
  icon: /* @__PURE__ */ jsx(PlusOutlined, {}),
5567
+ style: {
5568
+ height: 32,
5569
+ paddingInline: 8
5570
+ },
5504
5571
  onClick: () => {
5505
5572
  setDrawerSource("request");
5506
5573
  setParamDrawerMode("add");
@@ -5537,6 +5604,10 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
5537
5604
  ghost: true,
5538
5605
  type: "primary",
5539
5606
  icon: /* @__PURE__ */ jsx(PlusOutlined, {}),
5607
+ style: {
5608
+ height: 32,
5609
+ paddingInline: 8
5610
+ },
5540
5611
  onClick: () => {
5541
5612
  setDrawerSource("request");
5542
5613
  setParamDrawerMode("add");
@@ -5918,6 +5989,10 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
5918
5989
  ghost: true,
5919
5990
  type: "primary",
5920
5991
  icon: /* @__PURE__ */ jsx(PlusOutlined, {}),
5992
+ style: {
5993
+ height: 32,
5994
+ paddingInline: 8
5995
+ },
5921
5996
  onClick: () => {
5922
5997
  setDrawerSource("response");
5923
5998
  setParamDrawerMode("add");
@@ -6008,6 +6083,10 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
6008
6083
  ghost: true,
6009
6084
  type: "primary",
6010
6085
  icon: /* @__PURE__ */ jsx(PlusOutlined, {}),
6086
+ style: {
6087
+ height: 32,
6088
+ paddingInline: 8
6089
+ },
6011
6090
  onClick: () => {
6012
6091
  setDrawerSource("response");
6013
6092
  setParamDrawerMode("add");
@@ -6301,20 +6380,13 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
6301
6380
  className: cx("param-row", openResponsePanels.has(ep.id) ? "param-row--open" : ""),
6302
6381
  style: { marginTop: token.margin },
6303
6382
  onClick: () => toggleResponsePanel(ep.id),
6304
- children: [
6305
- /* @__PURE__ */ jsx(DownOutlined, { className: cx("param-row-icon", openResponsePanels.has(ep.id) ? "param-row-icon--open" : "") }),
6306
- /* @__PURE__ */ jsxs("span", {
6307
- style: { fontSize: token.fontSize },
6308
- children: ["Response ", /* @__PURE__ */ jsx("span", {
6309
- style: { color: token.colorError },
6310
- children: "*"
6311
- })]
6312
- }),
6313
- /* @__PURE__ */ jsx(InfoCircle, { style: {
6314
- width: 24,
6315
- height: 24
6316
- } })
6317
- ]
6383
+ children: [/* @__PURE__ */ jsx(DownOutlined, { className: cx("param-row-icon", openResponsePanels.has(ep.id) ? "param-row-icon--open" : "") }), /* @__PURE__ */ jsxs("span", {
6384
+ style: { fontSize: token.fontSize },
6385
+ children: ["Response ", /* @__PURE__ */ jsx("span", {
6386
+ style: { color: token.colorError },
6387
+ children: "*"
6388
+ })]
6389
+ })]
6318
6390
  }),
6319
6391
  openResponsePanels.has(ep.id) && /* @__PURE__ */ jsxs("div", {
6320
6392
  className: cx("code-panel"),
@@ -7517,7 +7589,8 @@ const EditModeSidebar = ({ selectedItem, onSelectItem, endpoints, hasGeneralErro
7517
7589
  [scope("badge")]: {
7518
7590
  minWidth: "3.75rem",
7519
7591
  textAlign: "center",
7520
- border: "none"
7592
+ border: "none",
7593
+ fontSize: 14
7521
7594
  },
7522
7595
  [scope("path")]: {
7523
7596
  fontSize: token.fontSize,
@@ -8196,37 +8269,28 @@ const buildRequestData = (params, token) => [...params].sort((a, b) => a.require
8196
8269
  if (p.schema?.type === "array" && p.schema?.items?.type) typeLabel = `${p.schema.type}_${p.schema.items.type}`;
8197
8270
  return {
8198
8271
  key: index,
8199
- param: /* @__PURE__ */ jsxs("span", { children: [
8200
- p.name,
8201
- typeLabel && /* @__PURE__ */ jsx("span", {
8202
- style: {
8203
- color: token.colorTextTertiary,
8204
- marginLeft: "0.25rem",
8205
- marginRight: "0.25rem"
8206
- },
8207
- children: typeLabel
8208
- }),
8209
- p.required ? /* @__PURE__ */ jsx("span", {
8210
- style: { color: token.colorError },
8211
- children: "*"
8212
- }) : /* @__PURE__ */ jsx("span", {
8213
- style: { color: token.colorSuccess },
8214
- children: "Optional"
8215
- })
8216
- ] }),
8217
- desc: p.description || "--",
8218
- enum: p.schema?.enum ? renderEnumTags(p.schema.enum, token) : "--"
8219
- };
8220
- });
8221
- const buildHeaderData = (headers, token) => {
8222
- if (!headers) return [];
8223
- return Object.entries(headers).sort(([, a], [, b]) => a.required === b.required ? 0 : a.required ? -1 : 1).map(([name, header], idx) => {
8224
- let typeLabel = header.schema?.type;
8225
- if (header.schema?.type === "array" && header.schema?.items?.type) typeLabel = `${header.schema.type}_${header.schema.items.type}`;
8226
- return {
8227
- key: idx,
8228
- param: /* @__PURE__ */ jsxs("span", { children: [
8229
- name,
8272
+ param: /* @__PURE__ */ jsxs("span", {
8273
+ style: {
8274
+ display: "flex",
8275
+ alignItems: "center",
8276
+ gap: 4
8277
+ },
8278
+ children: [
8279
+ /* @__PURE__ */ jsx(Tooltip, {
8280
+ title: p.name,
8281
+ placement: "bottom",
8282
+ children: /* @__PURE__ */ jsx("span", {
8283
+ style: {
8284
+ display: "inline-block",
8285
+ maxWidth: 200,
8286
+ overflow: "hidden",
8287
+ textOverflow: "ellipsis",
8288
+ whiteSpace: "nowrap",
8289
+ verticalAlign: "bottom"
8290
+ },
8291
+ children: p.name
8292
+ })
8293
+ }),
8230
8294
  typeLabel && /* @__PURE__ */ jsx("span", {
8231
8295
  style: {
8232
8296
  color: token.colorTextTertiary,
@@ -8235,50 +8299,84 @@ const buildHeaderData = (headers, token) => {
8235
8299
  },
8236
8300
  children: typeLabel
8237
8301
  }),
8238
- header.required ? /* @__PURE__ */ jsx("span", {
8302
+ p.required ? /* @__PURE__ */ jsx("span", {
8239
8303
  style: { color: token.colorError },
8240
8304
  children: "*"
8241
8305
  }) : /* @__PURE__ */ jsx("span", {
8242
8306
  style: { color: token.colorSuccess },
8243
8307
  children: "Optional"
8244
8308
  })
8245
- ] }, idx),
8309
+ ]
8310
+ }),
8311
+ desc: /* @__PURE__ */ jsx(Tooltip, {
8312
+ title: p.description || "--",
8313
+ placement: "bottom",
8314
+ children: /* @__PURE__ */ jsx("span", {
8315
+ style: {
8316
+ display: "inline-block",
8317
+ maxWidth: 300,
8318
+ overflow: "hidden",
8319
+ textOverflow: "ellipsis",
8320
+ whiteSpace: "nowrap",
8321
+ verticalAlign: "bottom"
8322
+ },
8323
+ children: p.description || "--"
8324
+ })
8325
+ }),
8326
+ enum: p.schema?.enum ? renderEnumTags(p.schema.enum, token) : "--"
8327
+ };
8328
+ });
8329
+ const buildHeaderData = (headers, token) => {
8330
+ if (!headers) return [];
8331
+ return Object.entries(headers).sort(([, a], [, b]) => a.required === b.required ? 0 : a.required ? -1 : 1).map(([name, header], idx) => {
8332
+ let typeLabel = header.schema?.type;
8333
+ if (header.schema?.type === "array" && header.schema?.items?.type) typeLabel = `${header.schema.type}_${header.schema.items.type}`;
8334
+ return {
8335
+ key: idx,
8336
+ param: /* @__PURE__ */ jsxs("span", {
8337
+ style: {
8338
+ display: "flex",
8339
+ alignItems: "center",
8340
+ gap: 4
8341
+ },
8342
+ children: [
8343
+ /* @__PURE__ */ jsx(Tooltip, {
8344
+ title: name,
8345
+ placement: "bottom",
8346
+ children: /* @__PURE__ */ jsx("span", {
8347
+ style: {
8348
+ display: "inline-block",
8349
+ maxWidth: 200,
8350
+ overflow: "hidden",
8351
+ textOverflow: "ellipsis",
8352
+ whiteSpace: "nowrap",
8353
+ verticalAlign: "bottom"
8354
+ },
8355
+ children: name
8356
+ })
8357
+ }),
8358
+ typeLabel && /* @__PURE__ */ jsx("span", {
8359
+ style: {
8360
+ color: token.colorTextTertiary,
8361
+ marginLeft: "0.25rem",
8362
+ marginRight: "0.25rem"
8363
+ },
8364
+ children: typeLabel
8365
+ }),
8366
+ header.required ? /* @__PURE__ */ jsx("span", {
8367
+ style: { color: token.colorError },
8368
+ children: "*"
8369
+ }) : /* @__PURE__ */ jsx("span", {
8370
+ style: { color: token.colorSuccess },
8371
+ children: "Optional"
8372
+ })
8373
+ ]
8374
+ }, idx),
8246
8375
  desc: header.description || "--",
8247
8376
  enum: header.schema?.enum ? renderEnumTags(header.schema.enum, token) : "--"
8248
8377
  };
8249
8378
  });
8250
8379
  };
8251
- const buildRequestBodyData = (requestBody, token) => {
8252
- if (!requestBody?.content) return [];
8253
- const contentType = Object.keys(requestBody.content)[0];
8254
- const schema = requestBody.content[contentType]?.schema;
8255
- if (!schema) return [];
8256
- const properties = schema.properties ?? {};
8257
- const required = schema.required ?? [];
8258
- return Object.entries(properties).map(([name, prop], idx) => ({
8259
- key: idx,
8260
- param: /* @__PURE__ */ jsxs("span", { children: [
8261
- name,
8262
- prop.type && /* @__PURE__ */ jsx("span", {
8263
- style: {
8264
- color: token.colorTextTertiary,
8265
- marginLeft: "0.25rem",
8266
- marginRight: "0.25rem"
8267
- },
8268
- children: prop.type
8269
- }),
8270
- required.includes(name) ? /* @__PURE__ */ jsx("span", {
8271
- style: { color: token.colorError },
8272
- children: "*"
8273
- }) : /* @__PURE__ */ jsx("span", {
8274
- style: { color: token.colorSuccess },
8275
- children: "Optional"
8276
- })
8277
- ] }),
8278
- desc: prop.description || "--",
8279
- enum: prop.enum ? renderEnumTags(prop.enum, token) : "--"
8280
- }));
8281
- };
8282
8380
  const EndpointPage = () => {
8283
8381
  const { selectedEndpoint, selectedApi, selectedStatusCode, setSelectedNodeKey, setFocusedContent, setFocusedTag, setActiveRequestTab } = useStore(({ view }) => view);
8284
8382
  const [activeTabKey, setActiveTabKey] = useState("header");
@@ -8327,7 +8425,6 @@ const EndpointPage = () => {
8327
8425
  const headerParams = buildRequestData(selectedEndpoint?.parameters?.filter((p) => p.in === "header") || [], token);
8328
8426
  const pathParams = buildRequestData(selectedEndpoint?.parameters?.filter((p) => p.in === "path") || [], token);
8329
8427
  const queryParams = buildRequestData(selectedEndpoint?.parameters?.filter((p) => p.in === "query") || [], token);
8330
- const requestBodyData = buildRequestBodyData(selectedEndpoint?.requestBody, token);
8331
8428
  const requestTabs = [
8332
8429
  {
8333
8430
  key: "header",
@@ -8364,19 +8461,7 @@ const EndpointPage = () => {
8364
8461
  size: "small",
8365
8462
  rowClassName: (_, idx) => cx(idx % 2 === 0 ? "row-even" : "row-odd")
8366
8463
  })
8367
- },
8368
- ...requestBodyData.length > 0 ? [{
8369
- key: "requestBody",
8370
- label: "Request Body",
8371
- children: /* @__PURE__ */ jsx(Table, {
8372
- columns: requestColumns,
8373
- dataSource: requestBodyData,
8374
- pagination: false,
8375
- bordered: true,
8376
- size: "small",
8377
- rowClassName: (_, idx) => cx(idx % 2 === 0 ? "row-even" : "row-odd")
8378
- })
8379
- }] : []
8464
+ }
8380
8465
  ].filter((t) => t !== null);
8381
8466
  useEffect(() => {
8382
8467
  const firstKey = requestTabs[0]?.key ?? "header";
@@ -9081,9 +9166,10 @@ const ConsoleDocumentationLayout = ({ data, preSelectedApi, handleVisitLandingPa
9081
9166
  gap: token.marginLG,
9082
9167
  height: "100%"
9083
9168
  },
9084
- [scope("section")]: {
9085
- flexShrink: 0,
9086
- height: "auto"
9169
+ [scope("section")]: { flexShrink: 0 },
9170
+ [scope("section-grow")]: {
9171
+ flex: 1,
9172
+ minHeight: 0
9087
9173
  },
9088
9174
  [scope("docs-layout")]: {
9089
9175
  display: "flex",
@@ -9266,7 +9352,7 @@ const ConsoleDocumentationLayout = ({ data, preSelectedApi, handleVisitLandingPa
9266
9352
  const result = {};
9267
9353
  Object.entries(rawFile.paths).forEach(([path, methods]) => {
9268
9354
  Object.entries(methods).forEach(([method, operation]) => {
9269
- const schema = operation.requestBody?.content?.["application/json"]?.schema;
9355
+ const schema = operation.requestBody?.content?.["application/json"]?.example;
9270
9356
  const epId = pathMethodToId[`${path}||${method}`];
9271
9357
  if (epId && schema) result[epId] = schema;
9272
9358
  });
@@ -9319,6 +9405,14 @@ const ConsoleDocumentationLayout = ({ data, preSelectedApi, handleVisitLandingPa
9319
9405
  }
9320
9406
  if (JSON.stringify(endpointParams) !== JSON.stringify(initialEndpointParams)) return true;
9321
9407
  if (JSON.stringify(endpointResponseParams) !== JSON.stringify(initialEndpointResponseParams)) return true;
9408
+ if (JSON.stringify(endpointRequestBody) !== JSON.stringify(initialEndpointRequestBody)) {
9409
+ console.log("hasChanges: endpointRequestBody changed", {
9410
+ endpointRequestBody,
9411
+ initialEndpointRequestBody
9412
+ });
9413
+ return true;
9414
+ }
9415
+ if (JSON.stringify(endpointResponseBody) !== JSON.stringify(initialEndpointResponseBody)) return true;
9322
9416
  return false;
9323
9417
  }, [
9324
9418
  selectedApi,
@@ -9333,7 +9427,11 @@ const ConsoleDocumentationLayout = ({ data, preSelectedApi, handleVisitLandingPa
9333
9427
  endpointParams,
9334
9428
  endpointResponseParams,
9335
9429
  initialEndpointParams,
9336
- initialEndpointResponseParams
9430
+ initialEndpointResponseParams,
9431
+ endpointRequestBody,
9432
+ initialEndpointRequestBody,
9433
+ endpointResponseBody,
9434
+ initialEndpointResponseBody
9337
9435
  ]);
9338
9436
  useEffect(() => {
9339
9437
  setBannerVisible(hasChanges);
@@ -9452,6 +9550,8 @@ const ConsoleDocumentationLayout = ({ data, preSelectedApi, handleVisitLandingPa
9452
9550
  setEndpointTags({});
9453
9551
  setEndpointParams(initialEndpointParams);
9454
9552
  setEndpointResponseParams(initialEndpointResponseParams);
9553
+ setEndpointRequestBody(initialEndpointRequestBody);
9554
+ setEndpointResponseBody(initialEndpointResponseBody);
9455
9555
  setLocalTags(tagMetadata);
9456
9556
  setResetKey((prev) => prev + 1);
9457
9557
  messageApi.success("Changes have been reset successfully.");
@@ -9541,7 +9641,7 @@ const ConsoleDocumentationLayout = ({ data, preSelectedApi, handleVisitLandingPa
9541
9641
  if (!methodObjAny.requestBody) methodObjAny.requestBody = {};
9542
9642
  const rb = methodObjAny.requestBody;
9543
9643
  if (!rb.content) rb.content = {};
9544
- rb.content["application/json"] = { schema };
9644
+ rb.content["application/json"] = { example: schema };
9545
9645
  });
9546
9646
  Object.entries(endpointResponseBody).forEach(([id, schema]) => {
9547
9647
  const loc = idToPathMethod[id];
@@ -9718,15 +9818,16 @@ const ConsoleDocumentationLayout = ({ data, preSelectedApi, handleVisitLandingPa
9718
9818
  display: "flex",
9719
9819
  alignItems: "center",
9720
9820
  gap: 8,
9721
- padding: "8px 12px",
9821
+ padding: mode === "view" ? "8px 12px" : "0 12px",
9722
9822
  border: "none",
9723
9823
  cursor: "pointer",
9724
- borderRadius: 8,
9824
+ borderRadius: mode === "view" ? 8 : 12,
9725
9825
  fontFamily: token.fontFamily,
9726
9826
  background: mode === "view" ? token.colorBgContainer : "transparent",
9727
9827
  boxShadow: mode === "view" ? "0px 2px 4px -2px rgba(17,12,34,0.12)" : "none",
9728
9828
  fontWeight: mode === "view" ? 700 : 400,
9729
- fontSize: mode === "view" ? token.fontSize : token.fontSizeLG,
9829
+ fontSize: token.fontSize,
9830
+ lineHeight: "22px",
9730
9831
  color: token.colorText
9731
9832
  },
9732
9833
  children: [/* @__PURE__ */ jsx(EyeOutlined, { style: { fontSize: 18 } }), "View"]
@@ -9828,10 +9929,11 @@ const ConsoleDocumentationLayout = ({ data, preSelectedApi, handleVisitLandingPa
9828
9929
  })
9829
9930
  }),
9830
9931
  /* @__PURE__ */ jsx("div", {
9831
- className: cx("section"),
9932
+ className: cx("section", "section-grow"),
9832
9933
  children: /* @__PURE__ */ jsx(EndpointsSection, {
9833
9934
  mode,
9834
9935
  endpointsByTag: getEndpointsByTag(),
9936
+ resetKey,
9835
9937
  collapsed: endpointsCollapsed,
9836
9938
  onToggleCollapse: () => setEndpointsCollapsed((c) => !c),
9837
9939
  endpointNames,
@@ -9925,7 +10027,7 @@ const ConsoleDocumentationLayout = ({ data, preSelectedApi, handleVisitLandingPa
9925
10027
  },
9926
10028
  requestBodySchemas: endpointRequestBody,
9927
10029
  responseBodySchemas: endpointResponseBody
9928
- }, resetKey)
10030
+ })
9929
10031
  })
9930
10032
  ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
9931
10033
  selectedEditItem.type === "errors" && errorBox && /* @__PURE__ */ jsx("div", {
@@ -10085,8 +10187,9 @@ const ConsoleDocumentationLayout = ({ data, preSelectedApi, handleVisitLandingPa
10085
10187
  } catch {}
10086
10188
  },
10087
10189
  requestBodySchemas: endpointRequestBody,
10088
- responseBodySchemas: endpointResponseBody
10089
- }, resetKey)
10190
+ responseBodySchemas: endpointResponseBody,
10191
+ resetKey
10192
+ })
10090
10193
  ] })
10091
10194
  })]
10092
10195
  }) : /* @__PURE__ */ jsxs("div", {