@scalar/api-reference 1.25.115 → 1.25.116

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 (57) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/dist/browser/standalone.js +10903 -10880
  3. package/dist/browser/webpack-stats.json +1 -1
  4. package/dist/components/Content/Lazy/Loading.vue.d.ts.map +1 -1
  5. package/dist/components/Content/Lazy/Loading.vue.js +58 -60
  6. package/dist/components/Content/Tag/TagList.vue.d.ts.map +1 -1
  7. package/dist/components/Content/Tag/TagList.vue.js +36 -38
  8. package/dist/components/Sidebar/SidebarElement.vue.d.ts.map +1 -1
  9. package/dist/components/Sidebar/SidebarElement.vue.js +1 -1
  10. package/dist/components/Sidebar/SidebarElement.vue2.js +59 -55
  11. package/dist/features/ApiClientModal/useApiClient.d.ts +18 -18
  12. package/dist/features/ApiClientModal/useApiClient.d.ts.map +1 -1
  13. package/dist/features/ExampleRequest/ExampleRequest.vue.d.ts +6 -4
  14. package/dist/features/ExampleRequest/ExampleRequest.vue.d.ts.map +1 -1
  15. package/dist/features/ExampleRequest/ExampleRequest.vue.js +2 -2
  16. package/dist/features/ExampleRequest/ExampleRequest.vue2.js +138 -119
  17. package/dist/features/ExampleRequest/helpers/filter-security-requirements.d.ts +6 -0
  18. package/dist/features/ExampleRequest/helpers/filter-security-requirements.d.ts.map +1 -0
  19. package/dist/features/ExampleRequest/helpers/filter-security-requirements.js +17 -0
  20. package/dist/features/Operation/Operation.vue.d.ts +4 -5
  21. package/dist/features/Operation/Operation.vue.d.ts.map +1 -1
  22. package/dist/features/Operation/Operation.vue.js +34 -41
  23. package/dist/features/Operation/layouts/ClassicLayout.vue.d.ts +6 -6
  24. package/dist/features/Operation/layouts/ClassicLayout.vue.d.ts.map +1 -1
  25. package/dist/features/Operation/layouts/ClassicLayout.vue.js +4 -4
  26. package/dist/features/Operation/layouts/ClassicLayout.vue2.js +52 -51
  27. package/dist/features/Operation/layouts/ModernLayout.vue.d.ts +6 -6
  28. package/dist/features/Operation/layouts/ModernLayout.vue.d.ts.map +1 -1
  29. package/dist/features/Operation/layouts/ModernLayout.vue.js +2 -2
  30. package/dist/features/Operation/layouts/ModernLayout.vue2.js +70 -70
  31. package/dist/helpers/convert-to-har-request.d.ts +28 -0
  32. package/dist/helpers/convert-to-har-request.d.ts.map +1 -0
  33. package/dist/helpers/convert-to-har-request.js +64 -0
  34. package/dist/helpers/get-example-code.d.ts +9 -0
  35. package/dist/helpers/get-example-code.d.ts.map +1 -0
  36. package/dist/helpers/get-example-code.js +51 -0
  37. package/dist/helpers/index.d.ts +0 -3
  38. package/dist/helpers/index.d.ts.map +1 -1
  39. package/dist/hooks/useNavState.d.ts.map +1 -1
  40. package/dist/hooks/useNavState.js +26 -24
  41. package/dist/hooks/useReactiveSpec.d.ts +1 -1
  42. package/dist/index.js +66 -72
  43. package/dist/style.css +1 -1
  44. package/package.json +10 -10
  45. package/dist/features/Operation/hooks/useRequestExample.d.ts +0 -17
  46. package/dist/features/Operation/hooks/useRequestExample.d.ts.map +0 -1
  47. package/dist/features/Operation/hooks/useRequestExample.js +0 -68
  48. package/dist/helpers/convertRequestToHarRequest.d.ts +0 -7
  49. package/dist/helpers/convertRequestToHarRequest.d.ts.map +0 -1
  50. package/dist/helpers/convertRequestToHarRequest.js +0 -64
  51. package/dist/helpers/get-request.js +0 -6
  52. package/dist/helpers/getExampleCode.d.ts +0 -8
  53. package/dist/helpers/getExampleCode.d.ts.map +0 -1
  54. package/dist/helpers/getExampleCode.js +0 -16
  55. package/dist/helpers/joinWithSlash.d.ts +0 -5
  56. package/dist/helpers/joinWithSlash.d.ts.map +0 -1
  57. package/dist/helpers/joinWithSlash.js +0 -4
