@digi-frontend/dgate-api-documentation 2.0.1-test.7 → 2.0.1-test.9

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 CHANGED
@@ -117,19 +117,19 @@ var store_default = useStore;
117
117
  //#endregion
118
118
  //#region src/hooks/useStyle.ts
119
119
  function useStyle(componentName, stylesFn) {
120
- const { token, theme, hashId } = antd.theme.useToken();
120
+ const { token: token$1, theme, hashId } = antd.theme.useToken();
121
121
  const scope = (className) => `.${hashId}.${componentName}-${className}`;
122
122
  const cx = (...classes) => classes.map((cls) => `${componentName}-${cls} ${hashId}`).join(" ");
123
123
  const wrapSSR = (0, __ant_design_cssinjs.useStyleRegister)({
124
124
  theme,
125
- token,
125
+ token: token$1,
126
126
  path: [componentName]
127
- }, () => stylesFn(token, scope));
127
+ }, () => stylesFn(token$1, scope));
128
128
  return {
129
129
  wrapSSR,
130
130
  cx,
131
131
  scope,
132
- token,
132
+ token: token$1,
133
133
  hashId
134
134
  };
135
135
  }
@@ -138,25 +138,914 @@ function useStyle(componentName, stylesFn) {
138
138
  //#region src/view/components/Header.tsx
139
139
  const { Header: AntHeader } = antd.Layout;
140
140
  const Header = () => {
141
- const { wrapSSR, cx } = useStyle("Header", (token, scope) => ({ [scope("header")]: {
141
+ const { wrapSSR, cx } = useStyle("Header", (token$1, scope) => ({ [scope("header")]: {
142
142
  width: "100%",
143
143
  height: "4rem",
144
- backgroundColor: token.colorBgContainer
144
+ backgroundColor: token$1.colorBgContainer
145
145
  } }));
146
146
  return wrapSSR(/* @__PURE__ */ (0, react_jsx_runtime.jsx)(AntHeader, { className: cx("header") }));
147
147
  };
148
148
 
149
+ //#endregion
150
+ //#region src/assets/Minify.svg
151
+ var _path;
152
+ function _extends() {
153
+ return _extends = Object.assign ? Object.assign.bind() : function(n) {
154
+ for (var e = 1; e < arguments.length; e++) {
155
+ var t = arguments[e];
156
+ for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
157
+ }
158
+ return n;
159
+ }, _extends.apply(null, arguments);
160
+ }
161
+ var SvgMinify = function SvgMinify$1(props) {
162
+ return /* @__PURE__ */ react.createElement("svg", _extends({
163
+ xmlns: "http://www.w3.org/2000/svg",
164
+ width: 16,
165
+ height: 16,
166
+ fill: "none"
167
+ }, props), _path || (_path = /* @__PURE__ */ react.createElement("path", {
168
+ stroke: "currentcolor",
169
+ d: "m6 11.334 2-2 2 2M6 4.666l2 2 2-2"
170
+ })));
171
+ };
172
+ var Minify_default = SvgMinify;
173
+
174
+ //#endregion
175
+ //#region src/theme/light.json
176
+ var token = {
177
+ "brnadColor.1": "#f1f5fd",
178
+ "brnadColor.2": "#e0e9f9",
179
+ "brnadColor.3": "#c8d8f5",
180
+ "brnadColor.4": "#a2bfee",
181
+ "brnadColor.5": "#769de4",
182
+ "brnadColor.6": "#4d75d9",
183
+ "brnadColor.7": "#4261ce",
184
+ "brnadColor.8": "#384fbd",
185
+ "brnadColor.9": "#33419a",
186
+ "brnadColor.10": "#20264b",
187
+ "cyan.1": "#e6fffb",
188
+ "cyan.2": "#b5f5ec",
189
+ "cyan.3": "#87e8de",
190
+ "cyan.4": "#5cdbd3",
191
+ "cyan.5": "#36cfc9",
192
+ "cyan.6": "#13c2c2",
193
+ "cyan.7": "#08979c",
194
+ "cyan.8": "#006d75",
195
+ "cyan.9": "#00474f",
196
+ "cyan.10": "#002329",
197
+ "geekblue.1": "#f0f5ff",
198
+ "geekblue.2": "#d6e4ff",
199
+ "geekblue.3": "#adc6ff",
200
+ "geekblue.4": "#85a5ff",
201
+ "geekblue.5": "#597ef7",
202
+ "geekblue.6": "#2f54eb",
203
+ "geekblue.7": "#1d39c4",
204
+ "geekblue.8": "#10239e",
205
+ "geekblue.9": "#061178",
206
+ "geekblue.10": "#030852",
207
+ "gold.1": "#fffbe6",
208
+ "gold.2": "#fff1b8",
209
+ "gold.3": "#ffe58f",
210
+ "gold.4": "#ffd666",
211
+ "gold.5": "#ffc53d",
212
+ "gold.6": "#faad14",
213
+ "gold.7": "#d48806",
214
+ "gold.8": "#ad6800",
215
+ "gold.9": "#874d00",
216
+ "gold.10": "#613400",
217
+ "green.1": "#f6ffed",
218
+ "green.2": "#d9f7be",
219
+ "green.3": "#b7eb8f",
220
+ "green.4": "#95de64",
221
+ "green.5": "#73d13d",
222
+ "green.6": "#52c41a",
223
+ "green.7": "#389e0d",
224
+ "green.8": "#237804",
225
+ "green.9": "#135200",
226
+ "green.10": "#092b00",
227
+ "lime.1": "#fcffe6",
228
+ "lime.2": "#f4ffb8",
229
+ "lime.3": "#eaff8f",
230
+ "lime.4": "#d3f261",
231
+ "lime.5": "#bae637",
232
+ "lime.6": "#a0d911",
233
+ "lime.7": "#7cb305",
234
+ "lime.8": "#5b8c00",
235
+ "lime.9": "#3f6600",
236
+ "lime.10": "#254000",
237
+ "magenta.1": "#fff0f6",
238
+ "magenta.2": "#ffd6e7",
239
+ "magenta.3": "#ffadd2",
240
+ "magenta.4": "#ff85c0",
241
+ "magenta.5": "#f759ab",
242
+ "magenta.6": "#eb2f96",
243
+ "magenta.7": "#c41d7f",
244
+ "magenta.8": "#9e1068",
245
+ "magenta.9": "#780650",
246
+ "magenta.10": "#520339",
247
+ "orange.1": "#fff7e6",
248
+ "orange.2": "#ffe7ba",
249
+ "orange.3": "#ffd591",
250
+ "orange.4": "#ffc069",
251
+ "colorText": "rgba(0, 0, 0, 0.88)",
252
+ "colorTextSecondary": "rgba(0, 0, 0, 0.65)",
253
+ "orange.5": "#ffa940",
254
+ "colorTextTertiary": "rgba(0, 0, 0, 0.45)",
255
+ "colorTextQuaternary": "rgba(0, 0, 0, 0.25)",
256
+ "orange.6": "#fa8c16",
257
+ "orange.7": "#d46b08",
258
+ "colorTextLightSolid": "#ffffff",
259
+ "colorTextHeading": "rgba(0, 0, 0, 0.88)",
260
+ "colorTextLabel": "rgba(0, 0, 0, 0.65)",
261
+ "orange.8": "#ad4e00",
262
+ "colorTextDescription": "rgba(0, 0, 0, 0.45)",
263
+ "orange.9": "#873800",
264
+ "colorTextDisabled": "rgba(0, 0, 0, 0.25)",
265
+ "orange.10": "#612500",
266
+ "purple.1": "#f9f0ff",
267
+ "purple.2": "#efdbff",
268
+ "purple.3": "#d3adf7",
269
+ "colorTextPlaceholder": "rgba(0, 0, 0, 0.25)",
270
+ "colorIcon": "rgba(0, 0, 0, 0.45)",
271
+ "purple.4": "#b37feb",
272
+ "colorIconHover": "rgba(0, 0, 0, 0.88)",
273
+ "colorBgContainer": "#ffffff",
274
+ "purple.5": "#9254de",
275
+ "colorBgElevated": "#ffffff",
276
+ "purple.6": "#722ed1",
277
+ "colorBgLayout": "#f5f5f5",
278
+ "purple.7": "#531dab",
279
+ "colorBgMask": "rgba(0, 0, 0, 0.45)",
280
+ "purple.8": "#391085",
281
+ "colorBgSpotlight": "rgba(0, 0, 0, 0.85)",
282
+ "purple.9": "#22075e",
283
+ "colorBorder": "#d9d9d9",
284
+ "purple.10": "#120338",
285
+ "colorBorderSecondary": "#f0f0f0",
286
+ "red.1": "#fff1f0",
287
+ "colorFill": "rgba(0, 0, 0, 0.15)",
288
+ "red.2": "#ffccc7",
289
+ "colorFillSecondary": "rgba(0, 0, 0, 0.06)",
290
+ "colorFillTertiary": "rgba(0, 0, 0, 0.04)",
291
+ "colorFillQuaternary": "rgba(0, 0, 0, 0.02)",
292
+ "red.3": "#ffa39e",
293
+ "red.4": "#ff7875",
294
+ "colorWhite": "#ffffff",
295
+ "red.5": "#ff4d4f",
296
+ "colorBgBase": "#ffffff",
297
+ "red.6": "#f5222d",
298
+ "colorTextBase": "#000000",
299
+ "red.7": "#cf1322",
300
+ "red.8": "#a8071a",
301
+ "colorBgContainerDisabled": "rgba(0, 0, 0, 0.04)",
302
+ "red.9": "#820014",
303
+ "colorBgTextActive": "rgba(0, 0, 0, 0.15)",
304
+ "red.10": "#5c0011",
305
+ "colorBgTextHover": "rgba(0, 0, 0, 0.06)",
306
+ "volcano.1": "#fff2e8",
307
+ "colorBorderBg": "#ffffff",
308
+ "volcano.2": "#ffd8bf",
309
+ "colorFillContent": "rgba(0, 0, 0, 0.06)",
310
+ "volcano.3": "#ffbb96",
311
+ "colorFillContentHover": "rgba(0, 0, 0, 0.15)",
312
+ "volcano.4": "#ff9c6e",
313
+ "colorFillAlter": "rgba(0, 0, 0, 0.02)",
314
+ "volcano.5": "#ff7a45",
315
+ "volcano.6": "#fa541c",
316
+ "volcano.7": "#d4380d",
317
+ "transparent": "rgba(0, 0, 0, 0)",
318
+ "colorSplit": "rgba(0, 0, 0, 0.06)",
319
+ "yellow.1": "#feffe6",
320
+ "volcano.8": "#ad2102",
321
+ "yellow.2": "#ffffb8",
322
+ "yellow.3": "#fffb8f",
323
+ "volcano.9": "#871400",
324
+ "yellow.4": "#fff566",
325
+ "volcano.10": "#610b00",
326
+ "yellow.5": "#ffec3d",
327
+ "yellow.6": "#fadb14",
328
+ "yellow.7": "#d4b106",
329
+ "yellow.8": "#ad8b00",
330
+ "yellow.9": "#876800",
331
+ "yellow.10": "#614700",
332
+ "colorPrimary": "#4d75d9",
333
+ "colorSuccess": "#52c41a",
334
+ "colorWarning": "#faad14",
335
+ "colorInfo": "#4d75d9",
336
+ "colorError": "#ff4d4f",
337
+ "colorLink": "#4d75d9",
338
+ "colorErrorBg": "#fff2f0",
339
+ "colorErrorBgHover": "#fff1f0",
340
+ "colorErrorBorder": "#ffccc7",
341
+ "colorErrorBorderHover": "#ffa39e",
342
+ "colorErrorHover": "#ff7875",
343
+ "colorErrorActive": "#d9363e",
344
+ "colorErrorTextHover": "#ff7875",
345
+ "colorErrorText": "#ff4d4f",
346
+ "colorErrorTextActive": "#d9363e",
347
+ "colorLinkHover": "#769de4",
348
+ "colorInfoBg": "#f1f5fd",
349
+ "colorInfoBgHover": "#e0e9f9",
350
+ "colorInfoBorder": "#c8d8f5",
351
+ "colorInfoBorderHover": "#a2bfee",
352
+ "colorInfoHover": "#769de4",
353
+ "colorInfoActive": "#4261ce",
354
+ "colorInfoTextHover": "#769de4",
355
+ "colorInfoText": "#4d75d9",
356
+ "colorInfoTextActive": "#4261ce",
357
+ "colorLinkActive": "#4261ce",
358
+ "colorPrimaryBg": "#f1f5fd",
359
+ "colorPrimaryBgHover": "#e0e9f9",
360
+ "colorPrimaryBorder": "#c8d8f5",
361
+ "colorPrimaryBorderHover": "#a2bfee",
362
+ "colorPrimaryHover": "#769de4",
363
+ "colorPrimaryActive": "#4261ce",
364
+ "colorPrimaryTextHover": "#769de4",
365
+ "colorPrimaryText": "#4d75d9",
366
+ "colorPrimaryTextActive": "#4261ce",
367
+ "colorSuccessBg": "#f6ffed",
368
+ "colorSuccessBgHover": "#d9f7be",
369
+ "colorSuccessBorder": "#b7eb8f",
370
+ "colorSuccessBorderHover": "#95de64",
371
+ "colorSuccessHover": "#95de64",
372
+ "colorSuccessActive": "#389e0d",
373
+ "colorSuccessTextHover": "#73d13d",
374
+ "colorSuccessText": "#52c41a",
375
+ "colorSuccessTextActive": "#389e0d",
376
+ "colorWarningBg": "#fffbe6",
377
+ "colorWarningBgHover": "#fff1b8",
378
+ "colorWarningBorder": "#ffe58f",
379
+ "colorWarningBorderHover": "#ffd666",
380
+ "colorWarningHover": "#ffd666",
381
+ "colorWarningActive": "#d48806",
382
+ "colorWarningTextHover": "#ffc53d",
383
+ "colorWarningText": "#faad14",
384
+ "colorWarningTextActive": "#d48806",
385
+ "colorErrorOutline": "rgba(255, 38, 6, 0.06)",
386
+ "colorWarningOutline": "rgba(255, 215, 5, 0.1)",
387
+ "controlItemBgActive": "#f1f5fd",
388
+ "controlItemBgActiveDisabled": "rgba(0, 0, 0, 0.15)",
389
+ "controlItemBgActiveHover": "#e0e9f9",
390
+ "controlItemBgHover": "rgba(0, 0, 0, 0.04)",
391
+ "controlOutline": "rgba(5, 145, 255, 0.1)",
392
+ "controlTmpOutline": "rgba(0, 0, 0, 0.02)",
393
+ "borderRadius": 6,
394
+ "borderRadiusLG": 8,
395
+ "borderRadiusSM": 4,
396
+ "borderRadiusXS": 2,
397
+ "sizeStep": 4,
398
+ "sizeUnit": 4,
399
+ "controlInteractiveSize": 16,
400
+ "size": 16,
401
+ "sizeLG": 24,
402
+ "sizeMD": 20,
403
+ "sizeMS": 16,
404
+ "sizeSM": 12,
405
+ "sizeXL": 32,
406
+ "sizeXS": 8,
407
+ "sizeXXL": 48,
408
+ "controlHeight": 32,
409
+ "sizeXXS": 4,
410
+ "controlHeightLG": 40,
411
+ "controlHeightSM": 24,
412
+ "controlHeightXS": 16,
413
+ "lineWidth": 1,
414
+ "lineWidthBold": 2,
415
+ "lineWidthFocus": 4,
416
+ "controlOutlineWidth": 2,
417
+ "screenLG": 992,
418
+ "screenLGMax": 1199,
419
+ "screenLGMin": 992,
420
+ "screenMD": 768,
421
+ "screenMDMax": 991,
422
+ "screenMDMin": 768,
423
+ "screenSM": 576,
424
+ "screenSMMax": 767,
425
+ "screenSMMin": 576,
426
+ "screenXL": 1200,
427
+ "screenXLMax": 1599,
428
+ "screenXLMin": 1200,
429
+ "screenXS": 480,
430
+ "screenXSMax": 575,
431
+ "screenXSMin": 480,
432
+ "screenXXL": 1600,
433
+ "screenXXLMin": 1600,
434
+ "sizePopupArrow": 16,
435
+ "margin": 16,
436
+ "marginLG": 24,
437
+ "marginMD": 20,
438
+ "marginSM": 12,
439
+ "marginXL": 32,
440
+ "marginXS": 8,
441
+ "marginXXL": 48,
442
+ "marginXXS": 4,
443
+ "padding": 16,
444
+ "paddingLG": 24,
445
+ "paddingMD": 20,
446
+ "paddingSM": 12,
447
+ "paddingXL": 32,
448
+ "paddingXS": 8,
449
+ "paddingXXS": 4,
450
+ "paddingContentHorizontal": 16,
451
+ "paddingContentHorizontalLG": 24,
452
+ "paddingContentHorizontalSM": 16,
453
+ "paddingContentVertical": 12,
454
+ "paddingContentVerticalLG": 16,
455
+ "paddingContentVerticalSM": 8,
456
+ "controlPaddingHorizontal": 12,
457
+ "controlPaddingHorizontalSM": 8,
458
+ "fontFamily": "SF Pro",
459
+ "fontFamilyCode": "Courier Prime",
460
+ "fontSize": 14,
461
+ "fontSizeLG": 16,
462
+ "fontSizeSM": 12,
463
+ "fontSizeXL": 20,
464
+ "fontSizeHeading1": 38,
465
+ "fontSizeHeading2": 30,
466
+ "fontSizeHeading3": 24,
467
+ "fontSizeHeading4": 20,
468
+ "fontSizeHeading5": 16,
469
+ "lineHeight": 1.5714285714285714,
470
+ "lineHeightHeading1": 1.2105263157894737,
471
+ "lineHeightHeading2": 1.2666666666666666,
472
+ "lineHeightHeading3": 1.3333333333333333,
473
+ "lineHeightHeading4": 1.4,
474
+ "lineHeightHeading5": 1.5,
475
+ "lineHeightLG": 1.5,
476
+ "lineHeightSM": 1.6666666666666667,
477
+ "fontSizeIcon": 12,
478
+ "fontWeightStrong": 600,
479
+ "colorFillAlterSolid": "#fafafa",
480
+ "fontWeightNormal": 400,
481
+ "colorFilledHandleBg": "#f0f0f0",
482
+ "colorBgSolid": "#000000",
483
+ "colorBgSolidActive": "rgba(0, 0, 0, 0.95)",
484
+ "colorBgSolidHover": "rgba(0, 0, 0, 0.75)",
485
+ "solidTextColor": "#ffffff",
486
+ "pink.1": "#fff0f6",
487
+ "pink.2": "#ffd6e7",
488
+ "pink.3": "#ffadd2",
489
+ "pink.4": "#ff85c0",
490
+ "pink.5": "#f759ab",
491
+ "pink.6": "#eb2f96",
492
+ "pink.7": "#c41d7f",
493
+ "pink.8": "#9e1068",
494
+ "pink.9": "#780650",
495
+ "pink.10": "#520339",
496
+ "sizeXXXL": 60,
497
+ "sizeXXXXL": 72,
498
+ "paddingXXL": 48,
499
+ "paddingXXXL": 60,
500
+ "paddingXXXXL": 72,
501
+ "marginXXXL": 60,
502
+ "marginXXXXL": 72
503
+ };
504
+
505
+ //#endregion
506
+ //#region src/view/helper/sidebar.utils.ts
507
+ const methodColors = {
508
+ GET: {
509
+ bg: token.colorPrimaryBgHover,
510
+ color: token.colorPrimary
511
+ },
512
+ POST: {
513
+ bg: token["green.1"],
514
+ color: token.colorSuccess
515
+ },
516
+ DELETE: {
517
+ bg: token.colorErrorBg,
518
+ color: token.colorError
519
+ },
520
+ PUT: {
521
+ bg: token.colorWarningBg,
522
+ color: token.colorWarning
523
+ },
524
+ PATCH: {
525
+ bg: token["volcano.5"],
526
+ color: token.colorWhite
527
+ },
528
+ OPTIONS: {
529
+ bg: token["geekblue.2"],
530
+ color: token["geekblue.6"]
531
+ },
532
+ HEAD: {
533
+ bg: token["purple.1"],
534
+ color: token["purple.5"]
535
+ },
536
+ TRACE: {
537
+ bg: token["cyan.1"],
538
+ color: token["cyan.5"]
539
+ }
540
+ };
541
+ const buildTreeDataStructure = (data) => {
542
+ if (!data) return [];
543
+ return data.map((api) => {
544
+ return {
545
+ title: api.title,
546
+ key: api.id,
547
+ selectable: true,
548
+ data: api,
549
+ children: Object.entries(api.tags).map(([tag, endpoints]) => {
550
+ const tagId = `tag-${(0, nanoid.nanoid)(8)}`;
551
+ return {
552
+ title: tag,
553
+ key: tagId,
554
+ selectable: false,
555
+ data: {
556
+ tagName: tag,
557
+ apiData: api
558
+ },
559
+ children: endpoints.map((endpoint) => {
560
+ return {
561
+ title: endpoint.summary,
562
+ key: endpoint.id,
563
+ isLeaf: true,
564
+ selectable: true,
565
+ method: endpoint.method,
566
+ data: {
567
+ endpoint,
568
+ api,
569
+ tagName: tag
570
+ }
571
+ };
572
+ })
573
+ };
574
+ })
575
+ };
576
+ });
577
+ };
578
+ const findNodeByKey = (nodes, targetKey) => {
579
+ for (const node of nodes) {
580
+ if (node.key === targetKey) return node;
581
+ if (node.children && node.children.length > 0) {
582
+ const found = findNodeByKey(node.children, targetKey);
583
+ if (found) return found;
584
+ }
585
+ }
586
+ return null;
587
+ };
588
+ const isApiSectionHighlighted = (apiKey, selectedNode, treeDataStructure) => {
589
+ if (!selectedNode || selectedNode.length === 0) return false;
590
+ const selectedKey = selectedNode[0];
591
+ if (selectedKey === apiKey) return false;
592
+ const findNodeParentApi = (nodes, targetKey) => {
593
+ for (const node of nodes) if (node.data && "id" in node.data && "tags" in node.data && !("endpoint" in node.data) && !("tagName" in node.data)) {
594
+ const apiId = node.key;
595
+ if (node.children) for (const child of node.children) {
596
+ if (child.key === targetKey) return apiId;
597
+ if (child.children) {
598
+ for (const grandChild of child.children) if (grandChild.key === targetKey) return apiId;
599
+ }
600
+ }
601
+ }
602
+ return null;
603
+ };
604
+ const parentApiKey = findNodeParentApi(treeDataStructure, selectedKey);
605
+ return parentApiKey === apiKey;
606
+ };
607
+ const getAllTreeKeys = (data) => {
608
+ const keys = [];
609
+ const traverse = (nodes) => {
610
+ nodes.forEach((node) => {
611
+ keys.push(node.key);
612
+ if (node.children && node.children.length > 0) traverse(node.children);
613
+ });
614
+ };
615
+ traverse(data);
616
+ return keys;
617
+ };
618
+ const filterTreeData = (data, searchText) => {
619
+ if (!searchText) return data;
620
+ const findOriginalNode = (nodes, key) => {
621
+ for (const node of nodes) {
622
+ if (node.key === key) return node;
623
+ if (node.children) {
624
+ const found = findOriginalNode(node.children, key);
625
+ if (found) return found;
626
+ }
627
+ }
628
+ return null;
629
+ };
630
+ const filterNode = (node) => {
631
+ let titleText = "";
632
+ const originalNode = findOriginalNode(data, node.key);
633
+ if (originalNode && typeof originalNode.title === "string") titleText = originalNode.title;
634
+ else if (typeof node.title === "string") titleText = node.title;
635
+ let searchableText = titleText;
636
+ if (node.isLeaf && node.method) searchableText = `${node.method} ${titleText}`.toLowerCase();
637
+ else searchableText = titleText.toLowerCase();
638
+ const searchLower = searchText.toLowerCase();
639
+ const matchesSearch = searchableText.includes(searchLower);
640
+ if (node.children) {
641
+ const filteredChildren = node.children.map((child) => filterNode(child)).filter((child) => child !== null);
642
+ if (matchesSearch || filteredChildren.length > 0) return {
643
+ ...node,
644
+ children: filteredChildren
645
+ };
646
+ } else if (matchesSearch) return node;
647
+ return null;
648
+ };
649
+ return data.map((node) => filterNode(node)).filter((node) => node !== null);
650
+ };
651
+ const getSidebarStyles = (token$1, scope) => ({
652
+ [scope("sider")]: {
653
+ backgroundColor: token$1.colorBgContainer,
654
+ maxWidth: "17.5rem",
655
+ overflowY: "auto",
656
+ overflowX: "clip"
657
+ },
658
+ [scope("content")]: { padding: token$1.padding },
659
+ [scope("controls")]: {
660
+ display: "flex",
661
+ gap: token$1.marginXS,
662
+ marginBottom: token$1.marginSM
663
+ },
664
+ [scope("search-input")]: { flex: 1 },
665
+ [scope("tree")]: {
666
+ backgroundColor: "transparent",
667
+ "& .ant-tree-node-content-wrapper": {
668
+ overflow: "hidden",
669
+ width: "100%",
670
+ display: "flex",
671
+ alignItems: "center"
672
+ },
673
+ "& .ant-tree-title": {
674
+ width: "100%",
675
+ overflow: "hidden",
676
+ display: "flex",
677
+ alignItems: "center",
678
+ marginBlock: "auto"
679
+ },
680
+ "& .ant-tree-treenode": {
681
+ width: "100%",
682
+ padding: 0
683
+ },
684
+ "& .ant-tree-node-content-wrapper:hover": { backgroundColor: token$1.colorFillTertiary }
685
+ },
686
+ [scope("endpoint-item")]: {
687
+ display: "flex",
688
+ alignItems: "center",
689
+ gap: token$1.marginXS,
690
+ width: "100%",
691
+ maxWidth: "100%",
692
+ minWidth: "100%"
693
+ },
694
+ [scope("method-tag")]: {
695
+ minWidth: "3.75rem",
696
+ textAlign: "center",
697
+ border: "none"
698
+ },
699
+ [scope("endpoint-text")]: {
700
+ flex: 1,
701
+ maxWidth: "100%"
702
+ },
703
+ [scope("tag-title")]: {
704
+ color: token$1.colorText,
705
+ maxWidth: "100%",
706
+ display: "block"
707
+ },
708
+ [scope("api-title")]: {
709
+ color: token$1.colorText,
710
+ maxWidth: "100%",
711
+ display: "block",
712
+ padding: 0,
713
+ margin: 0,
714
+ "&.highlighted": { color: token$1.colorPrimary }
715
+ },
716
+ [scope("create-text")]: { color: token$1.colorTextSecondary }
717
+ });
718
+
719
+ //#endregion
720
+ //#region src/view/helper/sidebar.components.tsx
721
+ const { Text } = antd.Typography;
722
+ const EndpointItem = ({ method, title, cx }) => {
723
+ const methodStyle = methodColors[method];
724
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
725
+ className: cx("endpoint-item"),
726
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(antd.Tag, {
727
+ className: cx("method-tag"),
728
+ style: {
729
+ backgroundColor: methodStyle?.bg,
730
+ color: methodStyle?.color,
731
+ border: "none"
732
+ },
733
+ children: method
734
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Text, {
735
+ className: cx("endpoint-text"),
736
+ ellipsis: { tooltip: title },
737
+ style: { flex: 1 },
738
+ children: title
739
+ })]
740
+ });
741
+ };
742
+ const convertToRenderableTreeData = (treeDataStructure, selectedNode, cx) => {
743
+ const renderNode = (node) => {
744
+ let title;
745
+ if (node.isLeaf && node.method) title = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(EndpointItem, {
746
+ method: node.method,
747
+ title: typeof node.title === "string" ? node.title.replace(`${node.method} `, "") : "",
748
+ cx
749
+ });
750
+ else if (node.data && "id" in node.data && "tags" in node.data && !("endpoint" in node.data) && !("tagName" in node.data)) {
751
+ const isHighlighted = isApiSectionHighlighted(node.key, selectedNode, treeDataStructure);
752
+ title = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Text, {
753
+ className: cx("api-title") + (isHighlighted ? " highlighted" : ""),
754
+ ellipsis: { tooltip: typeof node.title === "string" ? node.title : "" },
755
+ children: node.title
756
+ });
757
+ } else title = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Text, {
758
+ className: cx("tag-title"),
759
+ ellipsis: { tooltip: typeof node.title === "string" ? node.title : "" },
760
+ children: node.title
761
+ });
762
+ return {
763
+ ...node,
764
+ title,
765
+ children: node.children ? node.children.map(renderNode) : void 0
766
+ };
767
+ };
768
+ return treeDataStructure.map(renderNode);
769
+ };
770
+
771
+ //#endregion
772
+ //#region src/view/components/Sidebar.tsx
773
+ const { Sider } = antd.Layout;
774
+ var SidebarErrorBoundary = class extends react.default.Component {
775
+ constructor(props) {
776
+ super(props);
777
+ this.state = { hasError: false };
778
+ }
779
+ static getDerivedStateFromError(error) {
780
+ console.error("[Sidebar] Error caught by ErrorBoundary:", error);
781
+ return {
782
+ hasError: true,
783
+ error
784
+ };
785
+ }
786
+ componentDidCatch(error, errorInfo) {
787
+ console.error("[Sidebar] ComponentDidCatch - Error:", error);
788
+ console.error("[Sidebar] ComponentDidCatch - ErrorInfo:", errorInfo);
789
+ setTimeout(() => {
790
+ throw new Error(`Sidebar component error: ${error.message}`);
791
+ }, 0);
792
+ }
793
+ render() {
794
+ if (this.state.hasError) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Sider, {
795
+ width: 280,
796
+ style: {
797
+ backgroundColor: "#f5f5f5",
798
+ border: "1px solid #d9d9d9"
799
+ },
800
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
801
+ style: { padding: 16 },
802
+ children: [
803
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("h4", {
804
+ style: {
805
+ color: "#ff4d4f",
806
+ margin: 0,
807
+ marginBottom: 8
808
+ },
809
+ children: "Sidebar Test Mode"
810
+ }),
811
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
812
+ style: {
813
+ margin: 0,
814
+ fontSize: "12px",
815
+ color: "#666"
816
+ },
817
+ children: "Original sidebar failed. This is a test element."
818
+ }),
819
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("details", {
820
+ style: {
821
+ marginTop: 8,
822
+ fontSize: "11px"
823
+ },
824
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("summary", {
825
+ style: {
826
+ cursor: "pointer",
827
+ color: "#1890ff"
828
+ },
829
+ children: "Error Details"
830
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("pre", {
831
+ style: {
832
+ marginTop: 4,
833
+ fontSize: "10px",
834
+ color: "#ff4d4f"
835
+ },
836
+ children: this.state.error?.message
837
+ })]
838
+ })
839
+ ]
840
+ })
841
+ });
842
+ return this.props.children;
843
+ }
844
+ };
845
+ const FallbackSidebar = () => {
846
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Sider, {
847
+ width: 280,
848
+ style: {
849
+ backgroundColor: "#f5f5f5",
850
+ border: "1px solid #d9d9d9"
851
+ },
852
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
853
+ style: { padding: 16 },
854
+ children: [
855
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("h4", {
856
+ style: {
857
+ color: "#ff4d4f",
858
+ margin: 0,
859
+ marginBottom: 8
860
+ },
861
+ children: "Sidebar Error"
862
+ }),
863
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
864
+ style: {
865
+ margin: 0,
866
+ fontSize: "12px",
867
+ color: "#666"
868
+ },
869
+ children: "The sidebar component encountered an error and has been disabled."
870
+ }),
871
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
872
+ style: {
873
+ margin: 0,
874
+ fontSize: "11px",
875
+ color: "#999",
876
+ marginTop: 8
877
+ },
878
+ children: "Check the console for more details."
879
+ })
880
+ ]
881
+ })
882
+ });
883
+ };
884
+ const SafeSidebar = () => {
885
+ try {
886
+ const expandedKeys = useStore((state) => state.view.expandedKeys);
887
+ const setExpandedKeys = useStore((state) => state.view.setExpandedKeys);
888
+ const setSelectedApi = useStore((state) => state.view.setSelectedApi);
889
+ const setSelectedEndpoint = useStore((state) => state.view.setSelectedEndpoint);
890
+ const [selectedNode, setSelectedNodeState] = (0, react.useState)();
891
+ const transformedData = useStore((state) => state.view.transformedData);
892
+ console.log("[Sidebar] Store access successful, transformedData:", transformedData);
893
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SidebarContent, {
894
+ expandedKeys,
895
+ setExpandedKeys,
896
+ setSelectedApi,
897
+ setSelectedEndpoint,
898
+ selectedNode,
899
+ setSelectedNodeState,
900
+ transformedData
901
+ });
902
+ } catch (error) {
903
+ console.error("[Sidebar] Error accessing store or rendering:", error);
904
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(FallbackSidebar, {});
905
+ }
906
+ };
907
+ const SidebarContent = ({ expandedKeys, setExpandedKeys, setSelectedApi, setSelectedEndpoint, selectedNode, setSelectedNodeState, transformedData }) => {
908
+ const builtTreeData = (0, react.useMemo)(() => {
909
+ console.log("[Sidebar] transformedData:", transformedData);
910
+ const tree = buildTreeDataStructure(transformedData);
911
+ console.log("[Sidebar] builtTreeData:", tree);
912
+ return tree;
913
+ }, [transformedData]);
914
+ const [searchValue, setSearchValue] = (0, react.useState)("");
915
+ const [autoExpandParent, setAutoExpandParent] = (0, react.useState)(true);
916
+ const { wrapSSR, cx } = useStyle("Sidebar", getSidebarStyles);
917
+ const handleSearch = (value) => {
918
+ if (value) {
919
+ const allKeys = getAllTreeKeys(builtTreeData);
920
+ setExpandedKeys(allKeys);
921
+ setSearchValue(value);
922
+ setAutoExpandParent(true);
923
+ } else {
924
+ setSearchValue(value);
925
+ setAutoExpandParent(false);
926
+ }
927
+ };
928
+ const renderTreeData = (0, react.useMemo)(() => {
929
+ const data = convertToRenderableTreeData(builtTreeData, selectedNode, cx);
930
+ console.log("[Sidebar] renderTreeData:", data);
931
+ return data;
932
+ }, [
933
+ builtTreeData,
934
+ selectedNode,
935
+ cx
936
+ ]);
937
+ const filteredTreeData = (0, react.useMemo)(() => {
938
+ if (!searchValue) return renderTreeData;
939
+ const filteredOriginal = filterTreeData(builtTreeData, searchValue);
940
+ const data = convertToRenderableTreeData(filteredOriginal, selectedNode, cx);
941
+ console.log("[Sidebar] filteredTreeData:", data);
942
+ return data;
943
+ }, [
944
+ builtTreeData,
945
+ searchValue,
946
+ selectedNode,
947
+ cx
948
+ ]);
949
+ const collapseAll = () => {
950
+ setExpandedKeys([]);
951
+ };
952
+ const handleNodeSelection = (nodeData, nodeKey) => {
953
+ if (!nodeData) return null;
954
+ if (nodeKey.startsWith("endpoint-")) {
955
+ const endpointNodeData = nodeData;
956
+ setSelectedEndpoint(endpointNodeData.endpoint);
957
+ setSelectedApi(endpointNodeData.api);
958
+ return {
959
+ type: "endpoint",
960
+ endpoint: endpointNodeData.endpoint,
961
+ api: endpointNodeData.api,
962
+ tag: endpointNodeData.tagName
963
+ };
964
+ } else if (nodeKey.startsWith("api-") || nodeKey === "custom-auth") {
965
+ const apiData = nodeData;
966
+ setSelectedApi(apiData);
967
+ setSelectedEndpoint(null);
968
+ return {
969
+ type: "api",
970
+ api: apiData
971
+ };
972
+ } else {
973
+ const tagData = nodeData;
974
+ return {
975
+ type: "tag",
976
+ tag: tagData.tagName,
977
+ api: tagData.apiData
978
+ };
979
+ }
980
+ };
981
+ const onTreeNodeSelect = (selectedKeys) => {
982
+ const stringKeys = selectedKeys.map((key) => String(key));
983
+ console.log("[Sidebar] onTreeNodeSelect - selectedKeys:", selectedKeys, "stringKeys:", stringKeys);
984
+ if (stringKeys.length === 0) {
985
+ setSelectedNodeState([]);
986
+ setSelectedApi(null);
987
+ setSelectedEndpoint(null);
988
+ return;
989
+ }
990
+ const selectedKey = stringKeys[0];
991
+ const selectedNode$1 = findNodeByKey(builtTreeData, selectedKey);
992
+ console.log("[Sidebar] findNodeByKey result:", selectedNode$1);
993
+ if (selectedNode$1) {
994
+ const result = handleNodeSelection(selectedNode$1.data, selectedKey);
995
+ console.log("[Sidebar] handleNodeSelection result:", result);
996
+ }
997
+ setSelectedNodeState(stringKeys);
998
+ };
999
+ return wrapSSR(/* @__PURE__ */ (0, react_jsx_runtime.jsx)(SidebarErrorBoundary, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Sider, {
1000
+ width: 280,
1001
+ className: cx("sider"),
1002
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
1003
+ className: cx("content"),
1004
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
1005
+ className: cx("controls"),
1006
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(antd.Input, {
1007
+ placeholder: "Search by APIs or Endpoints",
1008
+ value: searchValue,
1009
+ onChange: (e) => handleSearch(e.target.value),
1010
+ allowClear: true,
1011
+ className: cx("search-input")
1012
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(antd.Button, {
1013
+ onClick: collapseAll,
1014
+ title: "Collapse All",
1015
+ icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Minify_default, {})
1016
+ })]
1017
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(antd.Tree, {
1018
+ showLine: { showLeafIcon: false },
1019
+ showIcon: false,
1020
+ expandedKeys,
1021
+ autoExpandParent,
1022
+ selectedKeys: selectedNode,
1023
+ onSelect: onTreeNodeSelect,
1024
+ onExpand: (expandedKeysValue) => {
1025
+ setExpandedKeys(expandedKeysValue);
1026
+ setAutoExpandParent(false);
1027
+ },
1028
+ treeData: filteredTreeData,
1029
+ className: cx("tree")
1030
+ })]
1031
+ })
1032
+ }) }));
1033
+ };
1034
+ const Sidebar = () => {
1035
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SafeSidebar, {});
1036
+ };
1037
+
149
1038
  //#endregion
