@scalar/api-reference 1.28.1 → 1.28.2

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 (34) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/dist/browser/standalone.js +11470 -11443
  3. package/dist/browser/webpack-stats.json +1 -1
  4. package/dist/components/Content/ClientLibraries/ClientLibraries.vue.d.ts.map +1 -1
  5. package/dist/components/Content/ClientLibraries/ClientLibraries.vue.js +2 -2
  6. package/dist/components/Content/ClientLibraries/ClientLibraries.vue2.js +48 -40
  7. package/dist/components/Content/ClientLibraries/ClientSelector.vue.d.ts.map +1 -1
  8. package/dist/components/Content/ClientLibraries/ClientSelector.vue.js +2 -2
  9. package/dist/components/Content/ClientLibraries/ClientSelector.vue2.js +6 -7
  10. package/dist/components/Content/Schema/SchemaPropertyHeading.vue.d.ts.map +1 -1
  11. package/dist/components/Content/Schema/SchemaPropertyHeading.vue.js +1 -1
  12. package/dist/components/Content/Schema/SchemaPropertyHeading.vue2.js +77 -77
  13. package/dist/components/Content/Tag/OperationsListItem.vue.js +2 -2
  14. package/dist/components/Content/Tag/OperationsListItem.vue2.js +1 -1
  15. package/dist/components/Section/CompactSection.vue.d.ts.map +1 -1
  16. package/dist/components/Section/CompactSection.vue.js +1 -1
  17. package/dist/components/Sidebar/SidebarElement.vue.d.ts.map +1 -1
  18. package/dist/components/Sidebar/SidebarElement.vue.js +2 -2
  19. package/dist/components/Sidebar/SidebarElement.vue2.js +41 -40
  20. package/dist/features/Operation/components/ParameterListItem.vue.d.ts.map +1 -1
  21. package/dist/features/Operation/components/ParameterListItem.vue.js +2 -2
  22. package/dist/features/Operation/components/ParameterListItem.vue2.js +11 -8
  23. package/dist/features/Operation/layouts/ModernLayout.vue.d.ts.map +1 -1
  24. package/dist/features/Operation/layouts/ModernLayout.vue.js +1 -1
  25. package/dist/features/Operation/layouts/ModernLayout.vue2.js +9 -8
  26. package/dist/helpers/scrollToId.d.ts +3 -1
  27. package/dist/helpers/scrollToId.d.ts.map +1 -1
  28. package/dist/helpers/scrollToId.js +4 -4
  29. package/dist/hooks/useSidebar.d.ts +2 -2
  30. package/dist/hooks/useSidebar.d.ts.map +1 -1
  31. package/dist/hooks/useSidebar.js +84 -84
  32. package/dist/index.js +1 -1
  33. package/dist/style.css +1 -1
  34. package/package.json +11 -10
