@scalar/api-reference 1.24.17 → 1.24.20

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 (90) hide show
  1. package/CHANGELOG.md +47 -0
  2. package/dist/browser/standalone.js +12029 -11613
  3. package/dist/browser/webpack-stats.json +1 -1
  4. package/dist/components/ApiClientModal.vue.d.ts.map +1 -1
  5. package/dist/components/ApiClientModal.vue.js +18 -12
  6. package/dist/components/ApiReference.vue.d.ts +1 -0
  7. package/dist/components/ApiReference.vue.d.ts.map +1 -1
  8. package/dist/components/ApiReference.vue.js +48 -51
  9. package/dist/components/ApiReferenceLayout.vue.d.ts +3 -2
  10. package/dist/components/ApiReferenceLayout.vue.d.ts.map +1 -1
  11. package/dist/components/ApiReferenceLayout.vue.js +1 -1
  12. package/dist/components/ApiReferenceLayout.vue2.js +75 -72
  13. package/dist/components/Content/BaseUrl/BaseUrl.vue.d.ts.map +1 -1
  14. package/dist/components/Content/BaseUrl/BaseUrl.vue.js +1 -1
  15. package/dist/components/Content/BaseUrl/BaseUrl.vue2.js +21 -19
  16. package/dist/components/Content/BaseUrl/ServerVariableSelect.vue.d.ts +22 -0
  17. package/dist/components/Content/BaseUrl/ServerVariableSelect.vue.d.ts.map +1 -0
  18. package/dist/components/Content/BaseUrl/ServerVariableSelect.vue.js +7 -0
  19. package/dist/components/Content/BaseUrl/ServerVariableSelect.vue2.js +46 -0
  20. package/dist/components/Content/BaseUrl/ServerVariableTextbox.vue.d.ts +20 -0
  21. package/dist/components/Content/BaseUrl/ServerVariableTextbox.vue.d.ts.map +1 -0
  22. package/dist/components/Content/BaseUrl/ServerVariableTextbox.vue.js +7 -0
  23. package/dist/components/Content/BaseUrl/ServerVariableTextbox.vue2.js +27 -0
  24. package/dist/components/Content/BaseUrl/ServerVariables.vue.d.ts.map +1 -1
  25. package/dist/components/Content/BaseUrl/ServerVariables.vue.js +1 -1
  26. package/dist/components/Content/BaseUrl/ServerVariables.vue2.js +31 -40
  27. package/dist/components/Content/Operation/CustomRequestExamples.vue.js +2 -2
  28. package/dist/components/Content/Operation/CustomRequestExamples.vue2.js +1 -1
  29. package/dist/components/Content/Operation/OperationAccordion.vue.d.ts.map +1 -1
  30. package/dist/components/Content/Operation/OperationAccordion.vue.js +1 -1
  31. package/dist/components/Content/Operation/PathResponses/PathResponses.vue.d.ts.map +1 -1
  32. package/dist/components/Content/Operation/PathResponses/PathResponses.vue.js +2 -2
  33. package/dist/components/Content/Operation/PathResponses/PathResponses.vue2.js +1 -1
  34. package/dist/components/Content/Operation/TestRequestButton.vue.d.ts.map +1 -1
  35. package/dist/components/Content/Operation/TestRequestButton.vue.js +1 -1
  36. package/dist/components/Content/Operation/TestRequestButton.vue2.js +8 -6
  37. package/dist/components/GettingStarted.vue.d.ts +1 -1
  38. package/dist/components/Layouts/ClassicLayout.vue.d.ts +4 -2
  39. package/dist/components/Layouts/ClassicLayout.vue.d.ts.map +1 -1
  40. package/dist/components/Layouts/ClassicLayout.vue.js +33 -28
  41. package/dist/components/Layouts/{BaseLayout.vue.d.ts → Layouts.vue.d.ts} +8 -3
  42. package/dist/components/Layouts/Layouts.vue.d.ts.map +1 -0
  43. package/dist/components/Layouts/Layouts.vue.js +33 -0
  44. package/dist/components/Layouts/Layouts.vue2.js +4 -0
  45. package/dist/components/Layouts/ModernLayout.vue.d.ts +4 -2
  46. package/dist/components/Layouts/ModernLayout.vue.d.ts.map +1 -1
  47. package/dist/components/Layouts/ModernLayout.vue.js +2 -2
  48. package/dist/components/Layouts/ModernLayout.vue2.js +46 -41
  49. package/dist/components/Layouts/index.d.ts +1 -7
  50. package/dist/components/Layouts/index.d.ts.map +1 -1
  51. package/dist/components/SearchButton.vue.js +1 -1
  52. package/dist/components/SearchButton.vue2.js +5 -5
  53. package/dist/components/api-client-bus.d.ts +19 -3
  54. package/dist/components/api-client-bus.d.ts.map +1 -1
  55. package/dist/components/api-client-bus.js +2 -2
  56. package/dist/features.d.ts +1 -1
  57. package/dist/features.d.ts.map +1 -1
  58. package/dist/helpers/createEmptySpecification.d.ts +4 -0
  59. package/dist/helpers/createEmptySpecification.d.ts.map +1 -1
  60. package/dist/helpers/deepMerge.d.ts +1 -1
  61. package/dist/helpers/deepMerge.d.ts.map +1 -1
  62. package/dist/helpers/getHeadingsFromMarkdown.d.ts +3 -0
  63. package/dist/helpers/getHeadingsFromMarkdown.d.ts.map +1 -1
  64. package/dist/helpers/getModels.d.ts +3 -0
  65. package/dist/helpers/getModels.d.ts.map +1 -1
  66. package/dist/helpers/isValidUrl.d.ts +3 -0
  67. package/dist/helpers/isValidUrl.d.ts.map +1 -1
  68. package/dist/helpers/isValidUrl.js +3 -3
  69. package/dist/helpers/openClientFor.d.ts +3 -0
  70. package/dist/helpers/openClientFor.d.ts.map +1 -1
  71. package/dist/hooks/index.d.ts +2 -2
  72. package/dist/hooks/useClientStore.js +5 -0
  73. package/dist/hooks/useDeprecationWarnings.d.ts +3 -0
  74. package/dist/hooks/useDeprecationWarnings.d.ts.map +1 -1
  75. package/dist/hooks/useRefOnMount.d.ts +3 -0
  76. package/dist/hooks/useRefOnMount.d.ts.map +1 -1
  77. package/dist/hooks/useRefOnMount.js +10 -0
  78. package/dist/hooks/useSidebar.d.ts +3 -0
  79. package/dist/hooks/useSidebar.d.ts.map +1 -1
  80. package/dist/index.d.ts +2 -0
  81. package/dist/index.d.ts.map +1 -1
  82. package/dist/index.js +92 -72
  83. package/dist/stores/useHttpClientStore.d.ts +3 -0
  84. package/dist/stores/useHttpClientStore.d.ts.map +1 -1
  85. package/dist/style.css +1 -1
  86. package/dist/types.d.ts +11 -1
  87. package/dist/types.d.ts.map +1 -1
  88. package/package.json +11 -10
  89. package/dist/components/Layouts/BaseLayout.vue.d.ts.map +0 -1
  90. package/dist/components/Layouts/index.js +0 -9
