@scalar/api-reference 1.28.11 → 1.28.12

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 (33) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/dist/browser/standalone.js +5740 -5724
  3. package/dist/browser/webpack-stats.json +1 -1
  4. package/dist/components/Content/Schema/Schema.preview.d.ts +232 -0
  5. package/dist/components/Content/Schema/Schema.preview.d.ts.map +1 -0
  6. package/dist/components/Content/Schema/Schema.vue.d.ts.map +1 -1
  7. package/dist/components/Content/Schema/Schema.vue.js +3 -3
  8. package/dist/components/Content/Schema/Schema.vue2.js +52 -51
  9. package/dist/components/Content/Schema/SchemaDiscriminator.vue.d.ts.map +1 -1
  10. package/dist/components/Content/Schema/SchemaDiscriminator.vue.js +2 -2
  11. package/dist/components/Content/Schema/SchemaDiscriminator.vue2.js +9 -7
  12. package/dist/components/Content/Schema/SchemaProperty.vue.d.ts.map +1 -1
  13. package/dist/components/Content/Schema/SchemaProperty.vue.js +2 -2
  14. package/dist/components/Content/Schema/SchemaProperty.vue2.js +55 -51
  15. package/dist/components/ShowMoreButton.vue.d.ts.map +1 -1
  16. package/dist/components/ShowMoreButton.vue.js +2 -2
  17. package/dist/components/ShowMoreButton.vue2.js +15 -11
  18. package/dist/components/Sidebar/Sidebar.vue.d.ts.map +1 -1
  19. package/dist/components/Sidebar/Sidebar.vue.js +2 -2
  20. package/dist/components/Sidebar/Sidebar.vue2.js +55 -55
  21. package/dist/components/Sidebar/SidebarElement.vue.d.ts.map +1 -1
  22. package/dist/components/Sidebar/SidebarElement.vue.js +2 -2
  23. package/dist/components/Sidebar/SidebarElement.vue2.js +53 -53
  24. package/dist/features/ExampleRequest/ExampleRequest.vue.d.ts.map +1 -1
  25. package/dist/features/ExampleRequest/ExampleRequest.vue.js +4 -4
  26. package/dist/features/ExampleRequest/ExampleRequest.vue2.js +76 -76
  27. package/dist/hooks/useMultipleDocuments.d.ts +3 -1
  28. package/dist/hooks/useMultipleDocuments.d.ts.map +1 -1
  29. package/dist/hooks/useReactiveSpec.d.ts.map +1 -1
  30. package/dist/hooks/useReactiveSpec.js +36 -36
  31. package/dist/index.js +1 -1
  32. package/dist/style.css +1 -1
  33. package/package.json +10 -9
