@scalar/api-reference 1.25.130 → 1.26.1

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 (59) hide show
  1. package/CHANGELOG.md +34 -0
  2. package/dist/browser/standalone.js +19687 -19597
  3. package/dist/browser/webpack-stats.json +1 -1
  4. package/dist/components/ApiReference.vue.d.ts +8 -21
  5. package/dist/components/ApiReference.vue.d.ts.map +1 -1
  6. package/dist/components/ApiReference.vue.js +20 -52
  7. package/dist/components/ApiReference.vue2.js +4 -0
  8. package/dist/components/ApiReferenceLayout.vue.d.ts +2 -2
  9. package/dist/components/ApiReferenceLayout.vue.js +2 -2
  10. package/dist/components/ApiReferenceLayout.vue2.js +1 -1
  11. package/dist/components/Content/Introduction/Introduction.vue.js +1 -1
  12. package/dist/components/Content/Introduction/Introduction.vue2.js +45 -42
  13. package/dist/components/DocumentSelector/DocumentSelector.vue.d.ts +12 -0
  14. package/dist/components/DocumentSelector/DocumentSelector.vue.d.ts.map +1 -0
  15. package/dist/components/DocumentSelector/DocumentSelector.vue.js +67 -0
  16. package/dist/components/DocumentSelector/DocumentSelector.vue2.js +4 -0
  17. package/dist/components/DocumentSelector/index.d.ts +2 -0
  18. package/dist/components/DocumentSelector/index.d.ts.map +1 -0
  19. package/dist/components/Layouts/ClassicLayout.vue.d.ts +4 -4
  20. package/dist/components/Layouts/ClassicLayout.vue.d.ts.map +1 -1
  21. package/dist/components/Layouts/ClassicLayout.vue.js +28 -22
  22. package/dist/components/Layouts/Layouts.vue.d.ts +4 -7
  23. package/dist/components/Layouts/Layouts.vue.d.ts.map +1 -1
  24. package/dist/components/Layouts/Layouts.vue.js +23 -14
  25. package/dist/components/Layouts/ModernLayout.vue.d.ts +4 -4
  26. package/dist/components/Layouts/ModernLayout.vue.d.ts.map +1 -1
  27. package/dist/components/Layouts/ModernLayout.vue.js +2 -2
  28. package/dist/components/Layouts/ModernLayout.vue2.js +33 -30
  29. package/dist/components/Sidebar/SidebarElement.vue.js +2 -2
  30. package/dist/components/SingleApiReference.vue.d.ts +28 -0
  31. package/dist/components/SingleApiReference.vue.d.ts.map +1 -0
  32. package/dist/components/SingleApiReference.vue.js +60 -0
  33. package/dist/components/SingleApiReference.vue3.js +5 -0
  34. package/dist/esm.d.ts +3 -5
  35. package/dist/esm.d.ts.map +1 -1
  36. package/dist/esm.js +12 -13
  37. package/dist/features/ApiClientModal/useApiClient.d.ts +2 -2
  38. package/dist/features/ApiClientModal/useApiClient.d.ts.map +1 -1
  39. package/dist/features/BaseUrl/BaseUrl.vue.js +31 -30
  40. package/dist/features/ExampleRequest/ExampleRequest.vue.d.ts.map +1 -1
  41. package/dist/features/ExampleRequest/ExampleRequest.vue.js +2 -2
  42. package/dist/features/TestRequestButton/TestRequestButton.vue.js +2 -2
  43. package/dist/features/TestRequestButton/TestRequestButton.vue2.js +16 -14
  44. package/dist/hooks/useConfig.d.ts +3 -3
  45. package/dist/hooks/useConfig.d.ts.map +1 -1
  46. package/dist/hooks/useConfig.js +7 -4
  47. package/dist/hooks/useMultipleDocuments.d.ts +87 -0
  48. package/dist/hooks/useMultipleDocuments.d.ts.map +1 -0
  49. package/dist/hooks/useMultipleDocuments.js +49 -0
  50. package/dist/hooks/useNavState.js +38 -38
  51. package/dist/hooks/useReactiveSpec.d.ts +1 -1
  52. package/dist/hooks/useReactiveSpec.d.ts.map +1 -1
  53. package/dist/index.js +80 -81
  54. package/dist/standalone/lib/html-api.d.ts.map +1 -1
  55. package/dist/style.css +1 -1
  56. package/dist/types.d.ts +6 -6
  57. package/dist/types.d.ts.map +1 -1
  58. package/package.json +13 -14
  59. package/dist/components/ApiReference.vue3.js +0 -5