@@ -0,0 +1,33 @@
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";
2
+ import M from "./ClassicLayout.vue.js";
3
+ import n from "./ModernLayout.vue.js";
4
+ const P = /* @__PURE__ */ l({
5
+ __name: "Layouts",
6
+ props: {
7
+ configuration: {},
8
+ parsedSpec: {},
9
+ rawSpec: {},
10
+ isDark: { type: Boolean }
11
+ },
12
+ emits: ["toggleDarkMode", "updateContent"],
13
+ setup(s) {
14
+ const a = s, p = d(), i = {
15
+ modern: n,
16
+ classic: M
17
+ };
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) => ({
23
+ name: r,
24
+ fn: C((m) => [
25
+ D(o.$slots, r, S($(m || {})))
26
+ ])
27
+ }))
28
+ ]), 1040));
29
+ }
30
+ });
31
+ export {
32
+ P as default
33
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./Layouts.vue.js";
2
+ export {
3
+ f as default
4
+ };
@@ -1,9 +1,11 @@
1
- import type { ReferenceLayoutProps, ReferenceSlots } from '../../types';
1
+ import type { ReferenceLayoutProps, ReferenceLayoutSlots } from '../../types';
2
2
  declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_TypePropsToOption<ReferenceLayoutProps>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
3
3
  toggleDarkMode: () => void;
4
+ updateContent: (v: string) => void;
4
5
  }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<ReferenceLayoutProps>>> & {
6
+ onUpdateContent?: ((v: string) => any) | undefined;
5
7
  onToggleDarkMode?: (() => any) | undefined;
6
- }, {}, {}>, Readonly<ReferenceSlots> & ReferenceSlots>;
8
+ }, {}, {}>, Readonly<ReferenceLayoutSlots> & ReferenceLayoutSlots>;
7
9
  export default _default;
