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