@scalar/api-reference 1.28.21 → 1.28.23
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 +28 -0
- package/dist/browser/standalone.js +6959 -6938
- package/dist/browser/webpack-stats.json +1 -1
- package/dist/components/Content/Schema/SchemaDiscriminator.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/SchemaDiscriminator.vue.js +2 -2
- package/dist/components/Content/Schema/SchemaDiscriminator.vue2.js +24 -24
- package/dist/features/ApiClientModal/ApiClientModal.vue.d.ts.map +1 -1
- package/dist/features/ApiClientModal/ApiClientModal.vue.js +27 -22
- package/dist/features/ExampleResponses/ExampleResponse.vue.js +1 -1
- package/dist/features/ExampleResponses/ExampleResponse.vue2.js +1 -1
- package/dist/features/Search/SearchButton.vue.d.ts.map +1 -1
- package/dist/features/Search/SearchButton.vue.js +2 -2
- package/dist/features/Search/SearchButton.vue2.js +30 -31
- package/dist/hooks/useMultipleDocuments.d.ts.map +1 -1
- package/dist/hooks/useMultipleDocuments.js +29 -27
- package/dist/index.js +1 -1
- package/dist/style.css +1 -1
- package/package.json +8 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SchemaDiscriminator.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Schema/SchemaDiscriminator.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SchemaDiscriminator.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Schema/SchemaDiscriminator.vue"],"names":[],"mappings":"AAiLA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAU9E,KAAK,WAAW,GAAG;IACjB,aAAa,EAAE,MAAM,CAAA;IACrB,OAAO,CAAC,EACJ,SAAS,CAAC,iBAAiB,GAC3B,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,YAAY,CAAC,GACtC,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,YAAY,CAAC,GACxC,OAAO,CAAA;IACX,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;;AAmOF,wBAOG"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./SchemaDiscriminator.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import r from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const i = /* @__PURE__ */ r(o, [["__scopeId", "data-v-0e658f97"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
i as default
|
|
7
7
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { defineComponent as O, ref as S, openBlock as a, createElementBlock as
|
|
2
|
-
import { TabGroup as T, TabList as
|
|
3
|
-
import { cva as
|
|
1
|
+
import { defineComponent as O, ref as S, openBlock as a, createElementBlock as i, createBlock as o, unref as r, withCtx as n, createVNode as u, createElementVNode as m, toDisplayString as d, Fragment as f, renderList as h, normalizeClass as B } from "vue";
|
|
2
|
+
import { TabGroup as T, TabList as w, Tab as H, TabPanel as N } from "@headlessui/vue";
|
|
3
|
+
import { cva as V, cx as j } from "@scalar/components";
|
|
4
4
|
import { stringify as v } from "flatted";
|
|
5
5
|
import { mergeAllOfSchemas as z } from "./helpers/merge-all-of-schemas.js";
|
|
6
6
|
import b from "./Schema.vue.js";
|
|
7
|
-
const L = { class: "property-rule" }, A = { class: "text-c-3" }, D = { class: "flex items-center gap-1.5" }, E = { class: "schema-tab-label z-1 relative" }, Z = /* @__PURE__ */ O({
|
|
7
|
+
const L = { class: "property-rule" }, A = { class: "text-c-3" }, D = { class: "custom-scroll flex items-center gap-1.5 !overflow-y-hidden" }, E = { class: "schema-tab-label z-1 relative" }, Z = /* @__PURE__ */ O({
|
|
8
8
|
__name: "SchemaDiscriminator",
|
|
9
9
|
props: {
|
|
10
10
|
discriminator: {},
|
|
@@ -16,7 +16,7 @@ const L = { class: "property-rule" }, A = { class: "text-c-3" }, D = { class: "f
|
|
|
16
16
|
hideHeading: { type: Boolean }
|
|
17
17
|
},
|
|
18
18
|
setup(y) {
|
|
19
|
-
const
|
|
19
|
+
const c = y, p = S(0), g = V({
|
|
20
20
|
base: "schema-tab",
|
|
21
21
|
variants: {
|
|
22
22
|
selected: {
|
|
@@ -29,31 +29,31 @@ const L = { class: "property-rule" }, A = { class: "text-c-3" }, D = { class: "f
|
|
|
29
29
|
return null;
|
|
30
30
|
if (e.name)
|
|
31
31
|
return e.name;
|
|
32
|
-
if (
|
|
33
|
-
for (const [s,
|
|
34
|
-
if (v(
|
|
32
|
+
if (c.schemas && typeof c.schemas == "object") {
|
|
33
|
+
for (const [s, l] of Object.entries(c.schemas))
|
|
34
|
+
if (v(l) === v(e))
|
|
35
35
|
return s;
|
|
36
36
|
return Object.keys(e)[0];
|
|
37
37
|
}
|
|
38
38
|
return null;
|
|
39
39
|
}, C = (e) => e.replace(/([A-Z])/g, " $1").replace(/^./, (s) => s.toUpperCase()).toLowerCase().replace(/^(\w)/, (s) => s.toUpperCase());
|
|
40
|
-
return (e, s) => (a(),
|
|
41
|
-
e.discriminator === "oneOf" || e.discriminator === "anyOf" ? (a(),
|
|
42
|
-
default:
|
|
43
|
-
u(r(
|
|
44
|
-
default:
|
|
40
|
+
return (e, s) => (a(), i("div", L, [
|
|
41
|
+
e.discriminator === "oneOf" || e.discriminator === "anyOf" ? (a(), o(r(T), { key: 0 }, {
|
|
42
|
+
default: n(() => [
|
|
43
|
+
u(r(w), { class: "discriminator-tab-list py-1.25 flex flex-col gap-1 rounded-t-lg border border-b-0 px-2 pr-3" }, {
|
|
44
|
+
default: n(() => [
|
|
45
45
|
m("span", A, d(C(e.discriminator)), 1),
|
|
46
46
|
m("div", D, [
|
|
47
|
-
(a(!0),
|
|
48
|
-
key:
|
|
47
|
+
(a(!0), i(f, null, h(e.value[e.discriminator], (l, t) => (a(), o(r(H), {
|
|
48
|
+
key: t,
|
|
49
49
|
class: B([
|
|
50
50
|
"cursor-pointer",
|
|
51
|
-
r(
|
|
51
|
+
r(j)(r(g)({ selected: p.value === t }))
|
|
52
52
|
]),
|
|
53
|
-
onClick: (F) => p.value =
|
|
53
|
+
onClick: (F) => p.value = t
|
|
54
54
|
}, {
|
|
55
|
-
default:
|
|
56
|
-
m("span", E, d(k(
|
|
55
|
+
default: n(() => [
|
|
56
|
+
m("span", E, d(k(l) || "Schema"), 1)
|
|
57
57
|
]),
|
|
58
58
|
_: 2
|
|
59
59
|
}, 1032, ["class", "onClick"]))), 128))
|
|
@@ -61,25 +61,25 @@ const L = { class: "property-rule" }, A = { class: "text-c-3" }, D = { class: "f
|
|
|
61
61
|
]),
|
|
62
62
|
_: 1
|
|
63
63
|
}),
|
|
64
|
-
(a(!0),
|
|
65
|
-
key:
|
|
64
|
+
(a(!0), i(f, null, h(e.value[e.discriminator], (l, t) => (a(), o(r(N), {
|
|
65
|
+
key: t,
|
|
66
66
|
class: "discriminator-panel"
|
|
67
67
|
}, {
|
|
68
|
-
default:
|
|
68
|
+
default: n(() => [
|
|
69
69
|
u(b, {
|
|
70
70
|
compact: e.compact,
|
|
71
71
|
hideHeading: e.hideHeading,
|
|
72
72
|
name: e.name,
|
|
73
73
|
noncollapsible: !0,
|
|
74
74
|
schemas: e.schemas,
|
|
75
|
-
value:
|
|
75
|
+
value: l
|
|
76
76
|
}, null, 8, ["compact", "hideHeading", "name", "schemas", "value"])
|
|
77
77
|
]),
|
|
78
78
|
_: 2
|
|
79
79
|
}, 1024))), 128))
|
|
80
80
|
]),
|
|
81
81
|
_: 1
|
|
82
|
-
})) : (a(),
|
|
82
|
+
})) : (a(), o(b, {
|
|
83
83
|
key: 1,
|
|
84
84
|
compact: e.compact,
|
|
85
85
|
level: e.level,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ApiClientModal.vue.d.ts","sourceRoot":"","sources":["../../../src/features/ApiClientModal/ApiClientModal.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ApiClientModal.vue.d.ts","sourceRoot":"","sources":["../../../src/features/ApiClientModal/ApiClientModal.vue"],"names":[],"mappings":"AA8EA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAA;AAWzE,KAAK,WAAW,GAAG;IACjB,aAAa,EAAE,OAAO,CAAC,sBAAsB,CAAC,CAAA;CAC/C,CAAC;;AAgHF,wBAOG"}
|
|
@@ -1,42 +1,47 @@
|
|
|
1
|
-
import { defineComponent as m, ref as p, onMounted as
|
|
1
|
+
import { defineComponent as m, ref as p, onMounted as d, watch as v, onBeforeUnmount as g, openBlock as h, createElementBlock as x } from "vue";
|
|
2
2
|
import { useWorkspace as E } from "@scalar/api-client/store";
|
|
3
|
-
import { watchDebounced as
|
|
3
|
+
import { watchDebounced as _ } from "@vueuse/core";
|
|
4
4
|
import { useApiClient as k } from "./useApiClient.js";
|
|
5
|
-
import { useNavState as
|
|
6
|
-
import { useExampleStore as
|
|
7
|
-
const
|
|
5
|
+
import { useNavState as y } from "../../hooks/useNavState.js";
|
|
6
|
+
import { useExampleStore as S } from "../../legacy/stores/useExampleStore.js";
|
|
7
|
+
const M = /* @__PURE__ */ m({
|
|
8
8
|
__name: "ApiClientModal",
|
|
9
9
|
props: {
|
|
10
10
|
configuration: {}
|
|
11
11
|
},
|
|
12
|
-
setup(
|
|
13
|
-
const o = p(null), { client: t, init:
|
|
14
|
-
return
|
|
15
|
-
o.value &&
|
|
12
|
+
setup(n) {
|
|
13
|
+
const o = p(null), { client: t, init: c } = k(), { selectedExampleKey: s, operationId: r } = S(), f = E(), { isIntersectionEnabled: a } = y();
|
|
14
|
+
return d(() => {
|
|
15
|
+
o.value && c({
|
|
16
16
|
el: o.value,
|
|
17
|
-
configuration:
|
|
18
|
-
store:
|
|
17
|
+
configuration: n.configuration,
|
|
18
|
+
store: f
|
|
19
19
|
});
|
|
20
|
-
}),
|
|
21
|
-
() =>
|
|
22
|
-
(e) => {
|
|
23
|
-
var
|
|
24
|
-
|
|
25
|
-
|
|
20
|
+
}), _(
|
|
21
|
+
() => n.configuration,
|
|
22
|
+
(e, u) => {
|
|
23
|
+
var l;
|
|
24
|
+
let i = !0;
|
|
25
|
+
try {
|
|
26
|
+
i = JSON.stringify(e) !== JSON.stringify(u);
|
|
27
|
+
} catch {
|
|
28
|
+
}
|
|
29
|
+
e && i && (a.value = !1, (l = t.value) == null || l.updateConfig(e), setTimeout(() => {
|
|
30
|
+
a.value = !0;
|
|
26
31
|
}, 1e3));
|
|
27
32
|
},
|
|
28
33
|
{ deep: !0, debounce: 300 }
|
|
29
|
-
), s
|
|
30
|
-
t.value && e &&
|
|
31
|
-
}),
|
|
34
|
+
), v(s, (e) => {
|
|
35
|
+
t.value && e && r.value && t.value.updateExample(e, r.value);
|
|
36
|
+
}), g(() => {
|
|
32
37
|
var e;
|
|
33
38
|
return (e = t.value) == null ? void 0 : e.app.unmount();
|
|
34
|
-
}), (e,
|
|
39
|
+
}), (e, u) => (h(), x("div", {
|
|
35
40
|
ref_key: "el",
|
|
36
41
|
ref: o
|
|
37
42
|
}, null, 512));
|
|
38
43
|
}
|
|
39
44
|
});
|
|
40
45
|
export {
|
|
41
|
-
|
|
46
|
+
M as default
|
|
42
47
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./ExampleResponse.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import p from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const m = /* @__PURE__ */ p(o, [["__scopeId", "data-v-
|
|
4
|
+
const m = /* @__PURE__ */ p(o, [["__scopeId", "data-v-8261a319"]]);
|
|
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":"AAwJA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;AAShD,KAAK,WAAW,GAAG;IACf,IAAI,EAAE,IAAI,CAAA;IACV,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB,CAAC;;kBADe,MAAM;;AAsJzB,wBAOG"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./SearchButton.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const c = /* @__PURE__ */ t(o, [["__scopeId", "data-v-4c6e9e93"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
c as default
|
|
7
7
|
};
|
|
@@ -1,73 +1,72 @@
|
|
|
1
|
-
import { defineComponent as S, ref as b, watch as w, nextTick as v, onMounted as K, onBeforeUnmount as
|
|
2
|
-
import { useModal as
|
|
3
|
-
import
|
|
1
|
+
import { defineComponent as S, ref as b, watch as w, nextTick as v, onMounted as K, onBeforeUnmount as g, openBlock as a, createElementBlock as n, Fragment as r, createElementVNode as s, normalizeClass as C, createVNode as p, unref as l, createTextVNode as u, toDisplayString as M } from "vue";
|
|
2
|
+
import { useModal as B } from "@scalar/components";
|
|
3
|
+
import { ScalarIconMagnifyingGlass as E } from "@scalar/icons";
|
|
4
|
+
import H from "./SearchModal.vue.js";
|
|
4
5
|
import { isMacOs as m } from "../../helpers/isMacOs.js";
|
|
5
6
|
import { useApiClient as L } from "../ApiClientModal/useApiClient.js";
|
|
6
|
-
const N = { class: "sidebar-search-input" }, T = { class: "sidebar-search-shortcut" }, V = { class: "sidebar-search-key" },
|
|
7
|
+
const N = { class: "sidebar-search-input" }, T = { class: "sidebar-search-shortcut" }, V = { class: "sidebar-search-key" }, G = /* @__PURE__ */ S({
|
|
7
8
|
__name: "SearchButton",
|
|
8
9
|
props: {
|
|
9
10
|
spec: {},
|
|
10
11
|
searchHotKey: { default: "k" }
|
|
11
12
|
},
|
|
12
|
-
setup(
|
|
13
|
-
const
|
|
13
|
+
setup(f) {
|
|
14
|
+
const h = f, i = b(), t = B(), { client: y } = L(), d = (o) => {
|
|
14
15
|
var e;
|
|
15
|
-
(m() ?
|
|
16
|
+
(m() ? o.metaKey : o.ctrlKey) && o.key === h.searchHotKey && !((e = y.value) != null && e.modalState.open) && (o.preventDefault(), o.stopPropagation(), t.open ? t.hide() : t.show());
|
|
16
17
|
};
|
|
17
18
|
w(
|
|
18
19
|
() => t.open,
|
|
19
|
-
(
|
|
20
|
-
!
|
|
21
|
-
var
|
|
22
|
-
(
|
|
20
|
+
(o, e) => {
|
|
21
|
+
!o && e && v(() => {
|
|
22
|
+
var c;
|
|
23
|
+
(c = i.value) == null || c.focus();
|
|
23
24
|
});
|
|
24
25
|
}
|
|
25
|
-
), K(() => window.addEventListener("keydown",
|
|
26
|
+
), K(() => window.addEventListener("keydown", d)), g(() => window.removeEventListener("keydown", d));
|
|
26
27
|
function k() {
|
|
27
28
|
t.show();
|
|
28
29
|
}
|
|
29
|
-
return (
|
|
30
|
-
|
|
30
|
+
return (o, e) => (a(), n(r, null, [
|
|
31
|
+
s("button", {
|
|
31
32
|
ref_key: "button",
|
|
32
33
|
ref: i,
|
|
33
|
-
class:
|
|
34
|
+
class: C(["sidebar-search", o.$attrs.class]),
|
|
34
35
|
role: "search",
|
|
35
36
|
type: "button",
|
|
36
37
|
onClick: k
|
|
37
38
|
}, [
|
|
38
|
-
p(l(
|
|
39
|
+
p(l(E), {
|
|
39
40
|
class: "scalar-search-icon",
|
|
40
|
-
|
|
41
|
-
size: "sm",
|
|
42
|
-
thickness: "2.5"
|
|
41
|
+
weight: "bold"
|
|
43
42
|
}),
|
|
44
|
-
|
|
45
|
-
e[3] || (e[3] =
|
|
46
|
-
e[4] || (e[4] =
|
|
43
|
+
s("div", N, [
|
|
44
|
+
e[3] || (e[3] = s("span", { class: "sr-only" }, "Open Search", -1)),
|
|
45
|
+
e[4] || (e[4] = s("span", {
|
|
47
46
|
"aria-hidden": "true",
|
|
48
47
|
class: "sidebar-search-placeholder"
|
|
49
48
|
}, " Search ", -1)),
|
|
50
|
-
|
|
51
|
-
e[2] || (e[2] =
|
|
52
|
-
|
|
49
|
+
s("span", T, [
|
|
50
|
+
e[2] || (e[2] = s("span", { class: "sr-only" }, "Keyboard Shortcut:", -1)),
|
|
51
|
+
s("kbd", V, [
|
|
53
52
|
l(m)() ? (a(), n(r, { key: 0 }, [
|
|
54
53
|
u("⌘")
|
|
55
54
|
], 64)) : (a(), n(r, { key: 1 }, [
|
|
56
|
-
e[0] || (e[0] =
|
|
57
|
-
e[1] || (e[1] =
|
|
55
|
+
e[0] || (e[0] = s("span", { class: "sr-only" }, "CTRL", -1)),
|
|
56
|
+
e[1] || (e[1] = s("span", { "aria-hidden": "true" }, "⌃", -1))
|
|
58
57
|
], 64)),
|
|
59
|
-
u(" " +
|
|
58
|
+
u(" " + M(o.searchHotKey), 1)
|
|
60
59
|
])
|
|
61
60
|
])
|
|
62
61
|
])
|
|
63
62
|
], 2),
|
|
64
|
-
p(
|
|
63
|
+
p(H, {
|
|
65
64
|
modalState: l(t),
|
|
66
|
-
parsedSpec:
|
|
65
|
+
parsedSpec: o.spec
|
|
67
66
|
}, null, 8, ["modalState", "parsedSpec"])
|
|
68
67
|
], 64));
|
|
69
68
|
}
|
|
70
69
|
});
|
|
71
70
|
export {
|
|
72
|
-
|
|
71
|
+
G as default
|
|
73
72
|
};
|
|
@@ -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;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
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;;;;;;;;;;;;;;;;;;;;;;;;;0CAmIgooB,GAAI;oBAAuF,GAAG;;;;yBAAiH,CAAC;;;;;;;;;;;;;yCAAymB,GAAI;2CAA6E,GAAI;6BAAgE,GAAG;qBAAwE,GAAG;uCAAyF,GAAI;2CAA6F,GAAI;;;;;gBAA0K,CAAC;WAA4B,GAAI;;gBAAyF,CAAC;WAA4B,GAAI;;gBAAuF,CAAC;WAA4B,GAAI;;;;uBAAkJ,CAAC;mBAAqC,CAAC;WAA4B,GAAI;;;kBAAmH,CAAC;WAA4B,GAAI;qCAAyE,GAAI;;2DAAgK,GAAI;4EAAgH,GAAI;;;uDApLl9sB,GAAG;;;;;;;;;mDAAH,GAAG;;;;;;;;CAmLrD,CAAA"}
|
|
@@ -1,45 +1,45 @@
|
|
|
1
|
-
import { isDefined as
|
|
1
|
+
import { isDefined as S } from "@scalar/oas-utils/helpers";
|
|
2
2
|
import { isConfigurationWithSources as y } from "@scalar/types/api-reference";
|
|
3
|
-
import
|
|
4
|
-
import { computed as
|
|
5
|
-
const w = "api",
|
|
3
|
+
import R from "github-slugger";
|
|
4
|
+
import { computed as g, ref as b, watch as A } from "vue";
|
|
5
|
+
const w = "api", h = new R(), C = (t) => t ? (Array.isArray(t) ? t : [t]).flatMap((u) => {
|
|
6
6
|
if (y(u)) {
|
|
7
|
-
const { sources:
|
|
8
|
-
return (
|
|
7
|
+
const { sources: s, ...r } = u;
|
|
8
|
+
return (s == null ? void 0 : s.map((m) => ({ ...r, ...m }))) ?? [];
|
|
9
9
|
}
|
|
10
10
|
return [u];
|
|
11
|
-
}).map((u,
|
|
11
|
+
}).map((u, s) => u && I(u, s)).filter(S) : [], I = (t, a = 0) => {
|
|
12
12
|
const e = {
|
|
13
13
|
...t,
|
|
14
14
|
// @ts-expect-error this is before parsing so we transform the old style
|
|
15
15
|
...t.spec ?? {}
|
|
16
16
|
};
|
|
17
17
|
if (!(!(e != null && e.url) && !(e != null && e.content)))
|
|
18
|
-
return
|
|
18
|
+
return h.reset(), e.title ? {
|
|
19
19
|
...e,
|
|
20
|
-
slug: e.slug ||
|
|
20
|
+
slug: e.slug || h.slug(e.title),
|
|
21
21
|
title: e.title
|
|
22
22
|
} : e.slug ? {
|
|
23
23
|
...e,
|
|
24
24
|
title: e.slug
|
|
25
25
|
} : {
|
|
26
26
|
...e,
|
|
27
|
-
slug: `api-${
|
|
28
|
-
title: `API #${
|
|
27
|
+
slug: `api-${a + 1}`,
|
|
28
|
+
title: `API #${a + 1}`
|
|
29
29
|
};
|
|
30
|
-
},
|
|
30
|
+
}, T = ({
|
|
31
31
|
configuration: t,
|
|
32
|
-
initialIndex:
|
|
32
|
+
initialIndex: a,
|
|
33
33
|
isIntersectionEnabled: e,
|
|
34
34
|
hash: u,
|
|
35
|
-
hashPrefix:
|
|
35
|
+
hashPrefix: s
|
|
36
36
|
}) => {
|
|
37
|
-
const r =
|
|
37
|
+
const r = g(() => C(t.value)), f = b((() => {
|
|
38
38
|
if (typeof window > "u")
|
|
39
|
-
return typeof
|
|
39
|
+
return typeof a == "number" ? a : 0;
|
|
40
40
|
const n = new URL(window.location.href).searchParams.get(w);
|
|
41
41
|
if (n) {
|
|
42
|
-
const o = r.value.findIndex((
|
|
42
|
+
const o = r.value.findIndex((p) => p.slug === n);
|
|
43
43
|
if (o !== -1)
|
|
44
44
|
return o;
|
|
45
45
|
const i = Number.parseInt(n, 10);
|
|
@@ -47,8 +47,8 @@ const w = "api", g = new S(), C = (t) => t ? (Array.isArray(t) ? t : [t]).flatMa
|
|
|
47
47
|
return i;
|
|
48
48
|
}
|
|
49
49
|
const l = r.value.findIndex((o) => "default" in o && o.default === !0);
|
|
50
|
-
return l !== -1 ? l : typeof
|
|
51
|
-
})()),
|
|
50
|
+
return l !== -1 ? l : typeof a == "number" ? a : 0;
|
|
51
|
+
})()), c = g(() => {
|
|
52
52
|
var n, l;
|
|
53
53
|
return t.value && y(t.value) ? {
|
|
54
54
|
...t.value,
|
|
@@ -59,26 +59,28 @@ const w = "api", g = new S(), C = (t) => t ? (Array.isArray(t) ? t : [t]).flatMa
|
|
|
59
59
|
...r.value[f.value]
|
|
60
60
|
};
|
|
61
61
|
});
|
|
62
|
-
return
|
|
62
|
+
return A(
|
|
63
63
|
f,
|
|
64
|
-
(
|
|
65
|
-
var i,
|
|
64
|
+
(d) => {
|
|
65
|
+
var i, p, v;
|
|
66
66
|
if (typeof window > "u" || r.value.length === 1)
|
|
67
67
|
return;
|
|
68
|
-
const n = new URL(window.location.href), l = r.value[
|
|
69
|
-
|
|
68
|
+
const n = new URL(window.location.href), l = r.value[d];
|
|
69
|
+
c.value.pathRouting && (n.pathname = ((i = c.value.pathRouting) == null ? void 0 : i.basePath) ?? "");
|
|
70
|
+
const o = (l == null ? void 0 : l.slug) ?? d.toString();
|
|
71
|
+
n.searchParams.set(w, o), n.hash = "", window.history.replaceState({}, "", n.toString()), u.value = "", s.value = "", e.value = !1, typeof window < "u" && window.scrollTo({ top: 0, behavior: "instant" }), (v = (p = c.value).onDocumentSelect) == null || v.call(p);
|
|
70
72
|
},
|
|
71
73
|
{ flush: "sync" }
|
|
72
74
|
), {
|
|
73
|
-
selectedConfiguration:
|
|
75
|
+
selectedConfiguration: c,
|
|
74
76
|
availableDocuments: r,
|
|
75
77
|
selectedDocumentIndex: f,
|
|
76
78
|
isIntersectionEnabled: e,
|
|
77
79
|
hash: u,
|
|
78
|
-
hashPrefix:
|
|
80
|
+
hashPrefix: s
|
|
79
81
|
};
|
|
80
82
|
};
|
|
81
83
|
export {
|
|
82
84
|
C as normalizeConfigurations,
|
|
83
|
-
|
|
85
|
+
T as useMultipleDocuments
|
|
84
86
|
};
|