@@ -1,24 +1,11 @@
1
- import type { ReferenceProps } from '../types';
2
- declare function __VLS_template(): {
3
- attrs: Partial<{}>;
4
- slots: {
5
- footer?(_: {}): any;
6
- footer?(_: {}): any;
7
- };
8
- refs: {};
9
- rootEl: any;
1
+ import type { ApiReferenceConfiguration, ApiReferenceConfigurationWithSources } from '@scalar/types/api-reference';
2
+ type __VLS_Props = {
3
+ /**
4
+ * Configuration for the API reference.
5
+ * Can be a single configuration or an array of configurations for multiple documents.
6
+ */
7
+ configuration?: Partial<ApiReferenceConfiguration> | Partial<ApiReferenceConfiguration>[] | Partial<ApiReferenceConfigurationWithSources>;
10
8
  };
11
- type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
12
- declare const __VLS_component: import("vue").DefineComponent<ReferenceProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
13
- updateContent: (value: string) => any;
14
- }, string, import("vue").PublicProps, Readonly<ReferenceProps> & Readonly<{
15
- onUpdateContent?: ((value: string) => any) | undefined;
16
- }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
17
- declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
9
+ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
18
10
  export default _default;
19
- type __VLS_WithTemplateSlots<T, S> = T & {
20
- new (): {
21
- $slots: S;
22
- };
23
- };
24
11
  //# sourceMappingURL=ApiReference.vue.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ApiReference.vue.d.ts","sourceRoot":"","sources":["../../src/components/ApiReference.vue"],"names":[],"mappings":"AAsFA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAgD7C,iBAAS,cAAc;WAyFT,OAAO,IAA6B;;wBATrB,GAAG;wBACH,GAAG;;;;EAa/B;AAeD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;;;;kFAOnB,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":"ApiReference.vue.d.ts","sourceRoot":"","sources":["../../src/components/ApiReference.vue"],"names":[],"mappings":"AAuCA,OAAO,KAAK,EACV,yBAAyB,EACzB,oCAAoC,EACrC,MAAM,6BAA6B,CAAA;AASpC,KAAK,WAAW,GAAG;IACjB;;;OAGG;IACH,aAAa,CAAC,EACV,OAAO,CAAC,yBAAyB,CAAC,GAClC,OAAO,CAAC,yBAAyB,CAAC,EAAE,GACpC,OAAO,CAAC,oCAAoC,CAAC,CAAA;CAClD,CAAC;;AAgFF,wBAOG"}
