@scalar/api-reference 1.25.81 → 1.25.82
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 +6 -0
- package/dist/browser/standalone.js +37 -37
- 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 +75 -76
- package/dist/index.js +1 -1
- package/dist/style.css +1 -1
- package/package.json +3 -3
|
@@ -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":"AAmoBA,OAAO,EACL,KAAK,OAAO,EAGb,MAAM,gBAAgB,CAAA;AA4BvB,OAAO,KAAK,EACV,oBAAoB,EAEpB,kBAAkB,EACnB,MAAM,UAAU,CAAA;AAOjB,KAAK,WAAW,GAAG,IAAI,CAAC,oBAAoB,EAAE,QAAQ,CAAC,CAAC;AAuRxD,iBAAS,cAAc;WAoPT,OAAO,IAA6B;;wBAtfZ,kBAAkB,KAAK,GAAG;wBAA1B,kBAAkB,KAAK,GAAG;wBAA1B,kBAAkB,KAAK,GAAG;iCAA1B,kBAAkB,KAAK,GAAG;+BAA1B,kBAAkB,KAAK,GAAG;iCAA1B,kBAAkB,KAAK,GAAG;+BAA1B,kBAAkB,KAAK,GAAG;;wBAA1B,kBAAkB,KAAK,GAAG;wBAA1B,kBAAkB,KAAK,GAAG;wBAA1B,kBAAkB,KAAK,GAAG;iCAA1B,kBAAkB,KAAK,GAAG;+BAA1B,kBAAkB,KAAK,GAAG;iCAA1B,kBAAkB,KAAK,GAAG;+BAA1B,kBAAkB,KAAK,GAAG;;;;;;EA2f/D;AAuBD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;;YApiBqB,OAAO;eAAS,MAAM;;;;;;;;YAAtB,OAAO;eAAS,MAAM;;;;;;kFA2iB9D,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"}
|
|
@@ -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-42a4b8e7"]]);
|
|
6
6
|
export {
|
|
7
|
-
|
|
7
|
+
m as default
|
|
8
8
|
};
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useHttpClientStore as
|
|
3
|
-
import { provideUseId as
|
|
4
|
-
import { createWorkspaceStore as
|
|
5
|
-
import { addScalarClassesToHeadless as
|
|
6
|
-
import { defaultStateFactory as
|
|
7
|
-
import { hasObtrusiveScrollbars as
|
|
8
|
-
import { useToasts as
|
|
9
|
-
import { useMediaQuery as
|
|
10
|
-
import
|
|
11
|
-
import { downloadSpecBus as
|
|
12
|
-
import { HIDE_DOWNLOAD_BUTTON_SYMBOL as ke, HIDE_TEST_REQUEST_BUTTON_SYMBOL as
|
|
1
|
+
import { defineComponent as ie, ref as w, computed as h, onBeforeMount as P, onMounted as se, onUnmounted as le, watch as C, onServerPrefetch as de, useSSRContext as ue, getCurrentInstance as ce, provide as p, openBlock as b, createElementBlock as T, Fragment as N, createElementVNode as d, normalizeClass as fe, unref as s, normalizeStyle as pe, renderSlot as u, normalizeProps as c, guardReactiveProps as f, createVNode as g, withCtx as m, createCommentVNode as E, withDirectives as ge, vShow as me, createSlots as Se } from "vue";
|
|
2
|
+
import { useHttpClientStore as ve } from "../stores/useHttpClientStore.js";
|
|
3
|
+
import { provideUseId as he } from "@headlessui/vue";
|
|
4
|
+
import { createWorkspaceStore as be, WORKSPACE_SYMBOL as Te, createActiveEntitiesStore as ye, ACTIVE_ENTITIES_SYMBOL as we } from "@scalar/api-client/store";
|
|
5
|
+
import { addScalarClassesToHeadless as Ce, ScalarErrorBoundary as Ee } from "@scalar/components";
|
|
6
|
+
import { defaultStateFactory as U } from "@scalar/oas-utils/helpers";
|
|
7
|
+
import { hasObtrusiveScrollbars as Re, getThemeStyles as Oe } from "@scalar/themes";
|
|
8
|
+
import { useToasts as $e, ScalarToasts as Ie } from "@scalar/use-toasts";
|
|
9
|
+
import { useMediaQuery as Be, useResizeObserver as Le, useDebounceFn as De } from "@vueuse/core";
|
|
10
|
+
import Ae from "./GettingStarted.vue.js";
|
|
11
|
+
import { downloadSpecBus as F, downloadSpecFile as Me } from "../helpers/specDownloads.js";
|
|
12
|
+
import { HIDE_DOWNLOAD_BUTTON_SYMBOL as ke, HIDE_TEST_REQUEST_BUTTON_SYMBOL as Pe, OPENAPI_DOCUMENT_URL_SYMBOL as Ne, INTEGRATION_SYMBOL as Ue } from "../helpers/provideSymbols.js";
|
|
13
13
|
import { useDeprecationWarnings as Fe } from "../hooks/useDeprecationWarnings.js";
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import { useSidebar as
|
|
18
|
-
import { useNavState as
|
|
19
|
-
import { sleep as
|
|
20
|
-
const
|
|
14
|
+
import He from "./Sidebar/Sidebar.vue.js";
|
|
15
|
+
import _e from "./Content/Content.vue.js";
|
|
16
|
+
import Ye from "../features/ApiClientModal/ApiClientModal.vue.js";
|
|
17
|
+
import { useSidebar as ze } from "../hooks/useSidebar.js";
|
|
18
|
+
import { useNavState as We } from "../hooks/useNavState.js";
|
|
19
|
+
import { sleep as Ge } from "../helpers/sleep.js";
|
|
20
|
+
const Ve = ["innerHTML"], Ke = { class: "references-header" }, Qe = {
|
|
21
21
|
key: 0,
|
|
22
22
|
class: "references-navigation t-doc__sidebar"
|
|
23
|
-
},
|
|
23
|
+
}, je = { class: "references-navigation-list" }, qe = { class: "references-editor" }, Je = { class: "references-editor-textarea" }, Xe = ["aria-label"], Ze = {
|
|
24
24
|
key: 0,
|
|
25
25
|
class: "references-footer"
|
|
26
|
-
},
|
|
26
|
+
}, ht = /* @__PURE__ */ ie({
|
|
27
27
|
inheritAttrs: !1,
|
|
28
28
|
__name: "ApiReferenceLayout",
|
|
29
29
|
props: {
|
|
@@ -32,14 +32,14 @@ const Ke = ["innerHTML"], Qe = { class: "references-header" }, je = {
|
|
|
32
32
|
rawSpec: {}
|
|
33
33
|
},
|
|
34
34
|
emits: ["changeTheme", "updateContent", "loadSwaggerFile", "linkSwaggerFile", "toggleDarkMode"],
|
|
35
|
-
setup(
|
|
36
|
-
const o =
|
|
35
|
+
setup(H) {
|
|
36
|
+
const o = H, { initializeToasts: _, toast: Y } = $e();
|
|
37
37
|
_((e) => Y(e));
|
|
38
|
-
const z =
|
|
39
|
-
|
|
38
|
+
const z = Be("(min-width: 1150px)"), W = w("100dvh"), S = w(null);
|
|
39
|
+
Le(S, (e) => {
|
|
40
40
|
W.value = e[0].contentRect.height + "px";
|
|
41
41
|
});
|
|
42
|
-
const G = h(
|
|
42
|
+
const G = h(Re), {
|
|
43
43
|
breadcrumb: V,
|
|
44
44
|
collapsedSidebarItems: v,
|
|
45
45
|
isSidebarOpen: K,
|
|
@@ -48,7 +48,7 @@ const Ke = ["innerHTML"], Qe = { class: "references-header" }, je = {
|
|
|
48
48
|
defaultOpenAllTags: j,
|
|
49
49
|
setParsedSpec: q,
|
|
50
50
|
scrollToOperation: J
|
|
51
|
-
} =
|
|
51
|
+
} = ze(), {
|
|
52
52
|
getReferenceHash: O,
|
|
53
53
|
getPathRoutingId: $,
|
|
54
54
|
getSectionId: X,
|
|
@@ -57,18 +57,17 @@ const Ke = ["innerHTML"], Qe = { class: "references-header" }, je = {
|
|
|
57
57
|
isIntersectionEnabled: I,
|
|
58
58
|
pathRouting: B,
|
|
59
59
|
updateHash: L,
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
ee("some/prefix/is-good/"), B.value = o.configuration.pathRouting, k(() => L());
|
|
60
|
+
replaceUrlState: ee
|
|
61
|
+
} = We();
|
|
62
|
+
B.value = o.configuration.pathRouting, P(() => L());
|
|
64
63
|
const D = async (e) => {
|
|
65
64
|
var t;
|
|
66
|
-
I.value = !1, L(), e ? J(e) : (t = S.value) == null || t.scrollTo(0, 0), await
|
|
65
|
+
I.value = !1, L(), e ? J(e) : (t = S.value) == null || t.scrollTo(0, 0), await Ge(100), I.value = !0;
|
|
67
66
|
}, A = w(0);
|
|
68
|
-
|
|
67
|
+
P(() => Ce()), se(() => {
|
|
69
68
|
var r, a, n;
|
|
70
|
-
history.scrollRestoration = "manual",
|
|
71
|
-
|
|
69
|
+
history.scrollRestoration = "manual", F.on(({ specTitle: i }) => {
|
|
70
|
+
Me(o.rawSpec, i);
|
|
72
71
|
});
|
|
73
72
|
const e = (a = (r = S.value) == null ? void 0 : r.parentElement) == null ? void 0 : a.getBoundingClientRect(), t = (n = S.value) == null ? void 0 : n.getBoundingClientRect();
|
|
74
73
|
if (e && t) {
|
|
@@ -79,23 +78,23 @@ const Ke = ["innerHTML"], Qe = { class: "references-header" }, je = {
|
|
|
79
78
|
console.log("CHANGED TO: ", O()), D(O());
|
|
80
79
|
}, window.onpopstate = () => B.value && D($(window.location.pathname));
|
|
81
80
|
});
|
|
82
|
-
const
|
|
81
|
+
const te = h(
|
|
83
82
|
() => z.value || !o.configuration.isEditable
|
|
84
|
-
), M =
|
|
83
|
+
), M = De((e) => {
|
|
85
84
|
if ((e.target.scrollTop ?? 0) < 50) {
|
|
86
85
|
const r = o.configuration.pathRouting ? o.configuration.pathRouting.basePath : window.location.pathname;
|
|
87
|
-
|
|
86
|
+
ee("", r + window.location.search);
|
|
88
87
|
}
|
|
89
88
|
}), l = h(() => ({
|
|
90
89
|
breadcrumb: V.value,
|
|
91
90
|
spec: o.parsedSpec
|
|
92
91
|
}));
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
}), C(() => o.parsedSpec, q, { deep: !0 }),
|
|
92
|
+
le(() => {
|
|
93
|
+
F.reset();
|
|
94
|
+
}), C(() => o.parsedSpec, q, { deep: !0 }), de(() => {
|
|
96
95
|
var t, r;
|
|
97
|
-
const e =
|
|
98
|
-
if (e && (e.payload || (e.payload = { data:
|
|
96
|
+
const e = ue();
|
|
97
|
+
if (e && (e.payload || (e.payload = { data: U() }), (t = e.payload).data || (t.data = U()), o.configuration.pathRouting)) {
|
|
99
98
|
const a = $(e.url);
|
|
100
99
|
x.value = a, e.payload.data.hash = a;
|
|
101
100
|
for (const n in v)
|
|
@@ -108,14 +107,14 @@ const Ke = ["innerHTML"], Qe = { class: "references-header" }, je = {
|
|
|
108
107
|
}
|
|
109
108
|
e.payload.data["useSidebarContent-collapsedSidebarItems"] = v;
|
|
110
109
|
}
|
|
111
|
-
}),
|
|
110
|
+
}), he(() => {
|
|
112
111
|
var a;
|
|
113
|
-
const e =
|
|
112
|
+
const e = ce(), t = "scalar-instance-id";
|
|
114
113
|
if (!e) return t;
|
|
115
114
|
let r = e.uid;
|
|
116
115
|
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}`;
|
|
117
116
|
});
|
|
118
|
-
const y =
|
|
117
|
+
const y = be({
|
|
119
118
|
isReadOnly: !0,
|
|
120
119
|
proxyUrl: o.configuration.proxy,
|
|
121
120
|
themeId: o.configuration.theme,
|
|
@@ -129,13 +128,13 @@ const Ke = ["innerHTML"], Qe = { class: "references-header" }, je = {
|
|
|
129
128
|
setCollectionSecurity: !0,
|
|
130
129
|
...o.configuration
|
|
131
130
|
})
|
|
132
|
-
), p(
|
|
133
|
-
const
|
|
134
|
-
p(
|
|
131
|
+
), p(Te, y);
|
|
132
|
+
const oe = ye(y);
|
|
133
|
+
p(we, oe), p(
|
|
135
134
|
ke,
|
|
136
135
|
() => o.configuration.hideDownloadButton
|
|
137
136
|
), p(
|
|
138
|
-
|
|
137
|
+
Pe,
|
|
139
138
|
() => o.configuration.hideTestRequestButton
|
|
140
139
|
), p(Ne, () => {
|
|
141
140
|
var e;
|
|
@@ -144,7 +143,7 @@ const Ke = ["innerHTML"], Qe = { class: "references-header" }, je = {
|
|
|
144
143
|
Ue,
|
|
145
144
|
() => o.configuration._integration !== null ? o.configuration._integration : "vue"
|
|
146
145
|
);
|
|
147
|
-
function
|
|
146
|
+
function k(e, t) {
|
|
148
147
|
C(
|
|
149
148
|
() => o.configuration[e],
|
|
150
149
|
(r) => {
|
|
@@ -153,22 +152,22 @@ const Ke = ["innerHTML"], Qe = { class: "references-header" }, je = {
|
|
|
153
152
|
{ immediate: !0 }
|
|
154
153
|
);
|
|
155
154
|
}
|
|
156
|
-
const { setExcludedClients:
|
|
157
|
-
|
|
158
|
-
const
|
|
155
|
+
const { setExcludedClients: re, setDefaultHttpClient: ae } = ve();
|
|
156
|
+
k("defaultHttpClient", ae), k("hiddenClients", re), Q.value = o.configuration.hideModels ?? !1, j.value = o.configuration.defaultOpenAllTags ?? !1, Fe(o.configuration);
|
|
157
|
+
const ne = h(
|
|
159
158
|
() => `<style>
|
|
160
|
-
${
|
|
159
|
+
${Oe(o.configuration.theme, {
|
|
161
160
|
fonts: o.configuration.withDefaultFonts
|
|
162
161
|
})}</style>`
|
|
163
162
|
);
|
|
164
163
|
return (e, t) => {
|
|
165
164
|
var r, a;
|
|
166
|
-
return b(), T(
|
|
167
|
-
d("div", { innerHTML:
|
|
165
|
+
return b(), T(N, null, [
|
|
166
|
+
d("div", { innerHTML: ne.value }, null, 8, Ve),
|
|
168
167
|
d("div", {
|
|
169
168
|
ref_key: "documentEl",
|
|
170
169
|
ref: S,
|
|
171
|
-
class:
|
|
170
|
+
class: fe(["scalar-app scalar-api-reference references-layout", [
|
|
172
171
|
{
|
|
173
172
|
"scalar-scrollbars-obtrusive": G.value,
|
|
174
173
|
"references-editable": e.configuration.isEditable,
|
|
@@ -178,20 +177,20 @@ const Ke = ["innerHTML"], Qe = { class: "references-header" }, je = {
|
|
|
178
177
|
},
|
|
179
178
|
e.$attrs.class
|
|
180
179
|
]]),
|
|
181
|
-
style:
|
|
180
|
+
style: pe({
|
|
182
181
|
"--scalar-y-offset": `var(--scalar-custom-header-height, ${A.value}px)`
|
|
183
182
|
}),
|
|
184
183
|
onScrollPassive: t[4] || (t[4] = //@ts-ignore
|
|
185
184
|
(...n) => s(M) && s(M)(...n))
|
|
186
185
|
}, [
|
|
187
|
-
d("div",
|
|
186
|
+
d("div", Ke, [
|
|
188
187
|
u(e.$slots, "header", c(f(l.value)), void 0, !0)
|
|
189
188
|
]),
|
|
190
|
-
e.configuration.showSidebar ? (b(), T("aside",
|
|
191
|
-
d("div",
|
|
192
|
-
g(s(
|
|
189
|
+
e.configuration.showSidebar ? (b(), T("aside", Qe, [
|
|
190
|
+
d("div", je, [
|
|
191
|
+
g(s(Ee), null, {
|
|
193
192
|
default: m(() => [
|
|
194
|
-
g(s(
|
|
193
|
+
g(s(He), {
|
|
195
194
|
operationsSorter: e.configuration.operationsSorter,
|
|
196
195
|
parsedSpec: e.parsedSpec,
|
|
197
196
|
tagsSorter: e.configuration.tagsSorter
|
|
@@ -209,24 +208,24 @@ const Ke = ["innerHTML"], Qe = { class: "references-header" }, je = {
|
|
|
209
208
|
})
|
|
210
209
|
])
|
|
211
210
|
])) : E("", !0),
|
|
212
|
-
|
|
213
|
-
d("div",
|
|
211
|
+
ge(d("div", qe, [
|
|
212
|
+
d("div", Je, [
|
|
214
213
|
u(e.$slots, "editor", c(f(l.value)), void 0, !0)
|
|
215
214
|
])
|
|
216
215
|
], 512), [
|
|
217
|
-
[
|
|
216
|
+
[me, e.configuration.isEditable]
|
|
218
217
|
]),
|
|
219
|
-
|
|
218
|
+
te.value ? (b(), T(N, { key: 1 }, [
|
|
220
219
|
d("section", {
|
|
221
220
|
"aria-label": `Open API Documentation for ${(r = e.parsedSpec.info) == null ? void 0 : r.title}`,
|
|
222
221
|
class: "references-rendered"
|
|
223
222
|
}, [
|
|
224
|
-
g(s(
|
|
223
|
+
g(s(_e), {
|
|
225
224
|
baseServerURL: e.configuration.baseServerURL,
|
|
226
225
|
layout: e.configuration.layout,
|
|
227
226
|
parsedSpec: e.parsedSpec,
|
|
228
227
|
servers: e.configuration.servers
|
|
229
|
-
},
|
|
228
|
+
}, Se({
|
|
230
229
|
start: m(() => [
|
|
231
230
|
u(e.$slots, "content-start", c(f(l.value)), void 0, !0)
|
|
232
231
|
]),
|
|
@@ -240,7 +239,7 @@ const Ke = ["innerHTML"], Qe = { class: "references-header" }, je = {
|
|
|
240
239
|
fn: m(() => {
|
|
241
240
|
var n;
|
|
242
241
|
return [
|
|
243
|
-
g(
|
|
242
|
+
g(Ae, {
|
|
244
243
|
theme: ((n = e.configuration) == null ? void 0 : n.theme) || "default",
|
|
245
244
|
onChangeTheme: t[0] || (t[0] = (i) => e.$emit("changeTheme", i)),
|
|
246
245
|
onLinkSwaggerFile: t[1] || (t[1] = (i) => e.$emit("linkSwaggerFile")),
|
|
@@ -252,18 +251,18 @@ const Ke = ["innerHTML"], Qe = { class: "references-header" }, je = {
|
|
|
252
251
|
key: "0"
|
|
253
252
|
} : void 0
|
|
254
253
|
]), 1032, ["baseServerURL", "layout", "parsedSpec", "servers"])
|
|
255
|
-
], 8,
|
|
256
|
-
e.$slots.footer ? (b(), T("div",
|
|
254
|
+
], 8, Xe),
|
|
255
|
+
e.$slots.footer ? (b(), T("div", Ze, [
|
|
257
256
|
u(e.$slots, "footer", c(f(l.value)), void 0, !0)
|
|
258
257
|
])) : E("", !0)
|
|
259
258
|
], 64)) : E("", !0),
|
|
260
|
-
g(s(
|
|
259
|
+
g(s(Ye), { configuration: e.configuration }, null, 8, ["configuration"])
|
|
261
260
|
], 38),
|
|
262
|
-
g(s(
|
|
261
|
+
g(s(Ie))
|
|
263
262
|
], 64);
|
|
264
263
|
};
|
|
265
264
|
}
|
|
266
265
|
});
|
|
267
266
|
export {
|
|
268
|
-
|
|
267
|
+
ht as default
|
|
269
268
|
};
|