@scalar/api-reference 1.31.15 → 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.
Files changed (32) hide show
  1. package/CHANGELOG.md +47 -0
  2. package/dist/browser/standalone.js +15688 -15636
  3. package/dist/browser/webpack-stats.json +1 -1
  4. package/dist/components/ApiReferenceLayout.vue.d.ts.map +1 -1
  5. package/dist/components/ApiReferenceLayout.vue.js +2 -2
  6. package/dist/components/ApiReferenceLayout.vue2.js +23 -23
  7. package/dist/components/ClassicHeader.vue.d.ts.map +1 -1
  8. package/dist/components/ClassicHeader.vue.js +11 -9
  9. package/dist/components/DocumentSelector/DocumentSelector.vue.d.ts.map +1 -1
  10. package/dist/components/DocumentSelector/DocumentSelector.vue.js +19 -22
  11. package/dist/components/Sidebar/Sidebar.vue.js +2 -2
  12. package/dist/components/Sidebar/SidebarElement.vue.d.ts.map +1 -1
  13. package/dist/components/Sidebar/SidebarElement.vue.js +1 -1
  14. package/dist/components/Sidebar/SidebarGroup.vue.js +1 -1
  15. package/dist/features/DocumentSource/hooks/useDocumentSource.d.ts.map +1 -1
  16. package/dist/features/DocumentSource/hooks/useDocumentSource.js +35 -31
  17. package/dist/features/DownloadLink/DownloadLink.vue.d.ts.map +1 -1
  18. package/dist/features/DownloadLink/DownloadLink.vue.js +3 -3
  19. package/dist/features/DownloadLink/DownloadLink.vue2.js +35 -31
  20. package/dist/features/ExampleResponses/ExampleResponses.vue.js +1 -1
  21. package/dist/features/Search/SearchButton.vue.d.ts.map +1 -1
  22. package/dist/features/Search/SearchButton.vue.js +61 -5
  23. package/dist/features/Search/SearchButton.vue2.js +2 -70
  24. package/dist/helpers/parse.js +7 -7
  25. package/dist/index.js +1 -1
  26. package/dist/libs/openapi.js +15 -15
  27. package/dist/style.css +1 -1
  28. package/package.json +12 -12
  29. package/dist/legacy/fixtures/httpRequestMethods.d.ts +0 -10
  30. package/dist/legacy/fixtures/httpRequestMethods.d.ts.map +0 -1
  31. package/dist/legacy/fixtures/index.d.ts +0 -2
  32. package/dist/legacy/fixtures/index.d.ts.map +0 -1
@@ -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
  };
@@ -3,10 +3,10 @@ import { provideUseId as $e } from "@headlessui/vue";
3
3
  import { OpenApiClientButton as Te } from "@scalar/api-client/components";
4
4
  import { LAYOUT_SYMBOL as De } from "@scalar/api-client/hooks";
5
5
  import { WORKSPACE_SYMBOL as Ee, ACTIVE_ENTITIES_SYMBOL as Me } from "@scalar/api-client/store";
6
- import { addScalarClassesToHeadless as Oe, ScalarErrorBoundary as Be, ScalarSidebarFooter as Ie, ScalarColorModeToggleButton as Re, ScalarColorModeToggleIcon as Le } from "@scalar/components";
6
+ import { addScalarClassesToHeadless as Oe, ScalarErrorBoundary as Ie, ScalarSidebarFooter as Be, ScalarColorModeToggleButton as Re, ScalarColorModeToggleIcon as Le } from "@scalar/components";
7
7
  import { sleep as He } from "@scalar/helpers/testing/sleep";
8
- import { hasObtrusiveScrollbars as Ae, getThemeStyles as Pe } from "@scalar/themes";
9
- import { apiReferenceConfigurationSchema as _e } from "@scalar/types/api-reference";
8
+ import { hasObtrusiveScrollbars as _e, getThemeStyles as Ae } from "@scalar/themes";
9
+ import { apiReferenceConfigurationSchema as Pe } from "@scalar/types/api-reference";
10
10
  import { useBreakpoints as Fe } from "@scalar/use-hooks/useBreakpoints";
11
11
  import { useToasts as Ne, ScalarToasts as Ve } from "@scalar/use-toasts";
12
12
  import { useMediaQuery as Ue, useResizeObserver as Ye, useDebounceFn as Ke } from "@vueuse/core";
