@scalar/api-reference 1.31.17 → 1.31.18
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 +25 -0
- package/dist/browser/standalone.js +15657 -15639
- 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 +2 -2
- package/dist/components/ClassicHeader.vue.d.ts.map +1 -1
- package/dist/components/ClassicHeader.vue.js +11 -9
- package/dist/components/DocumentSelector/DocumentSelector.vue.d.ts.map +1 -1
- package/dist/components/DocumentSelector/DocumentSelector.vue.js +15 -15
- package/dist/features/DocumentSource/hooks/useDocumentSource.d.ts.map +1 -1
- package/dist/features/DocumentSource/hooks/useDocumentSource.js +35 -31
- package/dist/features/DownloadLink/DownloadLink.vue.d.ts.map +1 -1
- package/dist/features/DownloadLink/DownloadLink.vue.js +3 -3
- package/dist/features/DownloadLink/DownloadLink.vue2.js +35 -31
- package/dist/features/Search/SearchButton.vue.d.ts.map +1 -1
- package/dist/features/Search/SearchButton.vue.js +20 -19
- package/dist/helpers/parse.js +7 -7
- package/dist/index.js +1 -1
- package/dist/libs/openapi.js +15 -15
- package/dist/style.css +1 -1
- package/package.json +11 -11
- package/dist/legacy/fixtures/httpRequestMethods.d.ts +0 -10
- package/dist/legacy/fixtures/httpRequestMethods.d.ts.map +0 -1
- package/dist/legacy/fixtures/index.d.ts +0 -2
- package/dist/legacy/fixtures/index.d.ts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ApiReferenceLayout.vue.d.ts","sourceRoot":"","sources":["../../src/components/ApiReferenceLayout.vue"],"names":[],"mappings":"AAuuBA,OAAO,EAGL,KAAK,OAAO,EACb,MAAM,gBAAgB,CAAA;AAsCvB,OAAO,KAAK,EACV,oBAAoB,EAEpB,kBAAkB,EACnB,MAAM,SAAS,CAAA;AAwShB,iBAAS,cAAc;
|
|
1
|
+
{"version":3,"file":"ApiReferenceLayout.vue.d.ts","sourceRoot":"","sources":["../../src/components/ApiReferenceLayout.vue"],"names":[],"mappings":"AAuuBA,OAAO,EAGL,KAAK,OAAO,EACb,MAAM,gBAAgB,CAAA;AAsCvB,OAAO,KAAK,EACV,oBAAoB,EAEpB,kBAAkB,EACnB,MAAM,SAAS,CAAA;AAwShB,iBAAS,cAAc;WAoYT,OAAO,IAA6B;;wBAxnBV,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;;6BACrC,GAAG;;wBADQ,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;;6BACrC,GAAG;;;;;;EA4nB/B;AAiCD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;;YArsBqB,OAAO;eAAS,MAAM;;;;;;;;YAAtB,OAAO;eAAS,MAAM;;;;;;kFA4sB9D,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"}
|
|
@@ -4,7 +4,7 @@ import o from "./ApiReferenceLayout.vue2.js";
|
|
|
4
4
|
/* empty css */
|
|
5
5
|
/* empty css */
|
|
6
6
|
import t from "../_virtual/_plugin-vue_export-helper.js";
|
|
7
|
-
const
|
|
7
|
+
const c = /* @__PURE__ */ t(o, [["__scopeId", "data-v-4c824364"]]);
|
|
8
8
|
export {
|
|
9
|
-
|
|
9
|
+
c as default
|
|
10
10
|
};
|
|
@@ -33,7 +33,7 @@ const lt = ["innerHTML"], st = { class: "references-header" }, ut = ["aria-label
|
|
|
33
33
|
class: "scalar-api-references-standalone-search"
|
|
34
34
|
}, ft = { key: 1 }, vt = { class: "references-editor" }, pt = { class: "references-editor-textarea" }, gt = ["aria-label"], ht = {
|
|
35
35
|
key: 0,
|
|
36
|
-
class: "w-64 empty:hidden"
|
|
36
|
+
class: "w-64 *:!p-0 empty:hidden"
|
|
37
37
|
}, St = {
|
|
38
38
|
key: 0,
|
|
39
39
|
class: "references-footer"
|
|
@@ -305,7 +305,7 @@ const lt = ["innerHTML"], st = { class: "references-header" }, ut = ["aria-label
|
|
|
305
305
|
])) : l("", !0),
|
|
306
306
|
t.value.hideSearch ? l("", !0) : (a(), y(r(W), {
|
|
307
307
|
key: 1,
|
|
308
|
-
class: "t-doc__sidebar",
|
|
308
|
+
class: "t-doc__sidebar max-w-64",
|
|
309
309
|
searchHotKey: t.value.searchHotKey,
|
|
310
310
|
spec: k.value
|
|
311
311
|
}, null, 8, ["searchHotKey", "spec"]))
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClassicHeader.vue.d.ts","sourceRoot":"","sources":["../../src/components/ClassicHeader.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ClassicHeader.vue.d.ts","sourceRoot":"","sources":["../../src/components/ClassicHeader.vue"],"names":[],"mappings":"AAoDA,iBAAS,cAAc;WAkDT,OAAO,IAA6B;;yBATrB,GAAG;oCACQ,GAAG;;;;EAa1C;AAOD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe,0RAMnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAKpG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -1,16 +1,18 @@
|
|
|
1
|
-
import { createElementBlock as
|
|
1
|
+
import { createElementBlock as c, openBlock as t, createElementVNode as s, renderSlot as r } from "vue";
|
|
2
2
|
/* empty css */
|
|
3
|
-
import
|
|
4
|
-
const n = {}, d = { class: "references-classic-header-container" }, a = { class: "references-classic-header" };
|
|
5
|
-
function
|
|
6
|
-
return t(),
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
import o from "../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
+
const n = {}, d = { class: "references-classic-header-container" }, a = { class: "references-classic-header" }, i = { class: "references-classic-header-content" };
|
|
5
|
+
function l(e, _) {
|
|
6
|
+
return t(), c("div", d, [
|
|
7
|
+
s("div", a, [
|
|
8
|
+
s("div", i, [
|
|
9
|
+
r(e.$slots, "default", {}, void 0, !0)
|
|
10
|
+
]),
|
|
9
11
|
r(e.$slots, "dark-mode-toggle", {}, void 0, !0)
|
|
10
12
|
])
|
|
11
13
|
]);
|
|
12
14
|
}
|
|
13
|
-
const
|
|
15
|
+
const h = /* @__PURE__ */ o(n, [["render", l], ["__scopeId", "data-v-9198d025"]]);
|
|
14
16
|
export {
|
|
15
|
-
|
|
17
|
+
h as default
|
|
16
18
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DocumentSelector.vue.d.ts","sourceRoot":"","sources":["../../../src/components/DocumentSelector/DocumentSelector.vue"],"names":[],"mappings":"AAwDA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAA;AAKpE,KAAK,WAAW,GAAG;IACjB,OAAO,CAAC,EAAE,iBAAiB,EAAE,CAAA;IAC7B,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB,CAAC;;;;;;
|
|
1
|
+
{"version":3,"file":"DocumentSelector.vue.d.ts","sourceRoot":"","sources":["../../../src/components/DocumentSelector/DocumentSelector.vue"],"names":[],"mappings":"AAwDA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAA;AAKpE,KAAK,WAAW,GAAG;IACjB,OAAO,CAAC,EAAE,iBAAiB,EAAE,CAAA;IAC7B,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB,CAAC;;;;;;AA6HF,wBAOG"}
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { defineComponent as p, computed as s, createElementBlock as b, createCommentVNode as f, openBlock as x, createVNode as r, unref as i, withCtx as
|
|
1
|
+
import { defineComponent as p, computed as s, createElementBlock as b, createCommentVNode as f, openBlock as x, createVNode as r, unref as i, withCtx as V, createElementVNode as c, toDisplayString as v } from "vue";
|
|
2
2
|
import { ScalarListbox as g } from "@scalar/components";
|
|
3
|
-
import { ScalarIconCaretUpDown as
|
|
4
|
-
const
|
|
3
|
+
import { ScalarIconCaretUpDown as h } from "@scalar/icons";
|
|
4
|
+
const S = {
|
|
5
5
|
key: 0,
|
|
6
6
|
class: "document-selector -mb-1 p-3 pb-0"
|
|
7
7
|
}, w = {
|
|
8
|
-
class: "group/dropdown-label hover:bg-b-2 text-c-2 flex w-full cursor-pointer items-center rounded border px-2 py-1.75",
|
|
9
|
-
|
|
10
|
-
}, _ = { class: "text-c-1 overflow-hidden text-base text-ellipsis" },
|
|
8
|
+
class: "group/dropdown-label hover:bg-b-2 text-c-2 flex h-8 w-full cursor-pointer items-center rounded border px-2 py-1.75",
|
|
9
|
+
type: "button"
|
|
10
|
+
}, _ = { class: "text-c-1 overflow-hidden text-base text-ellipsis" }, k = /* @__PURE__ */ p({
|
|
11
11
|
__name: "DocumentSelector",
|
|
12
12
|
props: {
|
|
13
13
|
options: {},
|
|
14
14
|
modelValue: {}
|
|
15
15
|
},
|
|
16
16
|
emits: ["update:modelValue"],
|
|
17
|
-
setup(l, { emit:
|
|
18
|
-
const
|
|
17
|
+
setup(l, { emit: u }) {
|
|
18
|
+
const d = u, m = s(() => {
|
|
19
19
|
var e;
|
|
20
20
|
return l.options && ((e = l.options) == null ? void 0 : e.length) > 1;
|
|
21
21
|
}), a = s(
|
|
@@ -29,21 +29,21 @@ const h = {
|
|
|
29
29
|
}
|
|
30
30
|
), n = s({
|
|
31
31
|
get: () => a.value.find(({ id: e }) => e === String(l.modelValue)),
|
|
32
|
-
set: (e) =>
|
|
32
|
+
set: (e) => d("update:modelValue", Number(e.id))
|
|
33
33
|
});
|
|
34
|
-
return (e, o) => m.value ? (x(), b("div",
|
|
34
|
+
return (e, o) => m.value ? (x(), b("div", S, [
|
|
35
35
|
r(i(g), {
|
|
36
36
|
modelValue: n.value,
|
|
37
37
|
"onUpdate:modelValue": o[0] || (o[0] = (t) => n.value = t),
|
|
38
38
|
options: a.value,
|
|
39
39
|
resize: ""
|
|
40
40
|
}, {
|
|
41
|
-
default:
|
|
41
|
+
default: V(() => {
|
|
42
42
|
var t;
|
|
43
43
|
return [
|
|
44
|
-
c("
|
|
45
|
-
r(i(
|
|
46
|
-
c("span", _,
|
|
44
|
+
c("button", w, [
|
|
45
|
+
r(i(h), { class: "mr-1 size-4 text-current" }),
|
|
46
|
+
c("span", _, v(((t = n.value) == null ? void 0 : t.label) || "Select API"), 1)
|
|
47
47
|
])
|
|
48
48
|
];
|
|
49
49
|
}),
|
|
@@ -53,5 +53,5 @@ const h = {
|
|
|
53
53
|
}
|
|
54
54
|
});
|
|
55
55
|
export {
|
|
56
|
-
|
|
56
|
+
k as default
|
|
57
57
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDocumentSource.d.ts","sourceRoot":"","sources":["../../../../src/features/DocumentSource/hooks/useDocumentSource.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAA;
|
|
1
|
+
{"version":3,"file":"useDocumentSource.d.ts","sourceRoot":"","sources":["../../../../src/features/DocumentSource/hooks/useDocumentSource.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAA;AAG1F,OAAO,KAAK,EAAW,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACjE,OAAO,EAAE,KAAK,yBAAyB,EAAmC,MAAM,6BAA6B,CAAA;AAC7G,OAAO,EAAE,KAAK,gBAAgB,EAAE,KAAK,GAAG,EAAiC,MAAM,KAAK,CAAA;AAIpF;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,EAChC,gBAAgB,EAAE,wBAAwB,EAC1C,oBAAoB,EAAE,4BAA4B,EAClD,aAAa,GACd,EAAE;IACD,gBAAgB,CAAC,EAAE,gBAAgB,CAAC,MAAM,CAAC,CAAA;IAC3C,oBAAoB,CAAC,EAAE,gBAAgB,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAA;IAC7D,aAAa,CAAC,EAAE,gBAAgB,CAAC,yBAAyB,CAAC,CAAA;CAC5D,GAAG;IACF,gBAAgB,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IAC7B,sBAAsB,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IACnC,oBAAoB,EAAE,GAAG,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAA;IAC/C,cAAc,EAAE,UAAU,CAAC,OAAO,oBAAoB,CAAC,CAAA;IACvD,mBAAmB,EAAE,UAAU,CAAC,OAAO,yBAAyB,CAAC,CAAA;CAClE,CA+GA"}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { createWorkspaceStore as
|
|
2
|
-
import { normalize as D, upgrade as P, dereference as V } from "@scalar/openapi-parser";
|
|
1
|
+
import { createWorkspaceStore as P, createActiveEntitiesStore as w } from "@scalar/api-client/store";
|
|
3
2
|
import { measure as f } from "@scalar/helpers/testing/measure";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
3
|
+
import { normalize as y, upgrade as O, dereference as V } from "@scalar/openapi-parser";
|
|
4
|
+
import { apiReferenceConfigurationSchema as D } from "@scalar/types/api-reference";
|
|
5
|
+
import { computed as l, toValue as t, ref as d, watch as F } from "vue";
|
|
6
|
+
import { useDocumentFetcher as I } from "./useDocumentFetcher.js";
|
|
7
7
|
function C({
|
|
8
|
-
originalDocument:
|
|
9
|
-
dereferencedDocument:
|
|
10
|
-
configuration:
|
|
8
|
+
originalDocument: i,
|
|
9
|
+
dereferencedDocument: n,
|
|
10
|
+
configuration: s
|
|
11
11
|
}) {
|
|
12
|
-
const { originalDocument:
|
|
13
|
-
configuration:
|
|
14
|
-
}),
|
|
12
|
+
const { originalDocument: h } = I({
|
|
13
|
+
configuration: s
|
|
14
|
+
}), u = l(() => i ? t(i) : t(h)), a = d(""), g = l(() => n ? t(n) : t(m)), m = d({
|
|
15
15
|
openapi: "3.1.0",
|
|
16
16
|
info: {
|
|
17
17
|
title: "",
|
|
@@ -19,46 +19,50 @@ function C({
|
|
|
19
19
|
},
|
|
20
20
|
paths: {}
|
|
21
21
|
});
|
|
22
|
-
|
|
23
|
-
() =>
|
|
24
|
-
async (
|
|
25
|
-
if (!
|
|
22
|
+
F(
|
|
23
|
+
() => t(u),
|
|
24
|
+
async (c) => {
|
|
25
|
+
if (!c)
|
|
26
26
|
return;
|
|
27
|
-
const
|
|
28
|
-
if (
|
|
27
|
+
const e = y(c);
|
|
28
|
+
if (e === void 0) {
|
|
29
|
+
console.error("Failed to parse the OpenAPI document:", c);
|
|
29
30
|
return;
|
|
30
|
-
|
|
31
|
+
}
|
|
32
|
+
if (a.value = typeof e == "object" && (e.openapi || e.swagger) || "", n)
|
|
33
|
+
return;
|
|
34
|
+
const v = !a.value.startsWith("3.1") ? (
|
|
31
35
|
// Upgrade needed
|
|
32
36
|
f("upgrade", () => {
|
|
33
|
-
const { specification:
|
|
34
|
-
return
|
|
37
|
+
const { specification: o } = O(e);
|
|
38
|
+
return o;
|
|
35
39
|
})
|
|
36
40
|
) : (
|
|
37
41
|
// Skip the upgrade
|
|
38
|
-
|
|
39
|
-
),
|
|
40
|
-
const { schema:
|
|
42
|
+
e
|
|
43
|
+
), A = await f("dereference", async () => {
|
|
44
|
+
const { schema: o, errors: r } = await V(v);
|
|
41
45
|
return r != null && r.length && console.warn(
|
|
42
46
|
`Please open an issue on https://github.com/scalar/scalar
|
|
43
47
|
`,
|
|
44
48
|
`Scalar OpenAPI Parser Warning:
|
|
45
49
|
`,
|
|
46
50
|
r
|
|
47
|
-
),
|
|
51
|
+
), o === void 0 && console.error("Failed to dereference the OpenAPI document", r), o;
|
|
48
52
|
});
|
|
49
|
-
|
|
53
|
+
m.value = A;
|
|
50
54
|
},
|
|
51
55
|
{ immediate: !0 }
|
|
52
56
|
);
|
|
53
|
-
const
|
|
57
|
+
const p = P({
|
|
54
58
|
useLocalStorage: !1,
|
|
55
|
-
...
|
|
56
|
-
}), S =
|
|
59
|
+
...t(s) ?? D.parse({})
|
|
60
|
+
}), S = w(p);
|
|
57
61
|
return {
|
|
58
|
-
originalDocument:
|
|
62
|
+
originalDocument: u,
|
|
59
63
|
originalOpenApiVersion: a,
|
|
60
|
-
dereferencedDocument:
|
|
61
|
-
workspaceStore:
|
|
64
|
+
dereferencedDocument: g,
|
|
65
|
+
workspaceStore: p,
|
|
62
66
|
activeEntitiesStore: S
|
|
63
67
|
};
|
|
64
68
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DownloadLink.vue.d.ts","sourceRoot":"","sources":["../../../src/features/DownloadLink/DownloadLink.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DownloadLink.vue.d.ts","sourceRoot":"","sources":["../../../src/features/DownloadLink/DownloadLink.vue"],"names":[],"mappings":"AAqLA,KAAK,WAAW,GAAG;IACjB,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAC;;AAoJF,wBAMG"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./DownloadLink.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
|
-
import
|
|
4
|
-
const
|
|
3
|
+
import a from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
+
const e = /* @__PURE__ */ a(o, [["__scopeId", "data-v-dde86eaa"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
e as default
|
|
7
7
|
};
|
|
@@ -1,55 +1,59 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { useConfig as
|
|
5
|
-
import { downloadEventBus as
|
|
6
|
-
const
|
|
7
|
-
key: 0,
|
|
8
|
-
class: "download-container group"
|
|
9
|
-
}, I = /* @__PURE__ */ w({
|
|
1
|
+
import { defineComponent as T, computed as B, createElementBlock as t, createCommentVNode as l, unref as n, openBlock as d, normalizeClass as N, withModifiers as w, createElementVNode as y, createVNode as g, withCtx as D, createTextVNode as b } from "vue";
|
|
2
|
+
import V from "github-slugger";
|
|
3
|
+
import c from "../../components/Badge/Badge.vue.js";
|
|
4
|
+
import { useConfig as j } from "../../hooks/useConfig.js";
|
|
5
|
+
import { downloadEventBus as E } from "../../libs/download.js";
|
|
6
|
+
const $ = /* @__PURE__ */ T({
|
|
10
7
|
__name: "DownloadLink",
|
|
11
8
|
props: {
|
|
12
9
|
title: {}
|
|
13
10
|
},
|
|
14
|
-
setup(
|
|
15
|
-
const
|
|
16
|
-
|
|
11
|
+
setup(v) {
|
|
12
|
+
const e = j(), k = new V(), x = B(() => k.slug(v.title ?? "")), r = (a) => {
|
|
13
|
+
E.emit({ id: "", filename: x.value, format: a });
|
|
17
14
|
};
|
|
18
|
-
return (
|
|
19
|
-
var
|
|
20
|
-
return (
|
|
21
|
-
|
|
15
|
+
return (a, o) => {
|
|
16
|
+
var u, s, i, m, p, f;
|
|
17
|
+
return ((u = n(e)) == null ? void 0 : u.documentDownloadType) !== "none" ? (d(), t("div", {
|
|
18
|
+
key: 0,
|
|
19
|
+
class: N([{
|
|
20
|
+
"download-both": ((s = n(e)) == null ? void 0 : s.documentDownloadType) === "both"
|
|
21
|
+
}, "download-container group"])
|
|
22
|
+
}, [
|
|
23
|
+
((i = n(e)) == null ? void 0 : i.documentDownloadType) === "json" || ((m = n(e)) == null ? void 0 : m.documentDownloadType) === "both" ? (d(), t("button", {
|
|
24
|
+
key: 0,
|
|
22
25
|
type: "button",
|
|
23
26
|
class: "download-button",
|
|
24
|
-
onClick: o[0] || (o[0] =
|
|
27
|
+
onClick: o[0] || (o[0] = w((C) => r("json"), ["prevent"])),
|
|
25
28
|
variant: "ghost"
|
|
26
29
|
}, [
|
|
27
|
-
o[3] || (o[3] =
|
|
28
|
-
|
|
29
|
-
default:
|
|
30
|
-
|
|
30
|
+
o[3] || (o[3] = y("span", null, " Download OpenAPI Document ", -1)),
|
|
31
|
+
g(c, { class: "extension hidden group-hover:flex" }, {
|
|
32
|
+
default: D(() => o[2] || (o[2] = [
|
|
33
|
+
b("json")
|
|
31
34
|
])),
|
|
32
35
|
_: 1
|
|
33
36
|
})
|
|
34
|
-
]),
|
|
35
|
-
t("button", {
|
|
37
|
+
])) : l("", !0),
|
|
38
|
+
((p = n(e)) == null ? void 0 : p.documentDownloadType) === "yaml" || ((f = n(e)) == null ? void 0 : f.documentDownloadType) === "both" ? (d(), t("button", {
|
|
39
|
+
key: 1,
|
|
36
40
|
type: "button",
|
|
37
41
|
class: "download-button",
|
|
38
|
-
onClick: o[1] || (o[1] =
|
|
42
|
+
onClick: o[1] || (o[1] = w((C) => r("yaml"), ["prevent"])),
|
|
39
43
|
variant: "ghost"
|
|
40
44
|
}, [
|
|
41
|
-
o[5] || (o[5] =
|
|
42
|
-
|
|
43
|
-
default:
|
|
44
|
-
|
|
45
|
+
o[5] || (o[5] = y("span", null, " Download OpenAPI Document ", -1)),
|
|
46
|
+
g(c, { class: "extension hidden group-hover:flex" }, {
|
|
47
|
+
default: D(() => o[4] || (o[4] = [
|
|
48
|
+
b("yaml")
|
|
45
49
|
])),
|
|
46
50
|
_: 1
|
|
47
51
|
})
|
|
48
|
-
])
|
|
49
|
-
]));
|
|
52
|
+
])) : l("", !0)
|
|
53
|
+
], 2)) : l("", !0);
|
|
50
54
|
};
|
|
51
55
|
}
|
|
52
56
|
});
|
|
53
57
|
export {
|
|
54
|
-
|
|
58
|
+
$ as default
|
|
55
59
|
};
|
|
@@ -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":"AAsFA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;AAQhD,KAAK,WAAW,GAAG;IACf,IAAI,EAAE,IAAI,CAAA;IACV,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB,CAAC;;kBADe,MAAM;;AA0JzB,wBAOG"}
|
|
@@ -1,45 +1,46 @@
|
|
|
1
|
-
import { defineComponent as w, ref as
|
|
2
|
-
import { useModal as
|
|
1
|
+
import { defineComponent as w, ref as C, watch as v, nextTick as K, onMounted as B, onBeforeUnmount as b, createElementBlock as a, openBlock as r, Fragment as s, createVNode as c, unref as l, normalizeClass as E, withCtx as u, createElementVNode as n, createTextVNode as m, toDisplayString as H } from "vue";
|
|
2
|
+
import { useModal as M, ScalarSidebarSearchButton as g } from "@scalar/components";
|
|
3
3
|
import { isMacOS as f } from "@scalar/helpers/general/is-mac-os";
|
|
4
|
-
import
|
|
5
|
-
import { useApiClient as
|
|
6
|
-
const
|
|
4
|
+
import L from "./SearchModal.vue.js";
|
|
5
|
+
import { useApiClient as N } from "../ApiClientModal/useApiClient.js";
|
|
6
|
+
const z = /* @__PURE__ */ w({
|
|
7
7
|
__name: "SearchButton",
|
|
8
8
|
props: {
|
|
9
9
|
spec: {},
|
|
10
10
|
searchHotKey: { default: "k" }
|
|
11
11
|
},
|
|
12
12
|
setup(y) {
|
|
13
|
-
const S = y,
|
|
13
|
+
const S = y, i = C(), o = M(), { client: h } = N(), p = (t) => {
|
|
14
14
|
var e;
|
|
15
15
|
(f() ? t.metaKey : t.ctrlKey) && t.key === S.searchHotKey && !((e = h.value) != null && e.modalState.open) && (t.preventDefault(), t.stopPropagation(), o.open ? o.hide() : o.show());
|
|
16
16
|
};
|
|
17
|
-
|
|
17
|
+
v(
|
|
18
18
|
() => o.open,
|
|
19
19
|
(t, e) => {
|
|
20
20
|
!t && e && K(() => {
|
|
21
|
-
var
|
|
22
|
-
(
|
|
21
|
+
var d;
|
|
22
|
+
(d = i.value) == null || d.focus();
|
|
23
23
|
});
|
|
24
24
|
}
|
|
25
|
-
), B(() => window.addEventListener("keydown",
|
|
25
|
+
), B(() => window.addEventListener("keydown", p)), b(() => window.removeEventListener("keydown", p));
|
|
26
26
|
function k() {
|
|
27
27
|
o.show();
|
|
28
28
|
}
|
|
29
|
-
return (t, e) => (
|
|
30
|
-
c(l(
|
|
29
|
+
return (t, e) => (r(), a(s, null, [
|
|
30
|
+
c(l(g), {
|
|
31
31
|
ref_key: "button",
|
|
32
|
-
ref:
|
|
32
|
+
ref: i,
|
|
33
|
+
class: E(["w-full", t.$attrs.class]),
|
|
33
34
|
onClick: k
|
|
34
35
|
}, {
|
|
35
36
|
shortcut: u(() => [
|
|
36
|
-
l(f)() ? (
|
|
37
|
+
l(f)() ? (r(), a(s, { key: 0 }, [
|
|
37
38
|
m("⌘")
|
|
38
|
-
], 64)) : (
|
|
39
|
+
], 64)) : (r(), a(s, { key: 1 }, [
|
|
39
40
|
e[0] || (e[0] = n("span", { class: "sr-only" }, "CTRL", -1)),
|
|
40
41
|
e[1] || (e[1] = n("span", { "aria-hidden": "true" }, "⌃", -1))
|
|
41
42
|
], 64)),
|
|
42
|
-
m(" " +
|
|
43
|
+
m(" " + H(t.searchHotKey), 1)
|
|
43
44
|
]),
|
|
44
45
|
default: u(() => [
|
|
45
46
|
e[2] || (e[2] = n("span", { class: "sr-only" }, "Open Search", -1)),
|
|
@@ -49,8 +50,8 @@ const O = /* @__PURE__ */ w({
|
|
|
49
50
|
}, " Search ", -1))
|
|
50
51
|
]),
|
|
51
52
|
_: 1
|
|
52
|
-
},
|
|
53
|
-
c(
|
|
53
|
+
}, 8, ["class"]),
|
|
54
|
+
c(L, {
|
|
54
55
|
modalState: l(o),
|
|
55
56
|
parsedSpec: t.spec
|
|
56
57
|
}, null, 8, ["modalState", "parsedSpec"])
|
|
@@ -58,5 +59,5 @@ const O = /* @__PURE__ */ w({
|
|
|
58
59
|
}
|
|
59
60
|
});
|
|
60
61
|
export {
|
|
61
|
-
|
|
62
|
+
z as default
|
|
62
63
|
};
|
package/dist/helpers/parse.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createEmptySpecification as w } from "../libs/openapi.js";
|
|
2
2
|
import { normalizeHttpMethod as m } from "@scalar/helpers/http/normalize-http-method";
|
|
3
|
-
const
|
|
3
|
+
const P = (s, i) => new Promise((e, b) => {
|
|
4
4
|
try {
|
|
5
5
|
return e(s ? k(s, i) : k(w()));
|
|
6
6
|
} catch (p) {
|
|
@@ -13,12 +13,12 @@ const I = (s, i) => new Promise((e, b) => {
|
|
|
13
13
|
const b = [], p = (o) => {
|
|
14
14
|
var h;
|
|
15
15
|
!("children" in o) || !((h = o.children) != null && h.length) || o.children.forEach((a) => {
|
|
16
|
-
var f, u, t, n, g;
|
|
17
|
-
let r = (f = e.tags) == null ? void 0 : f.findIndex((
|
|
16
|
+
var f, u, t, n, g, d;
|
|
17
|
+
let r = (f = e.tags) == null ? void 0 : f.findIndex((y) => "tag" in o && y.name === o.tag.name);
|
|
18
18
|
r === -1 && "tag" in o && (e.tags.push({
|
|
19
19
|
name: o.tag.name,
|
|
20
20
|
operations: []
|
|
21
|
-
}), r = e.tags.length - 1), e.tags[r].operations
|
|
21
|
+
}), r = e.tags.length - 1), (u = e.tags[r]).operations || (u.operations = []), "tag" in a ? p(a) : "operation" in a ? e.tags[r].operations.push({
|
|
22
22
|
id: a.id,
|
|
23
23
|
httpVerb: m(a.method),
|
|
24
24
|
path: a.path,
|
|
@@ -26,7 +26,7 @@ const I = (s, i) => new Promise((e, b) => {
|
|
|
26
26
|
description: a.operation.description || "",
|
|
27
27
|
isWebhook: !1,
|
|
28
28
|
information: a.operation,
|
|
29
|
-
pathParameters: (
|
|
29
|
+
pathParameters: (n = (t = e.paths) == null ? void 0 : t[a.path ?? ""]) == null ? void 0 : n.parameters
|
|
30
30
|
}) : "webhook" in a && e.tags[r].operations.push({
|
|
31
31
|
id: a.id,
|
|
32
32
|
httpVerb: m(a.method),
|
|
@@ -35,7 +35,7 @@ const I = (s, i) => new Promise((e, b) => {
|
|
|
35
35
|
description: a.webhook.description || "",
|
|
36
36
|
isWebhook: !0,
|
|
37
37
|
information: a.webhook,
|
|
38
|
-
pathParameters: (
|
|
38
|
+
pathParameters: (d = (g = e.webhooks) == null ? void 0 : g[a.name ?? ""]) == null ? void 0 : d.parameters
|
|
39
39
|
});
|
|
40
40
|
});
|
|
41
41
|
};
|
|
@@ -77,5 +77,5 @@ const I = (s, i) => new Promise((e, b) => {
|
|
|
77
77
|
};
|
|
78
78
|
};
|
|
79
79
|
export {
|
|
80
|
-
|
|
80
|
+
P as parse
|
|
81
81
|
};
|