@scalar/api-reference 1.31.14 → 1.31.17
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.
- package/CHANGELOG.md +35 -0
- package/README.md +4 -0
- package/dist/browser/standalone.js +6884 -6853
- package/dist/browser/webpack-stats.json +1 -1
- package/dist/components/ApiReferenceLayout.vue2.js +21 -21
- package/dist/components/Content/Schema/SchemaComposition.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/SchemaComposition.vue.js +32 -34
- package/dist/components/Content/Schema/helpers/schema-name.d.ts +2 -2
- package/dist/components/Content/Schema/helpers/schema-name.d.ts.map +1 -1
- package/dist/components/Content/Schema/helpers/schema-name.js +30 -39
- package/dist/components/DocumentSelector/DocumentSelector.vue.d.ts.map +1 -1
- package/dist/components/DocumentSelector/DocumentSelector.vue.js +17 -20
- package/dist/components/Sidebar/Sidebar.vue.js +2 -2
- package/dist/components/Sidebar/SidebarElement.vue.d.ts.map +1 -1
- package/dist/components/Sidebar/SidebarElement.vue.js +1 -1
- package/dist/components/Sidebar/SidebarGroup.vue.js +1 -1
- package/dist/features/ExampleResponses/ExampleResponses.vue.js +1 -1
- package/dist/features/Search/SearchButton.vue.d.ts.map +1 -1
- package/dist/features/Search/SearchButton.vue.js +60 -5
- package/dist/features/Search/SearchButton.vue2.js +2 -70
- package/dist/index.js +1 -1
- package/dist/style.css +1 -1
- package/package.json +10 -10
|
@@ -3,10 +3,10 @@ import { provideUseId as $e } from "@headlessui/vue";
|
|
|
3
3
|
import { OpenApiClientButton as Te } from "@scalar/api-client/components";
|
|
4
4
|
import { LAYOUT_SYMBOL as De } from "@scalar/api-client/hooks";
|
|
5
5
|
import { WORKSPACE_SYMBOL as Ee, ACTIVE_ENTITIES_SYMBOL as Me } from "@scalar/api-client/store";
|
|
6
|
-
import { addScalarClassesToHeadless as Oe, ScalarErrorBoundary as
|
|
6
|
+
import { addScalarClassesToHeadless as Oe, ScalarErrorBoundary as Ie, ScalarSidebarFooter as Be, ScalarColorModeToggleButton as Re, ScalarColorModeToggleIcon as Le } from "@scalar/components";
|
|
7
7
|
import { sleep as He } from "@scalar/helpers/testing/sleep";
|
|
8
|
-
import { hasObtrusiveScrollbars as
|
|
9
|
-
import { apiReferenceConfigurationSchema as
|
|
8
|
+
import { hasObtrusiveScrollbars as _e, getThemeStyles as Ae } from "@scalar/themes";
|
|
9
|
+
import { apiReferenceConfigurationSchema as Pe } from "@scalar/types/api-reference";
|
|
10
10
|
import { useBreakpoints as Fe } from "@scalar/use-hooks/useBreakpoints";
|
|
11
11
|
import { useToasts as Ne, ScalarToasts as Ve } from "@scalar/use-toasts";
|
|
12
12
|
import { useMediaQuery as Ue, useResizeObserver as Ye, useDebounceFn as Ke } from "@vueuse/core";
|
|
@@ -51,7 +51,7 @@ const lt = ["innerHTML"], st = { class: "references-header" }, ut = ["aria-label
|
|
|
51
51
|
emits: ["changeTheme", "updateContent", "loadSwaggerFile", "linkSwaggerFile", "toggleDarkMode"],
|
|
52
52
|
setup(M) {
|
|
53
53
|
const t = T(
|
|
54
|
-
() =>
|
|
54
|
+
() => Pe.parse(M.configuration)
|
|
55
55
|
), { initializeToasts: j, toast: q } = Ne();
|
|
56
56
|
j((e) => q(e));
|
|
57
57
|
const {
|
|
@@ -70,7 +70,7 @@ const lt = ["innerHTML"], st = { class: "references-header" }, ut = ["aria-label
|
|
|
70
70
|
Ye(w, (e) => {
|
|
71
71
|
te.value = e[0].contentRect.height + "px";
|
|
72
72
|
});
|
|
73
|
-
const oe = T(
|
|
73
|
+
const oe = T(_e), R = qe(t), { isSidebarOpen: I, setCollapsedSidebarItem: L, scrollToOperation: re, items: H } = tt(d, {
|
|
74
74
|
...R,
|
|
75
75
|
config: t
|
|
76
76
|
}), {
|
|
@@ -79,8 +79,8 @@ const lt = ["innerHTML"], st = { class: "references-header" }, ut = ["aria-label
|
|
|
79
79
|
getSectionId: ie,
|
|
80
80
|
getTagId: le,
|
|
81
81
|
hash: O,
|
|
82
|
-
isIntersectionEnabled:
|
|
83
|
-
updateHash:
|
|
82
|
+
isIntersectionEnabled: _,
|
|
83
|
+
updateHash: A,
|
|
84
84
|
replaceUrlState: se
|
|
85
85
|
} = R;
|
|
86
86
|
if (t.value.redirect && typeof window < "u") {
|
|
@@ -90,11 +90,11 @@ const lt = ["innerHTML"], st = { class: "references-header" }, ut = ["aria-label
|
|
|
90
90
|
e && history.replaceState({}, "", e);
|
|
91
91
|
}
|
|
92
92
|
ge(() => {
|
|
93
|
-
|
|
93
|
+
A(), Oe();
|
|
94
94
|
});
|
|
95
|
-
const
|
|
95
|
+
const P = async (e) => {
|
|
96
96
|
var o;
|
|
97
|
-
|
|
97
|
+
_.value = !1, A(), e ? re(e) : (o = w.value) == null || o.scrollTo(0, 0), await He(100), _.value = !0;
|
|
98
98
|
}, F = D(0);
|
|
99
99
|
K(() => {
|
|
100
100
|
var n, i, C;
|
|
@@ -105,8 +105,8 @@ const lt = ["innerHTML"], st = { class: "references-header" }, ut = ["aria-label
|
|
|
105
105
|
F.value = $ < 2 ? 0 : $;
|
|
106
106
|
}
|
|
107
107
|
window.onhashchange = () => {
|
|
108
|
-
|
|
109
|
-
}, window.onpopstate = () => t.value.pathRouting &&
|
|
108
|
+
P(ae());
|
|
109
|
+
}, window.onpopstate = () => t.value.pathRouting && P(ne(window.location.pathname)), window.addEventListener("scroll", N, { passive: !0 });
|
|
110
110
|
});
|
|
111
111
|
const ue = T(
|
|
112
112
|
() => ee.value || !t.value.isEditable
|
|
@@ -173,14 +173,14 @@ const lt = ["innerHTML"], st = { class: "references-header" }, ut = ["aria-label
|
|
|
173
173
|
U("defaultHttpClient", ce), U("hiddenClients", de);
|
|
174
174
|
const me = T(
|
|
175
175
|
() => `<style>
|
|
176
|
-
${
|
|
176
|
+
${Ae(t.value.theme, {
|
|
177
177
|
fonts: t.value.withDefaultFonts
|
|
178
178
|
})}</style>`
|
|
179
179
|
), { mediaQueries: fe } = Fe(), ve = !1;
|
|
180
180
|
return E(fe.lg, (e, o) => {
|
|
181
|
-
o && !e && (
|
|
181
|
+
o && !e && (I.value = !1);
|
|
182
182
|
}), E(O, (e, o) => {
|
|
183
|
-
e && e !== o && (
|
|
183
|
+
e && e !== o && (I.value = !1);
|
|
184
184
|
}), (e, o) => {
|
|
185
185
|
var n, i, C, $, Y;
|
|
186
186
|
return a(), f(G, null, [
|
|
@@ -194,7 +194,7 @@ const lt = ["innerHTML"], st = { class: "references-header" }, ut = ["aria-label
|
|
|
194
194
|
"scalar-scrollbars-obtrusive": oe.value,
|
|
195
195
|
"references-editable": t.value.isEditable,
|
|
196
196
|
"references-sidebar": t.value.showSidebar,
|
|
197
|
-
"references-sidebar-mobile-open": r(
|
|
197
|
+
"references-sidebar-mobile-open": r(I),
|
|
198
198
|
"references-classic": t.value.layout === "classic"
|
|
199
199
|
},
|
|
200
200
|
e.$attrs.class
|
|
@@ -216,7 +216,7 @@ const lt = ["innerHTML"], st = { class: "references-header" }, ut = ["aria-label
|
|
|
216
216
|
class: "references-navigation t-doc__sidebar"
|
|
217
217
|
}, [
|
|
218
218
|
p("div", dt, [
|
|
219
|
-
v(r(
|
|
219
|
+
v(r(Ie), null, {
|
|
220
220
|
default: s(() => {
|
|
221
221
|
var S, m;
|
|
222
222
|
return [
|
|
@@ -224,14 +224,14 @@ const lt = ["innerHTML"], st = { class: "references-header" }, ut = ["aria-label
|
|
|
224
224
|
title: ((m = (S = r(d)) == null ? void 0 : S.info) == null ? void 0 : m.title) ?? "The OpenAPI Schema"
|
|
225
225
|
}, {
|
|
226
226
|
"sidebar-start": s(() => {
|
|
227
|
-
var
|
|
227
|
+
var B;
|
|
228
228
|
return [
|
|
229
229
|
e.$slots["document-selector"] ? (a(), f("div", ct, [
|
|
230
230
|
u(e.$slots, "document-selector", {}, void 0, !0)
|
|
231
231
|
])) : l("", !0),
|
|
232
232
|
t.value.hideSearch ? l("", !0) : (a(), f("div", mt, [
|
|
233
233
|
v(r(W), {
|
|
234
|
-
searchHotKey: (
|
|
234
|
+
searchHotKey: (B = t.value) == null ? void 0 : B.searchHotKey,
|
|
235
235
|
spec: k.value
|
|
236
236
|
}, null, 8, ["searchHotKey", "spec"])
|
|
237
237
|
])),
|
|
@@ -240,12 +240,12 @@ const lt = ["innerHTML"], st = { class: "references-header" }, ut = ["aria-label
|
|
|
240
240
|
}),
|
|
241
241
|
"sidebar-end": s(() => [
|
|
242
242
|
u(e.$slots, "sidebar-end", g(h(c.value)), () => [
|
|
243
|
-
v(r(
|
|
243
|
+
v(r(Be), { class: "darklight-reference" }, {
|
|
244
244
|
toggle: s(() => [
|
|
245
245
|
t.value.hideDarkModeToggle ? (a(), f("span", ft)) : (a(), y(r(Re), {
|
|
246
246
|
key: 0,
|
|
247
247
|
modelValue: e.isDark,
|
|
248
|
-
"onUpdate:modelValue": o[0] || (o[0] = (
|
|
248
|
+
"onUpdate:modelValue": o[0] || (o[0] = (B) => e.$emit("toggleDarkMode"))
|
|
249
249
|
}, null, 8, ["modelValue"]))
|
|
250
250
|
]),
|
|
251
251
|
default: s(() => [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SchemaComposition.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Schema/SchemaComposition.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SchemaComposition.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Schema/SchemaComposition.vue"],"names":[],"mappings":"AA8QA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oCAAoC,CAAA;AAEjE,OAAO,EAEL,KAAK,kBAAkB,EACxB,MAAM,8BAA8B,CAAA;AAKrC,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,kBAAkB,CAAA;IAC/B,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC1B,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,WAAW,CAAC,EAAE,OAAO,CAAA;CACtB,CAAC;;AA+TF,wBAOG"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as F, ref as M, computed as
|
|
1
|
+
import { defineComponent as F, ref as M, computed as t, resolveComponent as T, createElementBlock as c, openBlock as r, createCommentVNode as u, createBlock as p, Fragment as N, renderList as j, createVNode as y, createElementVNode as f, unref as d, withCtx as R, toDisplayString as V } from "vue";
|
|
2
2
|
import { ScalarListbox as Z, ScalarMarkdown as $ } from "@scalar/components";
|
|
3
3
|
import { ScalarIconCaretDown as G } from "@scalar/icons";
|
|
4
4
|
import { mergeAllOfSchemas as w } from "./helpers/merge-all-of-schemas.js";
|
|
@@ -22,34 +22,32 @@ const K = { class: "property-rule" }, P = {
|
|
|
22
22
|
compact: { type: Boolean },
|
|
23
23
|
hideHeading: { type: Boolean }
|
|
24
24
|
},
|
|
25
|
-
setup(
|
|
26
|
-
const
|
|
27
|
-
s(() => a.value[a.composition] || []);
|
|
28
|
-
const B = s(() => k.value), C = s(
|
|
25
|
+
setup(s) {
|
|
26
|
+
const v = M(0), B = t(() => k.value), C = t(
|
|
29
27
|
() => B.value.map(
|
|
30
28
|
(e, o) => ({
|
|
31
29
|
id: String(o),
|
|
32
|
-
label: J(e
|
|
30
|
+
label: J(e) || "Schema"
|
|
33
31
|
})
|
|
34
32
|
)
|
|
35
|
-
), O =
|
|
33
|
+
), O = t({
|
|
36
34
|
get: () => C.value.find(
|
|
37
|
-
(e) => e.id === String(
|
|
35
|
+
(e) => e.id === String(v.value)
|
|
38
36
|
),
|
|
39
|
-
set: (e) =>
|
|
40
|
-
}), D =
|
|
37
|
+
set: (e) => v.value = Number(e.id)
|
|
38
|
+
}), D = t(() => {
|
|
41
39
|
var i;
|
|
42
|
-
const e = ["oneOf", "anyOf"].includes(
|
|
40
|
+
const e = ["oneOf", "anyOf"].includes(s.composition), o = s.composition === "allOf" && ((i = s.value[s.composition]) == null ? void 0 : i.some((l) => b(l)));
|
|
43
41
|
return e || o;
|
|
44
42
|
}), I = (e) => e.find((o) => b(o)), L = (e) => !e.allOf || !Array.isArray(e.allOf) ? !1 : e.allOf.some(
|
|
45
43
|
(o) => o.oneOf || o.anyOf || o.allOf
|
|
46
|
-
), S = (e) => e.allOf && Array.isArray(e.allOf) ? L(e) ? e : w(e.allOf) : e, k =
|
|
47
|
-
const e =
|
|
48
|
-
return !o ||
|
|
44
|
+
), S = (e) => e.allOf && Array.isArray(e.allOf) ? L(e) ? e : w(e.allOf) : e, k = t(() => {
|
|
45
|
+
const e = s.value[s.composition], o = I(e);
|
|
46
|
+
return !o || s.composition !== "allOf" && o.allOf ? e.map(S) : (o.oneOf || o.anyOf || o.allOf).map(S);
|
|
49
47
|
}), U = (e) => {
|
|
50
48
|
var o, i;
|
|
51
49
|
if (e === "allOf") {
|
|
52
|
-
const l = (i = (o =
|
|
50
|
+
const l = (i = (o = s.value) == null ? void 0 : o[e]) == null ? void 0 : i.find(
|
|
53
51
|
(m) => b(m)
|
|
54
52
|
);
|
|
55
53
|
if (l != null && l.oneOf)
|
|
@@ -58,17 +56,17 @@ const K = { class: "property-rule" }, P = {
|
|
|
58
56
|
return "Any of";
|
|
59
57
|
}
|
|
60
58
|
return e.replace(/([A-Z])/g, " $1").replace(/^./, (l) => l.toUpperCase()).toLowerCase().replace(/^(\w)/, (l) => l.toUpperCase());
|
|
61
|
-
},
|
|
62
|
-
() => k.value[
|
|
63
|
-
), h =
|
|
59
|
+
}, a = t(
|
|
60
|
+
() => k.value[v.value]
|
|
61
|
+
), h = t(() => {
|
|
64
62
|
var e;
|
|
65
|
-
return (e =
|
|
66
|
-
}), q =
|
|
63
|
+
return (e = a.value) != null && e.oneOf ? "oneOf" : "anyOf";
|
|
64
|
+
}), q = t(() => {
|
|
67
65
|
var o;
|
|
68
66
|
const e = h.value;
|
|
69
|
-
return (o =
|
|
70
|
-
}), z =
|
|
71
|
-
const e =
|
|
67
|
+
return (o = a.value) == null ? void 0 : o[e];
|
|
68
|
+
}), z = t(() => {
|
|
69
|
+
const e = a.value;
|
|
72
70
|
return e ? !!(e.properties || e.type || e.nullable || e.const !== void 0 || e.enum || e.allOf || e.oneOf || e.anyOf || e.items) : !1;
|
|
73
71
|
});
|
|
74
72
|
return (e, o) => {
|
|
@@ -87,7 +85,7 @@ const K = { class: "property-rule" }, P = {
|
|
|
87
85
|
value: n
|
|
88
86
|
}, null, 8, ["compact", "level", "name", "noncollapsible", "schemas", "value"]))), 128)) : u("", !0),
|
|
89
87
|
D.value ? (r(), c(N, { key: 1 }, [
|
|
90
|
-
y(
|
|
88
|
+
y(d(Z), {
|
|
91
89
|
modelValue: O.value,
|
|
92
90
|
"onUpdate:modelValue": o[0] || (o[0] = (n) => O.value = n),
|
|
93
91
|
options: C.value,
|
|
@@ -99,16 +97,16 @@ const K = { class: "property-rule" }, P = {
|
|
|
99
97
|
f("button", P, [
|
|
100
98
|
f("span", Q, V(U(e.composition)), 1),
|
|
101
99
|
f("span", X, V(((n = O.value) == null ? void 0 : n.label) || "Schema"), 1),
|
|
102
|
-
y(
|
|
100
|
+
y(d(G))
|
|
103
101
|
])
|
|
104
102
|
];
|
|
105
103
|
}),
|
|
106
104
|
_: 1
|
|
107
105
|
}, 8, ["modelValue", "options"]),
|
|
108
106
|
f("div", Y, [
|
|
109
|
-
(l =
|
|
110
|
-
y(
|
|
111
|
-
value:
|
|
107
|
+
(l = a.value) != null && l.description ? (r(), c("div", W, [
|
|
108
|
+
y(d($), {
|
|
109
|
+
value: a.value.description
|
|
112
110
|
}, null, 8, ["value"])
|
|
113
111
|
])) : u("", !0),
|
|
114
112
|
z.value ? (r(), p(g, {
|
|
@@ -119,13 +117,13 @@ const K = { class: "property-rule" }, P = {
|
|
|
119
117
|
name: e.name,
|
|
120
118
|
noncollapsible: !0,
|
|
121
119
|
schemas: e.schemas,
|
|
122
|
-
value: (m =
|
|
120
|
+
value: (m = a.value) != null && m.properties ? {
|
|
123
121
|
type: "object",
|
|
124
|
-
properties:
|
|
125
|
-
required:
|
|
126
|
-
} :
|
|
122
|
+
properties: a.value.properties,
|
|
123
|
+
required: a.value.required
|
|
124
|
+
} : a.value
|
|
127
125
|
}, null, 8, ["compact", "level", "hideHeading", "name", "schemas", "value"])) : u("", !0),
|
|
128
|
-
(A =
|
|
126
|
+
(A = a.value) != null && A.oneOf || (H = a.value) != null && H.anyOf ? (r(), p(i, {
|
|
129
127
|
key: 2,
|
|
130
128
|
compact: e.compact,
|
|
131
129
|
composition: h.value,
|
|
@@ -146,7 +144,7 @@ const K = { class: "property-rule" }, P = {
|
|
|
146
144
|
name: e.name,
|
|
147
145
|
noncollapsible: e.level == 0,
|
|
148
146
|
schemas: e.schemas,
|
|
149
|
-
value:
|
|
147
|
+
value: d(w)(e.value[e.composition])
|
|
150
148
|
}, null, 8, ["compact", "level", "name", "noncollapsible", "schemas", "value"]))
|
|
151
149
|
]);
|
|
152
150
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type { OpenAPIV3_1 } from '@scalar/openapi-types';
|
|
2
1
|
import type { Schemas } from '../../../../features/Operation/types/schemas';
|
|
2
|
+
import type { OpenAPIV3_1 } from '@scalar/openapi-types';
|
|
3
3
|
/**
|
|
4
4
|
* Extract schema name from various schema formats
|
|
5
5
|
* Handles $ref, title, name, type, and schema dictionary lookup
|
|
6
6
|
*/
|
|
7
|
-
export declare function getModelNameFromSchema(schema: OpenAPIV3_1.SchemaObject
|
|
7
|
+
export declare function getModelNameFromSchema(schema: OpenAPIV3_1.SchemaObject): string | null;
|
|
8
8
|
/**
|
|
9
9
|
* Find schema name by matching against component schemas
|
|
10
10
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema-name.d.ts","sourceRoot":"","sources":["../../../../../src/components/Content/Schema/helpers/schema-name.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"schema-name.d.ts","sourceRoot":"","sources":["../../../../../src/components/Content/Schema/helpers/schema-name.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oCAAoC,CAAA;AACjE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAGxD;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,WAAW,CAAC,YAAY,GAAG,MAAM,GAAG,IAAI,CA6CtF;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,WAAW,CAAC,YAAY,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAwB3G;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAE3E;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAC1B,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC1B,OAAO,CAAC,EAAE,OAAO,EACjB,cAAc,UAAQ,EACtB,0BAA0B,CAAC,EAAE,CAAC,MAAM,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,OAAO,KAAK,MAAM,GAAG,IAAI,GAC7E,MAAM,GAAG,IAAI,CA2Df;AAED;;GAEG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO,CAgBpD;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CACnC,WAAW,EAAE,WAAW,CAAC,YAAY,EAAE,EACvC,kBAAkB,EAAE,WAAW,CAAC,YAAY,EAAE,EAC9C,OAAO,CAAC,EAAE,OAAO,GAChB,WAAW,CAAC,YAAY,EAAE,CA0B5B"}
|
|
@@ -1,16 +1,11 @@
|
|
|
1
|
-
import { stringify as
|
|
2
|
-
function
|
|
1
|
+
import { stringify as $ } from "flatted";
|
|
2
|
+
function s(t) {
|
|
3
3
|
if (!t)
|
|
4
4
|
return null;
|
|
5
5
|
if ("title" in t && t.title)
|
|
6
6
|
return t.title;
|
|
7
7
|
if ("name" in t && t.name)
|
|
8
8
|
return t.name;
|
|
9
|
-
if (r && typeof r == "object") {
|
|
10
|
-
for (const [i, n] of Object.entries(r))
|
|
11
|
-
if (p(n) === p(t))
|
|
12
|
-
return i;
|
|
13
|
-
}
|
|
14
9
|
if ("$ref" in t) {
|
|
15
10
|
const n = t.$ref.match(/\/([^\/]+)$/);
|
|
16
11
|
if (n)
|
|
@@ -21,56 +16,52 @@ function m(t, r) {
|
|
|
21
16
|
if ("type" in t && t.type)
|
|
22
17
|
return Array.isArray(t.type) ? t.type.join(" | ") : t.type;
|
|
23
18
|
if (typeof t == "object") {
|
|
24
|
-
const
|
|
25
|
-
if (
|
|
26
|
-
return
|
|
19
|
+
const r = Object.keys(t);
|
|
20
|
+
if (r.length > 0)
|
|
21
|
+
return r[0];
|
|
27
22
|
}
|
|
28
23
|
return null;
|
|
29
24
|
}
|
|
30
|
-
function
|
|
31
|
-
var
|
|
32
|
-
if (!t || !r || typeof r != "object")
|
|
25
|
+
function b(t, r) {
|
|
26
|
+
var n, y;
|
|
27
|
+
if (!t || !r || typeof r != "object" || t.type !== "array" && t.type !== "object")
|
|
33
28
|
return null;
|
|
34
|
-
for (const [e,
|
|
35
|
-
if (
|
|
29
|
+
for (const [e, i] of Object.entries(r))
|
|
30
|
+
if (i.type === t.type && (t.type === "array" && ((n = i.items) == null ? void 0 : n.type) === ((y = t.items) == null ? void 0 : y.type) || t.type === "object" && i.properties && t.properties && $(i.properties) === $(t.properties)))
|
|
36
31
|
return e;
|
|
37
32
|
return null;
|
|
38
33
|
}
|
|
39
|
-
function
|
|
34
|
+
function p(t, r) {
|
|
40
35
|
return t === "array" ? `${t} ${r}[]` : `${t} ${r}`;
|
|
41
36
|
}
|
|
42
|
-
function
|
|
43
|
-
var
|
|
37
|
+
function u(t, r, n = !1, y) {
|
|
38
|
+
var o;
|
|
44
39
|
if (!(t != null && t.type))
|
|
45
40
|
return null;
|
|
46
|
-
if (
|
|
47
|
-
return t.type === "array" && ((
|
|
48
|
-
const e =
|
|
41
|
+
if (n)
|
|
42
|
+
return t.type === "array" && ((o = t.items) != null && o.type) ? `array ${t.items.type}[]` : null;
|
|
43
|
+
const e = s(t);
|
|
49
44
|
if (e && (t.title || t.name))
|
|
50
45
|
return t.type === "array" ? `array ${e}[]` : e;
|
|
51
|
-
const
|
|
52
|
-
if (
|
|
53
|
-
return t.type === "array" ? `array ${
|
|
46
|
+
const i = b(t, r);
|
|
47
|
+
if (i)
|
|
48
|
+
return t.type === "array" ? `array ${i}[]` : i;
|
|
54
49
|
if (t.type === "array" && t.items) {
|
|
55
|
-
if (
|
|
56
|
-
const
|
|
57
|
-
if (
|
|
58
|
-
return
|
|
50
|
+
if (y) {
|
|
51
|
+
const m = y(t.items, r);
|
|
52
|
+
if (m)
|
|
53
|
+
return p(t.type, m);
|
|
59
54
|
}
|
|
60
55
|
if (t.items.title || t.items.name)
|
|
61
|
-
return
|
|
62
|
-
const
|
|
63
|
-
return
|
|
56
|
+
return p(t.type, t.items.title || t.items.name);
|
|
57
|
+
const f = s(t.items);
|
|
58
|
+
return f && f !== t.items.type ? p(t.type, f) : t.items.type ? p(t.type, t.items.type) : p(t.type, "object");
|
|
64
59
|
}
|
|
65
60
|
return e && e !== t.type ? e.startsWith("Array of ") ? `array ${e.replace("Array of ", "")}[]` : e : null;
|
|
66
61
|
}
|
|
67
|
-
function b(t) {
|
|
68
|
-
return !t || ["anyOf", "oneOf", "allOf"].includes(t) ? !1 : /[A-Z]/.test(t) || /\s/.test(t) || /\(\d+\)/.test(t);
|
|
69
|
-
}
|
|
70
62
|
export {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
b as hasName
|
|
63
|
+
p as formatTypeWithModel,
|
|
64
|
+
u as getModelName,
|
|
65
|
+
s as getModelNameFromSchema,
|
|
66
|
+
b as getSchemaNameFromSchemas
|
|
76
67
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DocumentSelector.vue.d.ts","sourceRoot":"","sources":["../../../src/components/DocumentSelector/DocumentSelector.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DocumentSelector.vue.d.ts","sourceRoot":"","sources":["../../../src/components/DocumentSelector/DocumentSelector.vue"],"names":[],"mappings":"AAwDA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAA;AAKpE,KAAK,WAAW,GAAG;IACjB,OAAO,CAAC,EAAE,iBAAiB,EAAE,CAAA;IAC7B,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB,CAAC;;;;;;AA4HF,wBAOG"}
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { defineComponent as p, computed as s, createElementBlock as b, createCommentVNode as f, openBlock as x, createVNode as
|
|
1
|
+
import { defineComponent as p, computed as s, createElementBlock as b, createCommentVNode as f, openBlock as x, createVNode as r, unref as i, withCtx as v, createElementVNode as c, toDisplayString as V } from "vue";
|
|
2
2
|
import { ScalarListbox as g } from "@scalar/components";
|
|
3
|
-
import { ScalarIconCaretUpDown as
|
|
4
|
-
const
|
|
3
|
+
import { ScalarIconCaretUpDown as S } from "@scalar/icons";
|
|
4
|
+
const h = {
|
|
5
5
|
key: 0,
|
|
6
6
|
class: "document-selector -mb-1 p-3 pb-0"
|
|
7
|
-
},
|
|
8
|
-
class: "group/dropdown-label hover:bg-b-2 text-c-2 flex w-full cursor-pointer items-center rounded border
|
|
7
|
+
}, w = {
|
|
8
|
+
class: "group/dropdown-label hover:bg-b-2 text-c-2 flex w-full cursor-pointer items-center rounded border px-2 py-1.75",
|
|
9
9
|
tabindex: "0"
|
|
10
|
-
}, _ = { class: "text-c-1 overflow-hidden text-
|
|
10
|
+
}, _ = { class: "text-c-1 overflow-hidden text-base text-ellipsis" }, y = /* @__PURE__ */ p({
|
|
11
11
|
__name: "DocumentSelector",
|
|
12
12
|
props: {
|
|
13
13
|
options: {},
|
|
14
14
|
modelValue: {}
|
|
15
15
|
},
|
|
16
16
|
emits: ["update:modelValue"],
|
|
17
|
-
setup(l, { emit:
|
|
18
|
-
const
|
|
17
|
+
setup(l, { emit: d }) {
|
|
18
|
+
const u = d, m = s(() => {
|
|
19
19
|
var e;
|
|
20
20
|
return l.options && ((e = l.options) == null ? void 0 : e.length) > 1;
|
|
21
|
-
}),
|
|
21
|
+
}), a = s(
|
|
22
22
|
() => {
|
|
23
23
|
var e;
|
|
24
24
|
return ((e = l.options) == null ? void 0 : e.map((o, t) => ({
|
|
@@ -28,25 +28,22 @@ const w = {
|
|
|
28
28
|
}))) || [];
|
|
29
29
|
}
|
|
30
30
|
), n = s({
|
|
31
|
-
get: () =>
|
|
32
|
-
set: (e) =>
|
|
31
|
+
get: () => a.value.find(({ id: e }) => e === String(l.modelValue)),
|
|
32
|
+
set: (e) => u("update:modelValue", Number(e.id))
|
|
33
33
|
});
|
|
34
|
-
return (e, o) =>
|
|
35
|
-
|
|
34
|
+
return (e, o) => m.value ? (x(), b("div", h, [
|
|
35
|
+
r(i(g), {
|
|
36
36
|
modelValue: n.value,
|
|
37
37
|
"onUpdate:modelValue": o[0] || (o[0] = (t) => n.value = t),
|
|
38
|
-
options:
|
|
38
|
+
options: a.value,
|
|
39
39
|
resize: ""
|
|
40
40
|
}, {
|
|
41
41
|
default: v(() => {
|
|
42
42
|
var t;
|
|
43
43
|
return [
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
weight: "bold"
|
|
48
|
-
}),
|
|
49
|
-
d("span", _, V(((t = n.value) == null ? void 0 : t.label) || "Select API"), 1)
|
|
44
|
+
c("div", w, [
|
|
45
|
+
r(i(S), { class: "mr-1 size-4 text-current" }),
|
|
46
|
+
c("span", _, V(((t = n.value) == null ? void 0 : t.label) || "Select API"), 1)
|
|
50
47
|
])
|
|
51
48
|
];
|
|
52
49
|
}),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./Sidebar.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import r from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const e = /* @__PURE__ */ r(o, [["__scopeId", "data-v-fbdf40e7"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
e as default
|
|
7
7
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SidebarElement.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Sidebar/SidebarElement.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SidebarElement.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Sidebar/SidebarElement.vue"],"names":[],"mappings":"AAiWA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAA;AAQhE,KAAK,WAAW,GAAG;IACjB,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,cAAc,CAAA;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,IAAI,CAAC,EAAE,OAAO,CAAA;CACf,CAAC;AAuEF,iBAAS,cAAc;WA+KT,OAAO,IAA6B;;yBATpB,GAAG;+BACG,GAAG;;;;EAatC;AAiBD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;;;;4FAQnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAWpG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./SidebarElement.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-
|
|
4
|
+
const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-9ab41262"]]);
|
|
5
5
|
export {
|
|
6
6
|
m as default
|
|
7
7
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./SidebarGroup.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import r from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const m = /* @__PURE__ */ r(o, [["__scopeId", "data-v-
|
|
4
|
+
const m = /* @__PURE__ */ r(o, [["__scopeId", "data-v-5d54b401"]]);
|
|
5
5
|
export {
|
|
6
6
|
m as default
|
|
7
7
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./ExampleResponses.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import e from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const m = /* @__PURE__ */ e(o, [["__scopeId", "data-v-
|
|
4
|
+
const m = /* @__PURE__ */ e(o, [["__scopeId", "data-v-ee300101"]]);
|
|
5
5
|
export {
|
|
6
6
|
m as default
|
|
7
7
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchButton.vue.d.ts","sourceRoot":"","sources":["../../../src/features/Search/SearchButton.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SearchButton.vue.d.ts","sourceRoot":"","sources":["../../../src/features/Search/SearchButton.vue"],"names":[],"mappings":"AAoFA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;AAQhD,KAAK,WAAW,GAAG;IACf,IAAI,EAAE,IAAI,CAAA;IACV,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB,CAAC;;kBADe,MAAM;;AAyJzB,wBAOG"}
|
|
@@ -1,7 +1,62 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
import
|
|
4
|
-
|
|
1
|
+
import { defineComponent as w, ref as v, watch as C, nextTick as K, onMounted as B, onBeforeUnmount as b, createElementBlock as r, openBlock as a, Fragment as s, createVNode as c, unref as l, withCtx as u, createElementVNode as n, createTextVNode as m, toDisplayString as E } from "vue";
|
|
2
|
+
import { useModal as H, ScalarSidebarSearchButton as M } from "@scalar/components";
|
|
3
|
+
import { isMacOS as f } from "@scalar/helpers/general/is-mac-os";
|
|
4
|
+
import g from "./SearchModal.vue.js";
|
|
5
|
+
import { useApiClient as x } from "../ApiClientModal/useApiClient.js";
|
|
6
|
+
const O = /* @__PURE__ */ w({
|
|
7
|
+
__name: "SearchButton",
|
|
8
|
+
props: {
|
|
9
|
+
spec: {},
|
|
10
|
+
searchHotKey: { default: "k" }
|
|
11
|
+
},
|
|
12
|
+
setup(y) {
|
|
13
|
+
const S = y, p = v(), o = H(), { client: h } = x(), d = (t) => {
|
|
14
|
+
var e;
|
|
15
|
+
(f() ? t.metaKey : t.ctrlKey) && t.key === S.searchHotKey && !((e = h.value) != null && e.modalState.open) && (t.preventDefault(), t.stopPropagation(), o.open ? o.hide() : o.show());
|
|
16
|
+
};
|
|
17
|
+
C(
|
|
18
|
+
() => o.open,
|
|
19
|
+
(t, e) => {
|
|
20
|
+
!t && e && K(() => {
|
|
21
|
+
var i;
|
|
22
|
+
(i = p.value) == null || i.focus();
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
), B(() => window.addEventListener("keydown", d)), b(() => window.removeEventListener("keydown", d));
|
|
26
|
+
function k() {
|
|
27
|
+
o.show();
|
|
28
|
+
}
|
|
29
|
+
return (t, e) => (a(), r(s, null, [
|
|
30
|
+
c(l(M), {
|
|
31
|
+
ref_key: "button",
|
|
32
|
+
ref: p,
|
|
33
|
+
onClick: k
|
|
34
|
+
}, {
|
|
35
|
+
shortcut: u(() => [
|
|
36
|
+
l(f)() ? (a(), r(s, { key: 0 }, [
|
|
37
|
+
m("⌘")
|
|
38
|
+
], 64)) : (a(), r(s, { key: 1 }, [
|
|
39
|
+
e[0] || (e[0] = n("span", { class: "sr-only" }, "CTRL", -1)),
|
|
40
|
+
e[1] || (e[1] = n("span", { "aria-hidden": "true" }, "⌃", -1))
|
|
41
|
+
], 64)),
|
|
42
|
+
m(" " + E(t.searchHotKey), 1)
|
|
43
|
+
]),
|
|
44
|
+
default: u(() => [
|
|
45
|
+
e[2] || (e[2] = n("span", { class: "sr-only" }, "Open Search", -1)),
|
|
46
|
+
e[3] || (e[3] = n("span", {
|
|
47
|
+
"aria-hidden": "true",
|
|
48
|
+
class: "sidebar-search-placeholder"
|
|
49
|
+
}, " Search ", -1))
|
|
50
|
+
]),
|
|
51
|
+
_: 1
|
|
52
|
+
}, 512),
|
|
53
|
+
c(g, {
|
|
54
|
+
modalState: l(o),
|
|
55
|
+
parsedSpec: t.spec
|
|
56
|
+
}, null, 8, ["modalState", "parsedSpec"])
|
|
57
|
+
], 64));
|
|
58
|
+
}
|
|
59
|
+
});
|
|
5
60
|
export {
|
|
6
|
-
|
|
61
|
+
O as default
|
|
7
62
|
};
|