@scalar/api-reference 1.24.74 → 1.24.76

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 (57) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/dist/browser/standalone.js +7481 -7449
  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 +71 -71
  7. package/dist/components/Content/Content.vue2.js +11 -11
  8. package/dist/components/Content/Lazy/Loading.vue.js +1 -1
  9. package/dist/components/Content/Operation/ContentTypeSelect.vue.d.ts +27 -0
  10. package/dist/components/Content/Operation/ContentTypeSelect.vue.d.ts.map +1 -0
  11. package/dist/components/Content/Operation/ContentTypeSelect.vue.js +7 -0
  12. package/dist/components/Content/Operation/ContentTypeSelect.vue2.js +41 -0
  13. package/dist/components/Content/Operation/EndpointDetails.vue.d.ts.map +1 -1
  14. package/dist/components/Content/Operation/EndpointDetails.vue.js +10 -7
  15. package/dist/components/Content/Operation/ParameterItem.vue.d.ts +5 -0
  16. package/dist/components/Content/Operation/ParameterItem.vue.d.ts.map +1 -1
  17. package/dist/components/Content/Operation/ParameterItem.vue.js +2 -2
  18. package/dist/components/Content/Operation/ParameterItem.vue2.js +54 -19
  19. package/dist/components/Content/Operation/Parameters.vue.d.ts +5 -0
  20. package/dist/components/Content/Operation/Parameters.vue.d.ts.map +1 -1
  21. package/dist/components/Content/Operation/Parameters.vue.js +2 -2
  22. package/dist/components/Content/Operation/Parameters.vue2.js +16 -14
  23. package/dist/components/Content/Operation/PathResponses/ExampleResponse.vue.d.ts.map +1 -1
  24. package/dist/components/Content/Operation/PathResponses/ExampleResponse.vue.js +1 -1
  25. package/dist/components/Content/Operation/PathResponses/ExampleResponse.vue2.js +28 -22
  26. package/dist/components/Content/Tag/Endpoints.vue.d.ts +2 -6
  27. package/dist/components/Content/Tag/Endpoints.vue.d.ts.map +1 -1
  28. package/dist/components/Content/Tag/Endpoints.vue.js +2 -2
  29. package/dist/components/Content/Tag/Endpoints.vue2.js +57 -60
  30. package/dist/components/Content/Tag/Tag.vue.d.ts.map +1 -1
  31. package/dist/components/Content/Tag/Tag.vue.js +2 -2
  32. package/dist/components/Content/Tag/Tag.vue2.js +21 -33
  33. package/dist/components/Content/Webhooks/Webhooks.vue.d.ts.map +1 -1
  34. package/dist/components/Content/Webhooks/Webhooks.vue.js +5 -76
  35. package/dist/components/Content/Webhooks/Webhooks.vue2.js +76 -2
  36. package/dist/components/Section/SectionContainer.vue.js +1 -1
  37. package/dist/components/ShowMoreButton.vue.d.ts.map +1 -1
  38. package/dist/components/ShowMoreButton.vue.js +1 -1
  39. package/dist/features/ExampleRequest/ExampleRequest.vue.d.ts.map +1 -1
  40. package/dist/features/ExampleRequest/ExampleRequest.vue.js +4 -4
  41. package/dist/features/ExampleRequest/ExampleRequest.vue2.js +11 -10
  42. package/dist/hooks/useReactiveSpec.d.ts +2 -0
  43. package/dist/hooks/useReactiveSpec.d.ts.map +1 -1
  44. package/dist/hooks/useResponses.d.ts +2 -1
  45. package/dist/hooks/useResponses.d.ts.map +1 -1
  46. package/dist/hooks/useResponses.js +12 -11
  47. package/dist/hooks/useSidebar.d.ts +9 -0
  48. package/dist/hooks/useSidebar.d.ts.map +1 -1
  49. package/dist/hooks/useSidebar.js +123 -108
  50. package/dist/index.js +20 -19
  51. package/dist/legacy/stores/useOpenApiStore.d.ts +2 -0
  52. package/dist/legacy/stores/useOpenApiStore.d.ts.map +1 -1
  53. package/dist/style.css +1 -1
  54. package/package.json +5 -5
  55. package/dist/components/Content/Tag/mutationObserver.d.ts +0 -3
  56. package/dist/components/Content/Tag/mutationObserver.d.ts.map +0 -1
  57. package/dist/components/Content/Tag/mutationObserver.js +0 -7