@@ -1,21 +1,21 @@
1
- import { defineComponent as $, openBlock as n, createElementBlock as d, createElementVNode as a, normalizeClass as A, unref as m, withModifiers as T, createVNode as b, withCtx as V, createTextVNode as h, toDisplayString as c, createCommentVNode as s, createBlock as E, renderSlot as v } from "vue";
2
- import { ScalarSidebarGroupToggle as N, ScalarIcon as O } from "@scalar/components";
3
- import { combineUrlAndPath as R } from "@scalar/oas-utils/helpers";
4
- import { useConfig as U } from "../../hooks/useConfig.js";
5
- import H from "./SidebarHttpBadge.vue.js";
6
- import { sleep as C } from "../../helpers/sleep.js";
7
- import { useNavState as I } from "../../hooks/useNavState.js";
8
- import { scrollToId as P } from "../../helpers/scrollToId.js";
9
- const D = ["id"], L = {
1
+ import { defineComponent as A, openBlock as s, createElementBlock as p, createElementVNode as r, normalizeClass as T, unref as c, withModifiers as V, createVNode as v, withCtx as E, createTextVNode as h, toDisplayString as u, createCommentVNode as l, createBlock as N, renderSlot as C } from "vue";
2
+ import { ScalarSidebarGroupToggle as O, ScalarIcon as R } from "@scalar/components";
3
+ import { combineUrlAndPath as U } from "@scalar/oas-utils/helpers";
4
+ import { useConfig as H } from "../../hooks/useConfig.js";
5
+ import I from "./SidebarHttpBadge.vue.js";
6
+ import { sleep as k } from "../../helpers/sleep.js";
7
+ import { useNavState as P } from "../../hooks/useNavState.js";
8
+ import { scrollToId as D } from "../../helpers/scrollToId.js";
9
+ const L = ["id"], M = {
10
10
  key: 0,
11
11
  class: "sidebar-heading-chevron"
12
- }, M = ["aria-expanded"], z = ["href", "tabindex"], F = { class: "sidebar-heading-link-title" }, G = {
12
+ }, z = ["aria-expanded"], F = ["href", "tabindex"], G = { class: "sidebar-heading-link-title" }, j = {
13
13
  key: 1,
14
14
  class: "sidebar-heading-link-method"
15
- }, j = {
15
+ }, q = {
16
16
  key: 1,
17
17
  class: "action-menu"
18
- }, _ = /* @__PURE__ */ $({
18
+ }, x = /* @__PURE__ */ A({
19
19
  __name: "SidebarElement",
20
20
  props: {
21
21
  id: {},
@@ -25,82 +25,82 @@ const D = ["id"], L = {
25
25
  open: { type: Boolean }
26
26
  },
27
27
  emits: ["toggleOpen"],
28
- setup(k, { emit: y }) {
29
- const i = k, p = y, { getFullHash: u, isIntersectionEnabled: r, replaceUrlState: w } = I(), l = U(), f = async () => {
28
+ setup(y, { emit: w }) {
29
+ const i = y, m = w, { getFullHash: f, isIntersectionEnabled: d, replaceUrlState: S } = P(), n = H(), g = async () => {
30
30
  var e, t;
31
- r.value = !1, i.hasChildren && p("toggleOpen"), (t = (e = i.item) == null ? void 0 : e.select) == null || t.call(e), await C(100), r.value = !0;
32
- }, S = () => {
33
- if (l.value.pathRouting)
34
- return R(l.value.pathRouting.basePath, i.item.id);
31
+ d.value = !1, i.hasChildren && m("toggleOpen"), (t = (e = i.item) == null ? void 0 : e.select) == null || t.call(e), await k(100), d.value = !0;
32
+ }, B = () => {
33
+ if (n.value.pathRouting)
34
+ return U(n.value.pathRouting.basePath, i.item.id);
35
35
  if (typeof window < "u") {
36
36
  const e = new URL(window.location.href);
37
- return e.hash = u(i.item.id), `${e.pathname}${e.search}${e.hash}`;
37
+ return e.hash = f(i.item.id), `${e.pathname}${e.search}${e.hash}`;
38
38
  }
39
- return `#${u(i.item.id)}`;
40
- }, B = async (e) => {
41
- var t, o;
42
- l.value.pathRouting && (e.preventDefault(), i.hasChildren && p("toggleOpen"), (o = (t = i.item) == null ? void 0 : t.select) == null || o.call(t), p("toggleOpen"), r.value = !1, w(i.item.id), P(i.item.id), await C(100), r.value = !0);
39
+ return `#${f(i.item.id)}`;
40
+ }, $ = async (e) => {
41
+ var t, a, o, b;
42
+ (a = (t = n.value).onSidebarClick) == null || a.call(t, i.item.id), n.value.pathRouting && (e.preventDefault(), i.hasChildren && m("toggleOpen"), (b = (o = i.item) == null ? void 0 : o.select) == null || b.call(o), m("toggleOpen"), d.value = !1, S(i.item.id), D(i.item.id), await k(100), d.value = !0);
43
43
  };
44
44
  return (e, t) => {
45
- var o, g;
46
- return n(), d("li", {
45
+ var a, o;
46
+ return s(), p("li", {
47
47
  id: e.id,
48
48
  class: "sidebar-group-item"
49
49
  }, [
50
- a("div", {
51
- class: A(["sidebar-heading", {
50
+ r("div", {
51
+ class: T(["sidebar-heading", {
52
52
  "sidebar-group-item__folder": e.hasChildren,
53
53
  active_page: e.isActive,
54
54
  deprecated: e.item.deprecated ?? !1
55
55
  }]),
56
- onClick: f
56
+ onClick: g
57
57
  }, [
58
- e.hasChildren && !m(l).defaultOpenAllTags ? (n(), d("p", L, [
59
- a("button", {
58
+ e.hasChildren && !c(n).defaultOpenAllTags ? (s(), p("p", M, [
59
+ r("button", {
60
60
  "aria-expanded": e.open,
61
61
  class: "toggle-nested-icon",
62
62
  type: "button",
63
- onClick: T(f, ["stop"])
63
+ onClick: V(g, ["stop"])
64
64
  }, [
65
- b(m(N), { open: e.open }, {
66
- label: V(() => [
67
- h(c(e.open ? "Collapse" : "Expand") + " " + c(e.item.title), 1)
65
+ v(c(O), { open: e.open }, {
66
+ label: E(() => [
67
+ h(u(e.open ? "Collapse" : "Expand") + " " + u(e.item.title), 1)
68
68
  ]),
69
69
  _: 1
70
70
  }, 8, ["open"])
71
- ], 8, M),
71
+ ], 8, z),
72
72
  t[0] || (t[0] = h("   "))
73
- ])) : s("", !0),
74
- a("a", {
73
+ ])) : l("", !0),
74
+ r("a", {
75
75
  class: "sidebar-heading-link",
76
- href: S(),
76
+ href: B(),
77
77
  tabindex: e.hasChildren ? -1 : 0,
78
- onClick: B
78
+ onClick: $
79
79
  }, [
80
- (g = (o = e.item) == null ? void 0 : o.icon) != null && g.src ? (n(), E(m(O), {
80
+ (o = (a = e.item) == null ? void 0 : a.icon) != null && o.src ? (s(), N(c(R), {
81
81
  key: 0,
82
82
  class: "sidebar-icon",
83
83
  icon: e.item.icon.src
84
- }, null, 8, ["icon"])) : s("", !0),
85
- a("p", F, c(e.item.title), 1),
86
- e.item.httpVerb && !e.hasChildren ? (n(), d("p", G, [
84
+ }, null, 8, ["icon"])) : l("", !0),
85
+ r("p", G, u(e.item.title), 1),
86
+ e.item.httpVerb && !e.hasChildren ? (s(), p("p", j, [
87
87
  t[1] || (t[1] = h("   ")),
88
- t[2] || (t[2] = a("span", { class: "sr-only" }, "HTTP Method: ", -1)),
89
- b(H, {
88
+ t[2] || (t[2] = r("span", { class: "sr-only" }, "HTTP Method: ", -1)),
89
+ v(I, {
90
90
  active: e.isActive,
91
91
  method: e.item.httpVerb
92
92
  }, null, 8, ["active", "method"])
93
- ])) : s("", !0)
94
- ], 8, z)
93
+ ])) : l("", !0)
94
+ ], 8, F)
95
95
  ], 2),
96
- e.open ? v(e.$slots, "default", { key: 0 }, void 0, !0) : s("", !0),
97
- e.$slots["action-menu"] ? (n(), d("div", j, [
98
- v(e.$slots, "action-menu", {}, void 0, !0)
99
- ])) : s("", !0)
100
- ], 8, D);
96
+ e.open ? C(e.$slots, "default", { key: 0 }, void 0, !0) : l("", !0),
97
+ e.$slots["action-menu"] ? (s(), p("div", q, [
98
+ C(e.$slots, "action-menu", {}, void 0, !0)
99
+ ])) : l("", !0)
100
+ ], 8, L);
101
101
  };
102
102
  }
103
103
  });
104
104
  export {
105
- _ as default
105
+ x as default
106
106
  };
@@ -1 +1 @@
1
- {"version":3,"file":"ExampleRequest.vue.d.ts","sourceRoot":"","sources":["../../../src/features/ExampleRequest/ExampleRequest.vue"],"names":[],"mappings":"AAuZA,OAAO,KAAK,EACV,UAAU,EACV,SAAS,EACT,MAAM,EACP,MAAM,iCAAiC,CAAA;AAExC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAA;AAEhE,OAAO,EAML,KAAK,uBAAuB,EAC7B,MAAM,KAAK,CAAA;AAcZ,KAAK,WAAW,GA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IAClB,0CAA0C;IAC1C,oBAAoB,EAAE,oBAAoB,CAAA;CAC3C,CAAC;AAwOF,iBAAS,cAAc;WAiPT,OAAO,IAA6B;;wBAZrB,GAAG;wBAEH,GAAG;wBADH,GAAG;wBAEH,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wCAtGqJ,GAAG,8CAA8C,GAAG,yBAAyB,GAAG,6DACnO,GAAG;;;;;;;;EAmHpC;AAiCD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe,kSAMnB,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 o from "./ExampleRequest.vue2.js";
1
+ import e from "./ExampleRequest.vue2.js";
2
2
  /* empty css */
3
- import t from "../../_virtual/_plugin-vue_export-helper.js";
4
- const p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-ecaba69d"]]);
3
+ import o from "../../_virtual/_plugin-vue_export-helper.js";
4
+ const r = /* @__PURE__ */ o(e, [["__scopeId", "data-v-c499eee4"]]);
5
5
  export {
6
- p as default
6
+ r as default
7
7
  };
@@ -1,4 +1,4 @@
1
- import { defineComponent as G, useId as L, computed as c, ref as T, watch as Q, unref as l, openBlock as d, createBlock as k, withCtx as r, createVNode as a, createElementBlock as b, Fragment as B, createTextVNode as f, toDisplayString as h, createElementVNode as E, renderSlot as K, createCommentVNode as C } from "vue";
1
+ import { defineComponent as G, useId as L, computed as c, ref as T, watch as Q, unref as o, openBlock as d, createBlock as k, withCtx as a, createVNode as n, createElementBlock as b, Fragment as B, createTextVNode as f, toDisplayString as E, createElementVNode as h, renderSlot as K, createCommentVNode as C } from "vue";
2
2
  import { useWorkspace as X } from "@scalar/api-client/store";
3
3
  import { getSnippet as Y } from "@scalar/api-client/views/Components/CodeSnippet";
4
4
  import { filterSecurityRequirements as Z } from "@scalar/api-client/views/Request/RequestSection";
@@ -6,8 +6,8 @@ import { ScalarCodeBlock as _ } from "@scalar/components";
6
6
  import S from "../../components/ScreenReader.vue.js";
7
7
  import { freezeElement as ee } from "../../helpers/freeze-element.js";
8
8
  import { useConfig as te } from "../../hooks/useConfig.js";
9
- import oe from "./ExamplePicker.vue.js";
10
- import le from "./TextSelect.vue.js";
9
+ import le from "./ExamplePicker.vue.js";
10
+ import oe from "./TextSelect.vue.js";
11
11
  /* empty css */
12
12
  import V from "../../components/Card/Card.vue.js";
13
13
  import re from "../../components/Card/CardHeader.vue.js";
@@ -28,9 +28,9 @@ const ie = ["id"], ue = ["id"], me = {
28
28
  fallback: { type: Boolean },
29
29
  transformedOperation: {}
30
30
  },
31
- setup(n) {
31
+ setup(i) {
32
32
  const { selectedExampleKey: R, operationId: w } = ne(), { requestExamples: J, securitySchemes: q } = X(), I = te(), {
33
- httpClient: i,
33
+ httpClient: s,
34
34
  setHttpClient: U,
35
35
  availableTargets: $,
36
36
  httpTargetTitle: z,
@@ -38,11 +38,11 @@ const ie = ["id"], ue = ["id"], me = {
38
38
  } = se(), y = L(), m = c(() => {
39
39
  var t;
40
40
  const e = ["x-custom-examples", "x-codeSamples", "x-code-samples"];
41
- for (const o of e)
42
- if ((t = n.transformedOperation.information) != null && t[o])
43
- return [...n.transformedOperation.information[o]];
41
+ for (const l of e)
42
+ if ((t = i.transformedOperation.information) != null && t[l])
43
+ return [...i.transformedOperation.information[l]];
44
44
  return [];
45
- }), s = T(
45
+ }), r = T(
46
46
  // Default to first custom example
47
47
  m.value.length ? {
48
48
  targetKey: "customExamples",
@@ -50,39 +50,39 @@ const ie = ["id"], ue = ["id"], me = {
50
50
  } : (
51
51
  // Otherwise use the globally selected HTTP client
52
52
  {
53
- targetKey: i.targetKey,
54
- clientKey: i.clientKey
53
+ targetKey: s.targetKey,
54
+ clientKey: s.clientKey
55
55
  }
56
56
  )
57
57
  );
58
- Q(i, () => {
59
- s.value = {
60
- targetKey: i.targetKey,
61
- clientKey: i.clientKey
58
+ Q(s, () => {
59
+ r.value = {
60
+ targetKey: s.targetKey,
61
+ clientKey: s.clientKey
62
62
  };
63
63
  });
64
64
  const O = c(
65
65
  () => {
66
- var e, t, o, u;
66
+ var e, t, l, u;
67
67
  return Object.keys(
68
- ((u = (o = (t = (e = n.transformedOperation.information) == null ? void 0 : e.requestBody) == null ? void 0 : t.content) == null ? void 0 : o["application/json"]) == null ? void 0 : u.examples) ?? {}
68
+ ((u = (l = (t = (e = i.transformedOperation.information) == null ? void 0 : e.requestBody) == null ? void 0 : t.content) == null ? void 0 : l["application/json"]) == null ? void 0 : u.examples) ?? {}
69
69
  ).length > 1;
70
70
  }
71
71
  ), M = () => {
72
72
  var g;
73
- if (s.value.targetKey === "customExamples")
74
- return ((g = m.value[s.value.clientKey]) == null ? void 0 : g.source) ?? "";
75
- const e = i.clientKey, t = i.targetKey, o = J[n.operation.examples[0]];
76
- if (!o)
73
+ if (r.value.targetKey === "customExamples")
74
+ return ((g = m.value[r.value.clientKey]) == null ? void 0 : g.source) ?? "";
75
+ const e = s.clientKey, t = s.targetKey, l = J[i.operation.examples[0]];
76
+ if (!l)
77
77
  return "";
78
78
  const u = Z(
79
- n.operation.security || n.collection.security,
80
- n.collection.selectedSecuritySchemeUids,
79
+ i.operation.security || i.collection.security,
80
+ i.collection.selectedSecuritySchemeUids,
81
81
  q
82
82
  ), [p, v] = Y(t, e, {
83
- operation: n.operation,
84
- example: o,
85
- server: n.server,
83
+ operation: i.operation,
84
+ example: l,
85
+ server: i.server,
86
86
  securitySchemes: u
87
87
  });
88
88
  return p ? p.message ?? "" : v;
@@ -93,12 +93,12 @@ const ie = ["id"], ue = ["id"], me = {
93
93
  return console.error("[generateSnippet]", e), "";
94
94
  }
95
95
  }), P = c(() => {
96
- var t, o;
96
+ var t, l;
97
97
  const e = (
98
98
  // Specified language
99
- ((t = s.value) == null ? void 0 : t.targetKey) === "customExamples" ? ((o = m.value[s.value.clientKey]) == null ? void 0 : o.lang) ?? "plaintext" : (
99
+ ((t = r.value) == null ? void 0 : t.targetKey) === "customExamples" ? ((l = m.value[r.value.clientKey]) == null ? void 0 : l.lang) ?? "plaintext" : (
100
100
  // Or language for the globally selected HTTP client
101
- i.targetKey
101
+ s.targetKey
102
102
  )
103
103
  );
104
104
  return e === "shell" && N.value.includes("curl") ? "curl" : e === "Objective-C" ? "objc" : e;
@@ -112,88 +112,88 @@ const ie = ["id"], ue = ["id"], me = {
112
112
  const e = $.value.map((t) => ({
113
113
  value: t.key,
114
114
  label: t.title,
115
- options: t.clients.map((o) => ({
115
+ options: t.clients.map((l) => ({
116
116
  value: JSON.stringify({
117
117
  targetKey: t.key,
118
- clientKey: o.client
118
+ clientKey: l.client
119
119
  }),
120
- label: o.title
120
+ label: l.title
121
121
  }))
122
122
  }));
123
123
  return m.value.length && e.unshift({
124
124
  value: "customExamples",
125
125
  label: "Examples",
126
- options: m.value.map((t, o) => ({
126
+ options: m.value.map((t, l) => ({
127
127
  value: JSON.stringify({
128
128
  targetKey: "customExamples",
129
- clientKey: o
129
+ clientKey: l
130
130
  }),
131
- label: t.label ?? t.lang ?? `Example #${o + 1}`
131
+ label: t.label ?? t.lang ?? `Example #${l + 1}`
132
132
  }))
133
133
  }), e;
134
134
  }), x = T(null);
135
135
  function A(e) {
136
136
  const t = JSON.parse(e);
137
137
  if (x.value) {
138
- const o = ee(x.value.$el);
138
+ const l = ee(x.value.$el);
139
139
  setTimeout(() => {
140
- o();
140
+ l();
141
141
  }, 300);
142
142
  }
143
- t.targetKey === "customExamples" ? s.value = t : U(t);
143
+ t.targetKey === "customExamples" || r.value.targetKey === "customExamples" && t.targetKey === s.targetKey && t.clientKey === s.clientKey ? r.value = t : U(t);
144
144
  }
145
- return (e, t) => l($).length || m.value.length ? (d(), k(l(V), {
145
+ return (e, t) => o($).length || m.value.length ? (d(), k(o(V), {
146
146
  key: 0,
147
- "aria-labelledby": `${l(y)}-header`,
147
+ "aria-labelledby": `${o(y)}-header`,
148
148
  class: "dark-mode",
149
149
  ref_key: "elem",
150
150
  ref: x,
151
151
  role: "region"
152
152
  }, {
153
- default: r(() => [
154
- a(l(re), { muted: "" }, {
155
- actions: r(() => [
156
- a(le, {
153
+ default: a(() => [
154
+ n(o(re), { muted: "" }, {
155
+ actions: a(() => [
156
+ n(oe, {
157
157
  class: "request-client-picker",
158
- controls: `${l(y)}-example`,
159
- modelValue: JSON.stringify(s.value),
158
+ controls: `${o(y)}-example`,
159
+ modelValue: JSON.stringify(r.value),
160
160
  options: W.value,
161
161
  "onUpdate:modelValue": A
162
162
  }, {
163
- default: r(() => [
164
- s.value.targetKey === "customExamples" ? (d(), b(B, { key: 0 }, [
165
- a(S, null, {
166
- default: r(() => t[2] || (t[2] = [
163
+ default: a(() => [
164
+ r.value.targetKey === "customExamples" ? (d(), b(B, { key: 0 }, [
165
+ n(S, null, {
166
+ default: a(() => t[2] || (t[2] = [
167
167
  f("Selected Example:")
168
168
  ])),
169
169
  _: 1
170
170
  }),
171
- f(" " + h(m.value[s.value.clientKey].label ?? "Example"), 1)
171
+ f(" " + E(m.value[r.value.clientKey].label ?? "Example"), 1)
172
172
  ], 64)) : (d(), b(B, { key: 1 }, [
173
- a(S, null, {
174
- default: r(() => t[3] || (t[3] = [
173
+ n(S, null, {
174
+ default: a(() => t[3] || (t[3] = [
175
175
  f("Selected HTTP client:")
176
176
  ])),
177
177
  _: 1
178
178
  }),
179
- f(" " + h(l(z)) + " " + h(l(F)), 1)
179
+ f(" " + E(o(z)) + " " + E(o(F)), 1)
180
180
  ], 64))
181
181
  ]),
182
182
  _: 1
183
183
  }, 8, ["controls", "modelValue", "options"])
184
184
  ]),
185
- default: r(() => [
186
- E("div", {
187
- id: `${l(y)}-header`,
185
+ default: a(() => [
186
+ h("div", {
187
+ id: `${o(y)}-header`,
188
188
  class: "request-header"
189
189
  }, [
190
- a(S, null, {
191
- default: r(() => t[1] || (t[1] = [
190
+ n(S, null, {
191
+ default: a(() => t[1] || (t[1] = [
192
192
  f("Request Example for")
193
193
  ])),
194
194
  _: 1
195
195
  }),
196
- a(l(j), {
196
+ n(o(j), {
197
197
  as: "span",
198
198
  class: "request-method",
199
199
  method: e.operation.method
@@ -203,17 +203,17 @@ const ie = ["id"], ue = ["id"], me = {
203
203
  ]),
204
204
  _: 3
205
205
  }),
206
- a(l(H), {
206
+ n(o(H), {
207
207
  borderless: "",
208
208
  class: "request-editor-section custom-scroll",
209
209
  frameless: ""
210
210
  }, {
211
- default: r(() => [
212
- E("div", {
213
- id: `${l(y)}-example`,
211
+ default: a(() => [
212
+ h("div", {
213
+ id: `${o(y)}-example`,
214
214
  class: "code-snippet"
215
215
  }, [
216
- a(l(_), {
216
+ n(o(_), {
217
217
  class: "bg-b-2 -outline-offset-2",
218
218
  content: N.value,
219
219
  hideCredentials: D.value,
@@ -224,18 +224,18 @@ const ie = ["id"], ue = ["id"], me = {
224
224
  ]),
225
225
  _: 1
226
226
  }),
227
- (O.value || !l(I).hideTestRequestButton) && e.$slots.footer ? (d(), k(l(ae), {
227
+ (O.value || !o(I).hideTestRequestButton) && e.$slots.footer ? (d(), k(o(ae), {
228
228
  key: 0,
229
229
  class: "request-card-footer",
230
230
  contrast: ""
231
231
  }, {
232
- default: r(() => {
233
- var o, u, p, v;
232
+ default: a(() => {
233
+ var l, u, p, v;
234
234
  return [
235
235
  O.value ? (d(), b("div", me, [
236
- a(oe, {
236
+ n(le, {
237
237
  class: "request-example-selector",
238
- examples: ((v = (p = (u = (o = e.transformedOperation.information) == null ? void 0 : o.requestBody) == null ? void 0 : u.content) == null ? void 0 : p["application/json"]) == null ? void 0 : v.examples) ?? [],
238
+ examples: ((v = (p = (u = (l = e.transformedOperation.information) == null ? void 0 : l.requestBody) == null ? void 0 : u.content) == null ? void 0 : p["application/json"]) == null ? void 0 : v.examples) ?? [],
239
239
  "onUpdate:modelValue": t[0] || (t[0] = (g) => (R.value = g, w.value = e.operation.operationId))
240
240
  }, null, 8, ["examples"])
241
241
  ])) : C("", !0),
@@ -246,15 +246,15 @@ const ie = ["id"], ue = ["id"], me = {
246
246
  })) : C("", !0)
247
247
  ]),
248
248
  _: 3
249
- }, 8, ["aria-labelledby"])) : e.fallback ? (d(), k(l(V), {
249
+ }, 8, ["aria-labelledby"])) : e.fallback ? (d(), k(o(V), {
250
250
  key: 1,
251
251
  class: "dark-mode"
252
252
  }, {
253
- default: r(() => [
254
- a(l(H), { class: "request-card-simple" }, {
255
- default: r(() => [
256
- E("div", ce, [
257
- a(l(j), {
253
+ default: a(() => [
254
+ n(o(H), { class: "request-card-simple" }, {
255
+ default: a(() => [
256
+ h("div", ce, [
257
+ n(o(j), {
258
258
  as: "span",
259
259
  class: "request-method",
260
260
  method: e.operation.method
@@ -52,6 +52,9 @@ export declare const useMultipleDocuments: ({ configuration, initialIndex, isInt
52
52
  onSpecUpdate?: ((args_0: string, ...args: unknown[]) => void) | undefined;
53
53
  onServerChange?: ((args_0: string, ...args: unknown[]) => void) | undefined;
54
54
  onDocumentSelect?: ((...args: unknown[]) => void | Promise<void>) | undefined;
55
+ onLoaded?: ((...args: unknown[]) => void | Promise<void>) | undefined;
56
+ onShowMore?: ((args_0: string, ...args: unknown[]) => void | Promise<void>) | undefined;
57
+ onSidebarClick?: ((args_0: string, ...args: unknown[]) => void | Promise<void>) | undefined;
55
58
  pathRouting?: {
56
59
  basePath: string;
57
60
  } | undefined;
@@ -74,7 +77,6 @@ export declare const useMultipleDocuments: ({ configuration, initialIndex, isInt
74
77
  name: string;
75
78
  method?: string | undefined;
76
79
  }, ...args: unknown[]) => string) | undefined;
77
- onLoaded?: ((...args: unknown[]) => void) | undefined;
78
80
  redirect?: ((args_0: string, ...args: unknown[]) => string | null | undefined) | undefined;
79
81
  defaultOpenAllTags?: boolean | undefined;
80
82
  tagsSorter?: "alpha" | ((args_0: any, args_1: any, ...args: unknown[]) => number) | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"useMultipleDocuments.d.ts","sourceRoot":"","sources":["../../src/hooks/useMultipleDocuments.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAA;AAEnD,OAAO,EACL,KAAK,4BAA4B,EACjC,KAAK,iBAAiB,EAEvB,MAAM,6BAA6B,CAAA;AAGpC,OAAO,EAAE,KAAK,GAAG,EAAwB,MAAM,KAAK,CAAA;AAKpD,KAAK,yBAAyB,GAAG;IAC/B;;;OAGG;IACH,aAAa,EAAE,GAAG,CAAC,4BAA4B,GAAG,SAAS,CAAC,CAAA;IAC5D,2FAA2F;IAC3F,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB,GAAG,QAAQ,CAAA;AAIZ;;GAEG;AACH,eAAO,MAAM,uBAAuB,kBACnB,4BAA4B,GAAG,SAAS,KACtD,iBAAiB,EA6BnB,CAAA;AA0CD,eAAO,MAAM,oBAAoB,8EAM9B,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yCA8HguzB,GAAI;2CAA6E,GAAI;6BAAgE,GAAG;;;;;gBAA0K,CAAC;WAA4B,GAAI;;gBAAyF,CAAC;WAA4B,GAAI;;gBAAuF,CAAC;WAA4B,GAAI;;;;uBAAkJ,CAAC;mBAAqC,CAAC;WAA4B,GAAI;;;kBAAmH,CAAC;WAA4B,GAAI;qBAA0D,GAAG;qCAAuE,GAAI;;2DAAgK,GAAI;4EAAgH,GAAI;;;uDA/K5h2B,GAAG;;;;;;;;;mDAAH,GAAG;;;;;;;;CA8KpE,CAAA"}
1
+ {"version":3,"file":"useMultipleDocuments.d.ts","sourceRoot":"","sources":["../../src/hooks/useMultipleDocuments.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAA;AAEnD,OAAO,EACL,KAAK,4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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAwDA"}
@@ -1,59 +1,59 @@
1
- import { isValidUrl as d, fetchSpecFromUrl as u, prettyPrintJson as h } from "@scalar/oas-utils/helpers";
2
- import { ref as s, watch as m, toValue as p } from "vue";
3
- import { parse as v } from "../helpers/parse.js";
4
- import { createEmptySpecification as l } from "../helpers/createEmptySpecification.js";
5
- const y = async ({ url: e, content: o }, n) => {
6
- if (e) {
1
+ import { fetchDocument as l, prettyPrintJson as d } from "@scalar/oas-utils/helpers";
2
+ import { ref as s, watch as u, toValue as f } from "vue";
3
+ import { parse as h } from "../helpers/parse.js";
4
+ import { createEmptySpecification as m } from "../helpers/createEmptySpecification.js";
5
+ const v = async ({ url: a, content: e }, r) => {
6
+ if (a) {
7
7
  const i = performance.now();
8
8
  try {
9
- const c = d(e) ? await u(e, n) : await u(e), r = performance.now();
10
- return console.log(`fetch: ${Math.round(r - i)} ms (${e})`), console.log("size:", Math.round(c.length / 1024), "kB"), c;
11
- } catch (c) {
12
- console.error("Failed to fetch spec from URL:", c);
9
+ const n = await l(a, r), o = performance.now();
10
+ return console.log(`fetch: ${Math.round(o - i)} ms (${a})`), console.log("size:", Math.round(n.length / 1024), "kB"), n;
11
+ } catch (n) {
12
+ console.error("Failed to fetch OpenAPI document from URL:", n);
13
13
  }
14
14
  }
15
- const t = typeof o == "function" ? o() : o;
15
+ const t = typeof e == "function" ? e() : e;
16
16
  if (typeof t == "string")
17
17
  return t;
18
18
  if (typeof t == "object")
19
- return h(t);
19
+ return d(t);
20
20
  };
21
- function E({
22
- specConfig: e,
23
- proxyUrl: o
21
+ function C({
22
+ specConfig: a,
23
+ proxyUrl: e
24
24
  }) {
25
- const n = s(""), t = s(l()), i = s(null);
26
- function c(r) {
27
- if (!r) {
28
- t.value = l();
25
+ const r = s(""), t = s(m()), i = s(null);
26
+ function n(o) {
27
+ if (!o) {
28
+ t.value = m();
29
29
  return;
30
30
  }
31
- v(r, {
32
- proxyUrl: o ? p(o) : void 0
33
- }).then((a) => {
34
- i.value = null, t.value = a;
35
- }).catch((a) => {
36
- i.value = a.toString();
31
+ h(o, {
32
+ proxyUrl: e ? f(e) : void 0
33
+ }).then((c) => {
34
+ i.value = null, t.value = c;
35
+ }).catch((c) => {
36
+ i.value = c.toString();
37
37
  });
38
38
  }
39
- return m(
40
- () => p(e),
41
- async (r) => {
42
- var a;
43
- if (r) {
44
- const f = (a = await y(r, p(o))) == null ? void 0 : a.trim();
45
- typeof f == "string" && (n.value = f);
39
+ return u(
40
+ () => f(a),
41
+ async (o) => {
42
+ var c;
43
+ if (o) {
44
+ const p = (c = await v(o, f(e))) == null ? void 0 : c.trim();
45
+ typeof p == "string" && (r.value = p);
46
46
  }
47
47
  },
48
48
  { immediate: !0, deep: !0 }
49
- ), m(n, () => {
50
- c(n.value);
49
+ ), u(r, () => {
50
+ n(r.value);
51
51
  }), {
52
- rawSpec: n,
52
+ rawSpec: r,
53
53
  parsedSpec: t,
54
54
  specErrors: i
55
55
  };
56
56
  }
57
57
  export {
58
- E as useReactiveSpec
58
+ C as useReactiveSpec
59
59
  };