@scalar/api-reference 1.24.46 → 1.24.49

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 (35) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/dist/browser/standalone.js +9227 -9250
  3. package/dist/browser/webpack-stats.json +1 -1
  4. package/dist/components/ApiReference.vue.d.ts.map +1 -1
  5. package/dist/components/ApiReference.vue.js +29 -29
  6. package/dist/components/ApiReferenceLayout.vue.d.ts.map +1 -1
  7. package/dist/components/ApiReferenceLayout.vue.js +2 -2
  8. package/dist/components/ApiReferenceLayout.vue2.js +24 -21
  9. package/dist/components/Content/Operation/OperationAccordion.vue.d.ts.map +1 -1
  10. package/dist/components/Content/Operation/OperationAccordion.vue.js +2 -2
  11. package/dist/components/Content/Operation/TestRequestButton.vue.d.ts.map +1 -1
  12. package/dist/components/Content/Operation/TestRequestButton.vue.js +2 -2
  13. package/dist/components/Content/Operation/TestRequestButton.vue2.js +9 -9
  14. package/dist/components/SearchButton.vue.d.ts.map +1 -1
  15. package/dist/components/SearchButton.vue.js +2 -2
  16. package/dist/components/SearchButton.vue2.js +10 -9
  17. package/dist/components/SearchModal.vue.js +2 -2
  18. package/dist/components/SearchModal.vue2.js +36 -36
  19. package/dist/components/Sidebar/Sidebar.vue.d.ts +3 -2
  20. package/dist/components/Sidebar/Sidebar.vue.d.ts.map +1 -1
  21. package/dist/components/Sidebar/Sidebar.vue.js +2 -2
  22. package/dist/components/Sidebar/Sidebar.vue2.js +29 -27
  23. package/dist/helpers/getModels.d.ts.map +1 -1
  24. package/dist/helpers/getModels.js +13 -7
  25. package/dist/hooks/useSidebar.d.ts +9 -4
  26. package/dist/hooks/useSidebar.d.ts.map +1 -1
  27. package/dist/hooks/useSidebar.js +123 -122
  28. package/dist/index.js +1 -1
  29. package/dist/stores/useHttpClientStore.d.ts +12 -0
  30. package/dist/stores/useHttpClientStore.d.ts.map +1 -1
  31. package/dist/stores/useHttpClientStore.js +63 -54
  32. package/dist/style.css +1 -1
  33. package/dist/types.d.ts +8 -0
  34. package/dist/types.d.ts.map +1 -1
  35. package/package.json +7 -7
@@ -1,5 +1,5 @@
1
- import { defineComponent as ee, toRef as te, ref as m, computed as q, watch as U, openBlock as E, createBlock as j, unref as S, withCtx as c, createElementVNode as w, createVNode as V, createTextVNode as g, toDisplayString as b, createElementBlock as oe, Fragment as ae, renderList as le, createSlots as re, pushScopeId as se, popScopeId as ne } from "vue";
2
- import { ScalarModal as ce, ScalarSearchInput as ie, ScalarSearchResultList as de, ScalarSearchResultItem as ue } from "@scalar/components";
1
+ import { defineComponent as ee, toRef as te, ref as m, computed as q, watch as U, openBlock as E, createBlock as H, unref as S, withCtx as n, createElementVNode as w, createVNode as V, createTextVNode as g, toDisplayString as b, createElementBlock as oe, Fragment as ae, renderList as le, createSlots as re, pushScopeId as se, popScopeId as ce } from "vue";
2
+ import { ScalarModal as ne, ScalarSearchInput as ie, ScalarSearchResultList as de, ScalarSearchResultItem as ue } from "@scalar/components";
3
3
  import { useMagicKeys as pe, whenever as _ } from "@vueuse/core";
4
4
  import he from "fuse.js";
5
5
  import { extractRequestBody as me } from "../helpers/specHelpers.js";
@@ -9,19 +9,19 @@ import { getHeadingsFromMarkdown as Se } from "../helpers/getHeadingsFromMarkdow
9
9
  import { useOperation as ge } from "../hooks/useOperation.js";
10
10
  import { getModels as be } from "../helpers/getModels.js";
11
11
  import { useNavState as we } from "../hooks/useNavState.js";
