@scalar/api-reference 1.28.1 → 1.28.3

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.
Files changed (83) hide show
  1. package/CHANGELOG.md +41 -0
  2. package/dist/blocks/hooks/useBlockProps.d.ts +4 -5
  3. package/dist/blocks/hooks/useBlockProps.d.ts.map +1 -1
  4. package/dist/blocks/hooks/useBlockProps.js +10 -14
  5. package/dist/browser/standalone.js +11624 -11582
  6. package/dist/browser/webpack-stats.json +1 -1
  7. package/dist/components/ApiReferenceLayout.vue.d.ts.map +1 -1
  8. package/dist/components/ApiReferenceLayout.vue.js +2 -2
  9. package/dist/components/ApiReferenceLayout.vue2.js +103 -109
  10. package/dist/components/Content/ClientLibraries/ClientLibraries.vue.d.ts.map +1 -1
  11. package/dist/components/Content/ClientLibraries/ClientLibraries.vue.js +2 -2
  12. package/dist/components/Content/ClientLibraries/ClientLibraries.vue2.js +48 -40
  13. package/dist/components/Content/ClientLibraries/ClientSelector.vue.d.ts.map +1 -1
  14. package/dist/components/Content/ClientLibraries/ClientSelector.vue.js +2 -2
  15. package/dist/components/Content/ClientLibraries/ClientSelector.vue2.js +6 -7
  16. package/dist/components/Content/Content.vue.d.ts.map +1 -1
  17. package/dist/components/Content/Content.vue.js +2 -2
  18. package/dist/components/Content/Content.vue2.js +97 -71
  19. package/dist/components/Content/Introduction/Introduction.vue.d.ts.map +1 -1
  20. package/dist/components/Content/Introduction/Introduction.vue.js +2 -2
  21. package/dist/components/Content/Introduction/Introduction.vue2.js +18 -18
  22. package/dist/components/Content/Lazy/Loading.vue.d.ts +3 -0
  23. package/dist/components/Content/Lazy/Loading.vue.d.ts.map +1 -1
  24. package/dist/components/Content/Lazy/Loading.vue.js +58 -56
  25. package/dist/components/Content/Schema/SchemaPropertyHeading.vue.d.ts.map +1 -1
  26. package/dist/components/Content/Schema/SchemaPropertyHeading.vue.js +1 -1
  27. package/dist/components/Content/Schema/SchemaPropertyHeading.vue2.js +77 -77
  28. package/dist/components/Content/Tag/OperationsList.vue.d.ts +2 -0
  29. package/dist/components/Content/Tag/OperationsList.vue.d.ts.map +1 -1
  30. package/dist/components/Content/Tag/OperationsList.vue.js +2 -2
  31. package/dist/components/Content/Tag/OperationsList.vue2.js +22 -20
  32. package/dist/components/Content/Tag/OperationsListItem.vue.d.ts +2 -0
  33. package/dist/components/Content/Tag/OperationsListItem.vue.d.ts.map +1 -1
  34. package/dist/components/Content/Tag/OperationsListItem.vue.js +2 -2
  35. package/dist/components/Content/Tag/OperationsListItem.vue2.js +10 -8
  36. package/dist/components/Content/Tag/Tag.vue.d.ts +2 -0
  37. package/dist/components/Content/Tag/Tag.vue.d.ts.map +1 -1
  38. package/dist/components/Content/Tag/Tag.vue.js +38 -34
  39. package/dist/components/Content/Tag/TagList.vue.d.ts +3 -0
  40. package/dist/components/Content/Tag/TagList.vue.d.ts.map +1 -1
  41. package/dist/components/Content/Tag/TagList.vue.js +32 -30
  42. package/dist/components/Content/Tag/TagSection.vue.d.ts +2 -0
  43. package/dist/components/Content/Tag/TagSection.vue.d.ts.map +1 -1
  44. package/dist/components/Content/Tag/TagSection.vue.js +2 -2
  45. package/dist/components/Content/Tag/TagSection.vue2.js +16 -14
  46. package/dist/components/Section/CompactSection.vue.d.ts.map +1 -1
  47. package/dist/components/Section/CompactSection.vue.js +1 -1
  48. package/dist/components/ShowMoreButton.vue.d.ts.map +1 -1
  49. package/dist/components/ShowMoreButton.vue.js +2 -2
  50. package/dist/components/Sidebar/SidebarElement.vue.d.ts.map +1 -1
  51. package/dist/components/Sidebar/SidebarElement.vue.js +2 -2
  52. package/dist/components/Sidebar/SidebarElement.vue2.js +41 -40
  53. package/dist/features/ApiClientModal/useApiClient.d.ts +6 -6
  54. package/dist/features/ApiClientModal/useApiClient.d.ts.map +1 -1
  55. package/dist/features/BaseUrl/BaseUrl.vue.d.ts +6 -1
  56. package/dist/features/BaseUrl/BaseUrl.vue.d.ts.map +1 -1
  57. package/dist/features/BaseUrl/BaseUrl.vue.js +36 -32
  58. package/dist/features/Operation/Operation.vue.d.ts +1 -1
  59. package/dist/features/Operation/Operation.vue.d.ts.map +1 -1
  60. package/dist/features/Operation/Operation.vue.js +13 -12
  61. package/dist/features/Operation/components/ParameterListItem.vue.d.ts.map +1 -1
  62. package/dist/features/Operation/components/ParameterListItem.vue.js +2 -2
  63. package/dist/features/Operation/components/ParameterListItem.vue2.js +11 -8
  64. package/dist/features/Operation/layouts/ModernLayout.vue.d.ts.map +1 -1
  65. package/dist/features/Operation/layouts/ModernLayout.vue.js +1 -1
  66. package/dist/features/Operation/layouts/ModernLayout.vue2.js +9 -8
  67. package/dist/helpers/scrollToId.d.ts +3 -1
  68. package/dist/helpers/scrollToId.d.ts.map +1 -1
  69. package/dist/helpers/scrollToId.js +4 -4
  70. package/dist/hooks/useMultipleDocuments.d.ts.map +1 -1
  71. package/dist/hooks/useMultipleDocuments.js +49 -41
  72. package/dist/hooks/useSidebar.d.ts +2 -2
  73. package/dist/hooks/useSidebar.d.ts.map +1 -1
  74. package/dist/hooks/useSidebar.js +84 -84
  75. package/dist/index.d.ts +1 -1
  76. package/dist/index.d.ts.map +1 -1
  77. package/dist/index.js +1 -1
  78. package/dist/standalone/lib/html-api.d.ts +8 -9
  79. package/dist/standalone/lib/html-api.d.ts.map +1 -1
  80. package/dist/style.css +1 -1
  81. package/dist/types.d.ts +2 -2
  82. package/dist/types.d.ts.map +1 -1
  83. package/package.json +11 -10