@@ -1 +1 @@
1
- {"version":3,"file":"Loading.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Lazy/Loading.vue"],"names":[],"mappings":"AAqOA,OAAO,KAAK,EACV,IAAI,EAGL,MAAM,sBAAsB,CAAA;AAkB7B;;;;;;;;;;;;GAYG;AACH,KAAK,WAAW,GAAG;IACf,MAAM,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAA;IAC7B,UAAU,EAAE,IAAI,CAAA;CACjB,CAAC;;YAFS,QAAQ,GAAG,SAAS;;AAyQjC,wBAQG"}
1
+ {"version":3,"file":"Loading.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Lazy/Loading.vue"],"names":[],"mappings":"AAmOA,OAAO,KAAK,EACV,IAAI,EAGL,MAAM,sBAAsB,CAAA;AAkB7B;;;;;;;;;;;;GAYG;AACH,KAAK,WAAW,GAAG;IACf,MAAM,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAA;IAC7B,UAAU,EAAE,IAAI,CAAA;CACjB,CAAC;;YAFS,QAAQ,GAAG,SAAS;;AAwQjC,wBAQG"}
@@ -1,122 +1,120 @@
1
- import { defineComponent as K, ref as v, watch as M, onMounted as j, withDirectives as A, openBlock as a, createElementBlock as m, normalizeClass as F, Fragment as h, renderList as b, createBlock as f, unref as t, withCtx as p, createCommentVNode as w, createVNode as T, createTextVNode as H, toDisplayString as P, vShow as G } from "vue";
2
- import { useWorkspace as J } from "@scalar/api-client/store";
3
- import { lazyBus as Q } from "./lazyBus.js";
4
- import R from "../Tag/Tag.vue.js";
5
- import U from "../../../features/Operation/Operation.vue.js";
6
- import X from "../../Section/SectionContainer.vue.js";
7
- import Y from "../../Section/Section.vue.js";
8
- import Z from "../../Section/SectionContent.vue.js";
9
- import ee from "../../Section/SectionHeader.vue.js";
10
- import te from "../../Anchor/Anchor.vue.js";
11
- import oe from "../Schema/Schema.vue.js";
12
- import { useNavState as re } from "../../../hooks/useNavState.js";
13
- import { getModels as g } from "../../../helpers/getModels.js";
14
- import { scrollToId as C } from "../../../helpers/scrollToId.js";
15
- const ye = /* @__PURE__ */ K({
1
+ import { defineComponent as D, ref as v, watch as K, onMounted as M, withDirectives as j, openBlock as n, createElementBlock as f, normalizeClass as F, Fragment as g, renderList as k, createBlock as m, unref as t, withCtx as p, createCommentVNode as w, createVNode as C, createTextVNode as H, toDisplayString as P, vShow as q } from "vue";
2
+ import { useActiveEntities as G } from "@scalar/api-client/store";
3
+ import { lazyBus as J } from "./lazyBus.js";
4
+ import Q from "../Tag/Tag.vue.js";
5
+ import R from "../../../features/Operation/Operation.vue.js";
6
+ import U from "../../Section/SectionContainer.vue.js";
7
+ import X from "../../Section/Section.vue.js";
8
+ import Y from "../../Section/SectionContent.vue.js";
9
+ import Z from "../../Section/SectionHeader.vue.js";
10
+ import ee from "../../Anchor/Anchor.vue.js";
11
+ import te from "../Schema/Schema.vue.js";
12
+ import { useNavState as oe } from "../../../hooks/useNavState.js";
13
+ import { getModels as h } from "../../../helpers/getModels.js";
14
+ import { scrollToId as x } from "../../../helpers/scrollToId.js";
15
+ const he = /* @__PURE__ */ D({
16
16
  __name: "Loading",
17
17
  props: {
18
18
  layout: { default: "modern" },
19
19
  parsedSpec: {}
20
20
  },
21
- setup(q) {
22
- const i = q, _ = v(!1), y = v([]), S = v([]), { requests: E, requestExamples: L, securitySchemes: V } = J(), { getModelId: z, getSectionId: B, getTagId: N, hash: s, isIntersectionEnabled: I } = re(), x = v(i.layout !== "classic" && s.value);
23
- M(
21
+ setup(L) {
22
+ const i = L, T = v(!1), S = v([]), y = v([]), { activeCollection: O, activeServer: V } = G(), { getModelId: z, getSectionId: B, getTagId: N, hash: a, isIntersectionEnabled: I } = oe(), _ = v(i.layout !== "classic" && a.value);
23
+ K(
24
24
  () => {
25
25
  var r;
26
26
  return (r = i.parsedSpec.tags) == null ? void 0 : r.length;
27
27
  },
28
28
  (r) => {
29
29
  var e, u;
30
- if (!s.value || typeof r != "number" || !i.parsedSpec.tags)
30
+ if (!a.value || typeof r != "number" || !i.parsedSpec.tags)
31
31
  return;
32
- const l = B();
33
- if (l.startsWith("tag")) {
32
+ const s = B();
33
+ if (s.startsWith("tag")) {
34
34
  let o = 0;
35
35
  const c = ((e = i.parsedSpec.tags) == null ? void 0 : e.findIndex(
36
- (k) => N(k) === l
37
- )) ?? 0, n = s.value.match(/tag\/([^/]+)\/([^/]+)\/(.+)/);
38
- if ((n == null ? void 0 : n.length) === 4) {
39
- const k = n[2], O = "/" + n[3];
36
+ (b) => N(b) === s
37
+ )) ?? 0, l = a.value.match(/tag\/([^/]+)\/([^/]+)\/(.+)/);
38
+ if ((l == null ? void 0 : l.length) === 4) {
39
+ const b = l[2], W = "/" + l[3];
40
40
  o = (u = i.parsedSpec.tags[c]) == null ? void 0 : u.operations.findIndex(
41
- ({ httpVerb: $, path: D }) => k === $ && O === D
41
+ ({ httpVerb: $, path: A }) => b === $ && W === A
42
42
  );
43
43
  }
44
44
  const d = i.parsedSpec.tags[c];
45
45
  if (!d) return;
46
- d.name !== "default" && (_.value = l !== s.value && l.startsWith("tag")), y.value.push({
46
+ d.name !== "default" && (T.value = s !== a.value && s.startsWith("tag")), S.value.push({
47
47
  ...d,
48
48
  lazyOperations: d.operations.slice(
49
49
  o,
50
50
  o + 2
51
51
  )
52
52
  });
53
- } else if (s.value.startsWith("model")) {
54
- const o = Object.keys(g(i.parsedSpec) ?? {}), [, c] = s.value.toLowerCase().split("/"), n = s.value === "models" ? 0 : o.findIndex((d) => d.toLowerCase() === c);
55
- if (n === -1) return;
56
- S.value = o.slice(n, n + 3);
53
+ } else if (a.value.startsWith("model")) {
54
+ const o = Object.keys(h(i.parsedSpec) ?? {}), [, c] = a.value.toLowerCase().split("/"), l = a.value === "models" ? 0 : o.findIndex((d) => d.toLowerCase() === c);
55
+ if (l === -1) return;
56
+ y.value = o.slice(l, l + 3);
57
57
  } else
58
- typeof window < "u" && C(s.value), setTimeout(() => I.value = !0, 1e3);
58
+ typeof window < "u" && x(a.value), setTimeout(() => I.value = !0, 1e3);
59
59
  },
60
60
  { immediate: !0 }
61
61
  );
62
- const W = Q.on(({ id: r }) => {
63
- const l = s.value;
64
- !l || r !== l || (W(), setTimeout(() => {
65
- typeof window < "u" && C(l), x.value = !1, setTimeout(() => I.value = !0, 1e3);
62
+ const E = J.on(({ id: r }) => {
63
+ const s = a.value;
64
+ !s || r !== s || (E(), setTimeout(() => {
65
+ typeof window < "u" && x(s), _.value = !1, setTimeout(() => I.value = !0, 1e3);
66
66
  }, 300));
67
67
  });
68
- return j(() => {
69
- s.value || setTimeout(() => I.value = !0, 1e3);
70
- }), (r, l) => A((a(), m("div", {
68
+ return M(() => {
69
+ a.value || setTimeout(() => I.value = !0, 1e3);
70
+ }), (r, s) => j((n(), f("div", {
71
71
  class: F(["references-loading", {
72
- "references-loading-hidden-tag": _.value,
73
- "references-loading-top-spacer": y.value.length
72
+ "references-loading-hidden-tag": T.value,
73
+ "references-loading-top-spacer": S.value.length
74
74
  }])
75
75
  }, [
76
- (a(!0), m(h, null, b(y.value, (e, u) => (a(), m(h, {
76
+ (n(!0), f(g, null, k(S.value, (e, u) => (n(), f(g, {
77
77
  key: e.name + u
78
78
  }, [
79
- e.operations && e.operations.length > 0 ? (a(), f(t(R), {
79
+ e.operations && e.operations.length > 0 ? (n(), m(t(Q), {
80
80
  key: 0,
81
81
  spec: r.parsedSpec,
82
82
  tag: e
83
83
  }, {
84
84
  default: p(() => [
85
- (a(!0), m(h, null, b(e.lazyOperations, (o) => (a(), f(t(U), {
85
+ (n(!0), f(g, null, k(e.lazyOperations, (o) => (n(), m(t(R), {
86
86
  key: `${o.httpVerb}-${o.operationId}`,
87
+ collection: t(O),
87
88
  layout: r.layout,
88
- operation: o,
89
- requestExamples: t(L),
90
- requests: t(E),
91
- securitySchemes: t(V),
92
- tag: e
93
- }, null, 8, ["layout", "operation", "requestExamples", "requests", "securitySchemes", "tag"]))), 128))
89
+ server: t(V),
90
+ transformedOperation: o
91
+ }, null, 8, ["collection", "layout", "server", "transformedOperation"]))), 128))
94
92
  ]),
95
93
  _: 2
96
94
  }, 1032, ["spec", "tag"])) : w("", !0)
97
95
  ], 64))), 128)),
98
- S.value.length ? (a(), f(t(X), { key: 0 }, {
96
+ y.value.length ? (n(), m(t(U), { key: 0 }, {
99
97
  default: p(() => [
100
- (a(!0), m(h, null, b(S.value, (e) => (a(), f(t(Y), {
98
+ (n(!0), f(g, null, k(y.value, (e) => (n(), m(t(X), {
101
99
  key: e,
102
100
  label: e
103
101
  }, {
104
102
  default: p(() => {
105
103
  var u;
106
104
  return [
107
- (u = t(g)(r.parsedSpec)) != null && u[e] ? (a(), f(t(Z), { key: 0 }, {
105
+ (u = t(h)(r.parsedSpec)) != null && u[e] ? (n(), m(t(Y), { key: 0 }, {
108
106
  default: p(() => {
109
107
  var o;
110
108
  return [
111
- T(t(ee), { level: 2 }, {
109
+ C(t(Z), { level: 2 }, {
112
110
  default: p(() => [
113
- T(t(te), {
111
+ C(t(ee), {
114
112
  id: t(z)({ name: e })
115
113
  }, {
116
114
  default: p(() => {
117
115
  var c;
118
116
  return [
119
- H(P(((c = t(g)(r.parsedSpec)) == null ? void 0 : c[e]).title ?? e), 1)
117
+ H(P(((c = t(h)(r.parsedSpec)) == null ? void 0 : c[e]).title ?? e), 1)
120
118
  ];
121
119
  }),
122
120
  _: 2
@@ -124,10 +122,10 @@ const ye = /* @__PURE__ */ K({
124
122
  ]),
125
123
  _: 2
126
124
  }, 1024),
127
- T(t(oe), {
125
+ C(t(te), {
128
126
  name: e,
129
127
  noncollapsible: "",
130
- value: (o = t(g)(r.parsedSpec)) == null ? void 0 : o[e]
128
+ value: (o = t(h)(r.parsedSpec)) == null ? void 0 : o[e]
131
129
  }, null, 8, ["name", "value"])
132
130
  ];
133
131
  }),
@@ -141,10 +139,10 @@ const ye = /* @__PURE__ */ K({
141
139
  _: 1
142
140
  })) : w("", !0)
143
141
  ], 2)), [
144
- [G, x.value]
142
+ [q, _.value]
145
143
  ]);
146
144
  }
147
145
  });
148
146
  export {
149
- ye as default
147
+ he as default
150
148
  };
@@ -1 +1 @@
1
- {"version":3,"file":"TagList.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Tag/TagList.vue"],"names":[],"mappings":"AAgFA,OAAO,KAAK,EAAE,IAAI,EAAE,GAAG,IAAI,OAAO,EAAE,MAAM,sBAAsB,CAAA;AAOhE,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,OAAO,EAAE,CAAA;IACf,IAAI,EAAE,IAAI,CAAA;IACV,MAAM,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAA;CAC9B,CAAC;;AAmIF,wBAMG"}
1
+ {"version":3,"file":"TagList.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Tag/TagList.vue"],"names":[],"mappings":"AA8EA,OAAO,KAAK,EAAE,IAAI,EAAE,GAAG,IAAI,OAAO,EAAE,MAAM,sBAAsB,CAAA;AAOhE,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,OAAO,EAAE,CAAA;IACf,IAAI,EAAE,IAAI,CAAA;IACV,MAAM,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAA;CAC9B,CAAC;;AAkIF,wBAMG"}
@@ -1,54 +1,52 @@
1
- import { defineComponent as x, computed as d, openBlock as a, createElementBlock as f, Fragment as y, renderList as _, createBlock as c, unref as e, withCtx as u, resolveDynamicComponent as B, createVNode as h } from "vue";
2
- import { useWorkspace as T } from "@scalar/api-client/store";
3
- import { ScalarErrorBoundary as $ } from "@scalar/components";
4
- import b from "./TagAccordion.vue.js";
5
- import C from "./Tag.vue.js";
1
+ import { defineComponent as C, computed as p, openBlock as s, createElementBlock as f, Fragment as y, renderList as v, createBlock as l, unref as e, withCtx as i, resolveDynamicComponent as T, createVNode as _ } from "vue";
2
+ import { useActiveEntities as $ } from "@scalar/api-client/store";
3
+ import { ScalarErrorBoundary as b } from "@scalar/components";
4
+ import E from "./TagAccordion.vue.js";
5
+ import O from "./Tag.vue.js";
6
6
  import L from "../Lazy/Lazy.vue2.js";
7
- import N from "../../../features/Operation/Operation.vue.js";
8
- import { useNavState as V } from "../../../hooks/useNavState.js";
9
- import { useSidebar as W } from "../../../hooks/useSidebar.js";
10
- const M = /* @__PURE__ */ x({
7
+ import A from "../../../features/Operation/Operation.vue.js";
8
+ import { useNavState as N } from "../../../hooks/useNavState.js";
9
+ import { useSidebar as V } from "../../../hooks/useSidebar.js";
10
+ const K = /* @__PURE__ */ C({
11
11
  __name: "TagList",
12
12
  props: {
13
13
  tags: {},
14
14
  spec: {},
15
15
  layout: {}
16
16
  },
17
- setup(S) {
18
- const i = S, { getOperationId: l, getTagId: r, hash: k } = V(), { collapsedSidebarItems: m } = W(), { requests: q, requestExamples: z, securitySchemes: I } = T(), g = d(
19
- () => i.layout === "classic" ? b : C
20
- ), v = d(
21
- () => i.tags.findIndex((s) => !m[r(s)]) + 1
22
- ), n = (s) => i.layout !== "classic" && !k.value.startsWith("model") && s > v.value;
23
- return (s, w) => (a(!0), f(y, null, _(s.tags, (t, p) => (a(), c(e(L), {
17
+ setup(h) {
18
+ const n = h, { getOperationId: c, getTagId: r, hash: z } = N(), { collapsedSidebarItems: m } = V(), { activeCollection: I, activeServer: g } = $(), k = p(
19
+ () => n.layout === "classic" ? E : O
20
+ ), S = p(
21
+ () => n.tags.findIndex((o) => !m[r(o)]) + 1
22
+ ), u = (o) => n.layout !== "classic" && !z.value.startsWith("model") && o > S.value;
23
+ return (o, w) => (s(!0), f(y, null, v(o.tags, (t, d) => (s(), l(e(L), {
24
24
  id: e(r)(t),
25
25
  key: e(r)(t),
26
- isLazy: n(p)
26
+ isLazy: u(d)
27
27
  }, {
28
- default: u(() => [
29
- (a(), c(B(g.value), {
28
+ default: i(() => [
29
+ (s(), l(T(k.value), {
30
30
  id: e(r)(t),
31
- spec: s.spec,
31
+ spec: o.spec,
32
32
  tag: t
33
33
  }, {
34
- default: u(() => [
35
- (a(!0), f(y, null, _(t.operations, (o, E) => (a(), c(e(L), {
36
- id: e(l)(o, t),
37
- key: `${o.httpVerb}-${o.operationId}`,
38
- isLazy: n(p) || e(m)[e(r)(t)] && E > 0
34
+ default: i(() => [
35
+ (s(!0), f(y, null, v(t.operations, (a, B) => (s(), l(e(L), {
36
+ id: e(c)(a, t),
37
+ key: `${a.httpVerb}-${a.operationId}`,
38
+ isLazy: u(d) || e(m)[e(r)(t)] && B > 0
39
39
  }, {
40
- default: u(() => [
41
- h(e($), null, {
42
- default: u(() => [
43
- h(e(N), {
44
- id: e(l)(o, t),
45
- layout: s.layout,
46
- operation: o,
47
- requestExamples: e(z),
48
- requests: e(q),
49
- securitySchemes: e(I),
50
- tag: t
51
- }, null, 8, ["id", "layout", "operation", "requestExamples", "requests", "securitySchemes", "tag"])
40
+ default: i(() => [
41
+ _(e(b), null, {
42
+ default: i(() => [
43
+ _(e(A), {
44
+ id: e(c)(a, t),
45
+ collection: e(I),
46
+ layout: o.layout,
47
+ server: e(g),
48
+ transformedOperation: a
49
+ }, null, 8, ["id", "collection", "layout", "server", "transformedOperation"])
52
50
  ]),
53
51
  _: 2
54
52
  }, 1024)
@@ -64,5 +62,5 @@ const M = /* @__PURE__ */ x({
64
62
  }
65
63
  });
66
64
  export {
67
- M as default
65
+ K as default
68
66
  };
@@ -1 +1 @@
1
- {"version":3,"file":"SidebarElement.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Sidebar/SidebarElement.vue"],"names":[],"mappings":"AA8UA,KAAK,WAAW,GAAG;IACjB,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE;QACJ,EAAE,EAAE,MAAM,CAAA;QACV,KAAK,EAAE,MAAM,CAAA;QACb,MAAM,CAAC,EAAE,MAAM,IAAI,CAAA;QACnB,IAAI,CAAC,EAAE,MAAM,CAAA;QACb,IAAI,CAAC,EAAE;YACL,GAAG,EAAE,MAAM,CAAA;SACZ,CAAA;QACD,QAAQ,CAAC,EAAE,MAAM,CAAA;QACjB,UAAU,CAAC,EAAE,OAAO,CAAA;KACrB,CAAA;IACD,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,IAAI,CAAC,EAAE,OAAO,CAAA;CACf,CAAC;AAgEF,iBAAS,cAAc;WA2KT,OAAO,IAA6B;;yBATpB,GAAG;+BACG,GAAG;;;;EAatC;AAeD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;;;;4FAQnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAWpG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
1
+ {"version":3,"file":"SidebarElement.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Sidebar/SidebarElement.vue"],"names":[],"mappings":"AA6VA,KAAK,WAAW,GAAG;IACjB,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE;QACJ,EAAE,EAAE,MAAM,CAAA;QACV,KAAK,EAAE,MAAM,CAAA;QACb,MAAM,CAAC,EAAE,MAAM,IAAI,CAAA;QACnB,IAAI,CAAC,EAAE,MAAM,CAAA;QACb,IAAI,CAAC,EAAE;YACL,GAAG,EAAE,MAAM,CAAA;SACZ,CAAA;QACD,QAAQ,CAAC,EAAE,MAAM,CAAA;QACjB,UAAU,CAAC,EAAE,OAAO,CAAA;KACrB,CAAA;IACD,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,IAAI,CAAC,EAAE,OAAO,CAAA;CACf,CAAC;AAgEF,iBAAS,cAAc;WAoKT,OAAO,IAA6B;;yBATpB,GAAG;+BACG,GAAG;;;;EAatC;AAeD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;;;;4FAQnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAWpG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import o from "./SidebarElement.vue2.js";
2
2
  /* empty css */
3
3
  import t from "../../_virtual/_plugin-vue_export-helper.js";
4
- const a = /* @__PURE__ */ t(o, [["__scopeId", "data-v-90ecd485"]]);
4
+ const a = /* @__PURE__ */ t(o, [["__scopeId", "data-v-18e6dc3d"]]);
5
5
  export {
6
6
  a as default
7
7
  };
@@ -1,20 +1,20 @@
1
- import { defineComponent as $, openBlock as o, createElementBlock as l, createElementVNode as r, normalizeClass as B, createVNode as u, unref as f, withModifiers as V, createTextVNode as g, createCommentVNode as a, createBlock as E, toDisplayString as N, renderSlot as v } from "vue";
2
- import { ScalarIconButton as A, ScalarIcon as I } from "@scalar/components";
3
- import O from "./SidebarHttpBadge.vue.js";
4
- import { sleep as b } from "../../helpers/sleep.js";
5
- import { useNavState as T } from "../../hooks/useNavState.js";
6
- import { joinWithSlash as D } from "../../helpers/joinWithSlash.js";
7
- import { scrollToId as H } from "../../helpers/scrollToId.js";
8
- const R = ["id"], U = {
1
+ import { defineComponent as $, openBlock as n, createElementBlock as l, createElementVNode as a, normalizeClass as V, withModifiers as A, createVNode as g, unref as b, withCtx as E, createTextVNode as m, toDisplayString as h, createCommentVNode as s, createBlock as N, renderSlot as v } from "vue";
2
+ import { ScalarSidebarGroupToggle as T, ScalarIcon as O } from "@scalar/components";
3
+ import { combineUrlAndPath as U } from "@scalar/oas-utils/helpers";
4
+ import H from "./SidebarHttpBadge.vue.js";
5
+ import { sleep as k } from "../../helpers/sleep.js";
6
+ import { useNavState as I } from "../../hooks/useNavState.js";
7
+ import { scrollToId as P } from "../../helpers/scrollToId.js";
8
+ const D = ["id"], L = {
9
9
  key: 0,
10
10
  class: "sidebar-heading-chevron"
11
- }, z = ["href", "tabindex"], L = { class: "sidebar-heading-link-title" }, M = {
11
+ }, M = ["aria-expanded"], R = ["href", "tabindex"], z = { class: "sidebar-heading-link-title" }, F = {
12
12
  key: 1,
13
13
  class: "sidebar-heading-link-method"
14
- }, P = {
14
+ }, G = {
15
15
  key: 1,
16
16
  class: "action-menu"
17
- }, Q = /* @__PURE__ */ $({
17
+ }, Y = /* @__PURE__ */ $({
18
18
  __name: "SidebarElement",
19
19
  props: {
20
20
  id: {},
@@ -24,77 +24,81 @@ const R = ["id"], U = {
24
24
  open: { type: Boolean }
25
25
  },
26
26
  emits: ["toggleOpen"],
27
- setup(k, { emit: C }) {
28
- const t = k, d = C, { getFullHash: m, isIntersectionEnabled: s, pathRouting: p, replaceUrlState: y } = T(), h = async () => {
29
- var e, i;
30
- t.hasChildren && d("toggleOpen"), (i = (e = t.item) == null ? void 0 : e.select) == null || i.call(e), t.open && (s.value = !1, await b(100), s.value = !0);
31
- }, w = () => {
27
+ setup(C, { emit: y }) {
28
+ const i = C, d = y, { getFullHash: c, isIntersectionEnabled: r, pathRouting: p, replaceUrlState: w } = I(), u = async () => {
29
+ var e, t;
30
+ i.hasChildren && d("toggleOpen"), (t = (e = i.item) == null ? void 0 : e.select) == null || t.call(e), i.open && (r.value = !1, await k(100), r.value = !0);
31
+ }, S = () => {
32
32
  if (p.value)
33
- return D(p.value.basePath, t.item.id);
33
+ return U(p.value.basePath, i.item.id);
34
34
  if (typeof window < "u") {
35
35
  const e = new URL(window.location.href);
36
- return e.hash = m(t.item.id), `${e.pathname}${e.search}${e.hash}`;
37
- } else return `#${m(t.item.id)}`;
38
- }, S = async (e) => {
39
- var i, n;
40
- p.value && (e.preventDefault(), t.hasChildren && d("toggleOpen"), (n = (i = t.item) == null ? void 0 : i.select) == null || n.call(i), d("toggleOpen"), s.value = !1, y(t.item.id), H(t.item.id), await b(100), s.value = !0);
36
+ return e.hash = c(i.item.id), `${e.pathname}${e.search}${e.hash}`;
37
+ } else return `#${c(i.item.id)}`;
38
+ }, B = async (e) => {
39
+ var t, o;
40
+ p.value && (e.preventDefault(), i.hasChildren && d("toggleOpen"), (o = (t = i.item) == null ? void 0 : t.select) == null || o.call(t), d("toggleOpen"), r.value = !1, w(i.item.id), P(i.item.id), await k(100), r.value = !0);
41
41
  };
42
- return (e, i) => {
43
- var n, c;
44
- return o(), l("li", {
42
+ return (e, t) => {
43
+ var o, f;
44
+ return n(), l("li", {
45
45
  id: e.id,
46
46
  class: "sidebar-group-item"
47
47
  }, [
48
- r("div", {
49
- class: B(["sidebar-heading", {
48
+ a("div", {
49
+ class: V(["sidebar-heading", {
50
50
  "sidebar-group-item__folder": e.hasChildren,
51
51
  active_page: e.isActive,
52
52
  deprecated: e.item.deprecated ?? !1
53
53
  }]),
54
- onClick: h
54
+ onClick: u
55
55
  }, [
56
- e.hasChildren ? (o(), l("p", U, [
57
- u(f(A), {
56
+ e.hasChildren ? (n(), l("p", L, [
57
+ a("button", {
58
58
  "aria-expanded": e.open,
59
59
  class: "toggle-nested-icon",
60
- icon: e.open ? "ChevronDown" : "ChevronRight",
61
- label: `${e.open ? "Collapse" : "Expand"} ${e.item.title}`,
62
- size: "xs",
63
- thickness: "1.5",
64
- onClick: V(h, ["stop"])
65
- }, null, 8, ["aria-expanded", "icon", "label"]),
66
- i[0] || (i[0] = g("   "))
67
- ])) : a("", !0),
68
- r("a", {
60
+ type: "button",
61
+ onClick: A(u, ["stop"])
62
+ }, [
63
+ g(b(T), { open: e.open }, {
64
+ label: E(() => [
65
+ m(h(e.open ? "Collapse" : "Expand") + " " + h(e.item.title), 1)
66
+ ]),
67
+ _: 1
68
+ }, 8, ["open"])
69
+ ], 8, M),
70
+ t[0] || (t[0] = m("   "))
71
+ ])) : s("", !0),
72
+ a("a", {
69
73
  class: "sidebar-heading-link",
70
- href: w(),
74
+ href: S(),
71
75
  tabindex: e.hasChildren ? -1 : 0,
72
- onClick: S
76
+ onClick: B
73
77
  }, [
74
- (c = (n = e.item) == null ? void 0 : n.icon) != null && c.src ? (o(), E(f(I), {
78
+ (f = (o = e.item) == null ? void 0 : o.icon) != null && f.src ? (n(), N(b(O), {
75
79
  key: 0,
76
80
  class: "sidebar-icon",
77
81
  icon: e.item.icon.src
78
- }, null, 8, ["icon"])) : a("", !0),
79
- r("p", L, N(e.item.title), 1),
80
- e.item.httpVerb && !e.hasChildren ? (o(), l("p", M, [
81
- i[1] || (i[1] = g("   ")),
82
- i[2] || (i[2] = r("span", { class: "sr-only" }, "HTTP Method: ", -1)),
83
- u(O, {
82
+ }, null, 8, ["icon"])) : s("", !0),
83
+ a("p", z, h(e.item.title), 1),
84
+ e.item.httpVerb && !e.hasChildren ? (n(), l("p", F, [
85
+ t[1] || (t[1] = m("   ")),
86
+ t[2] || (t[2] = a("span", { class: "sr-only" }, "HTTP Method: ", -1)),
87
+ g(H, {
84
88
  active: e.isActive,
85
89
  method: e.item.httpVerb
86
90
  }, null, 8, ["active", "method"])
87
- ])) : a("", !0)
88
- ], 8, z)
91
+ ])) : s("", !0)
92
+ ], 8, R)
89
93
  ], 2),
90
- e.open ? v(e.$slots, "default", { key: 0 }, void 0, !0) : a("", !0),
91
- e.$slots["action-menu"] ? (o(), l("div", P, [
94
+ e.open ? v(e.$slots, "default", { key: 0 }, void 0, !0) : s("", !0),
95
+ e.$slots["action-menu"] ? (n(), l("div", G, [
92
96
  v(e.$slots, "action-menu", {}, void 0, !0)
93
- ])) : a("", !0)
94
- ], 8, R);
97
+ ])) : s("", !0)
98
+ ], 8, D);
95
99
  };
96
100
  }
97
101
  });
98
102
  export {
99
- Q as default
103
+ Y as default
100
104
  };