12
- const ke = (d) => (se("data-v-0250b3fc"), d = d(), ne(), d), ye = /* @__PURE__ */ ke(() => /* @__PURE__ */ w("div", { class: "ref-search-meta" }, [
12
+ const ke = (d) => (se("data-v-241cc7e9"), d = d(), ce(), d), ye = /* @__PURE__ */ ke(() => /* @__PURE__ */ w("div", { class: "ref-search-meta" }, [
13
13
  /* @__PURE__ */ w("span", null, "↑↓ Navigate"),
14
14
  /* @__PURE__ */ w("span", null, "⏎ Select")
15
- ], -1)), xe = /* @__PURE__ */ ee({
15
+ ], -1)), Ne = /* @__PURE__ */ ee({
16
16
  __name: "SearchModal",
17
17
  props: {
18
18
  parsedSpec: {},
19
19
  modalState: {}
20
20
  },
21
21
  setup(d) {
22
- const l = d, H = te(l, "parsedSpec"), A = {
22
+ const l = d, j = te(l, "parsedSpec"), A = {
23
23
  heading: "DocsPage",
24
- model: "JsonObject",
24
+ model: "Brackets",
25
25
  req: "Terminal",
26
26
  tag: "CodeFolder",
27
27
  webhook: "Terminal"
@@ -31,26 +31,26 @@ const ke = (d) => (se("data-v-0250b3fc"), d = d(), ne(), d), ye = /* @__PURE__ *
31
31
  s.value = 0, y.value = I.search(i.value);
32
32
  }, f = q(
33
33
  () => u.value[s.value]
34
- ), { getHeadingId: P, getWebhookId: J, getModelId: K, getOperationId: Y, getTagId: z } = we();
34
+ ), { getHeadingId: P, getWebhookId: K, getModelId: Y, getOperationId: z, getTagId: G } = we();
35
35
  U(
36
36
  () => l.modalState.open,
37
37
  (o) => {
38
38
  o && (i.value = "", s.value = 0, y.value = []);
39
39
  }
40
40
  );
41
- const { setCollapsedSidebarItem: G, hideModels: Q } = ve();
41
+ const { setCollapsedSidebarItem: J, hideModels: Q } = ve();
42
42
  U(
43
- H.value,
43
+ j.value,
44
44
  async () => {
45
- var M, $, F, N, x;
46
- if (r.value = [], !(($ = (M = l.parsedSpec) == null ? void 0 : M.tags) != null && $.length) && !((F = l.parsedSpec) != null && F.webhooks)) {
45
+ var M, $, B, F, N;
46
+ if (r.value = [], !(($ = (M = l.parsedSpec) == null ? void 0 : M.tags) != null && $.length) && !((B = l.parsedSpec) != null && B.webhooks)) {
47
47
  I.setCollection([]);
48
48
  return;
49
49
  }
50
- const o = [], n = Se(
51
- ((N = l.parsedSpec.info) == null ? void 0 : N.description) ?? ""
50
+ const o = [], c = Se(
51
+ ((F = l.parsedSpec.info) == null ? void 0 : F.description) ?? ""
52
52
  );
53
- n.length && (n.forEach((t) => {
53
+ c.length && (c.forEach((t) => {
54
54
  o.push({
55
55
  type: "heading",
56
56
  title: `Info > ${t.value}`,
@@ -59,23 +59,23 @@ const ke = (d) => (se("data-v-0250b3fc"), d = d(), ne(), d), ye = /* @__PURE__ *
59
59
  tag: t.slug,
60
60
  body: ""
61
61
  });
62
- }), r.value = r.value.concat(o)), (x = l.parsedSpec.tags) == null || x.forEach((t) => {
63
- const B = {
62
+ }), r.value = r.value.concat(o)), (N = l.parsedSpec.tags) == null || N.forEach((t) => {
63
+ const x = {
64
64
  title: t["x-displayName"] ?? t.name,
65
- href: `#${z(t)}`,
65
+ href: `#${G(t)}`,
66
66
  description: t.description,
67
67
  type: "tag",
68
68
  tag: t.name,
69
69
  body: ""
70
70
  };
71
- r.value.push(B), t.operations && t.operations.forEach((a) => {
71
+ r.value.push(x), t.operations && t.operations.forEach((a) => {
72
72
  const { parameterMap: v } = ge({ operation: a }), O = me(a) || v.value;
73
73
  let R = null;
74
74
  typeof O != "boolean" && (R = O);
75
75
  const T = {
76
76
  type: "req",
77
77
  title: a.name ?? a.path,
78
- href: `#${Y(a, t)}`,
78
+ href: `#${z(a, t)}`,
79
79
  operationId: a.operationId,
80
80
  description: a.description ?? "",
81
81
  httpVerb: a.httpVerb,
@@ -95,7 +95,7 @@ const ke = (d) => (se("data-v-0250b3fc"), d = d(), ne(), d), ye = /* @__PURE__ *
95
95
  p.push({
96
96
  type: "webhook",
97
97
  title: `Webhook: ${(v = e[t][a]) == null ? void 0 : v.name}`,
98
- href: `#${J(t, a)}`,
98
+ href: `#${K(t, a)}`,
99
99
  description: t,
100
100
  httpVerb: a,
101
101
  tag: t,
@@ -108,7 +108,7 @@ const ke = (d) => (se("data-v-0250b3fc"), d = d(), ne(), d), ye = /* @__PURE__ *
108
108
  D.push({
109
109
  type: "model",
110
110
  title: "Model",
111
- href: `#${K(t)}`,
111
+ href: `#${Y(t)}`,
112
112
  description: h[t].title ?? t,
113
113
  tag: t,
114
114
  body: ""
@@ -136,19 +136,19 @@ const ke = (d) => (se("data-v-0250b3fc"), d = d(), ne(), d), ye = /* @__PURE__ *
136
136
  item: o
137
137
  })) : y.value
138
138
  ), X = /#(tag\/[^/]*)/, C = (o) => {
139
- let n = "models";
139
+ let c = "models";
140
140
  const e = o.item.href.match(X);
141
- e != null && e.length && e.length > 1 && (n = e[1]), G(n, !0), l.modalState.hide();
141
+ e != null && e.length && e.length > 1 && (c = e[1]), J(c, !0), l.modalState.hide();
142
142
  };
143
143
  function Z(o) {
144
- const n = new URL(window.location.href);
145
- return n.hash = o, n.toString();
144
+ const c = new URL(window.location.href);
145
+ return c.hash = o, c.toString();
146
146
  }
147
- return (o, n) => (E(), j(S(ce), {
147
+ return (o, c) => (E(), H(S(ne), {
148
148
  state: o.modalState,
149
149
  variant: "search"
150
150
  }, {
151
- default: c(() => [
151
+ default: n(() => [
152
152
  w("div", {
153
153
  ref_key: "searchModalRef",
154
154
  ref: L,
@@ -156,7 +156,7 @@ const ke = (d) => (se("data-v-0250b3fc"), d = d(), ne(), d), ye = /* @__PURE__ *
156
156
  }, [
157
157
  V(S(ie), {
158
158
  modelValue: i.value,
159
- "onUpdate:modelValue": n[0] || (n[0] = (e) => i.value = e),
159
+ "onUpdate:modelValue": c[0] || (c[0] = (e) => i.value = e),
160
160
  onInput: W
161
161
  }, null, 8, ["modelValue"])
162
162
  ], 512),
@@ -164,11 +164,11 @@ const ke = (d) => (se("data-v-0250b3fc"), d = d(), ne(), d), ye = /* @__PURE__ *
164
164
  class: "ref-search-results custom-scroll",
165
165
  noResults: !u.value.length
166
166
  }, {
167
- query: c(() => [
167
+ query: n(() => [
168
168
  g(b(i.value), 1)
169
169
  ]),
170
- default: c(() => [
171
- (E(!0), oe(ae, null, le(u.value, (e, p) => (E(), j(S(ue), {
170
+ default: n(() => [
171
+ (E(!0), oe(ae, null, le(u.value, (e, p) => (E(), H(S(ue), {
172
172
  id: e.item.href,
173
173
  key: e.refIndex,
174
174
  active: s.value === p,
@@ -177,27 +177,27 @@ const ke = (d) => (se("data-v-0250b3fc"), d = d(), ne(), d), ye = /* @__PURE__ *
177
177
  onClick: (h) => C(e),
178
178
  onFocus: (h) => s.value = p
179
179
  }, re({
180
- default: c(() => [
180
+ default: n(() => [
181
181
  g(b(e.item.title) + " ", 1)
182
182
  ]),
183
183
  _: 2
184
184
  }, [
185
185
  (e.item.httpVerb || e.item.path) && e.item.path !== e.item.title ? {
186
186
  name: "description",
187
- fn: c(() => [
187
+ fn: n(() => [
188
188
  g(b(e.item.path), 1)
189
189
  ]),
190
190
  key: "0"
191
191
  } : e.item.description ? {
192
192
  name: "description",
193
- fn: c(() => [
193
+ fn: n(() => [
194
194
  g(b(e.item.description), 1)
195
195
  ]),
196
196
  key: "1"
197
197
  } : void 0,
198
198
  e.item.type === "req" ? {
199
199
  name: "addon",
200
- fn: c(() => [
200
+ fn: n(() => [
201
201
  V(fe, {
202
202
  method: e.item.httpVerb ?? "get"
203
203
  }, null, 8, ["method"])
@@ -215,5 +215,5 @@ const ke = (d) => (se("data-v-0250b3fc"), d = d(), ne(), d), ye = /* @__PURE__ *
215
215
  }
216
216
  });
217
217
  export {
218
- xe as default
218
+ Ne as default
219
219
  };
@@ -1,13 +1,14 @@
1
1
  import type { Spec } from '@scalar/oas-utils';
2
+ import { type TagsSorterOption } from '../../hooks';
2
3
  declare function __VLS_template(): {
3
4
  "sidebar-start"?(_: {}): any;
4
5
  "sidebar-end"?(_: {}): any;
5
6
  };
6
7
  declare const __VLS_component: import("vue").DefineComponent<__VLS_TypePropsToOption<{
7
8
  parsedSpec: Spec;
8
- }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<{
9
+ } & TagsSorterOption>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<{
9
10
  parsedSpec: Spec;
10
- }>>>, {}, {}>;
11
+ } & TagsSorterOption>>>, {}, {}>;
11
12
  declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
12
13
  export default _default;
13
14
  type __VLS_WithTemplateSlots<T, S> = T & {
@@ -1 +1 @@
1
- {"version":3,"file":"Sidebar.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Sidebar/Sidebar.vue"],"names":[],"mappings":"AA6NA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAA;AAwE7C,iBAAS,cAAc;6BA4Oc,GAAG;2BACJ,GAAG;EAuBtC;AACD,QAAA,MAAM,eAAe;gBAlUP,IAAI;;gBAAJ,IAAI;aAwUhB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAAvG,wBAAwG;AAOxG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACpC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC;AAEN,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AAC5D,KAAK,uBAAuB,CAAC,CAAC,IAAI;KAChC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GACpC;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAC9D;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CACzD,CAAC"}
1
+ {"version":3,"file":"Sidebar.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Sidebar/Sidebar.vue"],"names":[],"mappings":"AAgOA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAA;AAI7C,OAAO,EAAE,KAAK,gBAAgB,EAA2B,MAAM,aAAa,CAAA;AAuE5E,iBAAS,cAAc;6BA4Oc,GAAG;2BACJ,GAAG;EAuBtC;AACD,QAAA,MAAM,eAAe;gBArUL,IAAI;;gBAAJ,IAAI;gCA2UlB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAAvG,wBAAwG;AAOxG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACpC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC;AAEN,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AAC5D,KAAK,uBAAuB,CAAC,CAAC,IAAI;KAChC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GACpC;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAC9D;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CACzD,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import o from "./Sidebar.vue2.js";
2
2
  /* empty css */
3
3
  import r from "../../_virtual/_plugin-vue_export-helper.js";
4
- const m = /* @__PURE__ */ r(o, [["__scopeId", "data-v-b727cdda"]]);
4
+ const p = /* @__PURE__ */ r(o, [["__scopeId", "data-v-14598096"]]);
5
5
  export {
6
- m as default
6
+ p as default
7
7
  };
@@ -1,18 +1,20 @@
1
- import { defineComponent as B, ref as E, watch as N, onMounted as I, openBlock as l, createElementBlock as a, renderSlot as g, createElementVNode as V, createVNode as F, withCtx as u, Fragment as d, renderList as h, unref as i, toDisplayString as L, createBlock as f, createCommentVNode as b } from "vue";
1
+ import { defineComponent as B, ref as E, watch as N, onMounted as F, openBlock as l, createElementBlock as a, renderSlot as V, createElementVNode as w, createVNode as I, withCtx as f, Fragment as d, renderList as h, unref as i, toDisplayString as L, createBlock as u, createCommentVNode as b } from "vue";
2
2
  import v from "./SidebarElement.vue.js";
3
3
  import m from "./SidebarGroup.vue.js";
4
4
  import { useSidebar as G } from "../../hooks/useSidebar.js";
5
- import { sleep as w } from "../../helpers/sleep.js";
5
+ import { sleep as C } from "../../helpers/sleep.js";
6
6
  import { useNavState as x } from "../../hooks/useNavState.js";
7
7
  const D = { class: "sidebar" }, H = { class: "sidebar-group-title" }, M = -160, P = /* @__PURE__ */ B({
8
8
  __name: "Sidebar",
9
9
  props: {
10
- parsedSpec: {}
10
+ parsedSpec: {},
11
+ tagsSorter: { type: [String, Function] }
11
12
  },
12
- setup(C) {
13
- const A = C, { hash: o, isIntersectionEnabled: $ } = x(), { items: O, toggleCollapsedSidebarItem: S, collapsedSidebarItems: T } = G(
13
+ setup(A) {
14
+ const S = A, { hash: o, isIntersectionEnabled: $ } = x(), { items: O, toggleCollapsedSidebarItem: T, collapsedSidebarItems: g } = G(
14
15
  {
15
- parsedSpec: A.parsedSpec
16
+ parsedSpec: S.parsedSpec,
17
+ tagsSorter: S.tagsSorter
16
18
  }
17
19
  ), y = E(null), c = E(!0);
18
20
  N(o, (p) => {
@@ -25,23 +27,23 @@ const D = { class: "sidebar" }, H = { class: "sidebar-group-title" }, M = -160,
25
27
  let e = M;
26
28
  n.getAttribute("data-sidebar-type") === "heading" ? e += n.offsetTop + ((t = n.getElementsByClassName("sidebar-heading")) == null ? void 0 : t[0]).offsetHeight : e += n.offsetTop + (((r = n.parentElement) == null ? void 0 : r.offsetTop) ?? 0) + (((_ = (s = n.parentElement) == null ? void 0 : s.parentElement) == null ? void 0 : _.offsetTop) ?? 0), y.value.scrollTo({ top: e, behavior: "smooth" });
27
29
  };
28
- return I(() => {
30
+ return F(() => {
29
31
  setTimeout(() => k(o.value), 500), c.value = !1;
30
32
  }), (p, n) => (l(), a("div", D, [
31
- g(p.$slots, "sidebar-start", {}, void 0, !0),
32
- V("div", {
33
+ V(p.$slots, "sidebar-start", {}, void 0, !0),
34
+ w("div", {
33
35
  ref_key: "scrollerEl",
34
36
  ref: y,
35
37
  class: "sidebar-pages custom-scroll custom-scroll-self-contain-overflow"
36
38
  }, [
37
- F(m, { level: 0 }, {
38
- default: u(() => [
39
+ I(m, { level: 0 }, {
40
+ default: f(() => [
39
41
  (l(!0), a(d, null, h(i(O).entries, (e) => (l(), a(d, {
40
42
  key: e.id
41
43
  }, [
42
44
  e.isGroup ? (l(), a(d, { key: 0 }, [
43
- V("li", H, L(e.displayTitle ?? e.title), 1),
44
- (l(!0), a(d, null, h(e.children, (t) => (l(), f(v, {
45
+ w("li", H, L(e.displayTitle ?? e.title), 1),
46
+ (l(!0), a(d, null, h(e.children, (t) => (l(), u(v, {
45
47
  key: t.id,
46
48
  id: `sidebar-${t.id}`,
47
49
  "data-sidebar-type": "heading",
@@ -54,23 +56,23 @@ const D = { class: "sidebar" }, H = { class: "sidebar-group-title" }, M = -160,
54
56
  httpVerb: t.httpVerb,
55
57
  deprecated: t.deprecated ?? !1
56
58
  },
57
- open: i(T)[t.id] ?? !1,
59
+ open: i(g)[t.id] ?? !1,
58
60
  onToggleOpen: async () => {
59
- c.value = !0, i(S)(t.id), await i(w)(100), c.value = !1;
61
+ c.value = !0, i(T)(t.id), await i(C)(100), c.value = !1;
60
62
  }
61
63
  }, {
62
- default: u(() => {
64
+ default: f(() => {
63
65
  var r;
64
66
  return [
65
- t.children && ((r = t.children) == null ? void 0 : r.length) > 0 ? (l(), f(m, {
67
+ t.children && ((r = t.children) == null ? void 0 : r.length) > 0 ? (l(), u(m, {
66
68
  key: 0,
67
69
  level: 1
68
70
  }, {
69
- default: u(() => [
71
+ default: f(() => [
70
72
  (l(!0), a(d, null, h(t.children, (s) => (l(), a(d, {
71
73
  key: s.id
72
74
  }, [
73
- e.show ? (l(), f(v, {
75
+ e.show ? (l(), u(v, {
74
76
  key: 0,
75
77
  id: `sidebar-${s.id}`,
76
78
  isActive: i(o) === s.id,
@@ -91,7 +93,7 @@ const D = { class: "sidebar" }, H = { class: "sidebar-group-title" }, M = -160,
91
93
  _: 2
92
94
  }, 1032, ["id", "hasChildren", "isActive", "item", "open", "onToggleOpen"]))), 128))
93
95
  ], 64)) : (l(), a(d, { key: 1 }, [
94
- e.show ? (l(), f(v, {
96
+ e.show ? (l(), u(v, {
95
97
  key: 0,
96
98
  id: `sidebar-${e.id}`,
97
99
  "data-sidebar-type": "heading",
@@ -104,23 +106,23 @@ const D = { class: "sidebar" }, H = { class: "sidebar-group-title" }, M = -160,
104
106
  httpVerb: e.httpVerb,
105
107
  deprecated: e.deprecated ?? !1
106
108
  },
107
- open: i(T)[e.id] ?? !1,
109
+ open: i(g)[e.id] ?? !1,
108
110
  onToggleOpen: async () => {
109
- c.value = !0, i(S)(e.id), await i(w)(100), c.value = !1;
111
+ c.value = !0, i(T)(e.id), await i(C)(100), c.value = !1;
110
112
  }
111
113
  }, {
112
- default: u(() => {
114
+ default: f(() => {
113
115
  var t;
114
116
  return [
115
- e.children && ((t = e.children) == null ? void 0 : t.length) > 0 ? (l(), f(m, {
117
+ e.children && ((t = e.children) == null ? void 0 : t.length) > 0 ? (l(), u(m, {
116
118
  key: 0,
117
119
  level: 1
118
120
  }, {
119
- default: u(() => [
121
+ default: f(() => [
120
122
  (l(!0), a(d, null, h(e.children, (r) => (l(), a(d, {
121
123
  key: r.id
122
124
  }, [
123
- e.show ? (l(), f(v, {
125
+ e.show ? (l(), u(v, {
124
126
  key: 0,
125
127
  id: `sidebar-${r.id}`,
126
128
  isActive: i(o) === r.id,
@@ -146,7 +148,7 @@ const D = { class: "sidebar" }, H = { class: "sidebar-group-title" }, M = -160,
146
148
  _: 1
147
149
  })
148
150
  ], 512),
149
- g(p.$slots, "sidebar-end", {}, void 0, !0)
151
+ V(p.$slots, "sidebar-end", {}, void 0, !0)
150
152
  ]));
151
153
  }
152
154
  });
@@ -1 +1 @@
1
- {"version":3,"file":"getModels.d.ts","sourceRoot":"","sources":["../../src/helpers/getModels.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAA;AAC7C,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AAE/E;;GAEG;AACH,wBAAgB,SAAS,CAAC,IAAI,CAAC,EAAE,IAAI,mHAoBpC"}
1
+ {"version":3,"file":"getModels.d.ts","sourceRoot":"","sources":["../../src/helpers/getModels.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAA;AAC7C,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AAE/E;;GAEG;AACH,wBAAgB,SAAS,CAAC,IAAI,CAAC,EAAE,IAAI,mHA6BpC"}
@@ -1,16 +1,22 @@
1
- function i(n) {
2
- var t, o;
3
- return n ? (
1
+ function l(t) {
2
+ var o, i;
3
+ if (!t)
4
+ return {};
5
+ const n = (
4
6
  // OpenAPI 3.x
5
- Object.keys(((t = n == null ? void 0 : n.components) == null ? void 0 : t.schemas) ?? {}).length ? (o = n == null ? void 0 : n.components) == null ? void 0 : o.schemas : (
7
+ Object.keys(((o = t == null ? void 0 : t.components) == null ? void 0 : o.schemas) ?? {}).length ? (i = t == null ? void 0 : t.components) == null ? void 0 : i.schemas : (
6
8
  // Swagger 2.0
7
- Object.keys((n == null ? void 0 : n.definitions) ?? {}).length ? n == null ? void 0 : n.definitions : (
9
+ Object.keys((t == null ? void 0 : t.definitions) ?? {}).length ? t == null ? void 0 : t.definitions : (
8
10
  // Fallback
9
11
  {}
10
12
  )
11
13
  )
12
- ) : {};
14
+ );
15
+ return Object.keys(n ?? {}).forEach((r) => {
16
+ var f;
17
+ ((f = n[r]) == null ? void 0 : f["x-internal"]) === !0 && delete n[r];
18
+ }), n;
13
19
  }
14
20
  export {
15
- i as getModels
21
+ l as getModels
16
22
  };
@@ -1,4 +1,4 @@
1
- import type { Spec } from '@scalar/oas-utils';
1
+ import type { Spec, Tag } from '@scalar/oas-utils';
2
2
  export type SidebarEntry = {
3
3
  id: string;
4
4
  title: string;
@@ -10,16 +10,21 @@ export type SidebarEntry = {
10
10
  deprecated?: boolean;
11
11
  isGroup?: boolean;
12
12
  };
13
+ /** Helper to overwrite the current OpenAPI document */
13
14
  declare function setParsedSpec(spec: Spec): Spec;
14
15
  type CollapsedSidebarItems = Record<string, boolean>;
15
16
  declare function toggleCollapsedSidebarItem(key: string): void;
16
17
  declare function setCollapsedSidebarItem(key: string, value: boolean): void;
18
+ export type ParsedSpecOption = {
19
+ parsedSpec: Spec;
20
+ };
21
+ export type TagsSorterOption = {
22
+ tagsSorter?: 'alpha' | ((a: Tag, b: Tag) => number);
23
+ };
17
24
  /**
18
25
  * Provides the sidebar state and methods to control it.
19
26
  */
20
- export declare function useSidebar(options?: {
21
- parsedSpec: Spec;
22
- }): {
27
+ export declare function useSidebar(options?: ParsedSpecOption & TagsSorterOption): {
23
28
  breadcrumb: import("vue").ComputedRef<string>;
24
29
  items: import("vue").ComputedRef<{
25
30
  entries: SidebarEntry[];
@@ -1 +1 @@
1
- {"version":3,"file":"useSidebar.d.ts","sourceRoot":"","sources":["../../src/hooks/useSidebar.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAA6B,MAAM,mBAAmB,CAAA;AAexE,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;AAeD,iBAAS,aAAa,CAAC,IAAI,EAAE,IAAI,QAEhC;AAMD,KAAK,qBAAqB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;AAMpD,iBAAS,0BAA0B,CAAC,GAAG,EAAE,MAAM,QAE9C;AAED,iBAAS,uBAAuB,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,QAE3D;AA2OD;;GAEG;AACH,wBAAgB,UAAU,CAAC,OAAO,CAAC,EAAE;IAAE,UAAU,EAAE,IAAI,CAAA;CAAE;;;;;;;;;;;;;EA4CxD"}
1
+ {"version":3,"file":"useSidebar.d.ts","sourceRoot":"","sources":["../../src/hooks/useSidebar.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,GAAG,EAAwB,MAAM,mBAAmB,CAAA;AAexE,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;AAkBD,uDAAuD;AACvD,iBAAS,aAAa,CAAC,IAAI,EAAE,IAAI,QAWhC;AAMD,KAAK,qBAAqB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;AAMpD,iBAAS,0BAA0B,CAAC,GAAG,EAAE,MAAM,QAE9C;AAED,iBAAS,uBAAuB,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,QAE3D;AA2OD,MAAM,MAAM,gBAAgB,GAAG;IAC7B,UAAU,EAAE,IAAI,CAAA;CACjB,CAAA;AAED,MAAM,MAAM,gBAAgB,GAAG;IAC7B,UAAU,CAAC,EAAE,OAAO,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,KAAK,MAAM,CAAC,CAAA;CACpD,CAAA;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,OAAO,CAAC,EAAE,gBAAgB,GAAG,gBAAgB;;;;;;;;;;;;;EA8CvE"}