8
10
  type __VLS_WithTemplateSlots<T, S> = T & {
9
11
  new (): {
@@ -1 +1 @@
1
- {"version":3,"file":"ModernLayout.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Layouts/ModernLayout.vue"],"names":[],"mappings":"AAkFA,OAAO,KAAK,EAAE,oBAAoB,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;;;;;;AAkKvE,wBAAwG;AAOxG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACpC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC;AAEN,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AAC5D,KAAK,uBAAuB,CAAC,CAAC,IAAI;KAChC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GACpC;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAC9D;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CACzD,CAAC"}
1
+ {"version":3,"file":"ModernLayout.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Layouts/ModernLayout.vue"],"names":[],"mappings":"AAyFA,OAAO,KAAK,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA;;;;;;;;AAsL7E,wBAAwG;AAOxG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACpC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC;AAEN,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AAC5D,KAAK,uBAAuB,CAAC,CAAC,IAAI;KAChC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GACpC;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAC9D;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CACzD,CAAC"}
@@ -2,7 +2,7 @@ import o from "./ModernLayout.vue2.js";
2
2
  /* empty css */
3
3
  /* empty css */
4
4
  import t from "../../_virtual/_plugin-vue_export-helper.js";
5
- const e = /* @__PURE__ */ t(o, [["__scopeId", "data-v-333fecad"]]);
5
+ const f = /* @__PURE__ */ t(o, [["__scopeId", "data-v-273f5da8"]]);
6
6
  export {
7
- e as default
7
+ f as default
8
8
  };