@@ -1,20 +1,21 @@
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 = {
1
+ import { defineComponent as A, openBlock as n, createElementBlock as l, createElementVNode as a, normalizeClass as T, unref as m, withModifiers as V, createVNode as b, withCtx as E, createTextVNode as c, toDisplayString as h, createCommentVNode as s, createBlock as N, renderSlot as v } from "vue";
2
+ import { ScalarSidebarGroupToggle as O, ScalarIcon as U } from "@scalar/components";
3
+ import { combineUrlAndPath as H } from "@scalar/oas-utils/helpers";
4
+ import { useConfig as I } from "../../hooks/useConfig.js";
5
+ import P from "./SidebarHttpBadge.vue.js";
6
+ import { sleep as C } from "../../helpers/sleep.js";
7
+ import { useNavState as D } from "../../hooks/useNavState.js";
8
+ import { scrollToId as L } from "../../helpers/scrollToId.js";
9
+ const M = ["id"], R = {
9
10
  key: 0,
10
11
  class: "sidebar-heading-chevron"
11
- }, M = ["aria-expanded"], R = ["href", "tabindex"], z = { class: "sidebar-heading-link-title" }, F = {
12
+ }, z = ["aria-expanded"], F = ["href", "tabindex"], G = { class: "sidebar-heading-link-title" }, j = {
12
13
  key: 1,
13
14
  class: "sidebar-heading-link-method"
14
- }, G = {
15
+ }, q = {
15
16
  key: 1,
16
17
  class: "action-menu"
17
- }, Y = /* @__PURE__ */ $({
18
+ }, x = /* @__PURE__ */ A({
18
19
  __name: "SidebarElement",
19
20
  props: {
20
21
  id: {},
@@ -24,81 +25,81 @@ const D = ["id"], L = {
24
25
  open: { type: Boolean }
25
26
  },
26
27
  emits: ["toggleOpen"],
27
- setup(C, { emit: y }) {
28
- const i = C, d = y, { getFullHash: c, isIntersectionEnabled: r, pathRouting: p, replaceUrlState: w } = I(), u = async () => {
28
+ setup(k, { emit: y }) {
29
+ const i = k, d = y, { getFullHash: u, isIntersectionEnabled: r, pathRouting: p, replaceUrlState: w } = D(), S = I(), f = async () => {
29
30
  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 = () => {
31
+ i.hasChildren && d("toggleOpen"), (t = (e = i.item) == null ? void 0 : e.select) == null || t.call(e), i.open && (r.value = !1, await C(100), r.value = !0);
32
+ }, B = () => {
32
33
  if (p.value)
33
- return U(p.value.basePath, i.item.id);
34
+ return H(p.value.basePath, i.item.id);
34
35
  if (typeof window < "u") {
35
36
  const e = new URL(window.location.href);
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) => {
37
+ return e.hash = u(i.item.id), `${e.pathname}${e.search}${e.hash}`;
38
+ } else return `#${u(i.item.id)}`;
39
+ }, $ = async (e) => {
39
40
  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
+ 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), L(i.item.id), await C(100), r.value = !0);
41
42
  };
42
43
  return (e, t) => {
43
- var o, f;
44
+ var o, g;
44
45
  return n(), l("li", {
45
46
  id: e.id,
46
47
  class: "sidebar-group-item"
47
48
  }, [
48
49
  a("div", {
49
- class: V(["sidebar-heading", {
50
+ class: T(["sidebar-heading", {
50
51
  "sidebar-group-item__folder": e.hasChildren,
51
52
  active_page: e.isActive,
52
53
  deprecated: e.item.deprecated ?? !1
53
54
  }]),
54
- onClick: u
55
+ onClick: f
55
56
  }, [
56
- e.hasChildren ? (n(), l("p", L, [
57
+ e.hasChildren && !m(S).defaultOpenAllTags ? (n(), l("p", R, [
57
58
  a("button", {
58
59
  "aria-expanded": e.open,
59
60
  class: "toggle-nested-icon",
60
61
  type: "button",
61
- onClick: A(u, ["stop"])
62
+ onClick: V(f, ["stop"])
62
63
  }, [
63
- g(b(T), { open: e.open }, {
64
+ b(m(O), { open: e.open }, {
64
65
  label: E(() => [
65
- m(h(e.open ? "Collapse" : "Expand") + " " + h(e.item.title), 1)
66
+ c(h(e.open ? "Collapse" : "Expand") + " " + h(e.item.title), 1)
66
67
  ]),
67
68
  _: 1
68
69
  }, 8, ["open"])
69
- ], 8, M),
70
- t[0] || (t[0] = m("   "))
70
+ ], 8, z),
71
+ t[0] || (t[0] = c("   "))
71
72
  ])) : s("", !0),
72
73
  a("a", {
73
74
  class: "sidebar-heading-link",
74
- href: S(),
75
+ href: B(),
75
76
  tabindex: e.hasChildren ? -1 : 0,
76
- onClick: B
77
+ onClick: $
77
78
  }, [
78
- (f = (o = e.item) == null ? void 0 : o.icon) != null && f.src ? (n(), N(b(O), {
79
+ (g = (o = e.item) == null ? void 0 : o.icon) != null && g.src ? (n(), N(m(U), {
79
80
  key: 0,
80
81
  class: "sidebar-icon",
81
82
  icon: e.item.icon.src
82
83
  }, 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("   ")),
84
+ a("p", G, h(e.item.title), 1),
85
+ e.item.httpVerb && !e.hasChildren ? (n(), l("p", j, [
86
+ t[1] || (t[1] = c("   ")),
86
87
  t[2] || (t[2] = a("span", { class: "sr-only" }, "HTTP Method: ", -1)),
87
- g(H, {
88
+ b(P, {
88
89
  active: e.isActive,
89
90
  method: e.item.httpVerb
90
91
  }, null, 8, ["active", "method"])
91
92
  ])) : s("", !0)
92
- ], 8, R)
93
+ ], 8, F)
93
94
  ], 2),
94
95
  e.open ? v(e.$slots, "default", { key: 0 }, void 0, !0) : s("", !0),
95
- e.$slots["action-menu"] ? (n(), l("div", G, [
96
+ e.$slots["action-menu"] ? (n(), l("div", q, [
96
97
  v(e.$slots, "action-menu", {}, void 0, !0)
97
98
  ])) : s("", !0)
98
- ], 8, D);
99
+ ], 8, M);
99
100
  };
100
101
  }
101
102
  });
102
103
  export {
103
- Y as default
104
+ x as default
104
105
  };
@@ -1 +1 @@
1
- {"version":3,"file":"ParameterListItem.vue.d.ts","sourceRoot":"","sources":["../../../../src/features/Operation/components/ParameterListItem.vue"],"names":[],"mappings":"AAwOA,OAAO,KAAK,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,iCAAiC,CAAA;AAY/E,KAAK,WAAW,GAAG;IACf,SAAS,EACL,WAAW,CAAC,aAAa,CAAC,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,GAChD,WAAW,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,CAAA;IACnD,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,YAAY,CAAC,EAAE,OAAO,CAAA;CACvB,CAAC;;kBADe,OAAO;kBAFP,OAAO;sBACH,OAAO;;AAgQ9B,wBAOG"}
1
+ {"version":3,"file":"ParameterListItem.vue.d.ts","sourceRoot":"","sources":["../../../../src/features/Operation/components/ParameterListItem.vue"],"names":[],"mappings":"AAyOA,OAAO,KAAK,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,iCAAiC,CAAA;AAY/E,KAAK,WAAW,GAAG;IACf,SAAS,EACL,WAAW,CAAC,aAAa,CAAC,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,GAChD,WAAW,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,CAAA;IACnD,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,YAAY,CAAC,EAAE,OAAO,CAAA;CACvB,CAAC;;kBADe,OAAO;kBAFP,OAAO;sBACH,OAAO;;AAkQ9B,wBAOG"}
@@ -1,7 +1,7 @@
1
1
  import t from "./ParameterListItem.vue2.js";
2
2
  /* empty css */
3
3
  import o from "../../../_virtual/_plugin-vue_export-helper.js";
4
- const a = /* @__PURE__ */ o(t, [["__scopeId", "data-v-6ec409c6"]]);
4
+ const e = /* @__PURE__ */ o(t, [["__scopeId", "data-v-d846a784"]]);
5
5
  export {
6
- a as default
6
+ e as default
7
7
  };
@@ -3,11 +3,11 @@ import { Disclosure as E, DisclosureButton as S, DisclosurePanel as q } from "@h
3
3
  import { ScalarIcon as D, ScalarMarkdown as P } from "@scalar/components";
4
4
  import V from "./ContentTypeSelect.vue.js";
5
5
  import I from "./ParameterHeaders.vue.js";
6
- import _ from "../../../components/Content/Schema/SchemaProperty.vue.js";
7
- const j = {
6
+ import j from "../../../components/Content/Schema/SchemaProperty.vue.js";
7
+ const N = {
8
8
  key: 0,
9
9
  class: "parameter-item group/parameter-item relative"
10
- }, N = { class: "parameter-item-name" }, T = { class: "parameter-item-type" }, O = { class: "absolute right-0 top-2.5 opacity-0 group-focus-within/parameter-item:opacity-100 group-hover/parameter-item:opacity-100" }, A = /* @__PURE__ */ w({
10
+ }, T = { class: "parameter-item-name" }, _ = { class: "parameter-item-type" }, O = { class: "absolute right-0 top-2.5 opacity-0 group-focus-within/parameter-item:opacity-100 group-hover/parameter-item:opacity-100" }, A = /* @__PURE__ */ w({
11
11
  __name: "ParameterListItem",
12
12
  props: {
13
13
  parameter: {},
@@ -21,7 +21,7 @@ const j = {
21
21
  );
22
22
  a.parameter.content && "application/json" in a.parameter.content && (l.value = "application/json");
23
23
  const r = i(() => !!(a.collapsableItems && a.parameter.content)), k = i(() => a.parameter.readOnly !== !0);
24
- return (e, d) => k.value ? (o(), g("li", j, [
24
+ return (e, d) => k.value ? (o(), g("li", N, [
25
25
  m(t(E), null, {
26
26
  default: u(({ open: s }) => [
27
27
  r.value ? (o(), p(t(S), {
@@ -34,8 +34,8 @@ const j = {
34
34
  icon: s ? "ChevronDown" : "ChevronRight",
35
35
  thickness: "1.5"
36
36
  }, null, 8, ["icon"]),
37
- c("span", N, b(e.parameter.name), 1),
38
- c("span", T, [
37
+ c("span", T, b(e.parameter.name), 1),
38
+ c("span", _, [
39
39
  e.parameter.description ? (o(), p(t(P), {
40
40
  key: 0,
41
41
  class: "markdown",
@@ -56,13 +56,16 @@ const j = {
56
56
  key: 0,
57
57
  headers: e.parameter.headers
58
58
  }, null, 8, ["headers"])) : n("", !0),
59
- m(t(_), {
59
+ m(t(j), {
60
60
  compact: "",
61
61
  description: r.value ? "" : e.parameter.description,
62
62
  name: r.value ? "" : e.parameter.name,
63
63
  noncollapsible: e.showChildren,
64
64
  required: e.parameter.required,
65
- value: e.parameter.content ? (h = (f = e.parameter.content) == null ? void 0 : f[l.value]) == null ? void 0 : h.schema : e.parameter.schema,
65
+ value: {
66
+ deprecated: e.parameter.deprecated,
67
+ ...e.parameter.content ? (h = (f = e.parameter.content) == null ? void 0 : f[l.value]) == null ? void 0 : h.schema : e.parameter.schema
68
+ },
66
69
  withExamples: e.withExamples
67
70
  }, null, 8, ["description", "name", "noncollapsible", "required", "value", "withExamples"])
68
71
  ];
@@ -1 +1 @@
1
- {"version":3,"file":"ModernLayout.vue.d.ts","sourceRoot":"","sources":["../../../../src/features/Operation/layouts/ModernLayout.vue"],"names":[],"mappings":"AAoIA,OAAO,KAAK,EACV,UAAU,EACV,SAAS,EACT,MAAM,EACP,MAAM,iCAAiC,CAAA;AACxC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAA;AA4BhE,KAAK,WAAW,GAAG;IACjB,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,UAAU,EAAE,UAAU,CAAA;IACtB,MAAM,EAAE,MAAM,GAAG,SAAS,CAAA;IAC1B,SAAS,EAAE,SAAS,CAAA;IACpB,0CAA0C;IAC1C,oBAAoB,EAAE,oBAAoB,CAAA;CAC3C,CAAC;;AAyOF,wBAOG"}
1
+ {"version":3,"file":"ModernLayout.vue.d.ts","sourceRoot":"","sources":["../../../../src/features/Operation/layouts/ModernLayout.vue"],"names":[],"mappings":"AAqIA,OAAO,KAAK,EACV,UAAU,EACV,SAAS,EACT,MAAM,EACP,MAAM,iCAAiC,CAAA;AACxC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAA;AA4BhE,KAAK,WAAW,GAAG;IACjB,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,UAAU,EAAE,UAAU,CAAA;IACtB,MAAM,EAAE,MAAM,GAAG,SAAS,CAAA;IAC1B,SAAS,EAAE,SAAS,CAAA;IACpB,0CAA0C;IAC1C,oBAAoB,EAAE,oBAAoB,CAAA;CAC3C,CAAC;;AAyOF,wBAOG"}
@@ -1,7 +1,7 @@
1
1
  import o from "./ModernLayout.vue2.js";
2
2
  /* empty css */
3
3
  import t from "../../../_virtual/_plugin-vue_export-helper.js";
4
- const p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-00a4c91b"]]);
4
+ const p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-73a18189"]]);
5
5
  export {
6
6
  p as default
7
7
  };
@@ -1,4 +1,4 @@
1
- import { defineComponent as O, useId as S, computed as b, openBlock as m, createBlock as s, unref as e, withCtx as t, createVNode as r, normalizeClass as d, createTextVNode as f, toDisplayString as u, createCommentVNode as y, createElementVNode as a } from "vue";
1
+ import { defineComponent as b, useId as O, computed as S, openBlock as d, createBlock as m, unref as e, withCtx as t, createVNode as r, normalizeClass as s, createTextVNode as f, toDisplayString as u, createCommentVNode as y, createElementVNode as a } from "vue";
2
2
  import { ScalarMarkdown as C, ScalarErrorBoundary as c } from "@scalar/components";
3
3
  import g from "../../../components/OperationPath.vue.js";
4
4
  import { getOperationStability as h, getOperationStabilityColor as _, isOperationDeprecated as k } from "../../../libs/operation.js";
@@ -15,7 +15,7 @@ import v from "../../../components/Section/SectionColumn.vue.js";
15
15
  import D from "../../ExampleRequest/ExampleRequest.vue.js";
16
16
  import H from "../../TestRequestButton/TestRequestButton.vue.js";
17
17
  import M from "../../ExampleResponses/ExampleResponses.vue.js";
18
- const $ = { class: "operation-details" }, z = { class: "examples" }, te = /* @__PURE__ */ O({
18
+ const $ = { class: "operation-details" }, z = { class: "examples" }, te = /* @__PURE__ */ b({
19
19
  __name: "ModernLayout",
20
20
  props: {
21
21
  id: {},
@@ -25,18 +25,19 @@ const $ = { class: "operation-details" }, z = { class: "examples" }, te = /* @__
25
25
  transformedOperation: {}
26
26
  },
27
27
  setup(n) {
28
- const i = S(), l = b(() => n.operation.summary || n.operation.path);
29
- return (o, A) => (m(), s(e(N), {
28
+ const i = O(), l = S(() => n.operation.summary || n.operation.path);
29
+ return (o, A) => (d(), m(e(N), {
30
30
  id: o.id,
31
31
  "aria-labelledby": e(i),
32
- label: l.value
32
+ label: l.value,
33
+ tabindex: "-1"
33
34
  }, {
34
35
  default: t(() => [
35
36
  r(e(V), null, {
36
37
  default: t(() => [
37
- e(h)(o.operation) ? (m(), s(e(w), {
38
+ e(h)(o.operation) ? (d(), m(e(w), {
38
39
  key: 0,
39
- class: d(e(_)(o.operation))
40
+ class: s(e(_)(o.operation))
40
41
  }, {
41
42
  default: t(() => [
42
43
  f(u(e(h)(o.operation)), 1)
@@ -44,7 +45,7 @@ const $ = { class: "operation-details" }, z = { class: "examples" }, te = /* @__
44
45
  _: 1
45
46
  }, 8, ["class"])) : y("", !0),
46
47
  a("div", {
47
- class: d(e(k)(o.operation) ? "deprecated" : "")
48
+ class: s(e(k)(o.operation) ? "deprecated" : "")
48
49
  }, [
49
50
  r(e(I), null, {
50
51
  default: t(() => [
@@ -1,5 +1,7 @@
1
1
  /**
2
2
  * Tiny wrapper around the scrollIntoView API
3
+ *
4
+ * Also focuses the element if the focus flag is true
3
5
  */
4
- export declare const scrollToId: (id: string) => Promise<void>;
6
+ export declare const scrollToId: (id: string, focus?: boolean) => Promise<void>;
5
7
  //# sourceMappingURL=scrollToId.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"scrollToId.d.ts","sourceRoot":"","sources":["../../src/helpers/scrollToId.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,UAAU,OAAc,MAAM,kBAE1C,CAAA"}
1
+ {"version":3,"file":"scrollToId.d.ts","sourceRoot":"","sources":["../../src/helpers/scrollToId.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,UAAU,OAAc,MAAM,UAAU,OAAO,kBAK3D,CAAA"}
@@ -1,7 +1,7 @@
1
- const t = async (e) => {
2
- var o;
3
- (o = document.getElementById(e)) == null || o.scrollIntoView();
1
+ const c = async (e, t) => {
2
+ const o = document.getElementById(e);
3
+ o && (o.scrollIntoView(), t && o.focus());
4
4
  };
5
5
  export {
6
- t as scrollToId
6
+ c as scrollToId
7
7
  };
@@ -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,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,SAepD,CAAA;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,OAAO,CAAC,EAAE,gBAAgB,GAAG,YAAY;;;;;;;;;;;;;qCApBrB,MAAM;EA2EpD"}
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,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