150
1039
  //#region src/view/components/MainContent.tsx
151
1040
  const MainContent = () => {
152
- const { wrapSSR, cx } = useStyle("MainContent", (token, scope) => ({ [scope("container")]: {
153
- backgroundColor: token.colorBgContainer,
1041
+ const { wrapSSR, cx } = useStyle("MainContent", (token$1, scope) => ({ [scope("container")]: {
1042
+ backgroundColor: token$1.colorBgContainer,
154
1043
  height: "100%",
155
1044
  width: "100%",
156
1045
  maxHeight: "100%",
157
1046
  overflow: "auto",
158
- borderRadius: token.borderRadius,
159
- padding: token.paddingXL
1047
+ borderRadius: token$1.borderRadius,
1048
+ padding: token$1.paddingXL
160
1049
  } }));
161
1050
  return wrapSSR(/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { className: cx("container") }));
162
1051
  };
@@ -206,11 +1095,11 @@ const DocumentationLayout = ({ data }) => {
206
1095
  const transformedData = data.map(transformOpenApiToDocs);
207
1096
  setTransformedData(transformedData);
208
1097
  }, [data]);
209
- const { cx } = useStyle("DocumentationLayout", (token, scope) => ({
1098
+ const { cx } = useStyle("DocumentationLayout", (token$1, scope) => ({
210
1099
  [scope("container")]: {
211
1100
  display: "flex",
212
1101
  flexDirection: "column",
213
- gap: token.marginLG,
1102
+ gap: token$1.marginLG,
214
1103
  height: "100%",
215
1104
  maxHeight: "100%",
216
1105
  overflow: "hidden"
@@ -220,14 +1109,14 @@ const DocumentationLayout = ({ data }) => {
220
1109
  height: "100%",
221
1110
  maxHeight: "100%",
222
1111
  overflow: "hidden",
223
- gap: token.marginLG
1112
+ gap: token$1.marginLG
224
1113
  }
225
1114
  }));
226
1115
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__ant_design_nextjs_registry.AntdRegistry, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
227
1116
  className: cx("container"),
228
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Header, {}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1117
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Header, {}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
229
1118
  className: cx("layout"),
230
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MainContent, {})
1119
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Sidebar, {}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MainContent, {})]
231
1120
  })]
232
1121
  }) });
233
1122
  };