@scalar/api-reference 1.31.17 → 1.31.18

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.
@@ -1 +1 @@
1
- {"version":3,"file":"ApiReferenceLayout.vue.d.ts","sourceRoot":"","sources":["../../src/components/ApiReferenceLayout.vue"],"names":[],"mappings":"AAuuBA,OAAO,EAGL,KAAK,OAAO,EACb,MAAM,gBAAgB,CAAA;AAsCvB,OAAO,KAAK,EACV,oBAAoB,EAEpB,kBAAkB,EACnB,MAAM,SAAS,CAAA;AAwShB,iBAAS,cAAc;WAkYT,OAAO,IAA6B;;wBAtnBV,kBAAkB,KAAK,GAAG;wBAA1B,kBAAkB,KAAK,GAAG;wBAA1B,kBAAkB,KAAK,GAAG;iCAA1B,kBAAkB,KAAK,GAAG;+BAA1B,kBAAkB,KAAK,GAAG;iCAA1B,kBAAkB,KAAK,GAAG;+BAA1B,kBAAkB,KAAK,GAAG;;6BACrC,GAAG;;wBADQ,kBAAkB,KAAK,GAAG;wBAA1B,kBAAkB,KAAK,GAAG;wBAA1B,kBAAkB,KAAK,GAAG;iCAA1B,kBAAkB,KAAK,GAAG;+BAA1B,kBAAkB,KAAK,GAAG;iCAA1B,kBAAkB,KAAK,GAAG;+BAA1B,kBAAkB,KAAK,GAAG;;6BACrC,GAAG;;;;;;EA0nB/B;AAiCD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;;YAnsBqB,OAAO;eAAS,MAAM;;;;;;;;YAAtB,OAAO;eAAS,MAAM;;;;;;kFA0sB9D,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":"ApiReferenceLayout.vue.d.ts","sourceRoot":"","sources":["../../src/components/ApiReferenceLayout.vue"],"names":[],"mappings":"AAuuBA,OAAO,EAGL,KAAK,OAAO,EACb,MAAM,gBAAgB,CAAA;AAsCvB,OAAO,KAAK,EACV,oBAAoB,EAEpB,kBAAkB,EACnB,MAAM,SAAS,CAAA;AAwShB,iBAAS,cAAc;WAoYT,OAAO,IAA6B;;wBAxnBV,kBAAkB,KAAK,GAAG;wBAA1B,kBAAkB,KAAK,GAAG;wBAA1B,kBAAkB,KAAK,GAAG;iCAA1B,kBAAkB,KAAK,GAAG;+BAA1B,kBAAkB,KAAK,GAAG;iCAA1B,kBAAkB,KAAK,GAAG;+BAA1B,kBAAkB,KAAK,GAAG;;6BACrC,GAAG;;wBADQ,kBAAkB,KAAK,GAAG;wBAA1B,kBAAkB,KAAK,GAAG;wBAA1B,kBAAkB,KAAK,GAAG;iCAA1B,kBAAkB,KAAK,GAAG;+BAA1B,kBAAkB,KAAK,GAAG;iCAA1B,kBAAkB,KAAK,GAAG;+BAA1B,kBAAkB,KAAK,GAAG;;6BACrC,GAAG;;;;;;EA4nB/B;AAiCD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;;YArsBqB,OAAO;eAAS,MAAM;;;;;;;;YAAtB,OAAO;eAAS,MAAM;;;;;;kFA4sB9D,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"}
@@ -4,7 +4,7 @@ import o from "./ApiReferenceLayout.vue2.js";
4
4
  /* empty css */
5
5
  /* empty css */
6
6
  import t from "../_virtual/_plugin-vue_export-helper.js";
7
- const a = /* @__PURE__ */ t(o, [["__scopeId", "data-v-790b49f0"]]);
7
+ const c = /* @__PURE__ */ t(o, [["__scopeId", "data-v-4c824364"]]);
8
8
  export {
9
- a as default
9
+ c as default
10
10
  };
