@digi-frontend/dgate-api-documentation 2.0.1-test.10 → 2.0.1-test.11

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