@@ -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"
@@ -51,7 +51,7 @@ const lt = ["innerHTML"], st = { class: "references-header" }, ut = ["aria-label
51
51
  emits: ["changeTheme", "updateContent", "loadSwaggerFile", "linkSwaggerFile", "toggleDarkMode"],
52
52
  setup(M) {
53
53
  const t = T(
54
- () => _e.parse(M.configuration)
54
+ () => Pe.parse(M.configuration)
55
55
  ), { initializeToasts: j, toast: q } = Ne();
56
56
  j((e) => q(e));
57
57
  const {
@@ -70,7 +70,7 @@ const lt = ["innerHTML"], st = { class: "references-header" }, ut = ["aria-label
70
70
  Ye(w, (e) => {
71
71
  te.value = e[0].contentRect.height + "px";
72
72
  });
73
- const oe = T(Ae), R = qe(t), { isSidebarOpen: B, setCollapsedSidebarItem: L, scrollToOperation: re, items: H } = tt(d, {
73
+ const oe = T(_e), R = qe(t), { isSidebarOpen: I, setCollapsedSidebarItem: L, scrollToOperation: re, items: H } = tt(d, {
74
74
  ...R,
75
75
  config: t
76
76
  }), {
@@ -79,8 +79,8 @@ const lt = ["innerHTML"], st = { class: "references-header" }, ut = ["aria-label
79
79
  getSectionId: ie,
80
80
  getTagId: le,
81
81
  hash: O,
82
- isIntersectionEnabled: A,
83
- updateHash: P,
82
+ isIntersectionEnabled: _,
83
+ updateHash: A,
84
84
  replaceUrlState: se
85
85
  } = R;
86
86
  if (t.value.redirect && typeof window < "u") {
@@ -90,11 +90,11 @@ const lt = ["innerHTML"], st = { class: "references-header" }, ut = ["aria-label
90
90
  e && history.replaceState({}, "", e);
91
91
  }
92
92
  ge(() => {
93
- P(), Oe();
93
+ A(), Oe();
94
94
  });
95
- const _ = async (e) => {
95
+ const P = async (e) => {
96
96
  var o;
97
- A.value = !1, P(), e ? re(e) : (o = w.value) == null || o.scrollTo(0, 0), await He(100), A.value = !0;
97
+ _.value = !1, A(), e ? re(e) : (o = w.value) == null || o.scrollTo(0, 0), await He(100), _.value = !0;
98
98
  }, F = D(0);
99
99
  K(() => {
100
100
  var n, i, C;
@@ -105,8 +105,8 @@ const lt = ["innerHTML"], st = { class: "references-header" }, ut = ["aria-label
105
105
  F.value = $ < 2 ? 0 : $;
106
106
  }
107
107
  window.onhashchange = () => {
108
- _(ae());
109
- }, window.onpopstate = () => t.value.pathRouting && _(ne(window.location.pathname)), window.addEventListener("scroll", N, { passive: !0 });
108
+ P(ae());
109
+ }, window.onpopstate = () => t.value.pathRouting && P(ne(window.location.pathname)), window.addEventListener("scroll", N, { passive: !0 });
110
110
  });
111
111
  const ue = T(
112
112
  () => ee.value || !t.value.isEditable
@@ -173,14 +173,14 @@ const lt = ["innerHTML"], st = { class: "references-header" }, ut = ["aria-label
173
173
  U("defaultHttpClient", ce), U("hiddenClients", de);
174
174
  const me = T(
175
175
  () => `<style>
176
- ${Pe(t.value.theme, {
176
+ ${Ae(t.value.theme, {
177
177
  fonts: t.value.withDefaultFonts
178
178
  })}</style>`
179
179
  ), { mediaQueries: fe } = Fe(), ve = !1;
180
180
  return E(fe.lg, (e, o) => {
181
- o && !e && (B.value = !1);
181
+ o && !e && (I.value = !1);
182
182
  }), E(O, (e, o) => {
183
- e && e !== o && (B.value = !1);
183
+ e && e !== o && (I.value = !1);
184
184
  }), (e, o) => {
185
185
  var n, i, C, $, Y;
186
186
  return a(), f(G, null, [
@@ -194,7 +194,7 @@ const lt = ["innerHTML"], st = { class: "references-header" }, ut = ["aria-label
194
194
  "scalar-scrollbars-obtrusive": oe.value,
195
195
  "references-editable": t.value.isEditable,
196
196
  "references-sidebar": t.value.showSidebar,
197
- "references-sidebar-mobile-open": r(B),
197
+ "references-sidebar-mobile-open": r(I),
198
198
  "references-classic": t.value.layout === "classic"
199
199
  },
200
200
  e.$attrs.class
@@ -216,7 +216,7 @@ const lt = ["innerHTML"], st = { class: "references-header" }, ut = ["aria-label
216
216
  class: "references-navigation t-doc__sidebar"
217
217
  }, [
218
218
  p("div", dt, [
219
- v(r(Be), null, {
219
+ v(r(Ie), null, {
220
220
  default: s(() => {
221
221
  var S, m;
222
222
  return [
@@ -224,14 +224,14 @@ const lt = ["innerHTML"], st = { class: "references-header" }, ut = ["aria-label
224
224
  title: ((m = (S = r(d)) == null ? void 0 : S.info) == null ? void 0 : m.title) ?? "The OpenAPI Schema"
225
225
  }, {
226
226
  "sidebar-start": s(() => {
227
- var I;
227
+ var B;
228
228
  return [
229
229
  e.$slots["document-selector"] ? (a(), f("div", ct, [
230
230
  u(e.$slots, "document-selector", {}, void 0, !0)
231
231
  ])) : l("", !0),
232
232
  t.value.hideSearch ? l("", !0) : (a(), f("div", mt, [
233
233
  v(r(W), {
234
- searchHotKey: (I = t.value) == null ? void 0 : I.searchHotKey,
234
+ searchHotKey: (B = t.value) == null ? void 0 : B.searchHotKey,
235
235
  spec: k.value
236
236
  }, null, 8, ["searchHotKey", "spec"])
237
237
  ])),
@@ -240,12 +240,12 @@ const lt = ["innerHTML"], st = { class: "references-header" }, ut = ["aria-label
240
240
  }),
241
241
  "sidebar-end": s(() => [
242
242
  u(e.$slots, "sidebar-end", g(h(c.value)), () => [
243
- v(r(Ie), { class: "darklight-reference" }, {
243
+ v(r(Be), { class: "darklight-reference" }, {
244
244
  toggle: s(() => [
245
245
  t.value.hideDarkModeToggle ? (a(), f("span", ft)) : (a(), y(r(Re), {
246
246
  key: 0,
247
247
  modelValue: e.isDark,
248
- "onUpdate:modelValue": o[0] || (o[0] = (I) => e.$emit("toggleDarkMode"))
248
+ "onUpdate:modelValue": o[0] || (o[0] = (B) => e.$emit("toggleDarkMode"))
249
249
  }, null, 8, ["modelValue"]))
250
250
  ]),
251
251
  default: s(() => [
@@ -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":"AA2DA,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;;;;;;AA+HF,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,24 +1,24 @@
1
- import { defineComponent as p, computed as s, createElementBlock as b, createCommentVNode as f, openBlock as x, createVNode as a, unref as i, withCtx as v, createElementVNode as d, 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
3
  import { ScalarIconCaretUpDown as h } from "@scalar/icons";
4
- const w = {
4
+ const S = {
5
5
  key: 0,
6
6
  class: "document-selector -mb-1 p-3 pb-0"
7
- }, S = {
8
- class: "group/dropdown-label hover:bg-b-2 text-c-2 flex w-full cursor-pointer items-center rounded border py-1.75 pr-1.5 pl-1.75",
9
- tabindex: "0"
10
- }, _ = { class: "text-c-1 overflow-hidden text-sm font-medium text-ellipsis" }, y = /* @__PURE__ */ p({
7
+ }, w = {
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: c }) {
18
- const m = c, u = 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
- }), r = s(
21
+ }), a = s(
22
22
  () => {
23
23
  var e;
24
24
  return ((e = l.options) == null ? void 0 : e.map((o, t) => ({
@@ -28,25 +28,22 @@ const w = {
28
28
  }))) || [];
29
29
  }
30
30
  ), n = s({
31
- get: () => r.value.find(({ id: e }) => e === String(l.modelValue)),
32
- set: (e) => m("update:modelValue", Number(e.id))
31
+ get: () => a.value.find(({ id: e }) => e === String(l.modelValue)),
32
+ set: (e) => d("update:modelValue", Number(e.id))
33
33
  });
34
- return (e, o) => u.value ? (x(), b("div", w, [
35
- a(i(g), {
34
+ return (e, o) => m.value ? (x(), b("div", S, [
35
+ r(i(g), {
36
36
  modelValue: n.value,
37
37
  "onUpdate:modelValue": o[0] || (o[0] = (t) => n.value = t),
38
- options: r.value,
38
+ options: a.value,
39
39
  resize: ""
40
40
  }, {
41
- default: v(() => {
41
+ default: V(() => {
42
42
  var t;
43
43
  return [
44
- d("div", S, [
45
- a(i(h), {
46
- class: "mr-1.5 h-3 w-3 text-current",
47
- weight: "bold"
48
- }),
49
- d("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)
50
47
  ])
51
48
  ];
52
49
  }),
@@ -56,5 +53,5 @@ const w = {
56
53
  }
57
54
  });
58
55
  export {
59
- y as default
56
+ k as default
60
57
  };
@@ -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 p = /* @__PURE__ */ r(o, [["__scopeId", "data-v-66291b32"]]);
4
+ const e = /* @__PURE__ */ r(o, [["__scopeId", "data-v-fbdf40e7"]]);
5
5
  export {
6
- p as default
6
+ e as default
7
7
  };
@@ -1 +1 @@
1
- {"version":3,"file":"SidebarElement.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Sidebar/SidebarElement.vue"],"names":[],"mappings":"AA2VA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAA;AAQhE,KAAK,WAAW,GAAG;IACjB,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,cAAc,CAAA;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,IAAI,CAAC,EAAE,OAAO,CAAA;CACf,CAAC;AAuEF,iBAAS,cAAc;WA4KT,OAAO,IAA6B;;yBATpB,GAAG;+BACG,GAAG;;;;EAatC;AAiBD,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":"AAiWA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAA;AAQhE,KAAK,WAAW,GAAG;IACjB,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,cAAc,CAAA;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,IAAI,CAAC,EAAE,OAAO,CAAA;CACf,CAAC;AAuEF,iBAAS,cAAc;WA+KT,OAAO,IAA6B;;yBATpB,GAAG;+BACG,GAAG;;;;EAatC;AAiBD,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 m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-b6cecb8a"]]);
4
+ const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-9ab41262"]]);
5
5
  export {
6
6
  m as default
7
7
  };
@@ -1,7 +1,7 @@
1
1
  import o from "./SidebarGroup.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-39c84840"]]);
4
+ const m = /* @__PURE__ */ r(o, [["__scopeId", "data-v-5d54b401"]]);
5
5
  export {
6
6
  m as default
7
7
  };
@@ -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,7 +1,7 @@
1
1
  import o from "./ExampleResponses.vue2.js";
2
2
  /* empty css */
3
3
  import e from "../../_virtual/_plugin-vue_export-helper.js";
4
- const m = /* @__PURE__ */ e(o, [["__scopeId", "data-v-027e0301"]]);
4
+ const m = /* @__PURE__ */ e(o, [["__scopeId", "data-v-ee300101"]]);
5
5
  export {
6
6
  m as default
7
7
  };
@@ -1 +1 @@
1
- {"version":3,"file":"SearchButton.vue.d.ts","sourceRoot":"","sources":["../../../src/features/Search/SearchButton.vue"],"names":[],"mappings":"AAyJA,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;;AAsJzB,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,7 +1,63 @@
1
- import o from "./SearchButton.vue2.js";
2
- /* empty css */
3
- import t from "../../_virtual/_plugin-vue_export-helper.js";
4
- const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-065378cc"]]);
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
+ import { isMacOS as f } from "@scalar/helpers/general/is-mac-os";
4
+ import L from "./SearchModal.vue.js";
5
+ import { useApiClient as N } from "../ApiClientModal/useApiClient.js";
6
+ const z = /* @__PURE__ */ w({
7
+ __name: "SearchButton",
8
+ props: {
9
+ spec: {},
10
+ searchHotKey: { default: "k" }
11
+ },
12
+ setup(y) {
13
+ const S = y, i = C(), o = M(), { client: h } = N(), p = (t) => {
14
+ var e;
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
+ };
17
+ v(
18
+ () => o.open,
19
+ (t, e) => {
20
+ !t && e && K(() => {
21
+ var d;
22
+ (d = i.value) == null || d.focus();
23
+ });
24
+ }
25
+ ), B(() => window.addEventListener("keydown", p)), b(() => window.removeEventListener("keydown", p));
26
+ function k() {
27
+ o.show();
28
+ }
29
+ return (t, e) => (r(), a(s, null, [
30
+ c(l(g), {
31
+ ref_key: "button",
32
+ ref: i,
33
+ class: E(["w-full", t.$attrs.class]),
34
+ onClick: k
35
+ }, {
36
+ shortcut: u(() => [
37
+ l(f)() ? (r(), a(s, { key: 0 }, [
38
+ m("⌘")
39
+ ], 64)) : (r(), a(s, { key: 1 }, [
40
+ e[0] || (e[0] = n("span", { class: "sr-only" }, "CTRL", -1)),
41
+ e[1] || (e[1] = n("span", { "aria-hidden": "true" }, "⌃", -1))
42
+ ], 64)),
43
+ m(" " + H(t.searchHotKey), 1)
44
+ ]),
45
+ default: u(() => [
46
+ e[2] || (e[2] = n("span", { class: "sr-only" }, "Open Search", -1)),
47
+ e[3] || (e[3] = n("span", {
48
+ "aria-hidden": "true",
49
+ class: "sidebar-search-placeholder"
50
+ }, " Search ", -1))
51
+ ]),
52
+ _: 1
53
+ }, 8, ["class"]),
54
+ c(L, {
55
+ modalState: l(o),
56
+ parsedSpec: t.spec
57
+ }, null, 8, ["modalState", "parsedSpec"])
58
+ ], 64));
59
+ }
60
+ });
5
61
  export {
6
- m as default
62
+ z as default
7
63
  };