@scalar/api-reference 1.24.68 → 1.24.69
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 +10 -0
- package/dist/browser/standalone.js +363 -359
- package/dist/browser/webpack-stats.json +1 -1
- package/dist/components/ApiClientModal.vue.d.ts +3 -1
- package/dist/components/ApiClientModal.vue.d.ts.map +1 -1
- package/dist/components/ApiClientModal.vue.js +20 -18
- package/dist/components/ApiReferenceLayout.vue.d.ts.map +1 -1
- package/dist/components/ApiReferenceLayout.vue.js +2 -2
- package/dist/components/ApiReferenceLayout.vue2.js +35 -34
- package/dist/index.js +1 -1
- package/dist/style.css +1 -1
- package/package.json +7 -7
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import type { SpecConfiguration } from '@scalar/oas-utils';
|
|
1
|
+
import type { Spec, SpecConfiguration } from '@scalar/oas-utils';
|
|
2
2
|
declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<{
|
|
3
3
|
proxyUrl?: string;
|
|
4
4
|
spec?: SpecConfiguration;
|
|
5
|
+
servers?: Spec["servers"];
|
|
5
6
|
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<{
|
|
6
7
|
proxyUrl?: string;
|
|
7
8
|
spec?: SpecConfiguration;
|
|
9
|
+
servers?: Spec["servers"];
|
|
8
10
|
}>>>, {}, {}>;
|
|
9
11
|
export default _default;
|
|
10
12
|
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ApiClientModal.vue.d.ts","sourceRoot":"","sources":["../../src/components/ApiClientModal.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ApiClientModal.vue.d.ts","sourceRoot":"","sources":["../../src/components/ApiClientModal.vue"],"names":[],"mappings":"AAiFA,OAAO,KAAK,EAAE,IAAI,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;;eAQnD,MAAM;WACV,iBAAiB;cACd,IAAI,CAAC,SAAS,CAAC;;eAFd,MAAM;WACV,iBAAiB;cACd,IAAI,CAAC,SAAS,CAAC;;AA8F3B,wBAMG;AAOH,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AAC5D,KAAK,uBAAuB,CAAC,CAAC,IAAI;KAChC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GACpC;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAC9D;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CACzD,CAAC"}
|
|
@@ -1,40 +1,42 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as S, ref as l, onMounted as U, watch as _, onBeforeUnmount as h, openBlock as x, createElementBlock as y } from "vue";
|
|
2
2
|
import { modalStateBus as B, apiClientBus as A } from "./api-client-bus.js";
|
|
3
3
|
import { getUrlFromServerState as C } from "../legacy/helpers/getUrlFromServerState.js";
|
|
4
4
|
import { useAuthenticationStore as k } from "../legacy/stores/useAuthenticationStore.js";
|
|
5
5
|
import { useServerStore as M } from "../legacy/stores/useServerStore.js";
|
|
6
|
-
const b = /* @__PURE__ */
|
|
6
|
+
const b = /* @__PURE__ */ S({
|
|
7
7
|
__name: "ApiClientModal",
|
|
8
8
|
props: {
|
|
9
9
|
proxyUrl: {},
|
|
10
|
-
spec: {}
|
|
10
|
+
spec: {},
|
|
11
|
+
servers: {}
|
|
11
12
|
},
|
|
12
|
-
setup(
|
|
13
|
-
const
|
|
13
|
+
setup(u) {
|
|
14
|
+
const t = u, o = l(null), p = l(null), { authentication: c } = k(), { server: i } = M();
|
|
14
15
|
return U(async () => {
|
|
15
|
-
if (!
|
|
16
|
-
const { createApiClientModal:
|
|
17
|
-
spec:
|
|
18
|
-
proxyUrl:
|
|
16
|
+
if (!o.value) return;
|
|
17
|
+
const { createApiClientModal: r } = await import("@scalar/api-client"), { app: n, open: m, updateAuth: f, updateServerUrl: d, modalState: v, updateSpec: a } = await r(o.value, {
|
|
18
|
+
spec: t.spec ?? {},
|
|
19
|
+
proxyUrl: t.proxyUrl,
|
|
20
|
+
servers: t.servers
|
|
19
21
|
});
|
|
20
|
-
B.emit(
|
|
22
|
+
B.emit(v), A.on((e) => {
|
|
21
23
|
if (e.open) {
|
|
22
|
-
f(
|
|
23
|
-
const
|
|
24
|
-
|
|
24
|
+
f(c);
|
|
25
|
+
const s = C(i);
|
|
26
|
+
s && d(s), m(e.open);
|
|
25
27
|
}
|
|
26
28
|
e.updateSpec && a(e.updateSpec);
|
|
27
29
|
}), _(
|
|
28
|
-
() =>
|
|
30
|
+
() => t.spec,
|
|
29
31
|
(e) => e && a(e),
|
|
30
32
|
{ deep: !0 }
|
|
31
33
|
), p.value = n;
|
|
32
34
|
}), h(() => {
|
|
33
|
-
var
|
|
34
|
-
return (
|
|
35
|
-
}), (
|
|
35
|
+
var r;
|
|
36
|
+
return (r = p.value) == null ? void 0 : r.unmount();
|
|
37
|
+
}), (r, n) => (x(), y("div", {
|
|
36
38
|
ref_key: "el",
|
|
37
|
-
ref:
|
|
39
|
+
ref: o
|
|
38
40
|
}, null, 512));
|
|
39
41
|
}
|
|
40
42
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ApiReferenceLayout.vue.d.ts","sourceRoot":"","sources":["../../src/components/ApiReferenceLayout.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ApiReferenceLayout.vue.d.ts","sour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AAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAC9D;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CACzD,CAAC"}
|
|
@@ -2,7 +2,7 @@ import o from "./ApiReferenceLayout.vue2.js";
|
|
|
2
2
|
/* empty css */
|
|
3
3
|
/* empty css */
|
|
4
4
|
import t from "../_virtual/_plugin-vue_export-helper.js";
|
|
5
|
-
const
|
|
5
|
+
const a = /* @__PURE__ */ t(o, [["__scopeId", "data-v-9058c8d1"]]);
|
|
6
6
|
export {
|
|
7
|
-
|
|
7
|
+
a as default
|
|
8
8
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as Z, ref as w, onMounted as D, onBeforeMount as F, computed as y, watch as _, onServerPrefetch as x, useSSRContext as ee, getCurrentInstance as
|
|
1
|
+
import { defineComponent as Z, ref as w, onMounted as D, onBeforeMount as F, computed as y, watch as _, onServerPrefetch as x, useSSRContext as ee, getCurrentInstance as oe, provide as M, openBlock as v, createElementBlock as S, Fragment as P, createElementVNode as i, normalizeClass as te, unref as u, normalizeStyle as re, renderSlot as l, normalizeProps as d, guardReactiveProps as c, createVNode as f, withCtx as g, createCommentVNode as T, withDirectives as ae, vShow as ne, createSlots as se } from "vue";
|
|
2
2
|
import { provideUseId as ie } from "@headlessui/vue";
|
|
3
3
|
import { addScalarClassesToHeadless as le } from "@scalar/components";
|
|
4
4
|
import { defaultStateFactory as U } from "@scalar/oas-utils/helpers";
|
|
@@ -23,7 +23,7 @@ const Le = ["innerHTML"], Ee = { class: "references-header" }, ke = {
|
|
|
23
23
|
}, Oe = { class: "references-navigation-list" }, Be = { class: "references-editor" }, De = { class: "references-editor-textarea" }, Fe = { class: "references-rendered" }, Me = {
|
|
24
24
|
key: 0,
|
|
25
25
|
class: "references-footer"
|
|
26
|
-
},
|
|
26
|
+
}, eo = /* @__PURE__ */ Z({
|
|
27
27
|
inheritAttrs: !1,
|
|
28
28
|
__name: "ApiReferenceLayout",
|
|
29
29
|
props: {
|
|
@@ -33,7 +33,7 @@ const Le = ["innerHTML"], Ee = { class: "references-header" }, ke = {
|
|
|
33
33
|
},
|
|
34
34
|
emits: ["changeTheme", "updateContent", "loadSwaggerFile", "linkSwaggerFile", "toggleDarkMode"],
|
|
35
35
|
setup(H) {
|
|
36
|
-
const
|
|
36
|
+
const t = H, { initializeToasts: N, toast: z } = ce();
|
|
37
37
|
N((e) => z(e));
|
|
38
38
|
const Y = pe("(min-width: 1150px)"), V = w("100dvh"), p = w(null);
|
|
39
39
|
fe(p, (e) => {
|
|
@@ -42,9 +42,9 @@ const Le = ["innerHTML"], Ee = { class: "references-header" }, ke = {
|
|
|
42
42
|
const R = w(0);
|
|
43
43
|
D(() => {
|
|
44
44
|
var r, a, n;
|
|
45
|
-
const e = (a = (r = p.value) == null ? void 0 : r.parentElement) == null ? void 0 : a.getBoundingClientRect(),
|
|
46
|
-
if (e &&
|
|
47
|
-
const B =
|
|
45
|
+
const e = (a = (r = p.value) == null ? void 0 : r.parentElement) == null ? void 0 : a.getBoundingClientRect(), o = (n = p.value) == null ? void 0 : n.getBoundingClientRect();
|
|
46
|
+
if (e && o) {
|
|
47
|
+
const B = o.top - e.top;
|
|
48
48
|
R.value = B < 2 ? 0 : B;
|
|
49
49
|
}
|
|
50
50
|
});
|
|
@@ -65,31 +65,31 @@ const Le = ["innerHTML"], Ee = { class: "references-header" }, ke = {
|
|
|
65
65
|
pathRouting: L,
|
|
66
66
|
updateHash: E
|
|
67
67
|
} = Ce();
|
|
68
|
-
L.value =
|
|
68
|
+
L.value = t.configuration.pathRouting, F(() => E());
|
|
69
69
|
const k = async (e) => {
|
|
70
|
-
var
|
|
71
|
-
I.value = !1, E(), e ? (b(e) !== e && (h(b(e), !0), await A(100)), Ie(e)) : (
|
|
70
|
+
var o;
|
|
71
|
+
I.value = !1, E(), e ? (b(e) !== e && (h(b(e), !0), await A(100)), Ie(e)) : (o = p.value) == null || o.scrollTo(0, 0), await A(100), I.value = !0;
|
|
72
72
|
};
|
|
73
73
|
F(() => le()), D(() => {
|
|
74
74
|
Se.on(({ specTitle: e }) => {
|
|
75
|
-
he(
|
|
75
|
+
he(t.rawSpec, e);
|
|
76
76
|
}), window.onhashchange = () => k(decodeURIComponent(window.location.hash.replace(/^#/, ""))), window.onpopstate = () => L.value && k($(window.location.pathname));
|
|
77
77
|
});
|
|
78
78
|
const J = y(
|
|
79
|
-
() => Y.value || !
|
|
79
|
+
() => Y.value || !t.configuration.isEditable
|
|
80
80
|
), O = ge((e) => {
|
|
81
81
|
if ((e.target.scrollTop ?? 0) < 50) {
|
|
82
|
-
const r =
|
|
82
|
+
const r = t.configuration.pathRouting ? t.configuration.pathRouting.basePath : window.location.pathname;
|
|
83
83
|
window.history.replaceState({}, "", r + window.location.search), C.value = "";
|
|
84
84
|
}
|
|
85
85
|
}), s = y(() => ({
|
|
86
86
|
breadcrumb: G.value,
|
|
87
|
-
spec:
|
|
87
|
+
spec: t.parsedSpec
|
|
88
88
|
}));
|
|
89
|
-
_(() =>
|
|
90
|
-
var
|
|
89
|
+
_(() => t.parsedSpec, Q, { deep: !0 }), x(() => {
|
|
90
|
+
var o, r;
|
|
91
91
|
const e = ee();
|
|
92
|
-
if (e && (e.payload || (e.payload = { data: U() }), (
|
|
92
|
+
if (e && (e.payload || (e.payload = { data: U() }), (o = e.payload).data || (o.data = U()), t.configuration.pathRouting)) {
|
|
93
93
|
const a = $(e.url);
|
|
94
94
|
C.value = a, e.payload.data.hash = a;
|
|
95
95
|
for (const n in m)
|
|
@@ -97,35 +97,35 @@ const Le = ["innerHTML"], Ee = { class: "references-header" }, ke = {
|
|
|
97
97
|
if (a)
|
|
98
98
|
h(b(a), !0);
|
|
99
99
|
else {
|
|
100
|
-
const n = (r =
|
|
100
|
+
const n = (r = t.parsedSpec.tags) == null ? void 0 : r[0];
|
|
101
101
|
n && h(q(n), !0);
|
|
102
102
|
}
|
|
103
103
|
e.payload.data["useSidebarContent-collapsedSidebarItems"] = m;
|
|
104
104
|
}
|
|
105
105
|
}), ie(() => {
|
|
106
106
|
var a;
|
|
107
|
-
const e =
|
|
108
|
-
if (!e) return
|
|
107
|
+
const e = oe(), o = "scalar-instance-id";
|
|
108
|
+
if (!e) return o;
|
|
109
109
|
let r = e.uid;
|
|
110
|
-
return typeof window > "u" ? (e.attrs || (e.attrs = {}), e.attrs[
|
|
111
|
-
}), M(Re, () =>
|
|
110
|
+
return typeof window > "u" ? (e.attrs || (e.attrs = {}), e.attrs[o] = r) : (a = e.vnode.el) != null && a.getAttribute && (r = e.vnode.el.getAttribute(o)), `${o}-${r}`;
|
|
111
|
+
}), M(Re, () => t.parsedSpec.security), M(
|
|
112
112
|
$e,
|
|
113
|
-
() =>
|
|
114
|
-
), j.value =
|
|
113
|
+
() => t.configuration.hideDownloadButton
|
|
114
|
+
), j.value = t.configuration.hideModels ?? !1, K.value = t.configuration.defaultOpenAllTags ?? !1, be(t.configuration);
|
|
115
115
|
const X = y(
|
|
116
116
|
() => `<style>
|
|
117
|
-
${de(
|
|
118
|
-
fonts:
|
|
117
|
+
${de(t.configuration.theme, {
|
|
118
|
+
fonts: t.configuration.withDefaultFonts
|
|
119
119
|
})}</style>`
|
|
120
120
|
);
|
|
121
|
-
return (e,
|
|
121
|
+
return (e, o) => {
|
|
122
122
|
var r;
|
|
123
123
|
return v(), S(P, null, [
|
|
124
124
|
i("div", { innerHTML: X.value }, null, 8, Le),
|
|
125
125
|
i("div", {
|
|
126
126
|
ref_key: "documentEl",
|
|
127
127
|
ref: p,
|
|
128
|
-
class:
|
|
128
|
+
class: te(["scalar-app scalar-api-reference references-layout", [
|
|
129
129
|
{
|
|
130
130
|
"references-editable": e.configuration.isEditable,
|
|
131
131
|
"references-sidebar": e.configuration.showSidebar,
|
|
@@ -137,7 +137,7 @@ const Le = ["innerHTML"], Ee = { class: "references-header" }, ke = {
|
|
|
137
137
|
style: re({
|
|
138
138
|
"--scalar-y-offset": `var(--scalar-custom-header-height, ${R.value}px)`
|
|
139
139
|
}),
|
|
140
|
-
onScrollPassive:
|
|
140
|
+
onScrollPassive: o[4] || (o[4] = //@ts-ignore
|
|
141
141
|
(...a) => u(O) && u(O)(...a))
|
|
142
142
|
}, [
|
|
143
143
|
i("div", Ee, [
|
|
@@ -190,10 +190,10 @@ const Le = ["innerHTML"], Ee = { class: "references-header" }, ke = {
|
|
|
190
190
|
return [
|
|
191
191
|
f(ve, {
|
|
192
192
|
theme: ((a = e.configuration) == null ? void 0 : a.theme) || "default",
|
|
193
|
-
onChangeTheme:
|
|
194
|
-
onLinkSwaggerFile:
|
|
195
|
-
onLoadSwaggerFile:
|
|
196
|
-
onUpdateContent:
|
|
193
|
+
onChangeTheme: o[0] || (o[0] = (n) => e.$emit("changeTheme", n)),
|
|
194
|
+
onLinkSwaggerFile: o[1] || (o[1] = (n) => e.$emit("linkSwaggerFile")),
|
|
195
|
+
onLoadSwaggerFile: o[2] || (o[2] = (n) => e.$emit("loadSwaggerFile")),
|
|
196
|
+
onUpdateContent: o[3] || (o[3] = (n) => e.$emit("updateContent", n))
|
|
197
197
|
}, null, 8, ["theme"])
|
|
198
198
|
];
|
|
199
199
|
}),
|
|
@@ -207,8 +207,9 @@ const Le = ["innerHTML"], Ee = { class: "references-header" }, ke = {
|
|
|
207
207
|
], 64)) : T("", !0),
|
|
208
208
|
f(me, {
|
|
209
209
|
proxyUrl: e.configuration.proxy,
|
|
210
|
+
servers: e.configuration.servers,
|
|
210
211
|
spec: e.configuration.spec
|
|
211
|
-
}, null, 8, ["proxyUrl", "spec"])
|
|
212
|
+
}, null, 8, ["proxyUrl", "servers", "spec"])
|
|
212
213
|
], 38),
|
|
213
214
|
f(u(ue))
|
|
214
215
|
], 64);
|
|
@@ -216,5 +217,5 @@ const Le = ["innerHTML"], Ee = { class: "references-header" }, ke = {
|
|
|
216
217
|
}
|
|
217
218
|
});
|
|
218
219
|
export {
|
|
219
|
-
|
|
220
|
+
eo as default
|
|
220
221
|
};
|