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