@scalar/api-reference 1.25.115 → 1.25.116
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 +24 -0
- package/dist/browser/standalone.js +10903 -10880
- package/dist/browser/webpack-stats.json +1 -1
- package/dist/components/Content/Lazy/Loading.vue.d.ts.map +1 -1
- package/dist/components/Content/Lazy/Loading.vue.js +58 -60
- package/dist/components/Content/Tag/TagList.vue.d.ts.map +1 -1
- package/dist/components/Content/Tag/TagList.vue.js +36 -38
- package/dist/components/Sidebar/SidebarElement.vue.d.ts.map +1 -1
- package/dist/components/Sidebar/SidebarElement.vue.js +1 -1
- package/dist/components/Sidebar/SidebarElement.vue2.js +59 -55
- package/dist/features/ApiClientModal/useApiClient.d.ts +18 -18
- package/dist/features/ApiClientModal/useApiClient.d.ts.map +1 -1
- package/dist/features/ExampleRequest/ExampleRequest.vue.d.ts +6 -4
- package/dist/features/ExampleRequest/ExampleRequest.vue.d.ts.map +1 -1
- package/dist/features/ExampleRequest/ExampleRequest.vue.js +2 -2
- package/dist/features/ExampleRequest/ExampleRequest.vue2.js +138 -119
- package/dist/features/ExampleRequest/helpers/filter-security-requirements.d.ts +6 -0
- package/dist/features/ExampleRequest/helpers/filter-security-requirements.d.ts.map +1 -0
- package/dist/features/ExampleRequest/helpers/filter-security-requirements.js +17 -0
- package/dist/features/Operation/Operation.vue.d.ts +4 -5
- package/dist/features/Operation/Operation.vue.d.ts.map +1 -1
- package/dist/features/Operation/Operation.vue.js +34 -41
- package/dist/features/Operation/layouts/ClassicLayout.vue.d.ts +6 -6
- package/dist/features/Operation/layouts/ClassicLayout.vue.d.ts.map +1 -1
- package/dist/features/Operation/layouts/ClassicLayout.vue.js +4 -4
- package/dist/features/Operation/layouts/ClassicLayout.vue2.js +52 -51
- package/dist/features/Operation/layouts/ModernLayout.vue.d.ts +6 -6
- package/dist/features/Operation/layouts/ModernLayout.vue.d.ts.map +1 -1
- package/dist/features/Operation/layouts/ModernLayout.vue.js +2 -2
- package/dist/features/Operation/layouts/ModernLayout.vue2.js +70 -70
- package/dist/helpers/convert-to-har-request.d.ts +28 -0
- package/dist/helpers/convert-to-har-request.d.ts.map +1 -0
- package/dist/helpers/convert-to-har-request.js +64 -0
- package/dist/helpers/get-example-code.d.ts +9 -0
- package/dist/helpers/get-example-code.d.ts.map +1 -0
- package/dist/helpers/get-example-code.js +51 -0
- package/dist/helpers/index.d.ts +0 -3
- package/dist/helpers/index.d.ts.map +1 -1
- package/dist/hooks/useNavState.d.ts.map +1 -1
- package/dist/hooks/useNavState.js +26 -24
- package/dist/hooks/useReactiveSpec.d.ts +1 -1
- package/dist/index.js +66 -72
- package/dist/style.css +1 -1
- package/package.json +10 -10
- package/dist/features/Operation/hooks/useRequestExample.d.ts +0 -17
- package/dist/features/Operation/hooks/useRequestExample.d.ts.map +0 -1
- package/dist/features/Operation/hooks/useRequestExample.js +0 -68
- package/dist/helpers/convertRequestToHarRequest.d.ts +0 -7
- package/dist/helpers/convertRequestToHarRequest.d.ts.map +0 -1
- package/dist/helpers/convertRequestToHarRequest.js +0 -64
- package/dist/helpers/get-request.js +0 -6
- package/dist/helpers/getExampleCode.d.ts +0 -8
- package/dist/helpers/getExampleCode.d.ts.map +0 -1
- package/dist/helpers/getExampleCode.js +0 -16
- package/dist/helpers/joinWithSlash.d.ts +0 -5
- package/dist/helpers/joinWithSlash.d.ts.map +0 -1
- package/dist/helpers/joinWithSlash.js +0 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Loading.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Lazy/Loading.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Loading.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Lazy/Loading.vue"],"names":[],"mappings":"AAmOA,OAAO,KAAK,EACV,IAAI,EAGL,MAAM,sBAAsB,CAAA;AAkB7B;;;;;;;;;;;;GAYG;AACH,KAAK,WAAW,GAAG;IACf,MAAM,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAA;IAC7B,UAAU,EAAE,IAAI,CAAA;CACjB,CAAC;;YAFS,QAAQ,GAAG,SAAS;;AAwQjC,wBAQG"}
|
|
@@ -1,122 +1,120 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import {
|
|
3
|
-
import { lazyBus as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import { useNavState as
|
|
13
|
-
import { getModels as
|
|
14
|
-
import { scrollToId as
|
|
15
|
-
const
|
|
1
|
+
import { defineComponent as D, ref as v, watch as K, onMounted as M, withDirectives as j, openBlock as n, createElementBlock as f, normalizeClass as F, Fragment as g, renderList as k, createBlock as m, unref as t, withCtx as p, createCommentVNode as w, createVNode as C, createTextVNode as H, toDisplayString as P, vShow as q } from "vue";
|
|
2
|
+
import { useActiveEntities as G } from "@scalar/api-client/store";
|
|
3
|
+
import { lazyBus as J } from "./lazyBus.js";
|
|
4
|
+
import Q from "../Tag/Tag.vue.js";
|
|
5
|
+
import R from "../../../features/Operation/Operation.vue.js";
|
|
6
|
+
import U from "../../Section/SectionContainer.vue.js";
|
|
7
|
+
import X from "../../Section/Section.vue.js";
|
|
8
|
+
import Y from "../../Section/SectionContent.vue.js";
|
|
9
|
+
import Z from "../../Section/SectionHeader.vue.js";
|
|
10
|
+
import ee from "../../Anchor/Anchor.vue.js";
|
|
11
|
+
import te from "../Schema/Schema.vue.js";
|
|
12
|
+
import { useNavState as oe } from "../../../hooks/useNavState.js";
|
|
13
|
+
import { getModels as h } from "../../../helpers/getModels.js";
|
|
14
|
+
import { scrollToId as x } from "../../../helpers/scrollToId.js";
|
|
15
|
+
const he = /* @__PURE__ */ D({
|
|
16
16
|
__name: "Loading",
|
|
17
17
|
props: {
|
|
18
18
|
layout: { default: "modern" },
|
|
19
19
|
parsedSpec: {}
|
|
20
20
|
},
|
|
21
|
-
setup(
|
|
22
|
-
const i =
|
|
23
|
-
|
|
21
|
+
setup(L) {
|
|
22
|
+
const i = L, T = v(!1), S = v([]), y = v([]), { activeCollection: O, activeServer: V } = G(), { getModelId: z, getSectionId: B, getTagId: N, hash: a, isIntersectionEnabled: I } = oe(), _ = v(i.layout !== "classic" && a.value);
|
|
23
|
+
K(
|
|
24
24
|
() => {
|
|
25
25
|
var r;
|
|
26
26
|
return (r = i.parsedSpec.tags) == null ? void 0 : r.length;
|
|
27
27
|
},
|
|
28
28
|
(r) => {
|
|
29
29
|
var e, u;
|
|
30
|
-
if (!
|
|
30
|
+
if (!a.value || typeof r != "number" || !i.parsedSpec.tags)
|
|
31
31
|
return;
|
|
32
|
-
const
|
|
33
|
-
if (
|
|
32
|
+
const s = B();
|
|
33
|
+
if (s.startsWith("tag")) {
|
|
34
34
|
let o = 0;
|
|
35
35
|
const c = ((e = i.parsedSpec.tags) == null ? void 0 : e.findIndex(
|
|
36
|
-
(
|
|
37
|
-
)) ?? 0,
|
|
38
|
-
if ((
|
|
39
|
-
const
|
|
36
|
+
(b) => N(b) === s
|
|
37
|
+
)) ?? 0, l = a.value.match(/tag\/([^/]+)\/([^/]+)\/(.+)/);
|
|
38
|
+
if ((l == null ? void 0 : l.length) === 4) {
|
|
39
|
+
const b = l[2], W = "/" + l[3];
|
|
40
40
|
o = (u = i.parsedSpec.tags[c]) == null ? void 0 : u.operations.findIndex(
|
|
41
|
-
({ httpVerb: $, path:
|
|
41
|
+
({ httpVerb: $, path: A }) => b === $ && W === A
|
|
42
42
|
);
|
|
43
43
|
}
|
|
44
44
|
const d = i.parsedSpec.tags[c];
|
|
45
45
|
if (!d) return;
|
|
46
|
-
d.name !== "default" && (
|
|
46
|
+
d.name !== "default" && (T.value = s !== a.value && s.startsWith("tag")), S.value.push({
|
|
47
47
|
...d,
|
|
48
48
|
lazyOperations: d.operations.slice(
|
|
49
49
|
o,
|
|
50
50
|
o + 2
|
|
51
51
|
)
|
|
52
52
|
});
|
|
53
|
-
} else if (
|
|
54
|
-
const o = Object.keys(
|
|
55
|
-
if (
|
|
56
|
-
|
|
53
|
+
} else if (a.value.startsWith("model")) {
|
|
54
|
+
const o = Object.keys(h(i.parsedSpec) ?? {}), [, c] = a.value.toLowerCase().split("/"), l = a.value === "models" ? 0 : o.findIndex((d) => d.toLowerCase() === c);
|
|
55
|
+
if (l === -1) return;
|
|
56
|
+
y.value = o.slice(l, l + 3);
|
|
57
57
|
} else
|
|
58
|
-
typeof window < "u" &&
|
|
58
|
+
typeof window < "u" && x(a.value), setTimeout(() => I.value = !0, 1e3);
|
|
59
59
|
},
|
|
60
60
|
{ immediate: !0 }
|
|
61
61
|
);
|
|
62
|
-
const
|
|
63
|
-
const
|
|
64
|
-
!
|
|
65
|
-
typeof window < "u" &&
|
|
62
|
+
const E = J.on(({ id: r }) => {
|
|
63
|
+
const s = a.value;
|
|
64
|
+
!s || r !== s || (E(), setTimeout(() => {
|
|
65
|
+
typeof window < "u" && x(s), _.value = !1, setTimeout(() => I.value = !0, 1e3);
|
|
66
66
|
}, 300));
|
|
67
67
|
});
|
|
68
|
-
return
|
|
69
|
-
|
|
70
|
-
}), (r,
|
|
68
|
+
return M(() => {
|
|
69
|
+
a.value || setTimeout(() => I.value = !0, 1e3);
|
|
70
|
+
}), (r, s) => j((n(), f("div", {
|
|
71
71
|
class: F(["references-loading", {
|
|
72
|
-
"references-loading-hidden-tag":
|
|
73
|
-
"references-loading-top-spacer":
|
|
72
|
+
"references-loading-hidden-tag": T.value,
|
|
73
|
+
"references-loading-top-spacer": S.value.length
|
|
74
74
|
}])
|
|
75
75
|
}, [
|
|
76
|
-
(
|
|
76
|
+
(n(!0), f(g, null, k(S.value, (e, u) => (n(), f(g, {
|
|
77
77
|
key: e.name + u
|
|
78
78
|
}, [
|
|
79
|
-
e.operations && e.operations.length > 0 ? (
|
|
79
|
+
e.operations && e.operations.length > 0 ? (n(), m(t(Q), {
|
|
80
80
|
key: 0,
|
|
81
81
|
spec: r.parsedSpec,
|
|
82
82
|
tag: e
|
|
83
83
|
}, {
|
|
84
84
|
default: p(() => [
|
|
85
|
-
(
|
|
85
|
+
(n(!0), f(g, null, k(e.lazyOperations, (o) => (n(), m(t(R), {
|
|
86
86
|
key: `${o.httpVerb}-${o.operationId}`,
|
|
87
|
+
collection: t(O),
|
|
87
88
|
layout: r.layout,
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
securitySchemes: t(V),
|
|
92
|
-
tag: e
|
|
93
|
-
}, null, 8, ["layout", "operation", "requestExamples", "requests", "securitySchemes", "tag"]))), 128))
|
|
89
|
+
server: t(V),
|
|
90
|
+
transformedOperation: o
|
|
91
|
+
}, null, 8, ["collection", "layout", "server", "transformedOperation"]))), 128))
|
|
94
92
|
]),
|
|
95
93
|
_: 2
|
|
96
94
|
}, 1032, ["spec", "tag"])) : w("", !0)
|
|
97
95
|
], 64))), 128)),
|
|
98
|
-
|
|
96
|
+
y.value.length ? (n(), m(t(U), { key: 0 }, {
|
|
99
97
|
default: p(() => [
|
|
100
|
-
(
|
|
98
|
+
(n(!0), f(g, null, k(y.value, (e) => (n(), m(t(X), {
|
|
101
99
|
key: e,
|
|
102
100
|
label: e
|
|
103
101
|
}, {
|
|
104
102
|
default: p(() => {
|
|
105
103
|
var u;
|
|
106
104
|
return [
|
|
107
|
-
(u = t(
|
|
105
|
+
(u = t(h)(r.parsedSpec)) != null && u[e] ? (n(), m(t(Y), { key: 0 }, {
|
|
108
106
|
default: p(() => {
|
|
109
107
|
var o;
|
|
110
108
|
return [
|
|
111
|
-
|
|
109
|
+
C(t(Z), { level: 2 }, {
|
|
112
110
|
default: p(() => [
|
|
113
|
-
|
|
111
|
+
C(t(ee), {
|
|
114
112
|
id: t(z)({ name: e })
|
|
115
113
|
}, {
|
|
116
114
|
default: p(() => {
|
|
117
115
|
var c;
|
|
118
116
|
return [
|
|
119
|
-
H(P(((c = t(
|
|
117
|
+
H(P(((c = t(h)(r.parsedSpec)) == null ? void 0 : c[e]).title ?? e), 1)
|
|
120
118
|
];
|
|
121
119
|
}),
|
|
122
120
|
_: 2
|
|
@@ -124,10 +122,10 @@ const ye = /* @__PURE__ */ K({
|
|
|
124
122
|
]),
|
|
125
123
|
_: 2
|
|
126
124
|
}, 1024),
|
|
127
|
-
|
|
125
|
+
C(t(te), {
|
|
128
126
|
name: e,
|
|
129
127
|
noncollapsible: "",
|
|
130
|
-
value: (o = t(
|
|
128
|
+
value: (o = t(h)(r.parsedSpec)) == null ? void 0 : o[e]
|
|
131
129
|
}, null, 8, ["name", "value"])
|
|
132
130
|
];
|
|
133
131
|
}),
|
|
@@ -141,10 +139,10 @@ const ye = /* @__PURE__ */ K({
|
|
|
141
139
|
_: 1
|
|
142
140
|
})) : w("", !0)
|
|
143
141
|
], 2)), [
|
|
144
|
-
[
|
|
142
|
+
[q, _.value]
|
|
145
143
|
]);
|
|
146
144
|
}
|
|
147
145
|
});
|
|
148
146
|
export {
|
|
149
|
-
|
|
147
|
+
he as default
|
|
150
148
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TagList.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Tag/TagList.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TagList.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Tag/TagList.vue"],"names":[],"mappings":"AA8EA,OAAO,KAAK,EAAE,IAAI,EAAE,GAAG,IAAI,OAAO,EAAE,MAAM,sBAAsB,CAAA;AAOhE,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,OAAO,EAAE,CAAA;IACf,IAAI,EAAE,IAAI,CAAA;IACV,MAAM,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAA;CAC9B,CAAC;;AAkIF,wBAMG"}
|
|
@@ -1,54 +1,52 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import {
|
|
3
|
-
import { ScalarErrorBoundary as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
1
|
+
import { defineComponent as C, computed as p, openBlock as s, createElementBlock as f, Fragment as y, renderList as v, createBlock as l, unref as e, withCtx as i, resolveDynamicComponent as T, createVNode as _ } from "vue";
|
|
2
|
+
import { useActiveEntities as $ } from "@scalar/api-client/store";
|
|
3
|
+
import { ScalarErrorBoundary as b } from "@scalar/components";
|
|
4
|
+
import E from "./TagAccordion.vue.js";
|
|
5
|
+
import O from "./Tag.vue.js";
|
|
6
6
|
import L from "../Lazy/Lazy.vue2.js";
|
|
7
|
-
import
|
|
8
|
-
import { useNavState as
|
|
9
|
-
import { useSidebar as
|
|
10
|
-
const
|
|
7
|
+
import A from "../../../features/Operation/Operation.vue.js";
|
|
8
|
+
import { useNavState as N } from "../../../hooks/useNavState.js";
|
|
9
|
+
import { useSidebar as V } from "../../../hooks/useSidebar.js";
|
|
10
|
+
const K = /* @__PURE__ */ C({
|
|
11
11
|
__name: "TagList",
|
|
12
12
|
props: {
|
|
13
13
|
tags: {},
|
|
14
14
|
spec: {},
|
|
15
15
|
layout: {}
|
|
16
16
|
},
|
|
17
|
-
setup(
|
|
18
|
-
const
|
|
19
|
-
() =>
|
|
20
|
-
),
|
|
21
|
-
() =>
|
|
22
|
-
),
|
|
23
|
-
return (
|
|
17
|
+
setup(h) {
|
|
18
|
+
const n = h, { getOperationId: c, getTagId: r, hash: z } = N(), { collapsedSidebarItems: m } = V(), { activeCollection: I, activeServer: g } = $(), k = p(
|
|
19
|
+
() => n.layout === "classic" ? E : O
|
|
20
|
+
), S = p(
|
|
21
|
+
() => n.tags.findIndex((o) => !m[r(o)]) + 1
|
|
22
|
+
), u = (o) => n.layout !== "classic" && !z.value.startsWith("model") && o > S.value;
|
|
23
|
+
return (o, w) => (s(!0), f(y, null, v(o.tags, (t, d) => (s(), l(e(L), {
|
|
24
24
|
id: e(r)(t),
|
|
25
25
|
key: e(r)(t),
|
|
26
|
-
isLazy:
|
|
26
|
+
isLazy: u(d)
|
|
27
27
|
}, {
|
|
28
|
-
default:
|
|
29
|
-
(
|
|
28
|
+
default: i(() => [
|
|
29
|
+
(s(), l(T(k.value), {
|
|
30
30
|
id: e(r)(t),
|
|
31
|
-
spec:
|
|
31
|
+
spec: o.spec,
|
|
32
32
|
tag: t
|
|
33
33
|
}, {
|
|
34
|
-
default:
|
|
35
|
-
(
|
|
36
|
-
id: e(
|
|
37
|
-
key: `${
|
|
38
|
-
isLazy:
|
|
34
|
+
default: i(() => [
|
|
35
|
+
(s(!0), f(y, null, v(t.operations, (a, B) => (s(), l(e(L), {
|
|
36
|
+
id: e(c)(a, t),
|
|
37
|
+
key: `${a.httpVerb}-${a.operationId}`,
|
|
38
|
+
isLazy: u(d) || e(m)[e(r)(t)] && B > 0
|
|
39
39
|
}, {
|
|
40
|
-
default:
|
|
41
|
-
|
|
42
|
-
default:
|
|
43
|
-
|
|
44
|
-
id: e(
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
tag: t
|
|
51
|
-
}, null, 8, ["id", "layout", "operation", "requestExamples", "requests", "securitySchemes", "tag"])
|
|
40
|
+
default: i(() => [
|
|
41
|
+
_(e(b), null, {
|
|
42
|
+
default: i(() => [
|
|
43
|
+
_(e(A), {
|
|
44
|
+
id: e(c)(a, t),
|
|
45
|
+
collection: e(I),
|
|
46
|
+
layout: o.layout,
|
|
47
|
+
server: e(g),
|
|
48
|
+
transformedOperation: a
|
|
49
|
+
}, null, 8, ["id", "collection", "layout", "server", "transformedOperation"])
|
|
52
50
|
]),
|
|
53
51
|
_: 2
|
|
54
52
|
}, 1024)
|
|
@@ -64,5 +62,5 @@ const M = /* @__PURE__ */ x({
|
|
|
64
62
|
}
|
|
65
63
|
});
|
|
66
64
|
export {
|
|
67
|
-
|
|
65
|
+
K as default
|
|
68
66
|
};
|
|
@@ -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":"AA6VA,KAAK,WAAW,GAAG;IACjB,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE;QACJ,EAAE,EAAE,MAAM,CAAA;QACV,KAAK,EAAE,MAAM,CAAA;QACb,MAAM,CAAC,EAAE,MAAM,IAAI,CAAA;QACnB,IAAI,CAAC,EAAE,MAAM,CAAA;QACb,IAAI,CAAC,EAAE;YACL,GAAG,EAAE,MAAM,CAAA;SACZ,CAAA;QACD,QAAQ,CAAC,EAAE,MAAM,CAAA;QACjB,UAAU,CAAC,EAAE,OAAO,CAAA;KACrB,CAAA;IACD,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,IAAI,CAAC,EAAE,OAAO,CAAA;CACf,CAAC;AAgEF,iBAAS,cAAc;WAoKT,OAAO,IAA6B;;yBATpB,GAAG;+BACG,GAAG;;;;EAatC;AAeD,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 a = /* @__PURE__ */ t(o, [["__scopeId", "data-v-
|
|
4
|
+
const a = /* @__PURE__ */ t(o, [["__scopeId", "data-v-18e6dc3d"]]);
|
|
5
5
|
export {
|
|
6
6
|
a as default
|
|
7
7
|
};
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { defineComponent as $, openBlock as
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { scrollToId as
|
|
8
|
-
const
|
|
1
|
+
import { defineComponent as $, openBlock as n, createElementBlock as l, createElementVNode as a, normalizeClass as V, withModifiers as A, createVNode as g, unref as b, withCtx as E, createTextVNode as m, toDisplayString as h, createCommentVNode as s, createBlock as N, renderSlot as v } from "vue";
|
|
2
|
+
import { ScalarSidebarGroupToggle as T, ScalarIcon as O } from "@scalar/components";
|
|
3
|
+
import { combineUrlAndPath as U } from "@scalar/oas-utils/helpers";
|
|
4
|
+
import H from "./SidebarHttpBadge.vue.js";
|
|
5
|
+
import { sleep as k } from "../../helpers/sleep.js";
|
|
6
|
+
import { useNavState as I } from "../../hooks/useNavState.js";
|
|
7
|
+
import { scrollToId as P } from "../../helpers/scrollToId.js";
|
|
8
|
+
const D = ["id"], L = {
|
|
9
9
|
key: 0,
|
|
10
10
|
class: "sidebar-heading-chevron"
|
|
11
|
-
},
|
|
11
|
+
}, M = ["aria-expanded"], R = ["href", "tabindex"], z = { class: "sidebar-heading-link-title" }, F = {
|
|
12
12
|
key: 1,
|
|
13
13
|
class: "sidebar-heading-link-method"
|
|
14
|
-
},
|
|
14
|
+
}, G = {
|
|
15
15
|
key: 1,
|
|
16
16
|
class: "action-menu"
|
|
17
|
-
},
|
|
17
|
+
}, Y = /* @__PURE__ */ $({
|
|
18
18
|
__name: "SidebarElement",
|
|
19
19
|
props: {
|
|
20
20
|
id: {},
|
|
@@ -24,77 +24,81 @@ const R = ["id"], U = {
|
|
|
24
24
|
open: { type: Boolean }
|
|
25
25
|
},
|
|
26
26
|
emits: ["toggleOpen"],
|
|
27
|
-
setup(
|
|
28
|
-
const
|
|
29
|
-
var e,
|
|
30
|
-
|
|
31
|
-
},
|
|
27
|
+
setup(C, { emit: y }) {
|
|
28
|
+
const i = C, d = y, { getFullHash: c, isIntersectionEnabled: r, pathRouting: p, replaceUrlState: w } = I(), u = async () => {
|
|
29
|
+
var e, t;
|
|
30
|
+
i.hasChildren && d("toggleOpen"), (t = (e = i.item) == null ? void 0 : e.select) == null || t.call(e), i.open && (r.value = !1, await k(100), r.value = !0);
|
|
31
|
+
}, S = () => {
|
|
32
32
|
if (p.value)
|
|
33
|
-
return
|
|
33
|
+
return U(p.value.basePath, i.item.id);
|
|
34
34
|
if (typeof window < "u") {
|
|
35
35
|
const e = new URL(window.location.href);
|
|
36
|
-
return e.hash =
|
|
37
|
-
} else return `#${
|
|
38
|
-
},
|
|
39
|
-
var
|
|
40
|
-
p.value && (e.preventDefault(),
|
|
36
|
+
return e.hash = c(i.item.id), `${e.pathname}${e.search}${e.hash}`;
|
|
37
|
+
} else return `#${c(i.item.id)}`;
|
|
38
|
+
}, B = async (e) => {
|
|
39
|
+
var t, o;
|
|
40
|
+
p.value && (e.preventDefault(), i.hasChildren && d("toggleOpen"), (o = (t = i.item) == null ? void 0 : t.select) == null || o.call(t), d("toggleOpen"), r.value = !1, w(i.item.id), P(i.item.id), await k(100), r.value = !0);
|
|
41
41
|
};
|
|
42
|
-
return (e,
|
|
43
|
-
var
|
|
44
|
-
return
|
|
42
|
+
return (e, t) => {
|
|
43
|
+
var o, f;
|
|
44
|
+
return n(), l("li", {
|
|
45
45
|
id: e.id,
|
|
46
46
|
class: "sidebar-group-item"
|
|
47
47
|
}, [
|
|
48
|
-
|
|
49
|
-
class:
|
|
48
|
+
a("div", {
|
|
49
|
+
class: V(["sidebar-heading", {
|
|
50
50
|
"sidebar-group-item__folder": e.hasChildren,
|
|
51
51
|
active_page: e.isActive,
|
|
52
52
|
deprecated: e.item.deprecated ?? !1
|
|
53
53
|
}]),
|
|
54
|
-
onClick:
|
|
54
|
+
onClick: u
|
|
55
55
|
}, [
|
|
56
|
-
e.hasChildren ? (
|
|
57
|
-
|
|
56
|
+
e.hasChildren ? (n(), l("p", L, [
|
|
57
|
+
a("button", {
|
|
58
58
|
"aria-expanded": e.open,
|
|
59
59
|
class: "toggle-nested-icon",
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
60
|
+
type: "button",
|
|
61
|
+
onClick: A(u, ["stop"])
|
|
62
|
+
}, [
|
|
63
|
+
g(b(T), { open: e.open }, {
|
|
64
|
+
label: E(() => [
|
|
65
|
+
m(h(e.open ? "Collapse" : "Expand") + " " + h(e.item.title), 1)
|
|
66
|
+
]),
|
|
67
|
+
_: 1
|
|
68
|
+
}, 8, ["open"])
|
|
69
|
+
], 8, M),
|
|
70
|
+
t[0] || (t[0] = m(" "))
|
|
71
|
+
])) : s("", !0),
|
|
72
|
+
a("a", {
|
|
69
73
|
class: "sidebar-heading-link",
|
|
70
|
-
href:
|
|
74
|
+
href: S(),
|
|
71
75
|
tabindex: e.hasChildren ? -1 : 0,
|
|
72
|
-
onClick:
|
|
76
|
+
onClick: B
|
|
73
77
|
}, [
|
|
74
|
-
(
|
|
78
|
+
(f = (o = e.item) == null ? void 0 : o.icon) != null && f.src ? (n(), N(b(O), {
|
|
75
79
|
key: 0,
|
|
76
80
|
class: "sidebar-icon",
|
|
77
81
|
icon: e.item.icon.src
|
|
78
|
-
}, null, 8, ["icon"])) :
|
|
79
|
-
|
|
80
|
-
e.item.httpVerb && !e.hasChildren ? (
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
82
|
+
}, null, 8, ["icon"])) : s("", !0),
|
|
83
|
+
a("p", z, h(e.item.title), 1),
|
|
84
|
+
e.item.httpVerb && !e.hasChildren ? (n(), l("p", F, [
|
|
85
|
+
t[1] || (t[1] = m(" ")),
|
|
86
|
+
t[2] || (t[2] = a("span", { class: "sr-only" }, "HTTP Method: ", -1)),
|
|
87
|
+
g(H, {
|
|
84
88
|
active: e.isActive,
|
|
85
89
|
method: e.item.httpVerb
|
|
86
90
|
}, null, 8, ["active", "method"])
|
|
87
|
-
])) :
|
|
88
|
-
], 8,
|
|
91
|
+
])) : s("", !0)
|
|
92
|
+
], 8, R)
|
|
89
93
|
], 2),
|
|
90
|
-
e.open ? v(e.$slots, "default", { key: 0 }, void 0, !0) :
|
|
91
|
-
e.$slots["action-menu"] ? (
|
|
94
|
+
e.open ? v(e.$slots, "default", { key: 0 }, void 0, !0) : s("", !0),
|
|
95
|
+
e.$slots["action-menu"] ? (n(), l("div", G, [
|
|
92
96
|
v(e.$slots, "action-menu", {}, void 0, !0)
|
|
93
|
-
])) :
|
|
94
|
-
], 8,
|
|
97
|
+
])) : s("", !0)
|
|
98
|
+
], 8, D);
|
|
95
99
|
};
|
|
96
100
|
}
|
|
97
101
|
});
|
|
98
102
|
export {
|
|
99
|
-
|
|
103
|
+
Y as default
|
|
100
104
|
};
|