@digi-frontend/dgate-api-documentation 2.0.1-test.13 → 2.0.1-test.14

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
@@ -33,19 +33,19 @@ const __ant_design_nextjs_registry = __toESM(require("@ant-design/nextjs-registr
33
33
 
34
34
  //#region src/hooks/useStyle.ts
35
35
  function useStyle(componentName, stylesFn) {
36
- const { token: token$1, theme, hashId } = antd.theme.useToken();
36
+ const { token, theme, hashId } = antd.theme.useToken();
37
37
  const scope = (className) => `.${hashId}.${componentName}-${className}`;
38
38
  const cx = (...classes) => classes.map((cls) => `${componentName}-${cls} ${hashId}`).join(" ");
39
39
  const wrapSSR = (0, __ant_design_cssinjs.useStyleRegister)({
40
40
  theme,
41
- token: token$1,
41
+ token,
42
42
  path: [componentName]
43
- }, () => stylesFn(token$1, scope));
43
+ }, () => stylesFn(token, scope));
44
44
  return {
45
45
  wrapSSR,
46
46
  cx,
47
47
  scope,
48
- token: token$1,
48
+ token,
49
49
  hashId
50
50
  };
51
51
  }
@@ -54,10 +54,10 @@ function useStyle(componentName, stylesFn) {
54
54
  //#region src/view/components/Header.tsx
55
55
  const { Header: AntHeader } = antd.Layout;
56
56
  const Header = () => {
57
- const { wrapSSR, cx } = useStyle("Header", (token$1, scope) => ({ [scope("header")]: {
57
+ const { wrapSSR, cx } = useStyle("Header", (token, scope) => ({ [scope("header")]: {
58
58
  width: "100%",
59
59
  height: "4rem",
60
- backgroundColor: token$1.colorBgContainer
60
+ backgroundColor: token.colorBgContainer
61
61
  } }));
62
62
  return wrapSSR(/* @__PURE__ */ (0, react_jsx_runtime.jsx)(AntHeader, { className: cx("header") }));
63
63
  };
@@ -146,762 +146,17 @@ const createStore = (set) => ({
146
146
  const useStore = (0, zustand.create)()((0, zustand_middleware.devtools)((0, zustand_middleware_immer.immer)(createStore), { name: "dgate-docs-store" }));
147
147
  var store_default = useStore;
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
- const Sidebar = () => {
775
- const expandedKeys = useStore((state) => state.view.expandedKeys);
776
- const setExpandedKeys = useStore((state) => state.view.setExpandedKeys);
777
- const setSelectedApi = useStore((state) => state.view.setSelectedApi);
778
- const setSelectedEndpoint = useStore((state) => state.view.setSelectedEndpoint);
779
- const [selectedNode, setSelectedNodeState] = (0, react.useState)();
780
- const transformedData = useStore((state) => state.view.transformedData);
781
- const builtTreeData = (0, react.useMemo)(() => buildTreeDataStructure(transformedData), [transformedData]);
782
- const [searchValue, setSearchValue] = (0, react.useState)("");
783
- const [autoExpandParent, setAutoExpandParent] = (0, react.useState)(true);
784
- const { wrapSSR, cx } = useStyle("Sidebar", getSidebarStyles);
785
- const handleSearch = (value) => {
786
- if (value) {
787
- const allKeys = getAllTreeKeys(builtTreeData);
788
- setExpandedKeys(allKeys);
789
- setSearchValue(value);
790
- setAutoExpandParent(true);
791
- } else {
792
- setSearchValue(value);
793
- setAutoExpandParent(false);
794
- }
795
- };
796
- const renderTreeData = (0, react.useMemo)(() => {
797
- return convertToRenderableTreeData(builtTreeData, selectedNode, cx);
798
- }, [
799
- builtTreeData,
800
- selectedNode,
801
- cx
802
- ]);
803
- const filteredTreeData = (0, react.useMemo)(() => {
804
- if (!searchValue) return renderTreeData;
805
- const filteredOriginal = filterTreeData(builtTreeData, searchValue);
806
- return convertToRenderableTreeData(filteredOriginal, selectedNode, cx);
807
- }, [
808
- builtTreeData,
809
- searchValue,
810
- selectedNode,
811
- cx
812
- ]);
813
- const collapseAll = () => {
814
- setExpandedKeys([]);
815
- };
816
- const handleNodeSelection = (nodeData, nodeKey) => {
817
- if (!nodeData) return null;
818
- if (nodeKey.startsWith("endpoint-")) {
819
- const endpointNodeData = nodeData;
820
- setSelectedEndpoint(endpointNodeData.endpoint);
821
- setSelectedApi(endpointNodeData.api);
822
- return {
823
- type: "endpoint",
824
- endpoint: endpointNodeData.endpoint,
825
- api: endpointNodeData.api,
826
- tag: endpointNodeData.tagName
827
- };
828
- } else if (nodeKey.startsWith("api-") || nodeKey === "custom-auth") {
829
- const apiData = nodeData;
830
- setSelectedApi(apiData);
831
- setSelectedEndpoint(null);
832
- return {
833
- type: "api",
834
- api: apiData
835
- };
836
- } else {
837
- const tagData = nodeData;
838
- return {
839
- type: "tag",
840
- tag: tagData.tagName,
841
- api: tagData.apiData
842
- };
843
- }
844
- };
845
- const onTreeNodeSelect = (selectedKeys) => {
846
- const stringKeys = selectedKeys.map((key) => String(key));
847
- if (stringKeys.length === 0) {
848
- setSelectedNodeState([]);
849
- setSelectedApi(null);
850
- setSelectedEndpoint(null);
851
- return;
852
- }
853
- const selectedKey = stringKeys[0];
854
- const selectedNode$1 = findNodeByKey(builtTreeData, selectedKey);
855
- if (selectedNode$1) handleNodeSelection(selectedNode$1.data, selectedKey);
856
- setSelectedNodeState(stringKeys);
857
- };
858
- return wrapSSR(/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Sider, {
859
- width: 280,
860
- className: cx("sider"),
861
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
862
- className: cx("content"),
863
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
864
- className: cx("controls"),
865
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(antd.Input, {
866
- placeholder: "Search by APIs or Endpoints",
867
- value: searchValue,
868
- onChange: (e) => handleSearch(e.target.value),
869
- allowClear: true,
870
- className: cx("search-input")
871
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(antd.Button, {
872
- onClick: collapseAll,
873
- title: "Collapse All",
874
- icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Minify_default, {})
875
- })]
876
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(antd.Tree, {
877
- showLine: { showLeafIcon: false },
878
- showIcon: false,
879
- expandedKeys,
880
- autoExpandParent,
881
- selectedKeys: selectedNode,
882
- onSelect: onTreeNodeSelect,
883
- onExpand: (expandedKeysValue) => {
884
- setExpandedKeys(expandedKeysValue);
885
- setAutoExpandParent(false);
886
- },
887
- treeData: filteredTreeData,
888
- className: cx("tree")
889
- })]
890
- })
891
- }));
892
- };
893
-
894
149
  //#endregion
895
150
  //#region src/view/components/MainContent.tsx
896
151
  const MainContent = () => {
897
- const { wrapSSR, cx } = useStyle("MainContent", (token$1, scope) => ({ [scope("container")]: {
898
- backgroundColor: token$1.colorBgContainer,
152
+ const { wrapSSR, cx } = useStyle("MainContent", (token, scope) => ({ [scope("container")]: {
153
+ backgroundColor: token.colorBgContainer,
899
154
  height: "100%",
900
155
  width: "100%",
901
156
  maxHeight: "100%",
902
157
  overflow: "auto",
903
- borderRadius: token$1.borderRadius,
904
- padding: token$1.paddingXL
158
+ borderRadius: token.borderRadius,
159
+ padding: token.paddingXL
905
160
  } }));
906
161
  return wrapSSR(/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { className: cx("container") }));
907
162
  };
@@ -945,17 +200,18 @@ const transformOpenApiToDocs = (api) => {
945
200
  //#region src/view/layout.tsx
946
201
  const DocumentationLayout = ({ data }) => {
947
202
  const { setOriginalData } = store_default(({ view }) => view);
948
- const { setTransformedData } = store_default(({ view }) => view);
203
+ const { setTransformedData, transformedData } = store_default(({ view }) => view);
204
+ console.log({ transformedData });
949
205
  (0, react.useEffect)(() => {
950
206
  setOriginalData(data);
951
- const transformedData = data.map(transformOpenApiToDocs);
952
- setTransformedData(transformedData);
207
+ const transformedData$1 = data.map(transformOpenApiToDocs);
208
+ setTransformedData(transformedData$1);
953
209
  }, [data]);
954
- const { cx } = useStyle("DocumentationLayout", (token$1, scope) => ({
210
+ const { cx } = useStyle("DocumentationLayout", (token, scope) => ({
955
211
  [scope("container")]: {
956
212
  display: "flex",
957
213
  flexDirection: "column",
958
- gap: token$1.marginLG,
214
+ gap: token.marginLG,
959
215
  height: "100%",
960
216
  maxHeight: "100%",
961
217
  overflow: "hidden"
@@ -965,14 +221,14 @@ const DocumentationLayout = ({ data }) => {
965
221
  height: "100%",
966
222
  maxHeight: "100%",
967
223
  overflow: "hidden",
968
- gap: token$1.marginLG
224
+ gap: token.marginLG
969
225
  }
970
226
  }));
971
227
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__ant_design_nextjs_registry.AntdRegistry, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
972
228
  className: cx("container"),
973
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Header, {}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
229
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Header, {}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
974
230
  className: cx("layout"),
975
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Sidebar, {}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MainContent, {})]
231
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MainContent, {})
976
232
  })]
977
233
  }) });
978
234
  };