@@ -33,7 +33,7 @@ const lt = ["innerHTML"], st = { class: "references-header" }, ut = ["aria-label
33
33
  class: "scalar-api-references-standalone-search"
34
34
  }, ft = { key: 1 }, vt = { class: "references-editor" }, pt = { class: "references-editor-textarea" }, gt = ["aria-label"], ht = {
35
35
  key: 0,
36
- class: "w-64 empty:hidden"
36
+ class: "w-64 *:!p-0 empty:hidden"
37
37
  }, St = {
38
38
  key: 0,
39
39
  class: "references-footer"
@@ -305,7 +305,7 @@ const lt = ["innerHTML"], st = { class: "references-header" }, ut = ["aria-label
305
305
  ])) : l("", !0),
306
306
  t.value.hideSearch ? l("", !0) : (a(), y(r(W), {
307
307
  key: 1,
308
- class: "t-doc__sidebar",
308
+ class: "t-doc__sidebar max-w-64",
309
309
  searchHotKey: t.value.searchHotKey,
310
310
  spec: k.value
311
311
  }, null, 8, ["searchHotKey", "spec"]))
@@ -1 +1 @@
1
- {"version":3,"file":"ClassicHeader.vue.d.ts","sourceRoot":"","sources":["../../src/components/ClassicHeader.vue"],"names":[],"mappings":"AA6CA,iBAAS,cAAc;WA+CT,OAAO,IAA6B;;yBATrB,GAAG;oCACQ,GAAG;;;;EAa1C;AAOD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe,0RAMnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAKpG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
1
+ {"version":3,"file":"ClassicHeader.vue.d.ts","sourceRoot":"","sources":["../../src/components/ClassicHeader.vue"],"names":[],"mappings":"AAoDA,iBAAS,cAAc;WAkDT,OAAO,IAA6B;;yBATrB,GAAG;oCACQ,GAAG;;;;EAa1C;AAOD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe,0RAMnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAKpG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
@@ -1,16 +1,18 @@
1
- import { createElementBlock as s, openBlock as t, createElementVNode as o, renderSlot as r } from "vue";
1
+ import { createElementBlock as c, openBlock as t, createElementVNode as s, renderSlot as r } from "vue";
2
2
  /* empty css */
3
- import c from "../_virtual/_plugin-vue_export-helper.js";
4
- const n = {}, d = { class: "references-classic-header-container" }, a = { class: "references-classic-header" };
5
- function i(e, l) {
6
- return t(), s("div", d, [
7
- o("div", a, [
8
- r(e.$slots, "default", {}, void 0, !0),
3
+ import o from "../_virtual/_plugin-vue_export-helper.js";
4
+ const n = {}, d = { class: "references-classic-header-container" }, a = { class: "references-classic-header" }, i = { class: "references-classic-header-content" };
5
+ function l(e, _) {
6
+ return t(), c("div", d, [
7
+ s("div", a, [
8
+ s("div", i, [
9
+ r(e.$slots, "default", {}, void 0, !0)
10
+ ]),
9
11
  r(e.$slots, "dark-mode-toggle", {}, void 0, !0)
10
12
  ])
11
13
  ]);
12
14
  }
13
- const u = /* @__PURE__ */ c(n, [["render", i], ["__scopeId", "data-v-a860f78f"]]);
15
+ const h = /* @__PURE__ */ o(n, [["render", l], ["__scopeId", "data-v-9198d025"]]);
14
16
  export {
15
- u as default
17
+ h as default
16
18
  };
@@ -1 +1 @@
1
- {"version":3,"file":"DocumentSelector.vue.d.ts","sourceRoot":"","sources":["../../../src/components/DocumentSelector/DocumentSelector.vue"],"names":[],"mappings":"AAwDA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAA;AAKpE,KAAK,WAAW,GAAG;IACjB,OAAO,CAAC,EAAE,iBAAiB,EAAE,CAAA;IAC7B,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB,CAAC;;;;;;AA4HF,wBAOG"}
1
+ {"version":3,"file":"DocumentSelector.vue.d.ts","sourceRoot":"","sources":["../../../src/components/DocumentSelector/DocumentSelector.vue"],"names":[],"mappings":"AAwDA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAA;AAKpE,KAAK,WAAW,GAAG;IACjB,OAAO,CAAC,EAAE,iBAAiB,EAAE,CAAA;IAC7B,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB,CAAC;;;;;;AA6HF,wBAOG"}
@@ -1,21 +1,21 @@
1
- import { defineComponent as p, computed as s, createElementBlock as b, createCommentVNode as f, openBlock as x, createVNode as r, unref as i, withCtx as v, createElementVNode as c, toDisplayString as V } from "vue";
1
+ import { defineComponent as p, computed as s, createElementBlock as b, createCommentVNode as f, openBlock as x, createVNode as r, unref as i, withCtx as V, createElementVNode as c, toDisplayString as v } from "vue";
2
2
  import { ScalarListbox as g } from "@scalar/components";
3
- import { ScalarIconCaretUpDown as S } from "@scalar/icons";
4
- const h = {
3
+ import { ScalarIconCaretUpDown as h } from "@scalar/icons";
4
+ const S = {
5
5
  key: 0,
6
6
  class: "document-selector -mb-1 p-3 pb-0"
7
7
  }, w = {
8
- class: "group/dropdown-label hover:bg-b-2 text-c-2 flex w-full cursor-pointer items-center rounded border px-2 py-1.75",
9
- tabindex: "0"
10
- }, _ = { class: "text-c-1 overflow-hidden text-base text-ellipsis" }, y = /* @__PURE__ */ p({
8
+ class: "group/dropdown-label hover:bg-b-2 text-c-2 flex h-8 w-full cursor-pointer items-center rounded border px-2 py-1.75",
9
+ type: "button"
10
+ }, _ = { class: "text-c-1 overflow-hidden text-base text-ellipsis" }, k = /* @__PURE__ */ p({
11
11
  __name: "DocumentSelector",
12
12
  props: {
13
13
  options: {},
14
14
  modelValue: {}
15
15
  },
16
16
  emits: ["update:modelValue"],
17
- setup(l, { emit: d }) {
18
- const u = d, m = s(() => {
17
+ setup(l, { emit: u }) {
18
+ const d = u, m = s(() => {
19
19
  var e;
20
20
  return l.options && ((e = l.options) == null ? void 0 : e.length) > 1;
21
21
  }), a = s(
@@ -29,21 +29,21 @@ const h = {
29
29
  }
30
30
  ), n = s({
31
31
  get: () => a.value.find(({ id: e }) => e === String(l.modelValue)),
32
- set: (e) => u("update:modelValue", Number(e.id))
32
+ set: (e) => d("update:modelValue", Number(e.id))
33
33
  });
34
- return (e, o) => m.value ? (x(), b("div", h, [
34
+ return (e, o) => m.value ? (x(), b("div", S, [
35
35
  r(i(g), {
36
36
  modelValue: n.value,
37
37
  "onUpdate:modelValue": o[0] || (o[0] = (t) => n.value = t),
38
38
  options: a.value,
39
39
  resize: ""
40
40
  }, {
41
- default: v(() => {
41
+ default: V(() => {
42
42
  var t;
43
43
  return [
44
- c("div", w, [
45
- r(i(S), { class: "mr-1 size-4 text-current" }),
46
- c("span", _, V(((t = n.value) == null ? void 0 : t.label) || "Select API"), 1)
44
+ c("button", w, [
45
+ r(i(h), { class: "mr-1 size-4 text-current" }),
46
+ c("span", _, v(((t = n.value) == null ? void 0 : t.label) || "Select API"), 1)
47
47
  ])
48
48
  ];
49
49
  }),
@@ -53,5 +53,5 @@ const h = {
53
53
  }
54
54
  });
55
55
  export {
56
- y as default
56
+ k as default
57
57
  };
@@ -1 +1 @@
1
- {"version":3,"file":"useDocumentSource.d.ts","sourceRoot":"","sources":["../../../../src/features/DocumentSource/hooks/useDocumentSource.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAA;AAE1F,OAAO,KAAK,EAAW,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAEjE,OAAO,EAAE,KAAK,yBAAyB,EAAmC,MAAM,6BAA6B,CAAA;AAC7G,OAAO,EAAE,KAAK,gBAAgB,EAAE,KAAK,GAAG,EAAiC,MAAM,KAAK,CAAA;AAIpF;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,EAChC,gBAAgB,EAAE,wBAAwB,EAC1C,oBAAoB,EAAE,4BAA4B,EAClD,aAAa,GACd,EAAE;IACD,gBAAgB,CAAC,EAAE,gBAAgB,CAAC,MAAM,CAAC,CAAA;IAC3C,oBAAoB,CAAC,EAAE,gBAAgB,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAA;IAC7D,aAAa,CAAC,EAAE,gBAAgB,CAAC,yBAAyB,CAAC,CAAA;CAC5D,GAAG;IACF,gBAAgB,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IAC7B,sBAAsB,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IACnC,oBAAoB,EAAE,GAAG,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAA;IAC/C,cAAc,EAAE,UAAU,CAAC,OAAO,oBAAoB,CAAC,CAAA;IACvD,mBAAmB,EAAE,UAAU,CAAC,OAAO,yBAAyB,CAAC,CAAA;CAClE,CA0GA"}
1
+ {"version":3,"file":"useDocumentSource.d.ts","sourceRoot":"","sources":["../../../../src/features/DocumentSource/hooks/useDocumentSource.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAA;AAG1F,OAAO,KAAK,EAAW,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACjE,OAAO,EAAE,KAAK,yBAAyB,EAAmC,MAAM,6BAA6B,CAAA;AAC7G,OAAO,EAAE,KAAK,gBAAgB,EAAE,KAAK,GAAG,EAAiC,MAAM,KAAK,CAAA;AAIpF;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,EAChC,gBAAgB,EAAE,wBAAwB,EAC1C,oBAAoB,EAAE,4BAA4B,EAClD,aAAa,GACd,EAAE;IACD,gBAAgB,CAAC,EAAE,gBAAgB,CAAC,MAAM,CAAC,CAAA;IAC3C,oBAAoB,CAAC,EAAE,gBAAgB,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAA;IAC7D,aAAa,CAAC,EAAE,gBAAgB,CAAC,yBAAyB,CAAC,CAAA;CAC5D,GAAG;IACF,gBAAgB,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IAC7B,sBAAsB,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IACnC,oBAAoB,EAAE,GAAG,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAA;IAC/C,cAAc,EAAE,UAAU,CAAC,OAAO,oBAAoB,CAAC,CAAA;IACvD,mBAAmB,EAAE,UAAU,CAAC,OAAO,yBAAyB,CAAC,CAAA;CAClE,CA+GA"}
@@ -1,17 +1,17 @@
1
- import { createWorkspaceStore as y, createActiveEntitiesStore as A } from "@scalar/api-client/store";
2
- import { normalize as D, upgrade as P, dereference as V } from "@scalar/openapi-parser";
1
+ import { createWorkspaceStore as P, createActiveEntitiesStore as w } from "@scalar/api-client/store";
3
2
  import { measure as f } from "@scalar/helpers/testing/measure";
4
- import { apiReferenceConfigurationSchema as O } from "@scalar/types/api-reference";
5
- import { computed as l, toValue as e, ref as d, watch as W } from "vue";
6
- import { useDocumentFetcher as b } from "./useDocumentFetcher.js";
3
+ import { normalize as y, upgrade as O, dereference as V } from "@scalar/openapi-parser";
4
+ import { apiReferenceConfigurationSchema as D } from "@scalar/types/api-reference";
5
+ import { computed as l, toValue as t, ref as d, watch as F } from "vue";
6
+ import { useDocumentFetcher as I } from "./useDocumentFetcher.js";
7
7
  function C({
8
- originalDocument: c,
9
- dereferencedDocument: o,
10
- configuration: i
8
+ originalDocument: i,
9
+ dereferencedDocument: n,
10
+ configuration: s
11
11
  }) {
12
- const { originalDocument: g } = b({
13
- configuration: i
14
- }), s = l(() => c ? e(c) : e(g)), a = d(""), h = l(() => o ? e(o) : e(u)), u = d({
12
+ const { originalDocument: h } = I({
13
+ configuration: s
14
+ }), u = l(() => i ? t(i) : t(h)), a = d(""), g = l(() => n ? t(n) : t(m)), m = d({
15
15
  openapi: "3.1.0",
16
16
  info: {
17
17
  title: "",
@@ -19,46 +19,50 @@ function C({
19
19
  },
20
20
  paths: {}
21
21
  });
22
- W(
23
- () => e(s),
24
- async (p) => {
25
- if (!p)
22
+ F(
23
+ () => t(u),
24
+ async (c) => {
25
+ if (!c)
26
26
  return;
27
- const t = D(p);
28
- if (a.value = typeof t == "object" && (t.openapi || t.swagger) || "", o)
27
+ const e = y(c);
28
+ if (e === void 0) {
29
+ console.error("Failed to parse the OpenAPI document:", c);
29
30
  return;
30
- const w = !a.value.startsWith("3.1") ? (
31
+ }
32
+ if (a.value = typeof e == "object" && (e.openapi || e.swagger) || "", n)
33
+ return;
34
+ const v = !a.value.startsWith("3.1") ? (
31
35
  // Upgrade needed
32
36
  f("upgrade", () => {
33
- const { specification: n } = P(t);
34
- return n;
37
+ const { specification: o } = O(e);
38
+ return o;
35
39
  })
36
40
  ) : (
37
41
  // Skip the upgrade
38
- t
39
- ), v = await f("dereference", async () => {
40
- const { schema: n, errors: r } = await V(w);
42
+ e
43
+ ), A = await f("dereference", async () => {
44
+ const { schema: o, errors: r } = await V(v);
41
45
  return r != null && r.length && console.warn(
42
46
  `Please open an issue on https://github.com/scalar/scalar
43
47
  `,
44
48
  `Scalar OpenAPI Parser Warning:
45
49
  `,
46
50
  r
47
- ), n === void 0 && console.error("Failed to dereference the OpenAPI document", r), n;
51
+ ), o === void 0 && console.error("Failed to dereference the OpenAPI document", r), o;
48
52
  });
49
- u.value = v;
53
+ m.value = A;
50
54
  },
51
55
  { immediate: !0 }
52
56
  );
53
- const m = y({
57
+ const p = P({
54
58
  useLocalStorage: !1,
55
- ...e(i) ?? O.parse({})
56
- }), S = A(m);
59
+ ...t(s) ?? D.parse({})
60
+ }), S = w(p);
57
61
  return {
58
- originalDocument: s,
62
+ originalDocument: u,
59
63
  originalOpenApiVersion: a,
60
- dereferencedDocument: h,
61
- workspaceStore: m,
64
+ dereferencedDocument: g,
65
+ workspaceStore: p,
62
66
  activeEntitiesStore: S
63
67
  };
64
68
  }
@@ -1 +1 @@
1
- {"version":3,"file":"DownloadLink.vue.d.ts","sourceRoot":"","sources":["../../../src/features/DownloadLink/DownloadLink.vue"],"names":[],"mappings":"AAuKA,KAAK,WAAW,GAAG;IACjB,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAC;;AA8HF,wBAMG"}
1
+ {"version":3,"file":"DownloadLink.vue.d.ts","sourceRoot":"","sources":["../../../src/features/DownloadLink/DownloadLink.vue"],"names":[],"mappings":"AAqLA,KAAK,WAAW,GAAG;IACjB,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAC;;AAoJF,wBAMG"}
@@ -1,7 +1,7 @@
1
1
  import o from "./DownloadLink.vue2.js";
2
2
  /* empty css */
3
- import t from "../../_virtual/_plugin-vue_export-helper.js";
4
- const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-3c00dd17"]]);
3
+ import a from "../../_virtual/_plugin-vue_export-helper.js";
4
+ const e = /* @__PURE__ */ a(o, [["__scopeId", "data-v-dde86eaa"]]);
5
5
  export {
6
- m as default
6
+ e as default
7
7
  };
@@ -1,55 +1,59 @@
1
- import { defineComponent as w, computed as v, createElementBlock as x, createCommentVNode as b, unref as k, openBlock as C, createElementVNode as t, withModifiers as r, createVNode as i, withCtx as s, createTextVNode as d } from "vue";
2
- import D from "github-slugger";
3
- import u from "../../components/Badge/Badge.vue.js";
4
- import { useConfig as c } from "../../hooks/useConfig.js";
5
- import { downloadEventBus as y } from "../../libs/download.js";
6
- const B = {
7
- key: 0,
8
- class: "download-container group"
9
- }, I = /* @__PURE__ */ w({
1
+ import { defineComponent as T, computed as B, createElementBlock as t, createCommentVNode as l, unref as n, openBlock as d, normalizeClass as N, withModifiers as w, createElementVNode as y, createVNode as g, withCtx as D, createTextVNode as b } from "vue";
2
+ import V from "github-slugger";
3
+ import c from "../../components/Badge/Badge.vue.js";
4
+ import { useConfig as j } from "../../hooks/useConfig.js";
5
+ import { downloadEventBus as E } from "../../libs/download.js";
6
+ const $ = /* @__PURE__ */ T({
10
7
  __name: "DownloadLink",
11
8
  props: {
12
9
  title: {}
13
10
  },
14
- setup(a) {
15
- const m = c(), p = new D(), f = v(() => p.slug(a.title ?? "")), e = (n) => {
16
- y.emit({ id: "", filename: f.value, format: n });
11
+ setup(v) {
12
+ const e = j(), k = new V(), x = B(() => k.slug(v.title ?? "")), r = (a) => {
13
+ E.emit({ id: "", filename: x.value, format: a });
17
14
  };
18
- return (n, o) => {
19
- var l;
20
- return (l = k(m)) != null && l.hideDownloadButton ? b("", !0) : (C(), x("div", B, [
21
- t("button", {
15
+ return (a, o) => {
16
+ var u, s, i, m, p, f;
17
+ return ((u = n(e)) == null ? void 0 : u.documentDownloadType) !== "none" ? (d(), t("div", {
18
+ key: 0,
19
+ class: N([{
20
+ "download-both": ((s = n(e)) == null ? void 0 : s.documentDownloadType) === "both"
21
+ }, "download-container group"])
22
+ }, [
23
+ ((i = n(e)) == null ? void 0 : i.documentDownloadType) === "json" || ((m = n(e)) == null ? void 0 : m.documentDownloadType) === "both" ? (d(), t("button", {
24
+ key: 0,
22
25
  type: "button",
23
26
  class: "download-button",
24
- onClick: o[0] || (o[0] = r((g) => e("json"), ["prevent"])),
27
+ onClick: o[0] || (o[0] = w((C) => r("json"), ["prevent"])),
25
28
  variant: "ghost"
26
29
  }, [
27
- o[3] || (o[3] = t("span", null, " Download OpenAPI Document ", -1)),
28
- i(u, { class: "extension hidden group-hover:flex" }, {
29
- default: s(() => o[2] || (o[2] = [
30
- d("json")
30
+ o[3] || (o[3] = y("span", null, " Download OpenAPI Document ", -1)),
31
+ g(c, { class: "extension hidden group-hover:flex" }, {
32
+ default: D(() => o[2] || (o[2] = [
33
+ b("json")
31
34
  ])),
32
35
  _: 1
33
36
  })
34
- ]),
35
- t("button", {
37
+ ])) : l("", !0),
38
+ ((p = n(e)) == null ? void 0 : p.documentDownloadType) === "yaml" || ((f = n(e)) == null ? void 0 : f.documentDownloadType) === "both" ? (d(), t("button", {
39
+ key: 1,
36
40
  type: "button",
37
41
  class: "download-button",
38
- onClick: o[1] || (o[1] = r((g) => e("yaml"), ["prevent"])),
42
+ onClick: o[1] || (o[1] = w((C) => r("yaml"), ["prevent"])),
39
43
  variant: "ghost"
40
44
  }, [
41
- o[5] || (o[5] = t("span", null, " Download OpenAPI Document ", -1)),
42
- i(u, { class: "extension hidden group-hover:flex" }, {
43
- default: s(() => o[4] || (o[4] = [
44
- d("yaml")
45
+ o[5] || (o[5] = y("span", null, " Download OpenAPI Document ", -1)),
46
+ g(c, { class: "extension hidden group-hover:flex" }, {
47
+ default: D(() => o[4] || (o[4] = [
48
+ b("yaml")
45
49
  ])),
46
50
  _: 1
47
51
  })
48
- ])
49
- ]));
52
+ ])) : l("", !0)
53
+ ], 2)) : l("", !0);
50
54
  };
51
55
  }
52
56
  });
53
57
  export {
54
- I as default
58
+ $ as default
55
59
  };
@@ -1 +1 @@
1
- {"version":3,"file":"SearchButton.vue.d.ts","sourceRoot":"","sources":["../../../src/features/Search/SearchButton.vue"],"names":[],"mappings":"AAoFA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;AAQhD,KAAK,WAAW,GAAG;IACf,IAAI,EAAE,IAAI,CAAA;IACV,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB,CAAC;;kBADe,MAAM;;AAyJzB,wBAOG"}
1
+ {"version":3,"file":"SearchButton.vue.d.ts","sourceRoot":"","sources":["../../../src/features/Search/SearchButton.vue"],"names":[],"mappings":"AAsFA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;AAQhD,KAAK,WAAW,GAAG;IACf,IAAI,EAAE,IAAI,CAAA;IACV,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB,CAAC;;kBADe,MAAM;;AA0JzB,wBAOG"}
@@ -1,45 +1,46 @@
1
- import { defineComponent as w, ref as v, watch as C, nextTick as K, onMounted as B, onBeforeUnmount as b, createElementBlock as r, openBlock as a, Fragment as s, createVNode as c, unref as l, withCtx as u, createElementVNode as n, createTextVNode as m, toDisplayString as E } from "vue";
2
- import { useModal as H, ScalarSidebarSearchButton as M } from "@scalar/components";
1
+ import { defineComponent as w, ref as C, watch as v, nextTick as K, onMounted as B, onBeforeUnmount as b, createElementBlock as a, openBlock as r, Fragment as s, createVNode as c, unref as l, normalizeClass as E, withCtx as u, createElementVNode as n, createTextVNode as m, toDisplayString as H } from "vue";
2
+ import { useModal as M, ScalarSidebarSearchButton as g } from "@scalar/components";
3
3
  import { isMacOS as f } from "@scalar/helpers/general/is-mac-os";
4
- import g from "./SearchModal.vue.js";
5
- import { useApiClient as x } from "../ApiClientModal/useApiClient.js";
6
- const O = /* @__PURE__ */ w({
4
+ import L from "./SearchModal.vue.js";
5
+ import { useApiClient as N } from "../ApiClientModal/useApiClient.js";
6
+ const z = /* @__PURE__ */ w({
7
7
  __name: "SearchButton",
8
8
  props: {
9
9
  spec: {},
10
10
  searchHotKey: { default: "k" }
11
11
  },
12
12
  setup(y) {
13
- const S = y, p = v(), o = H(), { client: h } = x(), d = (t) => {
13
+ const S = y, i = C(), o = M(), { client: h } = N(), p = (t) => {
14
14
  var e;
15
15
  (f() ? t.metaKey : t.ctrlKey) && t.key === S.searchHotKey && !((e = h.value) != null && e.modalState.open) && (t.preventDefault(), t.stopPropagation(), o.open ? o.hide() : o.show());
16
16
  };
17
- C(
17
+ v(
18
18
  () => o.open,
19
19
  (t, e) => {
20
20
  !t && e && K(() => {
21
- var i;
22
- (i = p.value) == null || i.focus();
21
+ var d;
22
+ (d = i.value) == null || d.focus();
23
23
  });
24
24
  }
25
- ), B(() => window.addEventListener("keydown", d)), b(() => window.removeEventListener("keydown", d));
25
+ ), B(() => window.addEventListener("keydown", p)), b(() => window.removeEventListener("keydown", p));
26
26
  function k() {
27
27
  o.show();
28
28
  }
29
- return (t, e) => (a(), r(s, null, [
30
- c(l(M), {
29
+ return (t, e) => (r(), a(s, null, [
30
+ c(l(g), {
31
31
  ref_key: "button",
32
- ref: p,
32
+ ref: i,
33
+ class: E(["w-full", t.$attrs.class]),
33
34
  onClick: k
34
35
  }, {
35
36
  shortcut: u(() => [
36
- l(f)() ? (a(), r(s, { key: 0 }, [
37
+ l(f)() ? (r(), a(s, { key: 0 }, [
37
38
  m("⌘")
38
- ], 64)) : (a(), r(s, { key: 1 }, [
39
+ ], 64)) : (r(), a(s, { key: 1 }, [
39
40
  e[0] || (e[0] = n("span", { class: "sr-only" }, "CTRL", -1)),
40
41
  e[1] || (e[1] = n("span", { "aria-hidden": "true" }, "⌃", -1))
41
42
  ], 64)),
42
- m(" " + E(t.searchHotKey), 1)
43
+ m(" " + H(t.searchHotKey), 1)
43
44
  ]),
44
45
  default: u(() => [
45
46
  e[2] || (e[2] = n("span", { class: "sr-only" }, "Open Search", -1)),
@@ -49,8 +50,8 @@ const O = /* @__PURE__ */ w({
49
50
  }, " Search ", -1))
50
51
  ]),
51
52
  _: 1
52
- }, 512),
53
- c(g, {
53
+ }, 8, ["class"]),
54
+ c(L, {
54
55
  modalState: l(o),
55
56
  parsedSpec: t.spec
56
57
  }, null, 8, ["modalState", "parsedSpec"])
@@ -58,5 +59,5 @@ const O = /* @__PURE__ */ w({
58
59
  }
59
60
  });
60
61
  export {
61
- O as default
62
+ z as default
62
63
  };
@@ -1,6 +1,6 @@
1
1
  import { createEmptySpecification as w } from "../libs/openapi.js";
2
2
  import { normalizeHttpMethod as m } from "@scalar/helpers/http/normalize-http-method";
3
- const I = (s, i) => new Promise((e, b) => {
3
+ const P = (s, i) => new Promise((e, b) => {
4
4
  try {
5
5
  return e(s ? k(s, i) : k(w()));
6
6
  } catch (p) {
@@ -13,12 +13,12 @@ const I = (s, i) => new Promise((e, b) => {
13
13
  const b = [], p = (o) => {
14
14
  var h;
15
15
  !("children" in o) || !((h = o.children) != null && h.length) || o.children.forEach((a) => {
16
- var f, u, t, n, g;
17
- let r = (f = e.tags) == null ? void 0 : f.findIndex((d) => "tag" in o && d.name === o.tag.name);
16
+ var f, u, t, n, g, d;
17
+ let r = (f = e.tags) == null ? void 0 : f.findIndex((y) => "tag" in o && y.name === o.tag.name);
18
18
  r === -1 && "tag" in o && (e.tags.push({
19
19
  name: o.tag.name,
20
20
  operations: []
21
- }), r = e.tags.length - 1), e.tags[r].operations ||= [], "tag" in a ? p(a) : "operation" in a ? e.tags[r].operations.push({
21
+ }), r = e.tags.length - 1), (u = e.tags[r]).operations || (u.operations = []), "tag" in a ? p(a) : "operation" in a ? e.tags[r].operations.push({
22
22
  id: a.id,
23
23
  httpVerb: m(a.method),
24
24
  path: a.path,
@@ -26,7 +26,7 @@ const I = (s, i) => new Promise((e, b) => {
26
26
  description: a.operation.description || "",
27
27
  isWebhook: !1,
28
28
  information: a.operation,
29
- pathParameters: (t = (u = e.paths) == null ? void 0 : u[a.path ?? ""]) == null ? void 0 : t.parameters
29
+ pathParameters: (n = (t = e.paths) == null ? void 0 : t[a.path ?? ""]) == null ? void 0 : n.parameters
30
30
  }) : "webhook" in a && e.tags[r].operations.push({
31
31
  id: a.id,
32
32
  httpVerb: m(a.method),
@@ -35,7 +35,7 @@ const I = (s, i) => new Promise((e, b) => {
35
35
  description: a.webhook.description || "",
36
36
  isWebhook: !0,
37
37
  information: a.webhook,
38
- pathParameters: (g = (n = e.webhooks) == null ? void 0 : n[a.name ?? ""]) == null ? void 0 : g.parameters
38
+ pathParameters: (d = (g = e.webhooks) == null ? void 0 : g[a.name ?? ""]) == null ? void 0 : d.parameters
39
39
  });
40
40
  });
41
41
  };
@@ -77,5 +77,5 @@ const I = (s, i) => new Promise((e, b) => {
77
77
  };
78
78
  };
79
79
  export {
80
- I as parse
80
+ P as parse
81
81
  };