@@ -1,49 +1,57 @@
1
- import { isDefined as c } from "@scalar/oas-utils/helpers";
2
- import { isConfigurationWithSources as i, apiReferenceConfigurationSchema as o } from "@scalar/types/api-reference";
3
- import h from "github-slugger";
4
- import { computed as m, ref as w, watch as S } from "vue";
5
- const p = "api", f = new h(), I = (t, a = 0) => {
6
- if (!(!(t != null && t.url) && !(t != null && t.content)))
7
- return f.reset(), t.title ? {
8
- ...t,
9
- slug: t.slug || f.slug(t.title),
10
- title: t.title
11
- } : t.slug ? {
12
- ...t,
13
- title: t.slug
1
+ import { useNavState as h } from "./useNavState.js";
2
+ import { isDefined as w } from "@scalar/oas-utils/helpers";
3
+ import { isConfigurationWithSources as o, apiReferenceConfigurationSchema as m } from "@scalar/types/api-reference";
4
+ import S from "github-slugger";
5
+ import { computed as v, ref as I, watch as b } from "vue";
6
+ const f = "api", p = new S(), R = (e, s = 0) => {
7
+ if (!(!(e != null && e.url) && !(e != null && e.content)))
8
+ return p.reset(), e.title ? {
9
+ ...e,
10
+ slug: e.slug || p.slug(e.title),
11
+ title: e.title
12
+ } : e.slug ? {
13
+ ...e,
14
+ title: e.slug
14
15
  } : {
15
- ...t,
16
- slug: `api-${a + 1}`,
17
- title: `API #${a + 1}`
16
+ ...e,
17
+ slug: `api-${s + 1}`,
18
+ title: `API #${s + 1}`
18
19
  };
19
- }, U = ({ configuration: t, initialIndex: a }) => {
20
- const s = m(() => {
21
- var e;
22
- return t.value ? (i(t.value) ? ((e = t.value) == null ? void 0 : e.sources) ?? [] : [t.value].flat().map((l) => l)).map((l, r) => l && I(l, r)).filter(c) : [];
23
- }), v = (n) => {
24
- if (s.value.length === 1)
20
+ }, T = ({ configuration: e, initialIndex: s }) => {
21
+ const { isIntersectionEnabled: i } = h(), n = v(() => {
22
+ var l;
23
+ return e.value ? (o(e.value) ? ((l = e.value) == null ? void 0 : l.sources) ?? [] : [e.value].flat().map((t) => t)).map((t, a) => t && R(t, a)).filter(w) : [];
24
+ }), c = (u) => {
25
+ if (n.value.length === 1)
25
26
  return;
26
- const e = new URL(window.location.href), l = s.value[n], r = (l == null ? void 0 : l.slug) ?? n.toString();
27
- e.searchParams.set(p, r), e.hash = "", window.scrollTo({ top: 0, behavior: "instant" }), window.history.replaceState({}, "", e.toString());
28
- }, u = w((() => {
29
- const e = new URL(window.location.href).searchParams.get(p) || "0", l = s.value.findIndex((d) => d.slug === e);
30
- if (l !== -1)
31
- return l;
32
- const r = Number.parseInt(e, 10);
33
- return !isNaN(r) && r >= 0 && r < s.value.length ? r : typeof a == "number" ? a : 0;
34
- })()), g = m(() => {
35
- var n, e;
36
- return t.value && i(t.value) ? o.parse({
37
- ...t.value,
38
- ...(e = (n = t.value) == null ? void 0 : n.sources) == null ? void 0 : e[u.value]
39
- }) : o.parse([t.value].flat()[u.value] ?? {});
27
+ const l = new URL(window.location.href), t = n.value[u], a = (t == null ? void 0 : t.slug) ?? u.toString();
28
+ l.searchParams.set(f, a), l.hash = "", window.history.replaceState({}, "", l.toString()), i.value = !1, window.scrollTo({ top: 0, behavior: "instant" }), setTimeout(() => i.value = !0, 300);
29
+ }, r = I((() => {
30
+ const l = new URL(window.location.href).searchParams.get(f) || "0", t = n.value.findIndex((g) => g.slug === l);
31
+ if (t !== -1)
32
+ return t;
33
+ const a = Number.parseInt(l, 10);
34
+ return !isNaN(a) && a >= 0 && a < n.value.length ? a : typeof s == "number" ? s : 0;
35
+ })()), d = v(() => {
36
+ var l, t;
37
+ if (e.value && o(e.value))
38
+ return m.parse({
39
+ ...e.value,
40
+ ...(t = (l = e.value) == null ? void 0 : l.sources) == null ? void 0 : t[r.value],
41
+ ...n.value[r.value]
42
+ });
43
+ const u = [e.value].flat()[r.value] ?? {};
44
+ return m.parse({
45
+ ...u,
46
+ ...n.value[r.value]
47
+ });
40
48
  });
41
- return S(u, v, { flush: "sync" }), {
42
- selectedConfiguration: g,
43
- availableDocuments: s,
44
- selectedDocumentIndex: u
49
+ return b(r, c, { flush: "sync" }), {
50
+ selectedConfiguration: d,
51
+ availableDocuments: n,
52
+ selectedDocumentIndex: r
45
53
  };
46
54
  };
47
55
  export {
48
- U as useMultipleDocuments
56
+ T as useMultipleDocuments
49
57
  };
@@ -29,7 +29,7 @@ export type SorterOption = {
29
29
  * it uses the lazyBus to ensure the section is open before scrolling to it
30
30
  *
31
31
  */
32
- export declare const scrollToOperation: (operationId: string) => void;
32
+ export declare const scrollToOperation: (operationId: string, focus?: boolean) => void;
33
33
  /**
34
34
  * Provides the sidebar state and methods to control it.
35
35
  */
@@ -46,7 +46,7 @@ export declare function useSidebar(options?: ParsedSpecOption & SorterOption): {
46
46
  hideModels: import("vue").Ref<boolean, boolean>;
47
47
  setParsedSpec: typeof setParsedSpec;
48
48
  defaultOpenAllTags: import("vue").Ref<boolean, boolean>;
49
- scrollToOperation: (operationId: string) => void;
49
+ scrollToOperation: (operationId: string, focus?: boolean) => void;
50
50
  };
51
51
  export {};
52
52
  //# sourceMappingURL=useSidebar.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useSidebar.d.ts","sourceRoot":"","sources":["../../src/hooks/useSidebar.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAA;AAa3E,MAAM,MAAM,YAAY,GAAG;IACzB,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,EAAE,YAAY,EAAE,CAAA;IACzB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAA;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,IAAI,EAAE,OAAO,CAAA;IACb,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB,CAAA;AAcD,uDAAuD;AACvD,iBAAS,aAAa,CAAC,IAAI,EAAE,IAAI,QA0ChC;AAMD,KAAK,qBAAqB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;AAIpD,iBAAS,0BAA0B,CAAC,GAAG,EAAE,MAAM,QAE9C;AAED,iBAAS,uBAAuB,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,QAE3D;AAgOD,MAAM,MAAM,gBAAgB,GAAG;IAC7B,UAAU,EAAE,IAAI,CAAA;CACjB,CAAA;AAED,MAAM,MAAM,YAAY,GAAG;IACzB,UAAU,CAAC,EAAE,OAAO,GAAG,CAAC,CAAC,CAAC,E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IAAI,CAAA;CACjB,CAAA;AAED,MAAM,MAAM,YAAY,GAAG;IACzB,UAAU,CAAC,EAAE,OAAO,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,KAAK,MAAM,CAAC,CAAA;IACnD,gBAAgB,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,CAAC,CAAC,CAAC,EAAE,oBAAoB,EAAE,CAAC,EAAE,oBAAoB,KAAK,MAAM,CAAC,CAAA;CACvG,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,gBAAiB,MAAM,UAAU,OAAO,SAerE,CAAA;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,OAAO,CAAC,EAAE,gBAAgB,GAAG,YAAY;;;;;;;;;;;;;qCApBrB,MAAM,UAAU,OAAO;EA2ErE"}
@@ -9,75 +9,75 @@ import { getModels as P } from "../helpers/getModels.js";
9
9
  import { hasWebhooks as te } from "../helpers/hasWebhooks.js";
10
10
  import { scrollToId as R } from "../helpers/scrollToId.js";
11
11
  import { getHeadingsFromMarkdown as se } from "../helpers/getHeadingsFromMarkdown.js";
12
- const y = S(null), n = S(void 0), v = q({});
12
+ const y = S(null), u = S(void 0), v = q({});
13
13
  function _(t) {
14
- var p, a, l;
15
- v.tagsSorter === "alpha" ? t.tags = (p = t.tags) == null ? void 0 : p.sort((s, c) => s.name.localeCompare(c.name)) : typeof v.tagsSorter == "function" && (t.tags = (a = t.tags) == null ? void 0 : a.sort(v.tagsSorter));
16
- const o = (s, c) => {
17
- const x = s.name ?? s.path, g = c.name ?? c.path;
14
+ var p, r, i;
15
+ v.tagsSorter === "alpha" ? t.tags = (p = t.tags) == null ? void 0 : p.sort((s, d) => s.name.localeCompare(d.name)) : typeof v.tagsSorter == "function" && (t.tags = (r = t.tags) == null ? void 0 : r.sort(v.tagsSorter));
16
+ const a = (s, d) => {
17
+ const x = s.name ?? s.path, g = d.name ?? d.path;
18
18
  return x.localeCompare(g);
19
- }, u = (s, c) => s.httpVerb.localeCompare(c.httpVerb);
20
- let d;
21
- return v.operationsSorter === "alpha" ? d = o : v.operationsSorter === "method" ? d = u : typeof v.operationsSorter == "function" && (d = v.operationsSorter), d && ((l = t.tags) == null || l.forEach((s) => {
22
- var c;
23
- s.operations = (c = s.operations) == null ? void 0 : c.sort(d);
24
- })), n.value = t;
19
+ }, l = (s, d) => s.httpVerb.localeCompare(d.httpVerb);
20
+ let c;
21
+ return v.operationsSorter === "alpha" ? c = a : v.operationsSorter === "method" ? c = l : typeof v.operationsSorter == "function" && (c = v.operationsSorter), c && ((i = t.tags) == null || i.forEach((s) => {
22
+ var d;
23
+ s.operations = (d = s.operations) == null ? void 0 : d.sort(c);
24
+ })), u.value = t;
25
25
  }
26
26
  const N = S(!1), Q = S(!1), T = q(Y["useSidebarContent-collapsedSidebarItems"] ?? {});
27
27
  function re(t) {
28
28
  T[t] = !T[t];
29
29
  }
30
- function w(t, o) {
31
- T[t] = o;
30
+ function w(t, a) {
31
+ T[t] = a;
32
32
  }
33
33
  const k = S([]);
34
34
  function oe(t) {
35
- const o = se(t), u = K(o);
36
- return o.filter((d) => (
35
+ const a = se(t), l = K(a);
36
+ return a.filter((c) => (
37
37
  // highest level, eg. # Introduction
38
- d.depth === u || // second highest level, eg. ## Authentication
39
- d.depth === u + 1
38
+ c.depth === l || // second highest level, eg. ## Authentication
39
+ c.depth === l + 1
40
40
  ));
41
41
  }
42
42
  const U = J(() => {
43
43
  var C, H, B, E, j, V, D, G, L, W;
44
44
  if (!y.value) return { entries: [], titles: {} };
45
- const { getHeadingId: t, getModelId: o, getOperationId: u, getTagId: d, getWebhookId: p } = y.value, a = {}, l = [];
45
+ const { getHeadingId: t, getModelId: a, getOperationId: l, getTagId: c, getWebhookId: p } = y.value, r = {}, i = [];
46
46
  let s = null;
47
47
  k.value.forEach((e) => {
48
- var r;
48
+ var o;
49
49
  e.depth === K(k.value) ? (s = {
50
50
  id: t(e),
51
51
  title: e.value,
52
52
  show: !0,
53
53
  children: []
54
- }, l.push(s)) : s && ((r = s.children) == null || r.push({
54
+ }, i.push(s)) : s && ((o = s.children) == null || o.push({
55
55
  id: t(e),
56
56
  title: e.value,
57
57
  show: !0
58
58
  }));
59
59
  });
60
- const c = (H = (C = n.value) == null ? void 0 : C.tags) == null ? void 0 : H[0], g = c && ((e) => (e == null ? void 0 : e.length) !== 1 || e[0].name !== "default" || e[0].description !== "")((B = n.value) == null ? void 0 : B.tags) ? (j = (E = n.value) == null ? void 0 : E.tags) == null ? void 0 : j.filter((e) => {
61
- var r;
62
- return ((r = e.operations) == null ? void 0 : r.length) > 0;
60
+ const d = (H = (C = u.value) == null ? void 0 : C.tags) == null ? void 0 : H[0], g = d && ((e) => (e == null ? void 0 : e.length) !== 1 || e[0].name !== "default" || e[0].description !== "")((B = u.value) == null ? void 0 : B.tags) ? (j = (E = u.value) == null ? void 0 : E.tags) == null ? void 0 : j.filter((e) => {
61
+ var o;
62
+ return ((o = e.operations) == null ? void 0 : o.length) > 0;
63
63
  }).map((e) => {
64
- var r;
64
+ var o;
65
65
  return {
66
- id: d(e),
66
+ id: c(e),
67
67
  title: e.name,
68
68
  displayTitle: e["x-displayName"] ?? e.name,
69
69
  show: !0,
70
- children: (r = e.operations) == null ? void 0 : r.map((i) => {
70
+ children: (o = e.operations) == null ? void 0 : o.map((n) => {
71
71
  var m, b;
72
- const h = u(i, e), f = i.name ?? i.path;
73
- return a[h] = f, {
72
+ const h = l(n, e), f = n.name ?? n.path;
73
+ return r[h] = f, {
74
74
  id: h,
75
75
  title: f,
76
- httpVerb: i.httpVerb,
76
+ httpVerb: n.httpVerb,
77
77
  // TODO: Workaround until we’re using the store directly
78
- deprecated: i.information ? F({
79
- deprecated: (m = i.information) == null ? void 0 : m.deprecated,
80
- "x-scalar-stability": (b = i.information) == null ? void 0 : b["x-scalar-stability"]
78
+ deprecated: n.information ? F({
79
+ deprecated: (m = n.information) == null ? void 0 : m.deprecated,
80
+ "x-scalar-stability": (b = n.information) == null ? void 0 : b["x-scalar-stability"]
81
81
  }) : !1,
82
82
  show: !0,
83
83
  select: () => {
@@ -85,12 +85,12 @@ const U = J(() => {
85
85
  };
86
86
  })
87
87
  };
88
- }) : (V = c == null ? void 0 : c.operations) == null ? void 0 : V.map((e) => {
88
+ }) : (V = d == null ? void 0 : d.operations) == null ? void 0 : V.map((e) => {
89
89
  var h, f;
90
- const r = u(e, c), i = e.name ?? e.path;
91
- return a[r] = i, {
92
- id: r,
93
- title: i,
90
+ const o = l(e, d), n = e.name ?? e.path;
91
+ return r[o] = n, {
92
+ id: o,
93
+ title: n,
94
94
  httpVerb: e.httpVerb,
95
95
  // TODO: Workaround until we’re using the store directly
96
96
  deprecated: e.information ? F({
@@ -102,35 +102,35 @@ const U = J(() => {
102
102
  }
103
103
  };
104
104
  });
105
- let I = ee(n.value) && !N.value ? [
105
+ let I = ee(u.value) && !N.value ? [
106
106
  {
107
- id: o(),
107
+ id: a(),
108
108
  title: "Models",
109
109
  show: !0,
110
- children: Object.keys(P(n.value) ?? {}).map((e) => {
111
- var i;
112
- const r = o({ name: e });
113
- return a[r] = e, {
114
- id: r,
115
- title: ((i = P(n.value)) == null ? void 0 : i[e]).title ?? e,
110
+ children: Object.keys(P(u.value) ?? {}).map((e) => {
111
+ var n;
112
+ const o = a({ name: e });
113
+ return r[o] = e, {
114
+ id: o,
115
+ title: ((n = P(u.value)) == null ? void 0 : n[e]).title ?? e,
116
116
  show: !0
117
117
  };
118
118
  })
119
119
  }
120
- ] : [], O = te(n.value) ? [
120
+ ] : [], O = te(u.value) ? [
121
121
  {
122
122
  id: p(),
123
123
  title: "Webhooks",
124
124
  show: !0,
125
- children: Object.keys(((D = n.value) == null ? void 0 : D.webhooks) ?? {}).flatMap((e) => {
126
- var i, h;
127
- const r = p({ name: e });
128
- return a[r] = e, Object.keys(((h = (i = n.value) == null ? void 0 : i.webhooks) == null ? void 0 : h[e]) ?? {}).map(
125
+ children: Object.keys(((D = u.value) == null ? void 0 : D.webhooks) ?? {}).flatMap((e) => {
126
+ var n, h;
127
+ const o = p({ name: e });
128
+ return r[o] = e, Object.keys(((h = (n = u.value) == null ? void 0 : n.webhooks) == null ? void 0 : h[e]) ?? {}).map(
129
129
  (f) => {
130
130
  var m, b, A;
131
131
  return {
132
132
  id: p({ name: e, method: f }),
133
- title: (A = (b = (m = n.value) == null ? void 0 : m.webhooks) == null ? void 0 : b[e][f]) == null ? void 0 : A.name,
133
+ title: (A = (b = (m = u.value) == null ? void 0 : m.webhooks) == null ? void 0 : b[e][f]) == null ? void 0 : A.name,
134
134
  httpVerb: f,
135
135
  show: !0
136
136
  };
@@ -139,27 +139,27 @@ const U = J(() => {
139
139
  })
140
140
  }
141
141
  ] : [];
142
- const X = (G = n.value) != null && G["x-tagGroups"] ? (W = (L = n.value) == null ? void 0 : L["x-tagGroups"]) == null ? void 0 : W.map((e) => {
142
+ const X = (G = u.value) != null && G["x-tagGroups"] ? (W = (L = u.value) == null ? void 0 : L["x-tagGroups"]) == null ? void 0 : W.map((e) => {
143
143
  var h;
144
- const r = [];
144
+ const o = [];
145
145
  return (h = e.tags) == null || h.map((f) => {
146
146
  if (f === "models" && I.length > 0)
147
- r.push(I[0]), I = [];
147
+ o.push(I[0]), I = [];
148
148
  else if (f === "webhooks" && O.length > 0)
149
- r.push(O[0]), O = [];
149
+ o.push(O[0]), O = [];
150
150
  else {
151
151
  const m = g == null ? void 0 : g.find((b) => b.title === f);
152
- m && r.push(m);
152
+ m && o.push(m);
153
153
  }
154
154
  }), {
155
155
  id: e.name,
156
156
  title: e.name,
157
- children: r,
157
+ children: o,
158
158
  show: !0,
159
159
  isGroup: !0
160
160
  };
161
161
  }) : void 0, M = [
162
- ...l,
162
+ ...i,
163
163
  ...X ?? g ?? [],
164
164
  ...O,
165
165
  ...I
@@ -168,53 +168,53 @@ const U = J(() => {
168
168
  w(e.id, !0), e.show = !0;
169
169
  }), {
170
170
  entries: M,
171
- titles: a
171
+ titles: r
172
172
  };
173
173
  }), ae = S(!1), le = J(() => {
174
- var t, o, u;
175
- return ((u = (t = U.value) == null ? void 0 : t.titles) == null ? void 0 : u[((o = y.value) == null ? void 0 : o.hash) ?? ""]) ?? "";
176
- }), ie = (t) => {
177
- var u;
178
- const o = (u = y.value) == null ? void 0 : u.getSectionId(t);
179
- if (o && o !== t)
180
- if (T[o])
181
- R(t);
174
+ var t, a, l;
175
+ return ((l = (t = U.value) == null ? void 0 : t.titles) == null ? void 0 : l[((a = y.value) == null ? void 0 : a.hash) ?? ""]) ?? "";
176
+ }), ie = (t, a) => {
177
+ var c;
178
+ const l = (c = y.value) == null ? void 0 : c.getSectionId(t);
179
+ if (l && l !== t)
180
+ if (T[l])
181
+ R(t, a);
182
182
  else {
183
- const d = Z.on((p) => {
184
- p.id === t && (R(t), d());
183
+ const p = Z.on((r) => {
184
+ r.id === t && (R(t, a), p());
185
185
  });
186
- w(o, !0);
186
+ w(l, !0);
187
187
  }
188
188
  };
189
189
  function Se(t) {
190
190
  Object.assign(v, t);
191
- const o = $();
192
- y.value = o;
193
- const { hash: u, getSectionId: d, getTagId: p } = o;
191
+ const a = $();
192
+ y.value = a;
193
+ const { hash: l, getSectionId: c, getTagId: p } = a;
194
194
  return t != null && t.parsedSpec && (_(t.parsedSpec), z(
195
195
  () => {
196
- var a, l;
197
- return (l = (a = n.value) == null ? void 0 : a.tags) == null ? void 0 : l.length;
196
+ var r, i;
197
+ return (i = (r = u.value) == null ? void 0 : r.tags) == null ? void 0 : i.length;
198
198
  },
199
199
  () => {
200
- var a, l;
201
- if (u.value) {
202
- const s = d(u.value);
200
+ var r, i;
201
+ if (l.value) {
202
+ const s = c(l.value);
203
203
  s && w(s, !0);
204
204
  } else {
205
- const s = (l = (a = n.value) == null ? void 0 : a.tags) == null ? void 0 : l[0];
205
+ const s = (i = (r = u.value) == null ? void 0 : r.tags) == null ? void 0 : i[0];
206
206
  s && w(p(s), !0);
207
207
  }
208
208
  }
209
209
  ), z(
210
210
  () => {
211
- var a, l;
212
- return (l = (a = n.value) == null ? void 0 : a.info) == null ? void 0 : l.description;
211
+ var r, i;
212
+ return (i = (r = u.value) == null ? void 0 : r.info) == null ? void 0 : i.description;
213
213
  },
214
214
  () => {
215
- var l, s;
216
- const a = (s = (l = n.value) == null ? void 0 : l.info) == null ? void 0 : s.description;
217
- return a ? k.value = oe(a) : k.value = [];
215
+ var i, s;
216
+ const r = (s = (i = u.value) == null ? void 0 : i.info) == null ? void 0 : s.description;
217
+ return r ? k.value = oe(r) : k.value = [];
218
218
  },
219
219
  {
220
220
  immediate: !0
package/dist/index.d.ts CHANGED
@@ -4,7 +4,7 @@ export { default as ModernLayout } from './components/Layouts/ModernLayout.vue.j
4
4
  export { SearchButton, SearchModal } from './features/Search';
5
5
  export { default as GettingStarted } from './components/GettingStarted.vue.js';
6
6
  export { useReactiveSpec } from './hooks/useReactiveSpec.js';
7
- export { createApiReference } from './standalone/lib/html-api.js';
7
+ export { type ApiReferenceInstance, createApiReference } from './standalone/lib/html-api.js';
8
8
  export { Sidebar } from './components/Sidebar';
9
9
  export { Card, CardHeader, CardContent, CardFooter, CardTabHeader, CardTab } from './components/Card';
10
10
  export { Layouts } from './components/Layouts';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,+BAA+B,CAAA;AACvE,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,qCAAqC,CAAA;AACnF,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,uCAAuC,CAAA;AAC/E,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAC7D,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,iCAAiC,CAAA;AAE3E,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAA;AACzD,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAA;AAE9D,O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