@@ -1,12 +1,12 @@
1
- import { defineComponent as g, watch as i, openBlock as p, createBlock as l, normalizeClass as S, withCtx as t, unref as d, isRef as k, createCommentVNode as h, createElementVNode as M, createVNode as c, renderSlot as b } from "vue";
2
- import { useMediaQuery as w } from "@vueuse/core";
3
- import y from "../ApiReferenceLayout.vue.js";
4
- import D from "../MobileHeader.vue.js";
5
- import v from "../SearchButton.vue.js";
6
- import B from "../DarkModeToggle/DarkModeToggle.vue.js";
7
- import { useSidebar as C } from "../../hooks/useSidebar.js";
8
- import { useNavState as N } from "../../hooks/useNavState.js";
9
- const H = { class: "scalar-api-references-standalone-search" }, E = /* @__PURE__ */ g({
1
+ import { defineComponent as k, useSlots as M, watch as i, openBlock as p, createBlock as l, normalizeClass as b, createSlots as h, withCtx as n, unref as d, isRef as v, createCommentVNode as w, createElementVNode as y, createVNode as u, renderList as D, renderSlot as C, normalizeProps as B, guardReactiveProps as N } from "vue";
2
+ import { useMediaQuery as $ } from "@vueuse/core";
3
+ import H from "../ApiReferenceLayout.vue.js";
4
+ import K from "../MobileHeader.vue.js";
5
+ import L from "../SearchButton.vue.js";
6
+ import R from "../DarkModeToggle/DarkModeToggle.vue.js";
7
+ import { useSidebar as V } from "../../hooks/useSidebar.js";
8
+ import { useNavState as z } from "../../hooks/useNavState.js";
9
+ const P = { class: "scalar-api-references-standalone-search" }, F = /* @__PURE__ */ k({
10
10
  __name: "ModernLayout",
11
11
  props: {
12
12
  configuration: {},
@@ -14,54 +14,59 @@ const H = { class: "scalar-api-references-standalone-search" }, E = /* @__PURE__
14
14
  rawSpec: {},
15
15
  isDark: { type: Boolean }
16
16
  },
17
- emits: ["toggleDarkMode"],
18
- setup(f) {
19
- const n = f, u = w("(max-width: 1000px)"), { isSidebarOpen: r } = C();
20
- i(u, (e, o) => {
21
- e && !o && (r.value = !1);
17
+ emits: ["toggleDarkMode", "updateContent"],
18
+ setup(c) {
19
+ const s = c, f = M(), m = $("(max-width: 1000px)"), { isSidebarOpen: a } = V();
20
+ i(m, (e, o) => {
21
+ e && !o && (a.value = !1);
22
22
  });
23
- const { hash: m } = N();
24
- return i(m, (e, o) => {
25
- e && e !== o && (r.value = !1);
26
- }), (e, o) => (p(), l(y, {
27
- class: S({
23
+ const { hash: S } = z();
24
+ return i(S, (e, o) => {
25
+ e && e !== o && (a.value = !1);
26
+ }), (e, o) => (p(), l(H, {
27
+ class: b({
28
28
  "scalar-api-references-standalone-mobile": e.configuration.showSidebar
29
29
  }),
30
30
  configuration: e.configuration,
31
31
  parsedSpec: e.parsedSpec,
32
- rawSpec: e.rawSpec
33
- }, {
34
- header: t(() => [
35
- n.configuration.showSidebar ? (p(), l(D, {
32
+ rawSpec: e.rawSpec,
33
+ onUpdateContent: o[2] || (o[2] = (r) => e.$emit("updateContent", r))
34
+ }, h({
35
+ header: n(() => [
36
+ s.configuration.showSidebar ? (p(), l(K, {
36
37
  key: 0,
37
- open: d(r),
38
- "onUpdate:open": o[0] || (o[0] = (a) => k(r) ? r.value = a : null)
39
- }, null, 8, ["open"])) : h("", !0)
38
+ open: d(a),
39
+ "onUpdate:open": o[0] || (o[0] = (r) => v(a) ? a.value = r : null)
40
+ }, null, 8, ["open"])) : w("", !0)
40
41
  ]),
41
- "sidebar-start": t(({ spec: a }) => {
42
- var s;
42
+ "sidebar-start": n(({ spec: r }) => {
43
+ var t;
43
44
  return [
44
- M("div", H, [
45
- c(v, {
46
- searchHotKey: (s = n.configuration) == null ? void 0 : s.searchHotKey,
47
- spec: a
45
+ y("div", P, [
46
+ u(L, {
47
+ searchHotKey: (t = s.configuration) == null ? void 0 : t.searchHotKey,
48
+ spec: r
48
49
  }, null, 8, ["searchHotKey", "spec"])
49
50
  ])
50
51
  ];
51
52
  }),
52
- "sidebar-end": t(() => [
53
- c(d(B), {
53
+ "sidebar-end": n(() => [
54
+ u(d(R), {
54
55
  isDarkMode: e.isDark,
55
- onToggleDarkMode: o[1] || (o[1] = (a) => e.$emit("toggleDarkMode"))
56
+ onToggleDarkMode: o[1] || (o[1] = (r) => e.$emit("toggleDarkMode"))
56
57
  }, null, 8, ["isDarkMode"])
57
58
  ]),
58
- "content-end": t(() => [
59
- b(e.$slots, "footer", {}, void 0, !0)
60
- ]),
61
- _: 3
62
- }, 8, ["class", "configuration", "parsedSpec", "rawSpec"]));
59
+ _: 2
60
+ }, [
61
+ D(f, (r, t) => ({
62
+ name: t,
63
+ fn: n((g) => [
64
+ C(e.$slots, t, B(N(g || {})), void 0, !0)
65
+ ])
66
+ }))
67
+ ]), 1032, ["class", "configuration", "parsedSpec", "rawSpec"]));
63
68
  }
64
69
  });
65
70
  export {
66
- E as default
71
+ F as default
67
72
  };
@@ -1,8 +1,2 @@
1
- import type { DeepReadonly } from 'vue';
2
- import type { ReferenceLayoutType } from '../../types';
3
- import type BaseLayout from './BaseLayout.vue';
4
- declare const layouts: DeepReadonly<{
5
- [x in ReferenceLayoutType]: typeof BaseLayout;
6
- }>;
7
- export default layouts;
1
+ export { default as Layouts } from './Layouts.vue.js';
8
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Layouts/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,KAAK,CAAA;AAEvC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AACtD,OAAO,KAAK,UAAU,MAAM,kBAAkB,CAAA;AAI9C,QAAA,MAAM,OAAO,EAAE,YAAY,CAAC;KACzB,CAAC,IAAI,mBAAmB,GAAG,OAAO,UAAU;CAC9C,CAGA,CAAA;AAED,eAAe,OAAO,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Layouts/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,eAAe,CAAA"}
@@ -1,7 +1,7 @@
1
1
  import o from "./SearchButton.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-af64a87b"]]);
4
+ const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-37498e26"]]);
5
5
  export {
6
6
  m as default
7
7
  };
@@ -1,10 +1,10 @@
1
- import { defineComponent as m, ref as u, onMounted as f, openBlock as S, createElementBlock as y, Fragment as _, createElementVNode as t, normalizeClass as b, unref as a, createVNode as p, toDisplayString as i, pushScopeId as v, popScopeId as k } from "vue";
1
+ import { defineComponent as m, ref as u, onMounted as S, openBlock as f, createElementBlock as y, Fragment as _, createElementVNode as t, normalizeClass as v, unref as a, createVNode as p, toDisplayString as i, pushScopeId as b, popScopeId as k } from "vue";
2
2
  import { useModal as K, ScalarIcon as M } from "@scalar/components";
3
3
  import { isMacOS as r } from "@scalar/use-tooltip";
4
4
  import { useMagicKeys as w, whenever as g } from "@vueuse/core";
5
5
  import B from "./SearchModal.vue.js";
6
6
  import { modalStateBus as C } from "./api-client-bus.js";
7
- const H = (s) => (v("data-v-af64a87b"), s = s(), k(), s), I = { class: "sidebar-search-input" }, E = /* @__PURE__ */ H(() => /* @__PURE__ */ t("span", { class: "sidebar-search-placeholder" }, "Search", -1)), $ = { class: "sidebar-search-shortcut" }, z = { class: "sidebar-search-key" }, j = /* @__PURE__ */ m({
7
+ const H = (s) => (b("data-v-37498e26"), s = s(), k(), s), I = { class: "sidebar-search-input" }, E = /* @__PURE__ */ H(() => /* @__PURE__ */ t("span", { class: "sidebar-search-placeholder" }, "Search", -1)), $ = { class: "sidebar-search-shortcut" }, z = { class: "sidebar-search-key" }, j = /* @__PURE__ */ m({
8
8
  __name: "SearchButton",
9
9
  props: {
10
10
  spec: {},
@@ -17,7 +17,7 @@ const H = (s) => (v("data-v-af64a87b"), s = s(), k(), s), I = { class: "sidebar-
17
17
  !r() && e.ctrlKey && e.key === c.searchHotKey && (e.preventDefault(), e.stopPropagation());
18
18
  }
19
19
  });
20
- return f(() => {
20
+ return S(() => {
21
21
  C.on((e) => {
22
22
  n.value = e;
23
23
  });
@@ -27,9 +27,9 @@ const H = (s) => (v("data-v-af64a87b"), s = s(), k(), s), I = { class: "sidebar-
27
27
  var e;
28
28
  (e = n.value) != null && e.open || (o.open ? o.hide() : o.show());
29
29
  }
30
- ), (e, l) => (S(), y(_, null, [
30
+ ), (e, l) => (f(), y(_, null, [
31
31
  t("button", {
32
- class: b(["sidebar-search", e.$attrs.class]),
32
+ class: v(["sidebar-search", e.$attrs.class]),
33
33
  type: "button",
34
34
  onClick: l[0] || (l[0] = //@ts-ignore
35
35
  (...h) => a(o).show && a(o).show(...h))
@@ -1,5 +1,21 @@
1
1
  import type { OpenClientPayload } from '@scalar/api-client-modal';
2
- /** Event bus to open the API Client */
3
- export declare const apiClientBus: import("@vueuse/core").UseEventBusReturn<OpenClientPayload, any>;
4
- export declare const modalStateBus: import("@vueuse/core").UseEventBusReturn<unknown, any>;
2
+ import type { AuthenticationState } from '@scalar/oas-utils';
3
+ import type { RequireAtLeastOne } from 'type-fest';
4
+ type ApiClientEvents = RequireAtLeastOne<{
5
+ open?: OpenClientPayload;
6
+ updateAuth?: AuthenticationState;
7
+ }>;
8
+ /**
9
+ * Event bus for controlling the Api Client
10
+ *
11
+ * There is a limitation in useEventBus with mapping the event with the payload type. This is a workaround, however
12
+ * doing it this way allows us to "fire" multiple events at the same time which is actually kind of nice
13
+ */
14
+ export declare const apiClientBus: import("@vueuse/core").UseEventBusReturn<ApiClientEvents, any>;
15
+ export declare const modalStateBus: import("@vueuse/core").UseEventBusReturn<{
16
+ open: boolean;
17
+ show: () => void;
18
+ hide: () => void;
19
+ }, any>;
20
+ export {};
5
21
  //# sourceMappingURL=api-client-bus.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"api-client-bus.d.ts","sourceRoot":"","sources":["../../src/components/api-client-bus.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAKjE,uCAAuC;AACvC,eAAO,MAAM,YAAY,kEAA+B,CAAA;AACxD,eAAO,MAAM,aAAa,wDAA4B,CAAA"}
1
+ {"version":3,"file":"api-client-bus.d.ts","sourceRoot":"","sources":["../../src/components/api-client-bus.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAEjE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAA;AAE5D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAA;AAElD,KAAK,eAAe,GAAG,iBAAiB,CAAC;IACvC,IAAI,CAAC,EAAE,iBAAiB,CAAA;IACxB,UAAU,CAAC,EAAE,mBAAmB,CAAA;CACjC,CAAC,CAAA;AAIF;;;;;GAKG;AACH,eAAO,MAAM,YAAY,gEAA+B,CAAA;AACxD,eAAO,MAAM,aAAa;;;;OAAyC,CAAA"}
@@ -1,6 +1,6 @@
1
1
  import { useEventBus as t } from "@vueuse/core";
2
- const o = Symbol(), s = t(o), a = t("modalState");
2
+ const o = Symbol(), e = Symbol(), n = t(o), a = t(e);
3
3
  export {
4
- s as apiClientBus,
4
+ n as apiClientBus,
5
5
  a as modalStateBus
6
6
  };
@@ -3,6 +3,6 @@
3
3
  *
4
4
  * To enable the new API client, copy `packages/api-reference/.env.example` to `packages/api-reference/.env`
5
5
  * and set `NEW_API_CLIENT=true`.
6
- **/
6
+ */
7
7
  export declare const NEW_API_MODAL: boolean;
8
8
  //# sourceMappingURL=features.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"features.d.ts","sourceRoot":"","sources":["../src/features.ts"],"names":[],"mappings":"AAAA;;;;;IAKI;AACJ,eAAO,MAAM,aAAa,SAAiD,CAAA"}
1
+ {"version":3,"file":"features.d.ts","sourceRoot":"","sources":["../src/features.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,eAAO,MAAM,aAAa,SAAiD,CAAA"}
@@ -1,3 +1,7 @@
1
1
  import type { Spec } from '@scalar/oas-utils';
2
+ /**
3
+ * Creates an empty specification object.
4
+ * The returning object has the same structure as a valid OpenAPI specification, but everything is empty.
5
+ */
2
6
  export declare function createEmptySpecification(): Spec;
3
7
  //# sourceMappingURL=createEmptySpecification.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"createEmptySpecification.d.ts","sourceRoot":"","sources":["../../src/helpers/createEmptySpecification.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAA;AAE7C,wBAAgB,wBAAwB,IAAI,IAAI,CAsB/C"}
1
+ {"version":3,"file":"createEmptySpecification.d.ts","sourceRoot":"","sources":["../../src/helpers/createEmptySpecification.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAA;AAE7C;;;GAGG;AACH,wBAAgB,wBAAwB,IAAI,IAAI,CAsB/C"}
@@ -1,5 +1,5 @@
1
1
  /**
2
2
  * Deep merge for objects
3
- **/
3
+ */
4
4
  export declare function deepMerge(source: Record<any, any>, target: Record<any, any>): Record<any, any>;
5
5
  //# sourceMappingURL=deepMerge.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"deepMerge.d.ts","sourceRoot":"","sources":["../../src/helpers/deepMerge.ts"],"names":[],"mappings":"AAAA;;IAEI;AACJ,wBAAgB,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,oBAW3E"}
1
+ {"version":3,"file":"deepMerge.d.ts","sourceRoot":"","sources":["../../src/helpers/deepMerge.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,oBAW3E"}
@@ -1,3 +1,6 @@
1
1
  import type { Heading } from '@scalar/oas-utils';
2
+ /**
3
+ * Extracts all headings from a Markdown string.
4
+ */
2
5
  export declare function getHeadingsFromMarkdown(input: string): Heading[];
3
6
  //# sourceMappingURL=getHeadingsFromMarkdown.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"getHeadingsFromMarkdown.d.ts","sourceRoot":"","sources":["../../src/helpers/getHeadingsFromMarkdown.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAWhD,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,EAAE,CAUhE"}
1
+ {"version":3,"file":"getHeadingsFromMarkdown.d.ts","sourceRoot":"","sources":["../../src/helpers/getHeadingsFromMarkdown.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAWhD;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,EAAE,CAUhE"}
@@ -1,4 +1,7 @@
1
1
  import type { Spec } from '@scalar/oas-utils';
2
2
  import type { OpenAPIV2, OpenAPIV3, OpenAPIV3_1 } from '@scalar/openapi-parser';
3
+ /**
4
+ * Returns all models from the specification, no matter if it’s Swagger 2.0 or OpenAPI 3.x.
5
+ */
3
6
  export declare function getModels(spec?: Spec): Record<string, OpenAPIV3_1.SchemaObject> | OpenAPIV2.DefinitionsObject | Record<string, OpenAPIV3.SchemaObject>;
4
7
  //# sourceMappingURL=getModels.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"getModels.d.ts","sourceRoot":"","sources":["../../src/helpers/getModels.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAA;AAC7C,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AAE/E,wBAAgB,SAAS,CAAC,IAAI,CAAC,EAAE,IAAI,mHAoBpC"}
1
+ {"version":3,"file":"getModels.d.ts","sourceRoot":"","sources":["../../src/helpers/getModels.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAA;AAC7C,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AAE/E;;GAEG;AACH,wBAAgB,SAAS,CAAC,IAAI,CAAC,EAAE,IAAI,mHAoBpC"}
@@ -1,2 +1,5 @@
1
+ /**
2
+ * Checks if the given string is a valid URL
3
+ */
1
4
  export declare function isValidUrl(url: string): boolean;
2
5
  //# sourceMappingURL=isValidUrl.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"isValidUrl.d.ts","sourceRoot":"","sources":["../../src/helpers/isValidUrl.ts"],"names":[],"mappings":"AACA,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,WAMrC"}
1
+ {"version":3,"file":"isValidUrl.d.ts","sourceRoot":"","sources":["../../src/helpers/isValidUrl.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,WAMrC"}
@@ -1,10 +1,10 @@
1
- function n(e) {
1
+ function e(r) {
2
2
  try {
3
- return !!new URL(e);
3
+ return !!new URL(r);
4
4
  } catch {
5
5
  return !1;
6
6
  }
7
7
  }
8
8
  export {
9
- n as isValidUrl
9
+ e as isValidUrl
10
10
  };
@@ -1,4 +1,7 @@
1
1
  import type { TransformedOperation } from '@scalar/oas-utils';
2
2
  import type { OpenAPIV3 } from '@scalar/openapi-parser';
3
+ /**
4
+ * Prepares all the data to open the API client for a specific operation.
5
+ */
3
6
  export declare function openClientFor(operation: TransformedOperation, globalSecurity?: OpenAPIV3.SecurityRequirementObject[]): void;
4
7
  //# sourceMappingURL=openClientFor.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"openClientFor.d.ts","sourceRoot":"","sources":["../../src/helpers/openClientFor.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAA;AAC7D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AAWvD,wBAAgB,aAAa,CAC3B,SAAS,EAAE,oBAAoB,EAC/B,cAAc,CAAC,EAAE,SAAS,CAAC,yBAAyB,EAAE,QAuBvD"}
1
+ {"version":3,"file":"openClientFor.d.ts","sourceRoot":"","sources":["../../src/helpers/openClientFor.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAA;AAC7D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AAWvD;;GAEG;AACH,wBAAgB,aAAa,CAC3B,SAAS,EAAE,oBAAoB,EAC/B,cAAc,CAAC,EAAE,SAAS,CAAC,yBAAyB,EAAE,QAuBvD"}
@@ -1,11 +1,11 @@
1
1
  export * from './useClipboard.js';
2
- export * from './useClientStore';
2
+ export * from './useClientStore.js';
3
3
  export * from './useDarkModeState.js';
4
4
  export * from './useDeprecationWarnings.js';
5
5
  export * from './useNavState.js';
6
6
  export * from './useOperation.js';
7
7
  export * from './useReactiveSpec.js';
8
- export * from './useRefOnMount';
8
+ export * from './useRefOnMount.js';
9
9
  export * from './useResponses.js';
10
10
  export * from './useSidebar.js';
11
11
  //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,5 @@
1
+ const e = () => {
2
+ };
3
+ export {
4
+ e as useClientStore
5
+ };
@@ -1,3 +1,6 @@
1
1
  import type { ReferenceConfiguration } from '../types';
2
+ /**
3
+ * Warns the user about deprecated configurations in the browser console.
4
+ */
2
5
  export declare function useDeprecationWarnings(configuration: ReferenceConfiguration): void;
3
6
  //# sourceMappingURL=useDeprecationWarnings.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useDeprecationWarnings.d.ts","sourceRoot":"","sources":["../../src/hooks/useDeprecationWarnings.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAA;AAMtD,wBAAgB,sBAAsB,CAAC,aAAa,EAAE,sBAAsB,QAoC3E"}
1
+ {"version":3,"file":"useDeprecationWarnings.d.ts","sourceRoot":"","sources":["../../src/hooks/useDeprecationWarnings.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAA;AAMtD;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,aAAa,EAAE,sBAAsB,QAoC3E"}
@@ -1,3 +1,6 @@
1
1
  import { type Ref } from 'vue';
2
+ /**
3
+ * Set a ref value on mount when needed to access properties that are not SSR-friendly.
4
+ */
2
5
  export declare function useRefOnMount<T>(setter: () => T): Ref<T | null>;
3
6
  //# sourceMappingURL=useRefOnMount.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useRefOnMount.d.ts","sourceRoot":"","sources":["../../src/hooks/useRefOnMount.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,GAAG,EAAkB,MAAM,KAAK,CAAA;AAG9C,wBAAgB,aAAa,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,iBAQ/C"}
1
+ {"version":3,"file":"useRefOnMount.d.ts","sourceRoot":"","sources":["../../src/hooks/useRefOnMount.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,GAAG,EAAkB,MAAM,KAAK,CAAA;AAE9C;;GAEG;AACH,wBAAgB,aAAa,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,iBAQ/C"}
@@ -0,0 +1,10 @@
1
+ import { ref as o, onMounted as u } from "vue";
2
+ function r(e) {
3
+ const n = o(null);
4
+ return u(() => {
5
+ n.value = e();
6
+ }), n;
7
+ }
8
+ export {
9
+ r as useRefOnMount
10
+ };
@@ -14,6 +14,9 @@ declare function setParsedSpec(spec: Spec): Spec;
14
14
  type CollapsedSidebarItems = Record<string, boolean>;
15
15
  declare function toggleCollapsedSidebarItem(key: string): void;
16
16
  declare function setCollapsedSidebarItem(key: string, value: boolean): void;
17
+ /**
18
+ * Provides the sidebar state and methods to control it.
19
+ */
17
20
  export declare function useSidebar(options?: {
18
21
  parsedSpec: Spec;
19
22
  }): {
@@ -1 +1 @@
1
- {"version":3,"file":"useSidebar.d.ts","sourceRoot":"","sources":["../../src/hooks/useSidebar.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAA6B,MAAM,mBAAmB,CAAA;AAexE,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;AAeD,iBAAS,aAAa,CAAC,IAAI,EAAE,IAAI,QAEhC;AAKD,KAAK,qBAAqB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;AAMpD,iBAAS,0BAA0B,CAAC,GAAG,EAAE,MAAM,QAE9C;AAED,iBAAS,uBAAuB,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,QAE3D;AAgOD,wBAAgB,UAAU,CAAC,OAAO,CAAC,EAAE;IAAE,UAAU,EAAE,IAAI,CAAA;CAAE;;;;;;;;;;;;EA2CxD"}
1
+ {"version":3,"file":"useSidebar.d.ts","sourceRoot":"","sources":["../../src/hooks/useSidebar.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAA6B,MAAM,mBAAmB,CAAA;AAexE,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;AAeD,iBAAS,aAAa,CAAC,IAAI,EAAE,IAAI,QAEhC;AAKD,KAAK,qBAAqB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;AAMpD,iBAAS,0BAA0B,CAAC,GAAG,EAAE,MAAM,QAE9C;AAED,iBAAS,uBAAuB,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,QAE3D;AAkOD;;GAEG;AACH,wBAAgB,UAAU,CAAC,OAAO,CAAC,EAAE;IAAE,UAAU,EAAE,IAAI,CAAA;CAAE;;;;;;;;;;;;EA2CxD"}
package/dist/index.d.ts CHANGED
@@ -11,8 +11,10 @@ export { useReactiveSpec } from './hooks/useReactiveSpec.js';
11
11
  export * from './components/DarkModeToggle';
12
12
  export * from './components/Sidebar';
13
13
  export * from './components/Card';
14
+ export * from './components/Layouts';
14
15
  export * from './stores';
15
16
  export * from './helpers';
16
17
  export * from './types';
18
+ export * from './hooks';
17
19
  export { useApiClientStore } from '@scalar/api-client';
18
20
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,oCAAoC,CAAA;AAC9E,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,+BAA+B,CAAA;AACvE,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,qCAAqC,CAAA;AACnF,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,uCAAuC,CAAA;AAC/E,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,kCAAkC,CAAA;AAC/E,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,8BAA8B,CAAA;AACrE,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,+BAA+B,CAAA;AACvE,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,iCAAiC,CAAA;AAC3E,OAAO,EAAE,sBAAsB,EAAE,MAAM,OAAO,CAAA;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAA;AAEzD,cAAc,6BAA6B,CAAA;AAC3C,cAAc,sBAAsB,CAAA;AACpC,cAAc,mBAAmB,CAAA;AAEjC,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA;AACzB,cAAc,SAAS,CAAA;AAEvB,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,oCAAoC,CAAA;AAC9E,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,+BAA+B,CAAA;AACvE,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,qCAAqC,CAAA;AACnF,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,uCAAuC,CAAA;AAC/E,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,kCAAkC,CAAA;AAC/E,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,8BAA8B,CAAA;AACrE,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,+BAA+B,CAAA;AACvE,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,iCAAiC,CAAA;AAC3E,OAAO,EAAE,sBAAsB,EAAE,MAAM,OAAO,CAAA;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAA;AAEzD,cAAc,6BAA6B,CAAA;AAC3C,cAAc,sBAAsB,CAAA;AACpC,cAAc,mBAAmB,CAAA;AACjC,cAAc,sBAAsB,CAAA;AAEpC,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA;AACzB,cAAc,SAAS,CAAA;AACvB,cAAc,SAAS,CAAA;AAEvB,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA"}