@digi-frontend/dgate-api-documentation 2.0.1-test.15 → 2.0.1-test.17

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,6 +1,7 @@
1
1
  'use client';
2
2
 
3
3
 
4
+ import * as React$1 from "react";
4
5
  import { useEffect, useMemo, useState } from "react";
5
6
  import { Button, Input, Layout, Tag, Tree, Typography, theme } from "antd";
6
7
  import { useStyleRegister } from "@ant-design/cssinjs";
@@ -8,7 +9,6 @@ import { jsx, jsxs } from "react/jsx-runtime";
8
9
  import { create } from "zustand";
9
10
  import { devtools } from "zustand/middleware";
10
11
  import { immer } from "zustand/middleware/immer";
11
- import { nanoid } from "nanoid";
12
12
  import { AntdRegistry } from "@ant-design/nextjs-registry";
13
13
 
14
14
  //#region src/hooks/useStyle.ts
@@ -126,6 +126,31 @@ const createStore = (set) => ({
126
126
  const useStore = create()(devtools(immer(createStore), { name: "dgate-docs-store" }));
127
127
  var store_default = useStore;
128
128
 
129
+ //#endregion
130
+ //#region src/assets/Minify.svg
131
+ var _path;
132
+ function _extends() {
133
+ return _extends = Object.assign ? Object.assign.bind() : function(n) {
134
+ for (var e = 1; e < arguments.length; e++) {
135
+ var t = arguments[e];
136
+ for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
137
+ }
138
+ return n;
139
+ }, _extends.apply(null, arguments);
140
+ }
141
+ var SvgMinify = function SvgMinify$1(props) {
142
+ return /* @__PURE__ */ React$1.createElement("svg", _extends({
143
+ xmlns: "http://www.w3.org/2000/svg",
144
+ width: 16,
145
+ height: 16,
146
+ fill: "none"
147
+ }, props), _path || (_path = /* @__PURE__ */ React$1.createElement("path", {
148
+ stroke: "currentcolor",
149
+ d: "m6 11.334 2-2 2 2M6 4.666l2 2 2-2"
150
+ })));
151
+ };
152
+ var Minify_default = SvgMinify;
153
+
129
154
  //#endregion
130
155
  //#region src/theme/light.json
131
156
  var token = {
@@ -502,7 +527,7 @@ const buildTreeDataStructure = (data) => {
502
527
  selectable: true,
503
528
  data: api,
504
529
  children: Object.entries(api.tags).map(([tag, endpoints]) => {
505
- const tagId = `tag-${nanoid(8)}`;
530
+ const tagId = `tag-${tag}`;
506
531
  return {
507
532
  title: tag,
508
533
  key: tagId,
@@ -826,7 +851,7 @@ const Sidebar = () => {
826
851
  }), /* @__PURE__ */ jsx(Button, {
827
852
  onClick: collapseAll,
828
853
  title: "Collapse All",
829
- children: "Minify"
854
+ icon: /* @__PURE__ */ jsx(Minify_default, {})
830
855
  })]
831
856
  }), /* @__PURE__ */ jsx(Tree, {
832
857
  showLine: { showLeafIcon: false },
@@ -879,17 +904,17 @@ const transformOpenApiToDocs = (api) => {
879
904
  if (!groupedPathsByTags[tag]) groupedPathsByTags[tag] = [];
880
905
  groupedPathsByTags[tag].push({
881
906
  ...entry,
882
- id: `endpoint-${nanoid(8)}`
907
+ id: `endpoint-${entry.summary}`
883
908
  });
884
909
  });
885
910
  else groupedPathsByTags.default.push({
886
911
  ...entry,
887
- id: `endpoint-${nanoid(8)}`
912
+ id: `endpoint-${entry.summary}`
888
913
  });
889
914
  }
890
915
  return {
891
916
  ...api.info,
892
- id: `api-${nanoid(8)}`,
917
+ id: `api-${api.info.title}`,
893
918
  contextPath,
894
919
  tags: groupedPathsByTags,
895
920
  servers: api.servers