@scalar/api-reference 1.24.54 → 1.24.55
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 +13 -0
- package/dist/browser/standalone.js +3746 -3742
- package/dist/browser/webpack-stats.json +1 -1
- package/dist/components/ApiReferenceLayout.vue.d.ts.map +1 -1
- package/dist/components/ApiReferenceLayout.vue.js +2 -2
- package/dist/components/ApiReferenceLayout.vue2.js +115 -115
- package/dist/index.js +1 -1
- package/dist/style.css +1 -1
- package/package.json +6 -6
|
@@ -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","sourceRoot":"","sources":["../../src/components/ApiReferenceLayout.vue"],"names":[],"mappings":"AAsiBA,OAAO,EAAE,KAAK,OAAO,EAAkB,MAAM,gBAAgB,CAAA;AAwB7D,OAAO,KAAK,EACV,oBAAoB,EAEpB,kBAAkB,EACnB,MAAM,UAAU,CAAA;AA+NjB,iBAAS,cAAc;oBAnMe,kBAAkB,KAAK,GAAG;oBAA1B,kBAAkB,KAAK,GAAG;oBAA1B,kBAAkB,KAAK,GAAG;6BAA1B,kBAAkB,KAAK,GAAG;2BAA1B,kBAAkB,KAAK,GAAG;6BAA1B,kBAAkB,KAAK,GAAG;2BAA1B,kBAAkB,KAAK,GAAG;;oBAA1B,kBAAkB,KAAK,GAAG;oBAA1B,kBAAkB,KAAK,GAAG;oBAA1B,kBAAkB,KAAK,GAAG;6BAA1B,kBAAkB,KAAK,GAAG;2BAA1B,kBAAkB,KAAK,GAAG;6BAA1B,kBAAkB,KAAK,GAAG;2BAA1B,kBAAkB,KAAK,GAAG;EAwe/D;AACD,QAAA,MAAM,eAAe;;YAzfqB,OAAO;eAAS,MAAM;;;;;;;;YAAtB,OAAO;eAAS,MAAM;;;;;;UAggB9D,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAAvG,wBAAwG;AAOxG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACpC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC;AAEN,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"}
|
|
@@ -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 m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-e9a08b34"]]);
|
|
6
6
|
export {
|
|
7
|
-
|
|
7
|
+
m as default
|
|
8
8
|
};
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { provideUseId as
|
|
3
|
-
import { addScalarClassesToHeadless as
|
|
4
|
-
import { defaultStateFactory as
|
|
5
|
-
import { getThemeStyles as
|
|
6
|
-
import { useToasts as
|
|
7
|
-
import { useMediaQuery as
|
|
8
|
-
import
|
|
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 te, provide as M, openBlock as v, createElementBlock as S, Fragment as P, createElementVNode as i, normalizeClass as oe, 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
|
+
import { provideUseId as ie } from "@headlessui/vue";
|
|
3
|
+
import { addScalarClassesToHeadless as le } from "@scalar/components";
|
|
4
|
+
import { defaultStateFactory as U } from "@scalar/oas-utils/helpers";
|
|
5
|
+
import { getThemeStyles as de } from "@scalar/themes";
|
|
6
|
+
import { useToasts as ce, ScalarToasts as ue } from "@scalar/use-toasts";
|
|
7
|
+
import { useMediaQuery as pe, useResizeObserver as fe, useDebounceFn as ge } from "@vueuse/core";
|
|
8
|
+
import me from "./ApiClientModal.vue.js";
|
|
9
9
|
/* empty css */
|
|
10
|
-
import
|
|
11
|
-
import { downloadSpecBus as
|
|
12
|
-
import { useDeprecationWarnings as
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import { useSidebar as
|
|
16
|
-
import { GLOBAL_SECURITY_SYMBOL as
|
|
17
|
-
import { useNavState as
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
10
|
+
import ve from "./GettingStarted.vue.js";
|
|
11
|
+
import { downloadSpecBus as Se, downloadSpecFile as he } from "../helpers/specDownloads.js";
|
|
12
|
+
import { useDeprecationWarnings as be } from "../hooks/useDeprecationWarnings.js";
|
|
13
|
+
import we from "./Sidebar/Sidebar.vue.js";
|
|
14
|
+
import ye from "./Content/Content.vue.js";
|
|
15
|
+
import { useSidebar as Te } from "../hooks/useSidebar.js";
|
|
16
|
+
import { GLOBAL_SECURITY_SYMBOL as Re, HIDE_DOWNLOAD_BUTTON_SYMBOL as $e } from "../helpers/provideSymbols.js";
|
|
17
|
+
import { useNavState as Ce } from "../hooks/useNavState.js";
|
|
18
|
+
import { sleep as A } from "../helpers/sleep.js";
|
|
19
|
+
import { scrollToId as Ie } from "../helpers/scrollToId.js";
|
|
20
20
|
const Le = ["innerHTML"], Ee = { class: "references-header" }, ke = {
|
|
21
21
|
key: 0,
|
|
22
22
|
class: "references-navigation t-doc__sidebar"
|
|
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
|
+
}, et = /* @__PURE__ */ Z({
|
|
27
27
|
inheritAttrs: !1,
|
|
28
28
|
__name: "ApiReferenceLayout",
|
|
29
29
|
props: {
|
|
@@ -32,96 +32,96 @@ const Le = ["innerHTML"], Ee = { class: "references-header" }, ke = {
|
|
|
32
32
|
rawSpec: {}
|
|
33
33
|
},
|
|
34
34
|
emits: ["changeTheme", "updateContent", "loadSwaggerFile", "linkSwaggerFile", "toggleDarkMode"],
|
|
35
|
-
setup(
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
const
|
|
39
|
-
|
|
40
|
-
|
|
35
|
+
setup(H) {
|
|
36
|
+
const o = H, { initializeToasts: N, toast: z } = ce();
|
|
37
|
+
N((e) => z(e));
|
|
38
|
+
const Y = pe("(min-width: 1150px)"), V = w("100dvh"), p = w(null);
|
|
39
|
+
fe(p, (e) => {
|
|
40
|
+
V.value = e[0].contentRect.height + "px";
|
|
41
41
|
});
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
var
|
|
45
|
-
const e = (
|
|
46
|
-
if (e &&
|
|
47
|
-
const
|
|
48
|
-
|
|
42
|
+
const R = w(0);
|
|
43
|
+
D(() => {
|
|
44
|
+
var r, a, n;
|
|
45
|
+
const e = (a = (r = p.value) == null ? void 0 : r.parentElement) == null ? void 0 : a.getBoundingClientRect(), t = (n = p.value) == null ? void 0 : n.getBoundingClientRect();
|
|
46
|
+
if (e && t) {
|
|
47
|
+
const B = t.top - e.top;
|
|
48
|
+
R.value = B < 2 ? 0 : B;
|
|
49
49
|
}
|
|
50
50
|
});
|
|
51
51
|
const {
|
|
52
|
-
breadcrumb:
|
|
52
|
+
breadcrumb: G,
|
|
53
53
|
collapsedSidebarItems: m,
|
|
54
|
-
isSidebarOpen:
|
|
55
|
-
setCollapsedSidebarItem:
|
|
56
|
-
hideModels:
|
|
57
|
-
defaultOpenAllTags:
|
|
58
|
-
setParsedSpec:
|
|
59
|
-
} =
|
|
60
|
-
getPathRoutingId:
|
|
61
|
-
getSectionId:
|
|
62
|
-
getTagId:
|
|
63
|
-
hash:
|
|
64
|
-
isIntersectionEnabled:
|
|
65
|
-
pathRouting:
|
|
66
|
-
updateHash:
|
|
67
|
-
} =
|
|
68
|
-
|
|
69
|
-
const
|
|
70
|
-
var
|
|
71
|
-
|
|
54
|
+
isSidebarOpen: W,
|
|
55
|
+
setCollapsedSidebarItem: h,
|
|
56
|
+
hideModels: j,
|
|
57
|
+
defaultOpenAllTags: K,
|
|
58
|
+
setParsedSpec: Q
|
|
59
|
+
} = Te(), {
|
|
60
|
+
getPathRoutingId: $,
|
|
61
|
+
getSectionId: b,
|
|
62
|
+
getTagId: q,
|
|
63
|
+
hash: C,
|
|
64
|
+
isIntersectionEnabled: I,
|
|
65
|
+
pathRouting: L,
|
|
66
|
+
updateHash: E
|
|
67
|
+
} = Ce();
|
|
68
|
+
L.value = o.configuration.pathRouting, F(() => E());
|
|
69
|
+
const k = async (e) => {
|
|
70
|
+
var t;
|
|
71
|
+
I.value = !1, E(), e ? (b(e) !== e && (h(b(e), !0), await A(100)), Ie(e)) : (t = p.value) == null || t.scrollTo(0, 0), await A(100), I.value = !0;
|
|
72
72
|
};
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
}), window.onhashchange = () =>
|
|
73
|
+
F(() => le()), D(() => {
|
|
74
|
+
Se.on(({ specTitle: e }) => {
|
|
75
|
+
he(o.rawSpec, e);
|
|
76
|
+
}), window.onhashchange = () => k(decodeURIComponent(window.location.hash.replace(/^#/, ""))), window.onpopstate = () => L.value && k($(window.location.pathname));
|
|
77
77
|
});
|
|
78
|
-
const
|
|
79
|
-
() =>
|
|
80
|
-
),
|
|
78
|
+
const J = y(
|
|
79
|
+
() => Y.value || !o.configuration.isEditable
|
|
80
|
+
), O = ge((e) => {
|
|
81
81
|
if ((e.target.scrollTop ?? 0) < 50) {
|
|
82
|
-
const
|
|
83
|
-
window.history.replaceState({}, "",
|
|
82
|
+
const r = o.configuration.pathRouting ? o.configuration.pathRouting.basePath : window.location.pathname;
|
|
83
|
+
window.history.replaceState({}, "", r + window.location.search), C.value = "";
|
|
84
84
|
}
|
|
85
|
-
}), s =
|
|
86
|
-
breadcrumb:
|
|
87
|
-
spec:
|
|
85
|
+
}), s = y(() => ({
|
|
86
|
+
breadcrumb: G.value,
|
|
87
|
+
spec: o.parsedSpec
|
|
88
88
|
}));
|
|
89
|
-
|
|
90
|
-
var
|
|
91
|
-
const e =
|
|
92
|
-
if (e && (e.payload || (e.payload = { data:
|
|
93
|
-
const
|
|
94
|
-
|
|
89
|
+
_(() => o.parsedSpec, Q, { deep: !0 }), x(() => {
|
|
90
|
+
var t, r;
|
|
91
|
+
const e = ee();
|
|
92
|
+
if (e && (e.payload || (e.payload = { data: U() }), (t = e.payload).data || (t.data = U()), o.configuration.pathRouting)) {
|
|
93
|
+
const a = $(e.url);
|
|
94
|
+
C.value = a, e.payload.data.hash = a;
|
|
95
95
|
for (const n in m)
|
|
96
96
|
Object.hasOwn(m, n) && delete m[n];
|
|
97
|
-
if (
|
|
98
|
-
|
|
97
|
+
if (a)
|
|
98
|
+
h(b(a), !0);
|
|
99
99
|
else {
|
|
100
|
-
const n = (
|
|
101
|
-
n &&
|
|
100
|
+
const n = (r = o.parsedSpec.tags) == null ? void 0 : r[0];
|
|
101
|
+
n && h(q(n), !0);
|
|
102
102
|
}
|
|
103
103
|
e.payload.data["useSidebarContent-collapsedSidebarItems"] = m;
|
|
104
104
|
}
|
|
105
|
-
}),
|
|
106
|
-
var
|
|
107
|
-
const e =
|
|
108
|
-
if (!e) return
|
|
109
|
-
let
|
|
110
|
-
return typeof window > "u" ? (e.attrs || (e.attrs = {}), e.attrs[
|
|
111
|
-
}),
|
|
112
|
-
|
|
113
|
-
() =>
|
|
114
|
-
),
|
|
115
|
-
const
|
|
105
|
+
}), ie(() => {
|
|
106
|
+
var a;
|
|
107
|
+
const e = te(), t = "scalar-instance-id";
|
|
108
|
+
if (!e) return t;
|
|
109
|
+
let r = e.uid;
|
|
110
|
+
return typeof window > "u" ? (e.attrs || (e.attrs = {}), e.attrs[t] = r) : (a = e.vnode.el) != null && a.getAttribute && (r = e.vnode.el.getAttribute(t)), `${t}-${r}`;
|
|
111
|
+
}), M(Re, () => o.parsedSpec.security), M(
|
|
112
|
+
$e,
|
|
113
|
+
() => o.configuration.hideDownloadButton
|
|
114
|
+
), j.value = o.configuration.hideModels ?? !1, K.value = o.configuration.defaultOpenAllTags ?? !1, be(o.configuration);
|
|
115
|
+
const X = y(
|
|
116
116
|
() => `<style>
|
|
117
|
-
${
|
|
118
|
-
fonts:
|
|
117
|
+
${de(o.configuration.theme, {
|
|
118
|
+
fonts: o.configuration.withDefaultFonts
|
|
119
119
|
})}</style>`
|
|
120
120
|
);
|
|
121
|
-
return (e,
|
|
122
|
-
var
|
|
123
|
-
return v(), S(
|
|
124
|
-
i("div", { innerHTML:
|
|
121
|
+
return (e, t) => {
|
|
122
|
+
var r;
|
|
123
|
+
return v(), S(P, null, [
|
|
124
|
+
i("div", { innerHTML: X.value }, null, 8, Le),
|
|
125
125
|
i("div", {
|
|
126
126
|
ref_key: "documentEl",
|
|
127
127
|
ref: p,
|
|
@@ -129,23 +129,23 @@ const Le = ["innerHTML"], Ee = { class: "references-header" }, ke = {
|
|
|
129
129
|
{
|
|
130
130
|
"references-editable": e.configuration.isEditable,
|
|
131
131
|
"references-sidebar": e.configuration.showSidebar,
|
|
132
|
-
"references-sidebar-mobile-open": u(
|
|
132
|
+
"references-sidebar-mobile-open": u(W),
|
|
133
133
|
"references-classic": e.configuration.layout === "classic"
|
|
134
134
|
},
|
|
135
135
|
e.$attrs.class
|
|
136
136
|
]]),
|
|
137
|
-
style:
|
|
138
|
-
"--scalar-y-offset": `var(--scalar-custom-header-height, ${
|
|
137
|
+
style: re({
|
|
138
|
+
"--scalar-y-offset": `var(--scalar-custom-header-height, ${R.value}px)`
|
|
139
139
|
}),
|
|
140
|
-
onScrollPassive:
|
|
141
|
-
(...
|
|
140
|
+
onScrollPassive: t[4] || (t[4] = //@ts-ignore
|
|
141
|
+
(...a) => u(O) && u(O)(...a))
|
|
142
142
|
}, [
|
|
143
143
|
i("div", Ee, [
|
|
144
144
|
l(e.$slots, "header", d(c(s.value)), void 0, !0)
|
|
145
145
|
]),
|
|
146
146
|
e.configuration.showSidebar ? (v(), S("aside", ke, [
|
|
147
147
|
i("div", Oe, [
|
|
148
|
-
f(u(
|
|
148
|
+
f(u(we), {
|
|
149
149
|
parsedSpec: e.parsedSpec,
|
|
150
150
|
tagsSorter: e.configuration.tagsSorter
|
|
151
151
|
}, {
|
|
@@ -158,23 +158,23 @@ const Le = ["innerHTML"], Ee = { class: "references-header" }, ke = {
|
|
|
158
158
|
_: 3
|
|
159
159
|
}, 8, ["parsedSpec", "tagsSorter"])
|
|
160
160
|
])
|
|
161
|
-
])) :
|
|
162
|
-
|
|
161
|
+
])) : T("", !0),
|
|
162
|
+
ae(i("div", Be, [
|
|
163
163
|
i("div", De, [
|
|
164
164
|
l(e.$slots, "editor", d(c(s.value)), void 0, !0)
|
|
165
165
|
])
|
|
166
166
|
], 512), [
|
|
167
|
-
[
|
|
167
|
+
[ne, e.configuration.isEditable]
|
|
168
168
|
]),
|
|
169
|
-
|
|
169
|
+
J.value ? (v(), S(P, { key: 1 }, [
|
|
170
170
|
i("div", Fe, [
|
|
171
|
-
f(u(
|
|
171
|
+
f(u(ye), {
|
|
172
172
|
baseServerURL: e.configuration.baseServerURL,
|
|
173
173
|
layout: e.configuration.layout === "classic" ? "accordion" : "default",
|
|
174
174
|
parsedSpec: e.parsedSpec,
|
|
175
175
|
proxy: e.configuration.proxy,
|
|
176
176
|
servers: e.configuration.servers
|
|
177
|
-
},
|
|
177
|
+
}, se({
|
|
178
178
|
start: g(() => [
|
|
179
179
|
l(e.$slots, "content-start", d(c(s.value)), void 0, !0)
|
|
180
180
|
]),
|
|
@@ -183,17 +183,17 @@ const Le = ["innerHTML"], Ee = { class: "references-header" }, ke = {
|
|
|
183
183
|
]),
|
|
184
184
|
_: 2
|
|
185
185
|
}, [
|
|
186
|
-
(
|
|
186
|
+
(r = e.configuration) != null && r.isEditable ? {
|
|
187
187
|
name: "empty-state",
|
|
188
188
|
fn: g(() => {
|
|
189
|
-
var
|
|
189
|
+
var a;
|
|
190
190
|
return [
|
|
191
|
-
f(
|
|
192
|
-
theme: ((
|
|
193
|
-
onChangeTheme:
|
|
194
|
-
onLinkSwaggerFile:
|
|
195
|
-
onLoadSwaggerFile:
|
|
196
|
-
onUpdateContent:
|
|
191
|
+
f(ve, {
|
|
192
|
+
theme: ((a = e.configuration) == null ? void 0 : a.theme) || "default",
|
|
193
|
+
onChangeTheme: t[0] || (t[0] = (n) => e.$emit("changeTheme", n)),
|
|
194
|
+
onLinkSwaggerFile: t[1] || (t[1] = (n) => e.$emit("linkSwaggerFile")),
|
|
195
|
+
onLoadSwaggerFile: t[2] || (t[2] = (n) => e.$emit("loadSwaggerFile")),
|
|
196
|
+
onUpdateContent: t[3] || (t[3] = (n) => e.$emit("updateContent", n))
|
|
197
197
|
}, null, 8, ["theme"])
|
|
198
198
|
];
|
|
199
199
|
}),
|
|
@@ -203,18 +203,18 @@ const Le = ["innerHTML"], Ee = { class: "references-header" }, ke = {
|
|
|
203
203
|
]),
|
|
204
204
|
e.$slots.footer ? (v(), S("div", Me, [
|
|
205
205
|
l(e.$slots, "footer", d(c(s.value)), void 0, !0)
|
|
206
|
-
])) :
|
|
207
|
-
], 64)) :
|
|
208
|
-
f(
|
|
206
|
+
])) : T("", !0)
|
|
207
|
+
], 64)) : T("", !0),
|
|
208
|
+
f(me, {
|
|
209
209
|
proxyUrl: e.configuration.proxy,
|
|
210
210
|
spec: e.configuration.spec
|
|
211
211
|
}, null, 8, ["proxyUrl", "spec"])
|
|
212
212
|
], 38),
|
|
213
|
-
f(u(
|
|
213
|
+
f(u(ue))
|
|
214
214
|
], 64);
|
|
215
215
|
};
|
|
216
216
|
}
|
|
217
217
|
});
|
|
218
218
|
export {
|
|
219
|
-
|
|
219
|
+
et as default
|
|
220
220
|
};
|