@@ -1 +1 @@
1
- {"version":3,"file":"ApiReferenceLayout.vue.d.ts","sourceRoot":"","sources":["../../src/components/ApiReference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C,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 "./ApiReferenceLayout.vue2.js";
2
2
  /* empty css */
3
3
  /* empty css */
4
4
  import t from "../_virtual/_plugin-vue_export-helper.js";
5
- const a = /* @__PURE__ */ t(o, [["__scopeId", "data-v-9058c8d1"]]);
5
+ const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-f9fd3db9"]]);
6
6
  export {
7
- a as default
7
+ m as default
8
8
  };
@@ -1,7 +1,7 @@
1
- import { defineComponent as Z, ref as w, onMounted as D, onBeforeMount as F, computed as y, watch as _, onServerPrefetch as x, useSSRContext as ee, getCurrentInstance as oe, provide as M, openBlock as v, createElementBlock as S, Fragment as P, createElementVNode as i, normalizeClass as te, unref as u, normalizeStyle as re, renderSlot as l, normalizeProps as d, guardReactiveProps as c, createVNode as f, withCtx as g, createCommentVNode as T, withDirectives as ae, vShow as ne, createSlots as se } from "vue";
1
+ import { defineComponent as Z, ref as h, onMounted as B, onBeforeMount as D, computed as b, watch as _, onServerPrefetch as x, useSSRContext as ee, getCurrentInstance as oe, provide as F, openBlock as v, createElementBlock as S, Fragment as M, createElementVNode as i, normalizeClass as te, unref as u, normalizeStyle as re, renderSlot as l, normalizeProps as d, guardReactiveProps as c, createVNode as f, withCtx as g, createCommentVNode as w, withDirectives as ae, vShow as ne, createSlots as se } from "vue";
2
2
  import { provideUseId as ie } from "@headlessui/vue";
3
3
  import { addScalarClassesToHeadless as le } from "@scalar/components";
4
- import { defaultStateFactory as U } from "@scalar/oas-utils/helpers";
4
+ import { defaultStateFactory as P } from "@scalar/oas-utils/helpers";
5
5
  import { getThemeStyles as de } from "@scalar/themes";
6
6
  import { useToasts as ce, ScalarToasts as ue } from "@scalar/use-toasts";
7
7
  import { useMediaQuery as pe, useResizeObserver as fe, useDebounceFn as ge } from "@vueuse/core";
@@ -15,15 +15,14 @@ import ye from "./Content/Content.vue.js";
15
15
  import { useSidebar as Te } from "../hooks/useSidebar.js";
16
16
  import { GLOBAL_SECURITY_SYMBOL as Re, HIDE_DOWNLOAD_BUTTON_SYMBOL as $e } from "../helpers/provideSymbols.js";
17
17
  import { useNavState as Ce } from "../hooks/useNavState.js";
18
- import { sleep as A } from "../helpers/sleep.js";
19
- import { scrollToId as Ie } from "../helpers/scrollToId.js";
20
- const Le = ["innerHTML"], Ee = { class: "references-header" }, ke = {
18
+ import { sleep as Le } from "../helpers/sleep.js";
19
+ const Ee = ["innerHTML"], Ie = { class: "references-header" }, Oe = {
21
20
  key: 0,
22
21
  class: "references-navigation t-doc__sidebar"
23
- }, Oe = { class: "references-navigation-list" }, Be = { class: "references-editor" }, De = { class: "references-editor-textarea" }, Fe = { class: "references-rendered" }, Me = {
22
+ }, ke = { class: "references-navigation-list" }, Be = { class: "references-editor" }, De = { class: "references-editor-textarea" }, Fe = { class: "references-rendered" }, Me = {
24
23
  key: 0,
25
24
  class: "references-footer"
26
- }, eo = /* @__PURE__ */ Z({
25
+ }, xe = /* @__PURE__ */ Z({
27
26
  inheritAttrs: !1,
28
27
  __name: "ApiReferenceLayout",
29
28
  props: {
@@ -32,96 +31,97 @@ const Le = ["innerHTML"], Ee = { class: "references-header" }, ke = {
32
31
  rawSpec: {}
33
32
  },
34
33
  emits: ["changeTheme", "updateContent", "loadSwaggerFile", "linkSwaggerFile", "toggleDarkMode"],
35
- setup(H) {
36
- const t = H, { initializeToasts: N, toast: z } = ce();
37
- N((e) => z(e));
38
- const Y = pe("(min-width: 1150px)"), V = w("100dvh"), p = w(null);
34
+ setup(U) {
35
+ const t = U, { initializeToasts: A, toast: H } = ce();
36
+ A((e) => H(e));
37
+ const N = pe("(min-width: 1150px)"), z = h("100dvh"), p = h(null);
39
38
  fe(p, (e) => {
40
- V.value = e[0].contentRect.height + "px";
39
+ z.value = e[0].contentRect.height + "px";
41
40
  });
42
- const R = w(0);
43
- D(() => {
44
- var r, a, n;
45
- const e = (a = (r = p.value) == null ? void 0 : r.parentElement) == null ? void 0 : a.getBoundingClientRect(), o = (n = p.value) == null ? void 0 : n.getBoundingClientRect();
41
+ const y = h(0);
42
+ B(() => {
43
+ var a, r, n;
44
+ const e = (r = (a = p.value) == null ? void 0 : a.parentElement) == null ? void 0 : r.getBoundingClientRect(), o = (n = p.value) == null ? void 0 : n.getBoundingClientRect();
46
45
  if (e && o) {
47
- const B = o.top - e.top;
48
- R.value = B < 2 ? 0 : B;
46
+ const k = o.top - e.top;
47
+ y.value = k < 2 ? 0 : k;
49
48
  }
50
49
  });
51
50
  const {
52
- breadcrumb: G,
51
+ breadcrumb: Y,
53
52
  collapsedSidebarItems: m,
54
- isSidebarOpen: W,
55
- setCollapsedSidebarItem: h,
56
- hideModels: j,
57
- defaultOpenAllTags: K,
58
- setParsedSpec: Q
53
+ isSidebarOpen: V,
54
+ setCollapsedSidebarItem: T,
55
+ hideModels: G,
56
+ defaultOpenAllTags: W,
57
+ setParsedSpec: j,
58
+ scrollToOperation: K
59
59
  } = Te(), {
60
- getPathRoutingId: $,
61
- getSectionId: b,
60
+ getPathRoutingId: R,
61
+ getSectionId: Q,
62
62
  getTagId: q,
63
- hash: C,
64
- isIntersectionEnabled: I,
63
+ hash: $,
64
+ isIntersectionEnabled: C,
65
65
  pathRouting: L,
66
66
  updateHash: E
67
67
  } = Ce();
68
- L.value = t.configuration.pathRouting, F(() => E());
69
- const k = async (e) => {
68
+ L.value = t.configuration.pathRouting, D(() => E());
69
+ const I = async (e) => {
70
70
  var o;
71
- I.value = !1, E(), e ? (b(e) !== e && (h(b(e), !0), await A(100)), Ie(e)) : (o = p.value) == null || o.scrollTo(0, 0), await A(100), I.value = !0;
71
+ C.value = !1, E(), e ? K(e) : (o = p.value) == null || o.scrollTo(0, 0), await Le(100), C.value = !0;
72
72
  };
73
- F(() => le()), D(() => {
73
+ D(() => le()), B(() => {
74
74
  Se.on(({ specTitle: e }) => {
75
75
  he(t.rawSpec, e);
76
- }), window.onhashchange = () => k(decodeURIComponent(window.location.hash.replace(/^#/, ""))), window.onpopstate = () => L.value && k($(window.location.pathname));
76
+ }), window.onhashchange = () => I(decodeURIComponent(window.location.hash.replace(/^#/, ""))), window.onpopstate = () => L.value && I(R(window.location.pathname));
77
77
  });
78
- const J = y(
79
- () => Y.value || !t.configuration.isEditable
78
+ const J = b(
79
+ () => N.value || !t.configuration.isEditable
80
80
  ), O = ge((e) => {
81
81
  if ((e.target.scrollTop ?? 0) < 50) {
82
- const r = t.configuration.pathRouting ? t.configuration.pathRouting.basePath : window.location.pathname;
83
- window.history.replaceState({}, "", r + window.location.search), C.value = "";
82
+ const a = t.configuration.pathRouting ? t.configuration.pathRouting.basePath : window.location.pathname;
83
+ window.history.replaceState({}, "", a + window.location.search), $.value = "";
84
84
  }
85
- }), s = y(() => ({
86
- breadcrumb: G.value,
85
+ }), s = b(() => ({
86
+ breadcrumb: Y.value,
87
87
  spec: t.parsedSpec
88
88
  }));
89
- _(() => t.parsedSpec, Q, { deep: !0 }), x(() => {
90
- var o, r;
89
+ _(() => t.parsedSpec, j, { deep: !0 }), x(() => {
90
+ var o, a;
91
91
  const e = ee();
92
- if (e && (e.payload || (e.payload = { data: U() }), (o = e.payload).data || (o.data = U()), t.configuration.pathRouting)) {
93
- const a = $(e.url);
94
- C.value = a, e.payload.data.hash = a;
92
+ if (e && (e.payload || (e.payload = { data: P() }), (o = e.payload).data || (o.data = P()), t.configuration.pathRouting)) {
93
+ const r = R(e.url);
94
+ $.value = r, e.payload.data.hash = r;
95
95
  for (const n in m)
96
96
  Object.hasOwn(m, n) && delete m[n];
97
- if (a)
98
- h(b(a), !0);
97
+ if (r)
98
+ T(Q(r), !0);
99
99
  else {
100
- const n = (r = t.parsedSpec.tags) == null ? void 0 : r[0];
101
- n && h(q(n), !0);
100
+ const n = (a = t.parsedSpec.tags) == null ? void 0 : a[0];
101
+ n && T(q(n), !0);
102
102
  }
103
103
  e.payload.data["useSidebarContent-collapsedSidebarItems"] = m;
104
104
  }
105
105
  }), ie(() => {
106
- var a;
106
+ var r;
107
107
  const e = oe(), o = "scalar-instance-id";
108
108
  if (!e) return o;
109
- let r = e.uid;
110
- return typeof window > "u" ? (e.attrs || (e.attrs = {}), e.attrs[o] = r) : (a = e.vnode.el) != null && a.getAttribute && (r = e.vnode.el.getAttribute(o)), `${o}-${r}`;
111
- }), M(Re, () => t.parsedSpec.security), M(
109
+ let a = e.uid;
110
+ return typeof window > "u" ? (e.attrs || (e.attrs = {}), e.attrs[o] = a) : (r = e.vnode.el) != null && r.getAttribute && (a = e.vnode.el.getAttribute(o)), `${o}-${a}`;
111
+ }), F(Re, () => t.parsedSpec.security), F(
112
112
  $e,
113
113
  () => t.configuration.hideDownloadButton
114
- ), j.value = t.configuration.hideModels ?? !1, K.value = t.configuration.defaultOpenAllTags ?? !1, be(t.configuration);
115
- const X = y(
114
+ ), G.value = t.configuration.hideModels ?? !1, W.value = t.configuration.defaultOpenAllTags ?? !1, be(t.configuration);
115
+ const X = b(
116
116
  () => `<style>
117
117
  ${de(t.configuration.theme, {
118
118
  fonts: t.configuration.withDefaultFonts
119
119
  })}</style>`
120
120
  );
121
121
  return (e, o) => {
122
- var r;
123
- return v(), S(P, null, [
124
- i("div", { innerHTML: X.value }, null, 8, Le),
122
+ var a;
123
+ return v(), S(M, null, [
124
+ i("div", { innerHTML: X.value }, null, 8, Ee),
125
125
  i("div", {
126
126
  ref_key: "documentEl",
127
127
  ref: p,
@@ -129,22 +129,22 @@ const Le = ["innerHTML"], Ee = { class: "references-header" }, ke = {
129
129
  {
130
130
  "references-editable": e.configuration.isEditable,
131
131
  "references-sidebar": e.configuration.showSidebar,
132
- "references-sidebar-mobile-open": u(W),
132
+ "references-sidebar-mobile-open": u(V),
133
133
  "references-classic": e.configuration.layout === "classic"
134
134
  },
135
135
  e.$attrs.class
136
136
  ]]),
137
137
  style: re({
138
- "--scalar-y-offset": `var(--scalar-custom-header-height, ${R.value}px)`
138
+ "--scalar-y-offset": `var(--scalar-custom-header-height, ${y.value}px)`
139
139
  }),
140
140
  onScrollPassive: o[4] || (o[4] = //@ts-ignore
141
- (...a) => u(O) && u(O)(...a))
141
+ (...r) => u(O) && u(O)(...r))
142
142
  }, [
143
- i("div", Ee, [
143
+ i("div", Ie, [
144
144
  l(e.$slots, "header", d(c(s.value)), void 0, !0)
145
145
  ]),
146
- e.configuration.showSidebar ? (v(), S("aside", ke, [
147
- i("div", Oe, [
146
+ e.configuration.showSidebar ? (v(), S("aside", Oe, [
147
+ i("div", ke, [
148
148
  f(u(we), {
149
149
  parsedSpec: e.parsedSpec,
150
150
  tagsSorter: e.configuration.tagsSorter
@@ -158,7 +158,7 @@ const Le = ["innerHTML"], Ee = { class: "references-header" }, ke = {
158
158
  _: 3
159
159
  }, 8, ["parsedSpec", "tagsSorter"])
160
160
  ])
161
- ])) : T("", !0),
161
+ ])) : w("", !0),
162
162
  ae(i("div", Be, [
163
163
  i("div", De, [
164
164
  l(e.$slots, "editor", d(c(s.value)), void 0, !0)
@@ -166,7 +166,7 @@ const Le = ["innerHTML"], Ee = { class: "references-header" }, ke = {
166
166
  ], 512), [
167
167
  [ne, e.configuration.isEditable]
168
168
  ]),
169
- J.value ? (v(), S(P, { key: 1 }, [
169
+ J.value ? (v(), S(M, { key: 1 }, [
170
170
  i("div", Fe, [
171
171
  f(u(ye), {
172
172
  baseServerURL: e.configuration.baseServerURL,
@@ -183,13 +183,13 @@ const Le = ["innerHTML"], Ee = { class: "references-header" }, ke = {
183
183
  ]),
184
184
  _: 2
185
185
  }, [
186
- (r = e.configuration) != null && r.isEditable ? {
186
+ (a = e.configuration) != null && a.isEditable ? {
187
187
  name: "empty-state",
188
188
  fn: g(() => {
189
- var a;
189
+ var r;
190
190
  return [
191
191
  f(ve, {
192
- theme: ((a = e.configuration) == null ? void 0 : a.theme) || "default",
192
+ theme: ((r = e.configuration) == null ? void 0 : r.theme) || "default",
193
193
  onChangeTheme: o[0] || (o[0] = (n) => e.$emit("changeTheme", n)),
194
194
  onLinkSwaggerFile: o[1] || (o[1] = (n) => e.$emit("linkSwaggerFile")),
195
195
  onLoadSwaggerFile: o[2] || (o[2] = (n) => e.$emit("loadSwaggerFile")),
@@ -203,8 +203,8 @@ const Le = ["innerHTML"], Ee = { class: "references-header" }, ke = {
203
203
  ]),
204
204
  e.$slots.footer ? (v(), S("div", Me, [
205
205
  l(e.$slots, "footer", d(c(s.value)), void 0, !0)
206
- ])) : T("", !0)
207
- ], 64)) : T("", !0),
206
+ ])) : w("", !0)
207
+ ], 64)) : w("", !0),
208
208
  f(me, {
209
209
  proxyUrl: e.configuration.proxy,
210
210
  servers: e.configuration.servers,
@@ -217,5 +217,5 @@ const Le = ["innerHTML"], Ee = { class: "references-header" }, ke = {
217
217
  }
218
218
  });
219
219
  export {
220
- eo as default
220
+ xe as default
221
221
  };
@@ -1,15 +1,15 @@
1
- import { defineComponent as O, computed as m, openBlock as r, createElementBlock as n, Fragment as c, createElementVNode as h, renderSlot as u, createVNode as l, unref as o, createBlock as s, withCtx as p, normalizeClass as T, renderList as k, resolveDynamicComponent as L, createCommentVNode as $, createStaticVNode as E } from "vue";
1
+ import { defineComponent as O, computed as m, openBlock as r, createElementBlock as n, Fragment as c, createElementVNode as h, renderSlot as u, createVNode as l, unref as o, createBlock as s, withCtx as p, normalizeClass as T, renderList as k, resolveDynamicComponent as L, createCommentVNode as C, createStaticVNode as E } from "vue";
2
2
  import R from "./Tag/TagAccordion.vue.js";
3
- import D from "./Tag/Tag.vue.js";
4
- import F from "./Operation/OperationAccordion.vue.js";
5
- import W from "./Operation/Operation.vue.js";
3
+ import W from "./Tag/Tag.vue.js";
4
+ import D from "./Operation/OperationAccordion.vue.js";
5
+ import F from "./Operation/Operation.vue.js";
6
6
  import j from "./Lazy/Loading.vue.js";
7
7
  /* empty css */
8
8
  import q from "./Introduction/Introduction.vue.js";
9
9
  import G from "../../features/BaseUrl/BaseUrl.vue.js";
10
10
  import H from "./Authentication/Authentication.vue.js";
11
11
  import J from "./ClientLibraries/ClientLibraries.vue.js";
12
- import C from "./Lazy/Lazy.vue.js";
12
+ import $ from "./Lazy/Lazy.vue.js";
13
13
  import K from "./Webhooks/Webhooks.vue.js";
14
14
  import P from "./Models/ModelsAccordion.vue.js";
15
15
  import Q from "./Models/Models.vue.js";
@@ -28,9 +28,9 @@ const _ = /* @__PURE__ */ E('<div class="section-flare" data-v-db9e3854><div cla
28
28
  },
29
29
  setup(z) {
30
30
  const i = z, { getOperationId: f, getTagId: d, hash: I } = Z(), { hideModels: M, collapsedSidebarItems: N } = X(), V = m(
31
- () => i.layout === "accordion" ? R : D
31
+ () => i.layout === "accordion" ? R : W
32
32
  ), A = m(
33
- () => i.layout === "accordion" ? F : W
33
+ () => i.layout === "accordion" ? D : F
34
34
  ), U = m(
35
35
  () => i.layout === "accordion" ? "after" : "aside"
36
36
  ), g = i.layout !== "accordion" && !I.value.startsWith("model");
@@ -69,7 +69,7 @@ const _ = /* @__PURE__ */ E('<div class="section-flare" data-v-db9e3854><div cla
69
69
  ]),
70
70
  _: 2
71
71
  }, 1032, ["info", "parsedSpec"])) : u(e.$slots, "empty-state", { key: 1 }, void 0, !0),
72
- (r(!0), n(c, null, k(e.parsedSpec.tags, (a) => (r(), s(o(C), {
72
+ (r(!0), n(c, null, k(e.parsedSpec.tags, (a) => (r(), s(o($), {
73
73
  id: o(d)(a),
74
74
  key: o(d)(a),
75
75
  isLazy: o(g) && !o(N)[o(d)(a)]
@@ -81,7 +81,7 @@ const _ = /* @__PURE__ */ E('<div class="section-flare" data-v-db9e3854><div cla
81
81
  tag: a
82
82
  }, {
83
83
  default: p(() => [
84
- (r(!0), n(c, null, k(a.operations, (t, B) => (r(), s(o(C), {
84
+ (r(!0), n(c, null, k(a.operations, (t, B) => (r(), s(o($), {
85
85
  id: o(f)(t, a),
86
86
  key: `${t.httpVerb}-${t.operationId}`,
87
87
  isLazy: B > 0
@@ -104,7 +104,7 @@ const _ = /* @__PURE__ */ E('<div class="section-flare" data-v-db9e3854><div cla
104
104
  e.parsedSpec.webhooks ? (r(), s(o(K), {
105
105
  key: 2,
106
106
  webhooks: e.parsedSpec.webhooks
107
- }, null, 8, ["webhooks"])) : $("", !0),
107
+ }, null, 8, ["webhooks"])) : C("", !0),
108
108
  o(Y)(e.parsedSpec) && !o(M) ? (r(), n(c, { key: 3 }, [
109
109
  e.layout === "accordion" ? (r(), s(o(P), {
110
110
  key: 0,
@@ -113,7 +113,7 @@ const _ = /* @__PURE__ */ E('<div class="section-flare" data-v-db9e3854><div cla
113
113
  key: 1,
114
114
  schemas: o(w)(e.parsedSpec)
115
115
  }, null, 8, ["schemas"]))
116
- ], 64)) : $("", !0),
116
+ ], 64)) : C("", !0),
117
117
  u(e.$slots, "end", {}, void 0, !0)
118
118
  ])
119
119
  ], 64);
@@ -1,6 +1,5 @@
1
1
  import { defineComponent as E, ref as v, watch as K, onMounted as M, withDirectives as $, openBlock as n, createElementBlock as f, normalizeClass as j, Fragment as g, renderList as k, createBlock as m, unref as o, withCtx as p, createCommentVNode as w, createVNode as T, createTextVNode as A, toDisplayString as F, vShow as H } from "vue";
2
2
  import { lazyBus as P } from "./lazyBus.js";
3
- import { scrollToId as x } from "../../../helpers/scrollToId.js";
4
3
  import q from "../Tag/Tag.vue.js";
5
4
  import G from "../Operation/Operation.vue.js";
6
5
  import J from "../../Section/SectionContainer.vue.js";
@@ -10,6 +9,7 @@ import U from "../../Section/SectionHeader.vue.js";
10
9
  import X from "../../Anchor/Anchor.vue.js";
11
10
  import Y from "../Schema/Schema.vue.js";
12
11
  import { getModels as h } from "../../../helpers/getModels.js";
12
+ import { scrollToId as x } from "../../../helpers/scrollToId.js";
13
13
  import { useNavState as Z } from "../../../hooks/useNavState.js";
14
14
  const fe = /* @__PURE__ */ E({
15
15
  __name: "Loading",
@@ -0,0 +1,27 @@
1
+ import type { ContentType, RequestBody } from '@scalar/oas-utils';
2
+ declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<{
3
+ requestBody?: RequestBody;
4
+ defaultValue?: ContentType;
5
+ }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
6
+ selectContentType: (payload: {
7
+ contentType: ContentType;
8
+ }) => void;
9
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<{
10
+ requestBody?: RequestBody;
11
+ defaultValue?: ContentType;
12
+ }>>> & {
13
+ onSelectContentType?: ((payload: {
14
+ contentType: ContentType;
15
+ }) => any) | undefined;
16
+ }, {}, {}>;
17
+ export default _default;
18
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
19
+ type __VLS_TypePropsToOption<T> = {
20
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
21
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
22
+ } : {
23
+ type: import('vue').PropType<T[K]>;
24
+ required: true;
25
+ };
26
+ };
27
+ //# sourceMappingURL=ContentTypeSelect.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ContentTypeSelect.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Operation/ContentTypeSelect.vue"],"names":[],"mappings":"AAgHA,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;;kBAMjD,WAAW;mBACV,WAAW;;;qBAIuB,WAAW;;;kBAL9C,WAAW;mBACV,WAAW;;;qBAIuB,WAAW;;;AA0F9D,wBAOG;AAOH,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"}
@@ -0,0 +1,7 @@
1
+ import t from "./ContentTypeSelect.vue2.js";
2
+ /* empty css */
3
+ import o from "../../../_virtual/_plugin-vue_export-helper.js";
4
+ const a = /* @__PURE__ */ o(t, [["__scopeId", "data-v-1b6c95ea"]]);
5
+ export {
6
+ a as default
7
+ };
@@ -0,0 +1,41 @@
1
+ import { defineComponent as v, computed as g, ref as C, openBlock as o, createElementBlock as l, normalizeClass as f, createElementVNode as _, toDisplayString as d, Fragment as B, renderList as h, createCommentVNode as T } from "vue";
2
+ const q = ["value"], V = ["value"], k = /* @__PURE__ */ v({
3
+ __name: "ContentTypeSelect",
4
+ props: {
5
+ requestBody: {},
6
+ defaultValue: {}
7
+ },
8
+ emits: ["selectContentType"],
9
+ setup(p, { emit: i }) {
10
+ const e = p, m = i, y = (t) => {
11
+ const n = t.target.value;
12
+ a.value = n, m("selectContentType", { contentType: n });
13
+ }, s = g(() => {
14
+ var t;
15
+ return (t = e.requestBody) != null && t.content ? Object.keys(e.requestBody.content) : [];
16
+ }), a = C(
17
+ e.defaultValue || s.value[0]
18
+ );
19
+ return (t, c) => {
20
+ var n;
21
+ return o(), l("div", {
22
+ class: f(["content-type-select", { "content-type-no-select": s.value.length <= 1 }])
23
+ }, [
24
+ _("span", null, d(a.value), 1),
25
+ e != null && e.requestBody && s.value.length > 1 ? (o(), l("select", {
26
+ key: 0,
27
+ value: a.value,
28
+ onChange: c[0] || (c[0] = (r) => y(r))
29
+ }, [
30
+ (o(!0), l(B, null, h((n = e.requestBody) == null ? void 0 : n.content, (r, u) => (o(), l("option", {
31
+ key: u,
32
+ value: u
33
+ }, d(u), 9, V))), 128))
34
+ ], 40, q)) : T("", !0)
35
+ ], 2);
36
+ };
37
+ }
38
+ });
39
+ export {
40
+ k as default
41
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"EndpointDetails.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Operation/EndpointDetails.vue"],"names":[],"mappings":"AAoDA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAA;;eAQ1B,oBAAoB;;eAApB,oBAAoB;;AA8JvD,wBAMG;AAOH,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":"EndpointDetails.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Operation/EndpointDetails.vue"],"names":[],"mappings":"AAsDA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAA;;eAQ1B,oBAAoB;;eAApB,oBAAoB;;AA8JvD,wBAMG;AAOH,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"}
@@ -4,15 +4,15 @@ import o from "./Parameters.vue.js";
4
4
  import q from "./RequestBody.vue.js";
5
5
  import { useResponses as k } from "../../../hooks/useResponses.js";
6
6
  import { useOperation as P } from "../../../hooks/useOperation.js";
7
- const v = { class: "endpoint-details" }, w = { class: "endpoint-description" }, b = /* @__PURE__ */ u({
7
+ const v = { class: "endpoint-details" }, w = { class: "endpoint-description" }, I = /* @__PURE__ */ u({
8
8
  __name: "EndpointDetails",
9
9
  props: {
10
10
  operation: {}
11
11
  },
12
12
  setup(l) {
13
- const n = l, { parameterMap: s } = P(n), { responses: c } = k(n.operation);
13
+ const m = l, { parameterMap: s } = P(m), { responses: c } = k(m.operation);
14
14
  return (p, C) => {
15
- var i, m;
15
+ var n, i;
16
16
  return d(), _("div", v, [
17
17
  f("div", w, [
18
18
  e(t(B), {
@@ -61,16 +61,19 @@ const v = { class: "endpoint-details" }, w = { class: "endpoint-description" },
61
61
  ]),
62
62
  _: 1
63
63
  }, 8, ["parameters"]),
64
- (i = p.operation.information) != null && i.requestBody ? (d(), y(q, {
64
+ (n = p.operation.information) != null && n.requestBody ? (d(), y(q, {
65
65
  key: 0,
66
- requestBody: (m = p.operation.information) == null ? void 0 : m.requestBody
66
+ requestBody: (i = p.operation.information) == null ? void 0 : i.requestBody
67
67
  }, {
68
68
  title: r(() => [
69
69
  a("Body")
70
70
  ]),
71
71
  _: 1
72
72
  }, 8, ["requestBody"])) : h("", !0),
73
- e(o, { parameters: t(c) }, {
73
+ e(o, {
74
+ collapsableItems: !0,
75
+ parameters: t(c)
76
+ }, {
74
77
  title: r(() => [
75
78
  a("Responses")
76
79
  ]),
@@ -81,5 +84,5 @@ const v = { class: "endpoint-details" }, w = { class: "endpoint-description" },
81
84
  }
82
85
  });
83
86
  export {
84
- b as default
87
+ I as default
85
88
  };
@@ -2,15 +2,20 @@ import type { Parameters } from '@scalar/oas-utils';
2
2
  declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<{
3
3
  parameter: Parameters;
4
4
  showChildren?: boolean;
5
+ collapsableItems?: boolean;
5
6
  }>, {
6
7
  showChildren: boolean;
8
+ collapsableItems: boolean;
7
9
  }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<{
8
10
  parameter: Parameters;
9
11
  showChildren?: boolean;
12
+ collapsableItems?: boolean;
10
13
  }>, {
11
14
  showChildren: boolean;
15
+ collapsableItems: boolean;
12
16
  }>>>, {
13
17
  showChildren: boolean;
18
+ collapsableItems: boolean;
14
19
  }, {}>;
15
20
  export default _default;
16
21
  type __VLS_WithDefaults<P, D> = {
@@ -1 +1 @@
1
- {"version":3,"file":"ParameterItem.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Operation/ParameterItem.vue"],"names":[],"mappings":"AA+EA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;;eAMhB,UAAU;mBAAiB,OAAO;;;;eAAlC,UAAU;mBAAiB,OAAO;;;;kBAAP,OAAO;;AAyErE,wBAMG;AAOH,KAAK,kBAAkB,CAAC,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AI,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,SAAS,MAAM,CAAC,GAC7C,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG;QAAE,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC,CAAA;KAAC,CAAC,GACvC,CAAC,CAAC,CAAC,CAAC;CACP,CAAC;AAEN,KAAK,cAAc,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC;AAExD,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,7 +1,7 @@
1
1
  import t from "./ParameterItem.vue2.js";
2
2
  /* empty css */
3
3
  import o from "../../../_virtual/_plugin-vue_export-helper.js";
4
- const e = /* @__PURE__ */ o(t, [["__scopeId", "data-v-1d97f100"]]);
4
+ const a = /* @__PURE__ */ o(t, [["__scopeId", "data-v-decfd300"]]);
5
5
  export {
6
- e as default
6
+ a as default
7
7
  };
@@ -1,27 +1,62 @@
1
- import { defineComponent as r, openBlock as a, createElementBlock as o, createElementVNode as t, createVNode as n, unref as m } from "vue";
2
- import l from "../Schema/SchemaProperty.vue.js";
3
- const p = { class: "parameter-item" }, i = { class: "parameter-item-container" }, h = /* @__PURE__ */ r({
1
+ import { defineComponent as B, ref as u, computed as d, openBlock as l, createElementBlock as s, normalizeClass as g, createVNode as v, unref as f, createElementVNode as y, toDisplayString as h, createBlock as b, createCommentVNode as m } from "vue";
2
+ import { ScalarIcon as q } from "@scalar/components";
3
+ import w from "./ContentTypeSelect.vue.js";
4
+ import I from "../Schema/SchemaProperty.vue.js";
5
+ const S = { class: "parameter-item" }, V = { class: "parameter-item-name" }, T = { class: "parameter-item-type" }, j = {
6
+ key: 1,
7
+ class: "parameter-item-container parameter-item-container-markdown"
8
+ }, P = /* @__PURE__ */ B({
4
9
  __name: "ParameterItem",
5
10
  props: {
6
11
  parameter: {},
7
- showChildren: { type: Boolean, default: !1 }
12
+ showChildren: { type: Boolean, default: !1 },
13
+ collapsableItems: { type: Boolean, default: !1 }
8
14
  },
9
- setup(s) {
10
- return (e, c) => (a(), o("li", p, [
11
- t("div", i, [
12
- n(m(l), {
13
- compact: "",
14
- description: e.parameter.description,
15
- level: 0,
16
- name: e.parameter.name,
17
- noncollapsible: e.showChildren,
18
- required: e.parameter.required,
19
- value: e.parameter.schema
20
- }, null, 8, ["description", "name", "noncollapsible", "required", "value"])
21
- ])
22
- ]));
15
+ setup(C) {
16
+ const t = C, r = u(!1), k = d(() => t.parameter.content ? Object.keys(t.parameter.content) : []), n = u(
17
+ k.value[0]
18
+ );
19
+ t.parameter.content && "application/json" in t.parameter.content && (n.value = "application/json");
20
+ const a = d(() => t.collapsableItems && t.parameter.content);
21
+ return (e, o) => {
22
+ var p, i;
23
+ return l(), s("li", S, [
24
+ a.value ? (l(), s("div", {
25
+ key: 0,
26
+ class: g(["flex parameter-item-trigger", { "parameter-item-trigger-open": r.value }]),
27
+ onClick: o[1] || (o[1] = (c) => r.value = !r.value)
28
+ }, [
29
+ v(f(q), {
30
+ class: "parameter-item-icon",
31
+ icon: r.value ? "ChevronDown" : "ChevronRight",
32
+ size: "md",
33
+ thickness: "1.75"
34
+ }, null, 8, ["icon"]),
35
+ y("span", V, h(e.parameter.name), 1),
36
+ y("span", T, h(e.parameter.description), 1),
37
+ a.value && t.parameter.content ? (l(), b(w, {
38
+ key: 0,
39
+ class: "parameter-item-content-type",
40
+ defaultValue: n.value,
41
+ requestBody: t.parameter,
42
+ onSelectContentType: o[0] || (o[0] = ({ contentType: c }) => n.value = c)
43
+ }, null, 8, ["defaultValue", "requestBody"])) : m("", !0)
44
+ ], 2)) : m("", !0),
45
+ a.value && r.value || !a.value ? (l(), s("div", j, [
46
+ v(f(I), {
47
+ compact: "",
48
+ description: a.value ? "" : e.parameter.description,
49
+ level: 0,
50
+ name: a.value ? "" : e.parameter.name,
51
+ noncollapsible: e.showChildren,
52
+ required: e.parameter.required,
53
+ value: e.parameter.content ? (i = (p = e.parameter.content) == null ? void 0 : p[n.value]) == null ? void 0 : i.schema : e.parameter.schema
54
+ }, null, 8, ["description", "name", "noncollapsible", "required", "value"])
55
+ ])) : m("", !0)
56
+ ]);
57
+ };
23
58
  }
24
59
  });
25
60
  export {
26
- h as default
61
+ P as default
27
62
  };