@@ -1,61 +1,29 @@
1
- import { defineComponent as S, computed as p, watch as M, toRef as c, openBlock as l, createElementBlock as D, Fragment as y, createBlock as w, resolveDynamicComponent as R, withCtx as a, createTextVNode as $, toDisplayString as x, createCommentVNode as B, createVNode as N, unref as t, renderSlot as u } from "vue";
2
- import { apiReferenceConfigurationSchema as U } from "@scalar/types/api-reference";
3
- import { useColorMode as V } from "@scalar/use-hooks/useColorMode";
4
- import { useSeoMeta as _ } from "@unhead/vue";
5
- import { useFavicon as F } from "@vueuse/core";
6
- import { useReactiveSpec as T } from "../hooks/useReactiveSpec.js";
7
- import A from "./Layouts/Layouts.vue.js";
8
- const H = /* @__PURE__ */ S({
1
+ import { defineComponent as a, toRef as l, openBlock as m, createBlock as f, unref as o, withCtx as s, createVNode as p, isRef as d } from "vue";
2
+ import _ from "./SingleApiReference.vue.js";
3
+ /* empty css */
4
+ import { useMultipleDocuments as g } from "../hooks/useMultipleDocuments.js";
5
+ import x from "./DocumentSelector/DocumentSelector.vue.js";
6
+ const B = /* @__PURE__ */ a({
9
7
  __name: "ApiReference",
10
8
  props: {
11
9
  configuration: {}
12
10
  },
13
- emits: ["updateContent"],
14
- setup(m) {
15
- var i;
16
- const f = m, e = p(
17
- () => U.parse(f.configuration)
18
- ), { toggleColorMode: d, isDarkMode: n } = V({
19
- initialColorMode: e.value.darkMode ? "dark" : void 0,
20
- overrideColorMode: e.value.forceDarkModeState
11
+ setup(t) {
12
+ const i = t, { selectedConfiguration: r, availableDocuments: u, selectedDocumentIndex: e } = g({
13
+ configuration: l(i, "configuration")
21
14
  });
22
- M(
23
- () => e.value.darkMode,
24
- (o) => n.value = !!o
25
- ), (i = e.value) != null && i.metaData && _(e.value.metaData);
26
- const { parsedSpec: v, rawSpec: C } = T({
27
- proxyUrl: c(() => e.value.proxyUrl || ""),
28
- specConfig: c(() => e.value.spec || {})
29
- }), g = p(() => e.value.favicon);
30
- return F(g), (o, r) => {
31
- var s;
32
- return l(), D(y, null, [
33
- (s = e.value) != null && s.customCss ? (l(), w(R("style"), { key: 0 }, {
34
- default: a(() => [
35
- $(x(e.value.customCss), 1)
36
- ]),
37
- _: 1
38
- })) : B("", !0),
39
- N(t(A), {
40
- configuration: e.value,
41
- isDark: t(n),
42
- parsedSpec: t(v),
43
- rawSpec: t(C),
44
- onToggleDarkMode: r[0] || (r[0] = () => t(d)()),
45
- onUpdateContent: r[1] || (r[1] = (k) => o.$emit("updateContent", k))
46
- }, {
47
- footer: a(() => [
48
- u(o.$slots, "footer")
49
- ]),
50
- "content-end": a(() => [
51
- u(o.$slots, "footer")
52
- ]),
53
- _: 3
54
- }, 8, ["configuration", "isDark", "parsedSpec", "rawSpec"])
55
- ], 64);
56
- };
15
+ return (V, n) => (m(), f(_, { configuration: o(r) }, {
16
+ "document-selector": s(() => [
17
+ p(o(x), {
18
+ modelValue: o(e),
19
+ "onUpdate:modelValue": n[0] || (n[0] = (c) => d(e) ? e.value = c : null),
20
+ options: o(u)
21
+ }, null, 8, ["modelValue", "options"])
22
+ ]),
23
+ _: 1
24
+ }, 8, ["configuration"]));
57
25
  }
58
26
  });
59
27
  export {
60
- H as default
28
+ B as default
61
29
  };
@@ -0,0 +1,4 @@
1
+ import f from "./ApiReference.vue.js";
2
+ export {
3
+ f as default
4
+ };
@@ -4,16 +4,16 @@ type __VLS_Props = Omit<ReferenceLayoutProps, 'isDark'>;
4
4
  declare function __VLS_template(): {
5
5
  attrs: Partial<{}>;
6
6
  slots: Readonly<{
7
- header: (props: ReferenceSlotProps) => any;
8
7
  footer: (props: ReferenceSlotProps) => any;
8
+ header: (props: ReferenceSlotProps) => any;
9
9
  editor: (props: ReferenceSlotProps) => any;
10
10
  "content-start": (props: ReferenceSlotProps) => any;
11
11
  "content-end": (props: ReferenceSlotProps) => any;
12
12
  "sidebar-start": (props: ReferenceSlotProps) => any;
13
13
  "sidebar-end": (props: ReferenceSlotProps) => any;
14
14
  }> & {
15
- header: (props: ReferenceSlotProps) => any;
16
15
  footer: (props: ReferenceSlotProps) => any;
16
+ header: (props: ReferenceSlotProps) => any;
17
17
  editor: (props: ReferenceSlotProps) => any;
18
18
  "content-start": (props: ReferenceSlotProps) => any;
19
19
  "content-end": (props: ReferenceSlotProps) => any;
@@ -2,7 +2,7 @@ import o from "./ApiReferenceLayout.vue2.js";
2
2
  /* empty css */
3
3
  /* empty css */
4
4
  import t from "../_virtual/_plugin-vue_export-helper.js";
5
- const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-fb8f58f4"]]);
5
+ const a = /* @__PURE__ */ t(o, [["__scopeId", "data-v-2f1a12fb"]]);
6
6
  export {
7
- m as default
7
+ a as default
8
8
  };
@@ -138,7 +138,7 @@ const Ke = ["innerHTML"], We = { class: "references-header" }, je = ["aria-label
138
138
  { immediate: !0 }
139
139
  ), w(Ce, $);
140
140
  const re = Te($);
141
- w($e, re), w(we, "modal"), w(He, a.value);
141
+ w($e, re), w(we, "modal"), w(He, a);
142
142
  function B(e, t) {
143
143
  E(
144
144
  () => a.value[e],
@@ -1,7 +1,7 @@
1
1
  import o from "./Introduction.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-2ce99a34"]]);
4
+ const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-53fa9a98"]]);
5
5
  export {
6
6
  m as default
7
7
  };
@@ -1,99 +1,102 @@
1
- import { defineComponent as V, computed as f, onMounted as $, openBlock as l, createBlock as s, unref as o, withCtx as t, createVNode as n, createElementVNode as S, createTextVNode as u, toDisplayString as d, createCommentVNode as m, renderSlot as _ } from "vue";
1
+ import { defineComponent as V, computed as a, onMounted as $, openBlock as l, createBlock as s, unref as o, withCtx as t, createVNode as r, createElementVNode as g, createTextVNode as d, toDisplayString as f, createCommentVNode as u, renderSlot as S } from "vue";
2
2
  import w from "github-slugger";
3
3
  import { useConfig as N } from "../../../hooks/useConfig.js";
4
4
  import b from "../../../features/DownloadLink/DownloadLink.vue.js";
5
5
  import B from "./Description.vue.js";
6
6
  import D from "../../Section/SectionContainer.vue.js";
7
7
  import H from "../../Section/Section.vue.js";
8
- import A from "../../Section/SectionContent.vue.js";
9
- import C from "../../Badge/Badge.vue.js";
10
- import E from "../../Section/SectionHeader.vue.js";
11
- import F from "../../Section/SectionHeaderTag.vue.js";
12
- import G from "../../Section/SectionColumns.vue.js";
13
- import k from "../../Section/SectionColumn.vue.js";
14
- const I = { class: "badges" }, M = { class: "sticky-cards" }, Y = /* @__PURE__ */ V({
8
+ import L from "../../Section/SectionContent.vue.js";
9
+ import _ from "../../Badge/Badge.vue.js";
10
+ import A from "../../Section/SectionHeader.vue.js";
11
+ import E from "../../Section/SectionHeaderTag.vue.js";
12
+ import F from "../../Section/SectionColumns.vue.js";
13
+ import C from "../../Section/SectionColumn.vue.js";
14
+ const G = { class: "badges" }, I = { class: "sticky-cards" }, Y = /* @__PURE__ */ V({
15
15
  __name: "Introduction",
16
16
  props: {
17
17
  info: {},
18
18
  parsedSpec: {}
19
19
  },
20
- setup(y) {
21
- const i = y, p = f(
20
+ setup(k) {
21
+ const i = k, m = a(
22
22
  () => {
23
- var e, r;
24
- return ((e = i.parsedSpec) == null ? void 0 : e.openapi) ?? ((r = i.parsedSpec) == null ? void 0 : r.swagger) ?? "";
23
+ var e, n;
24
+ return ((e = i.parsedSpec) == null ? void 0 : e.openapi) ?? ((n = i.parsedSpec) == null ? void 0 : n.swagger) ?? "";
25
25
  }
26
- ), h = new w(), T = f(() => {
26
+ ), y = new w(), h = a(() => {
27
27
  var e;
28
- return h.slug(((e = i.info) == null ? void 0 : e.title) ?? "");
29
- }), c = f(() => {
30
- var e, r;
31
- return typeof ((e = i.info) == null ? void 0 : e.version) == "string" ? i.info.version.toString().match(/^\d/) ? `v${i.info.version}` : i.info.version : typeof ((r = i.info) == null ? void 0 : r.version) == "number" ? `v${i.info.version}` : void 0;
32
- }), { onLoaded: a } = N();
33
- return $(() => a == null ? void 0 : a()), (e, r) => (l(), s(o(D), null, {
28
+ return y.slug(((e = i.info) == null ? void 0 : e.title) ?? "");
29
+ }), p = a(() => {
30
+ var e, n;
31
+ return typeof ((e = i.info) == null ? void 0 : e.version) == "string" ? i.info.version.toString().match(/^\d/) ? `v${i.info.version}` : i.info.version : typeof ((n = i.info) == null ? void 0 : n.version) == "number" ? `v${i.info.version}` : void 0;
32
+ }), T = N();
33
+ return $(() => {
34
+ var e, n;
35
+ return (n = (e = T.value).onLoaded) == null ? void 0 : n.call(e);
36
+ }), (e, n) => (l(), s(o(D), null, {
34
37
  default: t(() => [
35
- n(o(H), { class: "introduction-section gap-12" }, {
38
+ r(o(H), { class: "introduction-section gap-12" }, {
36
39
  default: t(() => {
37
- var v, g;
40
+ var c, v;
38
41
  return [
39
- n(o(A), {
40
- loading: !((v = e.info) != null && v.description) && !((g = e.info) != null && g.title)
42
+ r(o(L), {
43
+ loading: !((c = e.info) != null && c.description) && !((v = e.info) != null && v.title)
41
44
  }, {
42
45
  default: t(() => [
43
- S("div", I, [
44
- c.value ? (l(), s(o(C), { key: 0 }, {
46
+ g("div", G, [
47
+ p.value ? (l(), s(o(_), { key: 0 }, {
45
48
  default: t(() => [
46
- u(d(c.value), 1)
49
+ d(f(p.value), 1)
47
50
  ]),
48
51
  _: 1
49
- })) : m("", !0),
50
- p.value ? (l(), s(o(C), { key: 1 }, {
52
+ })) : u("", !0),
53
+ m.value ? (l(), s(o(_), { key: 1 }, {
51
54
  default: t(() => [
52
- u("OAS " + d(p.value), 1)
55
+ d("OAS " + f(m.value), 1)
53
56
  ]),
54
57
  _: 1
55
- })) : m("", !0)
58
+ })) : u("", !0)
56
59
  ]),
57
- n(o(E), {
60
+ r(o(A), {
58
61
  loading: !e.info.title,
59
62
  tight: ""
60
63
  }, {
61
64
  default: t(() => [
62
- n(o(F), { level: 1 }, {
65
+ r(o(E), { level: 1 }, {
63
66
  default: t(() => [
64
- u(d(e.info.title), 1)
67
+ d(f(e.info.title), 1)
65
68
  ]),
66
69
  _: 1
67
70
  })
68
71
  ]),
69
72
  _: 1
70
73
  }, 8, ["loading"]),
71
- n(b, { specTitle: T.value }, null, 8, ["specTitle"]),
72
- n(o(G), null, {
74
+ r(b, { specTitle: h.value }, null, 8, ["specTitle"]),
75
+ r(o(F), null, {
73
76
  default: t(() => [
74
- n(o(k), null, {
77
+ r(o(C), null, {
75
78
  default: t(() => [
76
- n(B, {
79
+ r(B, {
77
80
  value: e.info.description
78
81
  }, null, 8, ["value"])
79
82
  ]),
80
83
  _: 1
81
84
  }),
82
- e.$slots.aside ? (l(), s(o(k), { key: 0 }, {
85
+ e.$slots.aside ? (l(), s(o(C), { key: 0 }, {
83
86
  default: t(() => [
84
- S("div", M, [
85
- _(e.$slots, "aside", {}, void 0, !0)
87
+ g("div", I, [
88
+ S(e.$slots, "aside", {}, void 0, !0)
86
89
  ])
87
90
  ]),
88
91
  _: 3
89
- })) : m("", !0)
92
+ })) : u("", !0)
90
93
  ]),
91
94
  _: 3
92
95
  })
93
96
  ]),
94
97
  _: 3
95
98
  }, 8, ["loading"]),
96
- _(e.$slots, "after", {}, void 0, !0)
99
+ S(e.$slots, "after", {}, void 0, !0)
97
100
  ];
98
101
  }),
99
102
  _: 3
@@ -0,0 +1,12 @@
1
+ import type { SpecConfiguration } from '@scalar/types/api-reference';
2
+ type __VLS_Props = {
3
+ options?: SpecConfiguration[];
4
+ modelValue?: number;
5
+ };
6
+ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
7
+ "update:modelValue": (value: number) => any;
8
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
9
+ "onUpdate:modelValue"?: ((value: number) => any) | undefined;
10
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
11
+ export default _default;
12
+ //# sourceMappingURL=DocumentSelector.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DocumentSelector.vue.d.ts","sourceRoot":"","sources":["../../../src/components/DocumentSelector/DocumentSelector.vue"],"names":[],"mappings":"AAwEA,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;;;;;;AAoIF,wBAOG"}
@@ -0,0 +1,67 @@
1
+ import { defineComponent as b, computed as n, openBlock as f, createElementBlock as v, createVNode as i, unref as a, withCtx as h, createElementVNode as c, toDisplayString as x, createCommentVNode as V } from "vue";
2
+ import { ScalarListbox as g, ScalarIcon as d } from "@scalar/components";
3
+ const w = {
4
+ key: 0,
5
+ class: "document-selector -mb-1 p-3 pb-0"
6
+ }, S = {
7
+ class: "group/dropdown-label hover:bg-b-2 text-c-2 py-1.75 pl-1.75 flex w-full cursor-pointer items-center rounded border pr-1.5",
8
+ tabindex: "0"
9
+ }, k = { class: "text-c-1 overflow-hidden text-ellipsis text-sm font-medium" }, N = /* @__PURE__ */ b({
10
+ __name: "DocumentSelector",
11
+ props: {
12
+ options: {},
13
+ modelValue: {}
14
+ },
15
+ emits: ["update:modelValue"],
16
+ setup(l, { emit: m }) {
17
+ const u = m, p = n(() => {
18
+ var e;
19
+ return l.options && ((e = l.options) == null ? void 0 : e.length) > 1;
20
+ }), r = n(
21
+ () => {
22
+ var e;
23
+ return ((e = l.options) == null ? void 0 : e.map((o, t) => ({
24
+ id: String(t),
25
+ // Get the display text for the selected option
26
+ label: o.title || o.slug || `API #${t + 1}`
27
+ }))) || [];
28
+ }
29
+ ), s = n({
30
+ get: () => r.value.find(({ id: e }) => e === String(l.modelValue)),
31
+ set: (e) => u("update:modelValue", Number(e.id))
32
+ });
33
+ return (e, o) => p.value ? (f(), v("div", w, [
34
+ i(a(g), {
35
+ modelValue: s.value,
36
+ "onUpdate:modelValue": o[0] || (o[0] = (t) => s.value = t),
37
+ options: r.value,
38
+ resize: ""
39
+ }, {
40
+ default: h(() => {
41
+ var t;
42
+ return [
43
+ c("div", S, [
44
+ i(a(d), {
45
+ class: "mr-1.25 min-w-4",
46
+ icon: "Versions",
47
+ size: "sm",
48
+ thickness: "2"
49
+ }),
50
+ c("span", k, x(((t = s.value) == null ? void 0 : t.label) || "Select API"), 1),
51
+ i(a(d), {
52
+ class: "group-hover/dropdown-label:text-c-1 ml-auto",
53
+ icon: "ChevronDown",
54
+ size: "sm",
55
+ thickness: "2"
56
+ })
57
+ ])
58
+ ];
59
+ }),
60
+ _: 1
61
+ }, 8, ["modelValue", "options"])
62
+ ])) : V("", !0);
63
+ }
64
+ });
65
+ export {
66
+ N as default
67
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./DocumentSelector.vue.js";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,2 @@
1
+ export { default as DocumentSelector } from './DocumentSelector.vue.js';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/DocumentSelector/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,wBAAwB,CAAA"}
@@ -1,15 +1,15 @@
1
- import type { InternalReferenceProps, ReferenceLayoutSlots } from '../../types';
1
+ import type { DocumentSelectorSlot, ReferenceLayoutProps, ReferenceLayoutSlots } from '../../types';
2
2
  declare function __VLS_template(): {
3
3
  attrs: Partial<{}>;
4
- slots: Readonly<ReferenceLayoutSlots> & ReferenceLayoutSlots;
4
+ slots: Readonly<ReferenceLayoutSlots & DocumentSelectorSlot> & ReferenceLayoutSlots & DocumentSelectorSlot;
5
5
  refs: {};
6
6
  rootEl: any;
7
7
  };
8
8
  type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
9
- declare const __VLS_component: import("vue").DefineComponent<InternalReferenceProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
9
+ declare const __VLS_component: import("vue").DefineComponent<ReferenceLayoutProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
10
10
  updateContent: (v: string) => any;
11
11
  toggleDarkMode: () => any;
12
- }, string, import("vue").PublicProps, Readonly<InternalReferenceProps> & Readonly<{
12
+ }, string, import("vue").PublicProps, Readonly<ReferenceLayoutProps> & Readonly<{
13
13
  onUpdateContent?: ((v: string) => any) | undefined;
14
14
  onToggleDarkMode?: (() => any) | undefined;
15
15
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
@@ -1 +1 @@
1
- {"version":3,"file":"ClassicLayout.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Layouts/ClassicLayout.vue"],"names":[],"mappings":"AA+DA,OAAO,KAAK,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAA;AAwB3E,iBAAS,cAAc;WAkHT,OAAO,IAA6B;;;;EAKjD;AAcD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;;;;;;kFAQnB,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":"ClassicLayout.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Layouts/ClassicLayout.vue"],"names":[],"mappings":"AAwEA,OAAO,KAAK,EACV,oBAAoB,EACpB,oBAAoB,EACpB,oBAAoB,EACrB,MAAM,SAAS,CAAA;AAwBhB,iBAAS,cAAc;WAwHT,OAAO,IAA6B;;;;EAKjD;AAcD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;;;;;;kFAQnB,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,9 +1,12 @@
1
- import { defineComponent as f, useSlots as g, computed as S, openBlock as s, createBlock as i, createSlots as k, withCtx as r, createVNode as C, unref as l, createCommentVNode as p, renderList as y, renderSlot as h, normalizeProps as v, guardReactiveProps as w } from "vue";
2
- import { ScalarColorModeToggleIcon as D } from "@scalar/components";
3
- import B from "../ApiReferenceLayout.vue.js";
1
+ import { defineComponent as g, useSlots as S, computed as k, openBlock as r, createBlock as c, createSlots as y, withCtx as a, createVNode as C, unref as d, createCommentVNode as i, createElementBlock as h, renderSlot as p, renderList as v, normalizeProps as w, guardReactiveProps as $ } from "vue";
2
+ import { ScalarColorModeToggleIcon as B } from "@scalar/components";
3
+ import D from "../ApiReferenceLayout.vue.js";
4
4
  import H from "../ClassicHeader.vue.js";
5
5
  import M from "../../features/Search/SearchButton.vue.js";
6
- const P = /* @__PURE__ */ f({
6
+ const K = {
7
+ key: 0,
8
+ class: "w-64"
9
+ }, T = /* @__PURE__ */ g({
7
10
  __name: "ClassicLayout",
8
11
  props: {
9
12
  configuration: {},
@@ -12,31 +15,34 @@ const P = /* @__PURE__ */ f({
12
15
  isDark: { type: Boolean }
13
16
  },
14
17
  emits: ["toggleDarkMode", "updateContent"],
15
- setup(d) {
16
- const a = d, u = g(), c = S(() => ({ ...a.configuration, showSidebar: !1 }));
17
- return (e, o) => (s(), i(B, {
18
- configuration: c.value,
18
+ setup(u) {
19
+ const n = u, m = S(), l = k(() => ({ ...n.configuration, showSidebar: !1 }));
20
+ return (e, o) => (r(), c(D, {
21
+ configuration: l.value,
19
22
  parsedSpec: e.parsedSpec,
20
23
  rawSpec: e.rawSpec,
21
24
  onUpdateContent: o[1] || (o[1] = (t) => e.$emit("updateContent", t))
22
- }, k({
23
- "content-start": r(({ spec: t }) => [
25
+ }, y({
26
+ "content-start": a(({ spec: t }) => [
24
27
  C(H, null, {
25
- "dark-mode-toggle": r(() => [
26
- a.configuration.hideDarkModeToggle ? p("", !0) : (s(), i(l(D), {
28
+ "dark-mode-toggle": a(() => [
29
+ n.configuration.hideDarkModeToggle ? i("", !0) : (r(), c(d(B), {
27
30
  key: 0,
28
31
  class: "text-c-2 hover:text-c-1",
29
32
  mode: e.isDark ? "dark" : "light",
30
33
  style: { transform: "scale(1.4)" },
31
34
  variant: "icon",
32
- onClick: o[0] || (o[0] = (n) => e.$emit("toggleDarkMode"))
35
+ onClick: o[0] || (o[0] = (s) => e.$emit("toggleDarkMode"))
33
36
  }, null, 8, ["mode"]))
34
37
  ]),
35
- default: r(() => [
36
- a.configuration.hideSearch ? p("", !0) : (s(), i(l(M), {
37
- key: 0,
38
+ default: a(() => [
39
+ e.$slots["document-selector"] ? (r(), h("div", K, [
40
+ p(e.$slots, "document-selector")
41
+ ])) : i("", !0),
42
+ n.configuration.hideSearch ? i("", !0) : (r(), c(d(M), {
43
+ key: 1,
38
44
  class: "t-doc__sidebar",
39
- searchHotKey: c.value.searchHotKey,
45
+ searchHotKey: l.value.searchHotKey,
40
46
  spec: t
41
47
  }, null, 8, ["searchHotKey", "spec"]))
42
48
  ]),
@@ -45,15 +51,15 @@ const P = /* @__PURE__ */ f({
45
51
  ]),
46
52
  _: 2
47
53
  }, [
48
- y(u, (t, n) => ({
49
- name: n,
50
- fn: r((m) => [
51
- h(e.$slots, n, v(w(m || {})))
54
+ v(m, (t, s) => ({
55
+ name: s,
56
+ fn: a((f) => [
57
+ p(e.$slots, s, w($(f || {})))
52
58
  ])
53
59
  }))
54
60
  ]), 1032, ["configuration", "parsedSpec", "rawSpec"]));
55
61
  }
56
62
  });
57
63
  export {
58
- P as default
64
+ T as default
59
65
  };
@@ -1,18 +1,15 @@
1
- /**
2
- * This component allows dynamic selection of various layout configurations
3
- */
4
- import type { InternalReferenceProps, ReferenceLayoutSlots } from '../../types';
1
+ import type { DocumentSelectorSlot, ReferenceLayoutProps, ReferenceLayoutSlots } from '../../types';
5
2
  declare function __VLS_template(): {
6
3
  attrs: Partial<{}>;
7
- slots: Readonly<ReferenceLayoutSlots> & ReferenceLayoutSlots;
4
+ slots: Readonly<ReferenceLayoutSlots & DocumentSelectorSlot> & ReferenceLayoutSlots & DocumentSelectorSlot;
8
5
  refs: {};
9
6
  rootEl: any;
10
7
  };
11
8
  type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
12
- declare const __VLS_component: import("vue").DefineComponent<InternalReferenceProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
9
+ declare const __VLS_component: import("vue").DefineComponent<ReferenceLayoutProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
13
10
  updateContent: (v: string) => any;
14
11
  toggleDarkMode: () => any;
15
- }, string, import("vue").PublicProps, Readonly<InternalReferenceProps> & Readonly<{
12
+ }, string, import("vue").PublicProps, Readonly<ReferenceLayoutProps> & Readonly<{
16
13
  onUpdateContent?: ((v: string) => any) | undefined;
17
14
  onToggleDarkMode?: (() => any) | undefined;
18
15
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
@@ -1 +1 @@
1
- {"version":3,"file":"Layouts.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Layouts/Layouts.vue"],"names":[],"mappings":"AAyCA;;GAEG;AACH,OAAO,KAAK,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAA;AA4B3E,iBAAS,cAAc;WAuET,OAAO,IAA6B;;;;EAKjD;AAWD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;;;;;;kFAOnB,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":"Layouts.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Layouts/Layouts.vue"],"names":[],"mappings":"AA6DA,OAAO,KAAK,EACV,oBAAoB,EACpB,oBAAoB,EACpB,oBAAoB,EACrB,MAAM,aAAa,CAAA;AAkCpB,iBAAS,cAAc;WA6ET,OAAO,IAA6B;;;;EAKjD;AAYD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;;;;;;kFAOnB,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
- import { defineComponent as l, useSlots as d, openBlock as u, createBlock as f, resolveDynamicComponent as g, mergeProps as c, createSlots as k, renderList as y, withCtx as C, renderSlot as D, normalizeProps as S, guardReactiveProps as $ } from "vue";
1
+ import { defineComponent as c, useSlots as f, computed as g, openBlock as y, createBlock as k, resolveDynamicComponent as C, mergeProps as S, createSlots as $, withCtx as n, renderSlot as s, renderList as D, normalizeProps as v, guardReactiveProps as L } from "vue";
2
2
  import M from "./ClassicLayout.vue.js";
3
- import n from "./ModernLayout.vue.js";
4
- const P = /* @__PURE__ */ l({
3
+ import a from "./ModernLayout.vue.js";
4
+ const b = /* @__PURE__ */ c({
5
5
  __name: "Layouts",
6
6
  props: {
7
7
  configuration: {},
@@ -10,24 +10,33 @@ const P = /* @__PURE__ */ l({
10
10
  isDark: { type: Boolean }
11
11
  },
12
12
  emits: ["toggleDarkMode", "updateContent"],
13
- setup(s) {
14
- const a = s, p = d(), i = {
15
- modern: n,
13
+ setup(l) {
14
+ const p = l, m = f(), i = g(
15
+ () => Object.keys(m).filter(
16
+ (e) => e !== "document-selector"
17
+ )
18
+ ), u = {
19
+ modern: a,
16
20
  classic: M
17
21
  };
18
- return (o, e) => (u(), f(g(i[o.configuration.layout ?? "modern"] ?? n), c(a, {
19
- onToggleDarkMode: e[0] || (e[0] = (t) => o.$emit("toggleDarkMode")),
20
- onUpdateContent: e[1] || (e[1] = (t) => o.$emit("updateContent", t))
21
- }), k({ _: 2 }, [
22
- y(p, (t, r) => ({
22
+ return (e, o) => (y(), k(C(u[e.configuration.layout ?? "modern"] ?? a), S(p, {
23
+ onToggleDarkMode: o[0] || (o[0] = (t) => e.$emit("toggleDarkMode")),
24
+ onUpdateContent: o[1] || (o[1] = (t) => e.$emit("updateContent", t))
25
+ }), $({
26
+ "document-selector": n(() => [
27
+ s(e.$slots, "document-selector")
28
+ ]),
29
+ _: 2
30
+ }, [
31
+ D(i.value, (t, r) => ({
23
32
  name: r,
24
- fn: C((m) => [
25
- D(o.$slots, r, S($(m || {})))
33
+ fn: n((d) => [
34
+ s(e.$slots, r, v(L(d || {})))
26
35
  ])
27
36
  }))
28
37
  ]), 1040));
29
38
  }
30
39
  });
31
40
  export {
32
- P as default
41
+ b as default
33
42
  };