@scalar/api-reference 1.31.15 → 1.31.17
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 +22 -0
- package/dist/browser/standalone.js +6873 -6839
- package/dist/browser/webpack-stats.json +1 -1
- package/dist/components/ApiReferenceLayout.vue2.js +21 -21
- package/dist/components/DocumentSelector/DocumentSelector.vue.d.ts.map +1 -1
- package/dist/components/DocumentSelector/DocumentSelector.vue.js +17 -20
- package/dist/components/Sidebar/Sidebar.vue.js +2 -2
- package/dist/components/Sidebar/SidebarElement.vue.d.ts.map +1 -1
- package/dist/components/Sidebar/SidebarElement.vue.js +1 -1
- package/dist/components/Sidebar/SidebarGroup.vue.js +1 -1
- package/dist/features/ExampleResponses/ExampleResponses.vue.js +1 -1
- package/dist/features/Search/SearchButton.vue.d.ts.map +1 -1
- package/dist/features/Search/SearchButton.vue.js +60 -5
- package/dist/features/Search/SearchButton.vue2.js +2 -70
- package/dist/index.js +1 -1
- package/dist/style.css +1 -1
- package/package.json +6 -6
|
@@ -3,10 +3,10 @@ import { provideUseId as $e } from "@headlessui/vue";
|
|
|
3
3
|
import { OpenApiClientButton as Te } from "@scalar/api-client/components";
|
|
4
4
|
import { LAYOUT_SYMBOL as De } from "@scalar/api-client/hooks";
|
|
5
5
|
import { WORKSPACE_SYMBOL as Ee, ACTIVE_ENTITIES_SYMBOL as Me } from "@scalar/api-client/store";
|
|
6
|
-
import { addScalarClassesToHeadless as Oe, ScalarErrorBoundary as
|
|
6
|
+
import { addScalarClassesToHeadless as Oe, ScalarErrorBoundary as Ie, ScalarSidebarFooter as Be, ScalarColorModeToggleButton as Re, ScalarColorModeToggleIcon as Le } from "@scalar/components";
|
|
7
7
|
import { sleep as He } from "@scalar/helpers/testing/sleep";
|
|
8
|
-
import { hasObtrusiveScrollbars as
|
|
9
|
-
import { apiReferenceConfigurationSchema as
|
|
8
|
+
import { hasObtrusiveScrollbars as _e, getThemeStyles as Ae } from "@scalar/themes";
|
|
9
|
+
import { apiReferenceConfigurationSchema as Pe } from "@scalar/types/api-reference";
|
|
10
10
|
import { useBreakpoints as Fe } from "@scalar/use-hooks/useBreakpoints";
|
|
11
11
|
import { useToasts as Ne, ScalarToasts as Ve } from "@scalar/use-toasts";
|
|
12
12
|
import { useMediaQuery as Ue, useResizeObserver as Ye, useDebounceFn as Ke } from "@vueuse/core";
|
|
@@ -51,7 +51,7 @@ const lt = ["innerHTML"], st = { class: "references-header" }, ut = ["aria-label
|
|
|
51
51
|
emits: ["changeTheme", "updateContent", "loadSwaggerFile", "linkSwaggerFile", "toggleDarkMode"],
|
|
52
52
|
setup(M) {
|
|
53
53
|
const t = T(
|
|
54
|
-
() =>
|
|
54
|
+
() => Pe.parse(M.configuration)
|
|
55
55
|
), { initializeToasts: j, toast: q } = Ne();
|
|
56
56
|
j((e) => q(e));
|
|
57
57
|
const {
|
|
@@ -70,7 +70,7 @@ const lt = ["innerHTML"], st = { class: "references-header" }, ut = ["aria-label
|
|
|
70
70
|
Ye(w, (e) => {
|
|
71
71
|
te.value = e[0].contentRect.height + "px";
|
|
72
72
|
});
|
|
73
|
-
const oe = T(
|
|
73
|
+
const oe = T(_e), R = qe(t), { isSidebarOpen: I, setCollapsedSidebarItem: L, scrollToOperation: re, items: H } = tt(d, {
|
|
74
74
|
...R,
|
|
75
75
|
config: t
|
|
76
76
|
}), {
|
|
@@ -79,8 +79,8 @@ const lt = ["innerHTML"], st = { class: "references-header" }, ut = ["aria-label
|
|
|
79
79
|
getSectionId: ie,
|
|
80
80
|
getTagId: le,
|
|
81
81
|
hash: O,
|
|
82
|
-
isIntersectionEnabled:
|
|
83
|
-
updateHash:
|
|
82
|
+
isIntersectionEnabled: _,
|
|
83
|
+
updateHash: A,
|
|
84
84
|
replaceUrlState: se
|
|
85
85
|
} = R;
|
|
86
86
|
if (t.value.redirect && typeof window < "u") {
|
|
@@ -90,11 +90,11 @@ const lt = ["innerHTML"], st = { class: "references-header" }, ut = ["aria-label
|
|
|
90
90
|
e && history.replaceState({}, "", e);
|
|
91
91
|
}
|
|
92
92
|
ge(() => {
|
|
93
|
-
|
|
93
|
+
A(), Oe();
|
|
94
94
|
});
|
|
95
|
-
const
|
|
95
|
+
const P = async (e) => {
|
|
96
96
|
var o;
|
|
97
|
-
|
|
97
|
+
_.value = !1, A(), e ? re(e) : (o = w.value) == null || o.scrollTo(0, 0), await He(100), _.value = !0;
|
|
98
98
|
}, F = D(0);
|
|
99
99
|
K(() => {
|
|
100
100
|
var n, i, C;
|
|
@@ -105,8 +105,8 @@ const lt = ["innerHTML"], st = { class: "references-header" }, ut = ["aria-label
|
|
|
105
105
|
F.value = $ < 2 ? 0 : $;
|
|
106
106
|
}
|
|
107
107
|
window.onhashchange = () => {
|
|
108
|
-
|
|
109
|
-
}, window.onpopstate = () => t.value.pathRouting &&
|
|
108
|
+
P(ae());
|
|
109
|
+
}, window.onpopstate = () => t.value.pathRouting && P(ne(window.location.pathname)), window.addEventListener("scroll", N, { passive: !0 });
|
|
110
110
|
});
|
|
111
111
|
const ue = T(
|
|
112
112
|
() => ee.value || !t.value.isEditable
|
|
@@ -173,14 +173,14 @@ const lt = ["innerHTML"], st = { class: "references-header" }, ut = ["aria-label
|
|
|
173
173
|
U("defaultHttpClient", ce), U("hiddenClients", de);
|
|
174
174
|
const me = T(
|
|
175
175
|
() => `<style>
|
|
176
|
-
${
|
|
176
|
+
${Ae(t.value.theme, {
|
|
177
177
|
fonts: t.value.withDefaultFonts
|
|
178
178
|
})}</style>`
|
|
179
179
|
), { mediaQueries: fe } = Fe(), ve = !1;
|
|
180
180
|
return E(fe.lg, (e, o) => {
|
|
181
|
-
o && !e && (
|
|
181
|
+
o && !e && (I.value = !1);
|
|
182
182
|
}), E(O, (e, o) => {
|
|
183
|
-
e && e !== o && (
|
|
183
|
+
e && e !== o && (I.value = !1);
|
|
184
184
|
}), (e, o) => {
|
|
185
185
|
var n, i, C, $, Y;
|
|
186
186
|
return a(), f(G, null, [
|
|
@@ -194,7 +194,7 @@ const lt = ["innerHTML"], st = { class: "references-header" }, ut = ["aria-label
|
|
|
194
194
|
"scalar-scrollbars-obtrusive": oe.value,
|
|
195
195
|
"references-editable": t.value.isEditable,
|
|
196
196
|
"references-sidebar": t.value.showSidebar,
|
|
197
|
-
"references-sidebar-mobile-open": r(
|
|
197
|
+
"references-sidebar-mobile-open": r(I),
|
|
198
198
|
"references-classic": t.value.layout === "classic"
|
|
199
199
|
},
|
|
200
200
|
e.$attrs.class
|
|
@@ -216,7 +216,7 @@ const lt = ["innerHTML"], st = { class: "references-header" }, ut = ["aria-label
|
|
|
216
216
|
class: "references-navigation t-doc__sidebar"
|
|
217
217
|
}, [
|
|
218
218
|
p("div", dt, [
|
|
219
|
-
v(r(
|
|
219
|
+
v(r(Ie), null, {
|
|
220
220
|
default: s(() => {
|
|
221
221
|
var S, m;
|
|
222
222
|
return [
|
|
@@ -224,14 +224,14 @@ const lt = ["innerHTML"], st = { class: "references-header" }, ut = ["aria-label
|
|
|
224
224
|
title: ((m = (S = r(d)) == null ? void 0 : S.info) == null ? void 0 : m.title) ?? "The OpenAPI Schema"
|
|
225
225
|
}, {
|
|
226
226
|
"sidebar-start": s(() => {
|
|
227
|
-
var
|
|
227
|
+
var B;
|
|
228
228
|
return [
|
|
229
229
|
e.$slots["document-selector"] ? (a(), f("div", ct, [
|
|
230
230
|
u(e.$slots, "document-selector", {}, void 0, !0)
|
|
231
231
|
])) : l("", !0),
|
|
232
232
|
t.value.hideSearch ? l("", !0) : (a(), f("div", mt, [
|
|
233
233
|
v(r(W), {
|
|
234
|
-
searchHotKey: (
|
|
234
|
+
searchHotKey: (B = t.value) == null ? void 0 : B.searchHotKey,
|
|
235
235
|
spec: k.value
|
|
236
236
|
}, null, 8, ["searchHotKey", "spec"])
|
|
237
237
|
])),
|
|
@@ -240,12 +240,12 @@ const lt = ["innerHTML"], st = { class: "references-header" }, ut = ["aria-label
|
|
|
240
240
|
}),
|
|
241
241
|
"sidebar-end": s(() => [
|
|
242
242
|
u(e.$slots, "sidebar-end", g(h(c.value)), () => [
|
|
243
|
-
v(r(
|
|
243
|
+
v(r(Be), { class: "darklight-reference" }, {
|
|
244
244
|
toggle: s(() => [
|
|
245
245
|
t.value.hideDarkModeToggle ? (a(), f("span", ft)) : (a(), y(r(Re), {
|
|
246
246
|
key: 0,
|
|
247
247
|
modelValue: e.isDark,
|
|
248
|
-
"onUpdate:modelValue": o[0] || (o[0] = (
|
|
248
|
+
"onUpdate:modelValue": o[0] || (o[0] = (B) => e.$emit("toggleDarkMode"))
|
|
249
249
|
}, null, 8, ["modelValue"]))
|
|
250
250
|
]),
|
|
251
251
|
default: s(() => [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DocumentSelector.vue.d.ts","sourceRoot":"","sources":["../../../src/components/DocumentSelector/DocumentSelector.vue"],"names":[],"mappings":"
|
|
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;;;;;;AA4HF,wBAOG"}
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { defineComponent as p, computed as s, createElementBlock as b, createCommentVNode as f, openBlock as x, createVNode 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 S } from "@scalar/icons";
|
|
4
|
+
const h = {
|
|
5
5
|
key: 0,
|
|
6
6
|
class: "document-selector -mb-1 p-3 pb-0"
|
|
7
|
-
},
|
|
8
|
-
class: "group/dropdown-label hover:bg-b-2 text-c-2 flex w-full cursor-pointer items-center rounded border
|
|
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
9
|
tabindex: "0"
|
|
10
|
-
}, _ = { class: "text-c-1 overflow-hidden text-
|
|
10
|
+
}, _ = { class: "text-c-1 overflow-hidden text-base text-ellipsis" }, y = /* @__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: d }) {
|
|
18
|
+
const u = d, m = s(() => {
|
|
19
19
|
var e;
|
|
20
20
|
return l.options && ((e = l.options) == null ? void 0 : e.length) > 1;
|
|
21
|
-
}),
|
|
21
|
+
}), a = s(
|
|
22
22
|
() => {
|
|
23
23
|
var e;
|
|
24
24
|
return ((e = l.options) == null ? void 0 : e.map((o, t) => ({
|
|
@@ -28,25 +28,22 @@ const w = {
|
|
|
28
28
|
}))) || [];
|
|
29
29
|
}
|
|
30
30
|
), n = s({
|
|
31
|
-
get: () =>
|
|
32
|
-
set: (e) =>
|
|
31
|
+
get: () => a.value.find(({ id: e }) => e === String(l.modelValue)),
|
|
32
|
+
set: (e) => u("update:modelValue", Number(e.id))
|
|
33
33
|
});
|
|
34
|
-
return (e, o) =>
|
|
35
|
-
|
|
34
|
+
return (e, o) => m.value ? (x(), b("div", h, [
|
|
35
|
+
r(i(g), {
|
|
36
36
|
modelValue: n.value,
|
|
37
37
|
"onUpdate:modelValue": o[0] || (o[0] = (t) => n.value = t),
|
|
38
|
-
options:
|
|
38
|
+
options: a.value,
|
|
39
39
|
resize: ""
|
|
40
40
|
}, {
|
|
41
41
|
default: v(() => {
|
|
42
42
|
var t;
|
|
43
43
|
return [
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
weight: "bold"
|
|
48
|
-
}),
|
|
49
|
-
d("span", _, V(((t = n.value) == null ? void 0 : t.label) || "Select API"), 1)
|
|
44
|
+
c("div", w, [
|
|
45
|
+
r(i(S), { class: "mr-1 size-4 text-current" }),
|
|
46
|
+
c("span", _, V(((t = n.value) == null ? void 0 : t.label) || "Select API"), 1)
|
|
50
47
|
])
|
|
51
48
|
];
|
|
52
49
|
}),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./Sidebar.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import r from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const e = /* @__PURE__ */ r(o, [["__scopeId", "data-v-fbdf40e7"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
e as default
|
|
7
7
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SidebarElement.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Sidebar/SidebarElement.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SidebarElement.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Sidebar/SidebarElement.vue"],"names":[],"mappings":"AAiWA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAA;AAQhE,KAAK,WAAW,GAAG;IACjB,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,cAAc,CAAA;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,IAAI,CAAC,EAAE,OAAO,CAAA;CACf,CAAC;AAuEF,iBAAS,cAAc;WA+KT,OAAO,IAA6B;;yBATpB,GAAG;+BACG,GAAG;;;;EAatC;AAiBD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;;;;4FAQnB,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"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./SidebarElement.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-
|
|
4
|
+
const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-9ab41262"]]);
|
|
5
5
|
export {
|
|
6
6
|
m as default
|
|
7
7
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./SidebarGroup.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import r from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const m = /* @__PURE__ */ r(o, [["__scopeId", "data-v-
|
|
4
|
+
const m = /* @__PURE__ */ r(o, [["__scopeId", "data-v-5d54b401"]]);
|
|
5
5
|
export {
|
|
6
6
|
m as default
|
|
7
7
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./ExampleResponses.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import e from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const m = /* @__PURE__ */ e(o, [["__scopeId", "data-v-
|
|
4
|
+
const m = /* @__PURE__ */ e(o, [["__scopeId", "data-v-ee300101"]]);
|
|
5
5
|
export {
|
|
6
6
|
m as default
|
|
7
7
|
};
|
|
@@ -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":"AAoFA,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;;AAyJzB,wBAOG"}
|
|
@@ -1,7 +1,62 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
import
|
|
4
|
-
|
|
1
|
+
import { defineComponent as w, ref as v, watch as C, nextTick as K, onMounted as B, onBeforeUnmount as b, createElementBlock as r, openBlock as a, Fragment as s, createVNode as c, unref as l, withCtx as u, createElementVNode as n, createTextVNode as m, toDisplayString as E } from "vue";
|
|
2
|
+
import { useModal as H, ScalarSidebarSearchButton as M } from "@scalar/components";
|
|
3
|
+
import { isMacOS as f } from "@scalar/helpers/general/is-mac-os";
|
|
4
|
+
import g from "./SearchModal.vue.js";
|
|
5
|
+
import { useApiClient as x } from "../ApiClientModal/useApiClient.js";
|
|
6
|
+
const O = /* @__PURE__ */ w({
|
|
7
|
+
__name: "SearchButton",
|
|
8
|
+
props: {
|
|
9
|
+
spec: {},
|
|
10
|
+
searchHotKey: { default: "k" }
|
|
11
|
+
},
|
|
12
|
+
setup(y) {
|
|
13
|
+
const S = y, p = v(), o = H(), { client: h } = x(), d = (t) => {
|
|
14
|
+
var e;
|
|
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
|
+
};
|
|
17
|
+
C(
|
|
18
|
+
() => o.open,
|
|
19
|
+
(t, e) => {
|
|
20
|
+
!t && e && K(() => {
|
|
21
|
+
var i;
|
|
22
|
+
(i = p.value) == null || i.focus();
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
), B(() => window.addEventListener("keydown", d)), b(() => window.removeEventListener("keydown", d));
|
|
26
|
+
function k() {
|
|
27
|
+
o.show();
|
|
28
|
+
}
|
|
29
|
+
return (t, e) => (a(), r(s, null, [
|
|
30
|
+
c(l(M), {
|
|
31
|
+
ref_key: "button",
|
|
32
|
+
ref: p,
|
|
33
|
+
onClick: k
|
|
34
|
+
}, {
|
|
35
|
+
shortcut: u(() => [
|
|
36
|
+
l(f)() ? (a(), r(s, { key: 0 }, [
|
|
37
|
+
m("⌘")
|
|
38
|
+
], 64)) : (a(), r(s, { key: 1 }, [
|
|
39
|
+
e[0] || (e[0] = n("span", { class: "sr-only" }, "CTRL", -1)),
|
|
40
|
+
e[1] || (e[1] = n("span", { "aria-hidden": "true" }, "⌃", -1))
|
|
41
|
+
], 64)),
|
|
42
|
+
m(" " + E(t.searchHotKey), 1)
|
|
43
|
+
]),
|
|
44
|
+
default: u(() => [
|
|
45
|
+
e[2] || (e[2] = n("span", { class: "sr-only" }, "Open Search", -1)),
|
|
46
|
+
e[3] || (e[3] = n("span", {
|
|
47
|
+
"aria-hidden": "true",
|
|
48
|
+
class: "sidebar-search-placeholder"
|
|
49
|
+
}, " Search ", -1))
|
|
50
|
+
]),
|
|
51
|
+
_: 1
|
|
52
|
+
}, 512),
|
|
53
|
+
c(g, {
|
|
54
|
+
modalState: l(o),
|
|
55
|
+
parsedSpec: t.spec
|
|
56
|
+
}, null, 8, ["modalState", "parsedSpec"])
|
|
57
|
+
], 64));
|
|
58
|
+
}
|
|
59
|
+
});
|
|
5
60
|
export {
|
|
6
|
-
|
|
61
|
+
O as default
|
|
7
62
|
};
|
|
@@ -1,72 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { useModal as B } from "@scalar/components";
|
|
3
|
-
import { isMacOS as m } from "@scalar/helpers/general/is-mac-os";
|
|
4
|
-
import { ScalarIconMagnifyingGlass as E } from "@scalar/icons";
|
|
5
|
-
import H from "./SearchModal.vue.js";
|
|
6
|
-
import { useApiClient as L } from "../ApiClientModal/useApiClient.js";
|
|
7
|
-
const N = { class: "sidebar-search-input" }, T = { class: "sidebar-search-shortcut" }, V = { class: "sidebar-search-key" }, G = /* @__PURE__ */ S({
|
|
8
|
-
__name: "SearchButton",
|
|
9
|
-
props: {
|
|
10
|
-
spec: {},
|
|
11
|
-
searchHotKey: { default: "k" }
|
|
12
|
-
},
|
|
13
|
-
setup(f) {
|
|
14
|
-
const h = f, i = b(), s = B(), { client: y } = L(), d = (o) => {
|
|
15
|
-
var e;
|
|
16
|
-
(m() ? o.metaKey : o.ctrlKey) && o.key === h.searchHotKey && !((e = y.value) != null && e.modalState.open) && (o.preventDefault(), o.stopPropagation(), s.open ? s.hide() : s.show());
|
|
17
|
-
};
|
|
18
|
-
w(
|
|
19
|
-
() => s.open,
|
|
20
|
-
(o, e) => {
|
|
21
|
-
!o && e && v(() => {
|
|
22
|
-
var c;
|
|
23
|
-
(c = i.value) == null || c.focus();
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
), K(() => window.addEventListener("keydown", d)), g(() => window.removeEventListener("keydown", d));
|
|
27
|
-
function k() {
|
|
28
|
-
s.show();
|
|
29
|
-
}
|
|
30
|
-
return (o, e) => (n(), a(r, null, [
|
|
31
|
-
t("button", {
|
|
32
|
-
ref_key: "button",
|
|
33
|
-
ref: i,
|
|
34
|
-
class: C(["sidebar-search", o.$attrs.class]),
|
|
35
|
-
role: "search",
|
|
36
|
-
type: "button",
|
|
37
|
-
onClick: k
|
|
38
|
-
}, [
|
|
39
|
-
p(l(E), {
|
|
40
|
-
class: "scalar-search-icon",
|
|
41
|
-
weight: "bold"
|
|
42
|
-
}),
|
|
43
|
-
t("div", N, [
|
|
44
|
-
e[3] || (e[3] = t("span", { class: "sr-only" }, "Open Search", -1)),
|
|
45
|
-
e[4] || (e[4] = t("span", {
|
|
46
|
-
"aria-hidden": "true",
|
|
47
|
-
class: "sidebar-search-placeholder"
|
|
48
|
-
}, " Search ", -1)),
|
|
49
|
-
t("span", T, [
|
|
50
|
-
e[2] || (e[2] = t("span", { class: "sr-only" }, "Keyboard Shortcut:", -1)),
|
|
51
|
-
t("kbd", V, [
|
|
52
|
-
l(m)() ? (n(), a(r, { key: 0 }, [
|
|
53
|
-
u("⌘")
|
|
54
|
-
], 64)) : (n(), a(r, { key: 1 }, [
|
|
55
|
-
e[0] || (e[0] = t("span", { class: "sr-only" }, "CTRL", -1)),
|
|
56
|
-
e[1] || (e[1] = t("span", { "aria-hidden": "true" }, "⌃", -1))
|
|
57
|
-
], 64)),
|
|
58
|
-
u(" " + M(o.searchHotKey), 1)
|
|
59
|
-
])
|
|
60
|
-
])
|
|
61
|
-
])
|
|
62
|
-
], 2),
|
|
63
|
-
p(H, {
|
|
64
|
-
modalState: l(s),
|
|
65
|
-
parsedSpec: o.spec
|
|
66
|
-
}, null, 8, ["modalState", "parsedSpec"])
|
|
67
|
-
], 64));
|
|
68
|
-
}
|
|
69
|
-
});
|
|
1
|
+
import f from "./SearchButton.vue.js";
|
|
70
2
|
export {
|
|
71
|
-
|
|
3
|
+
f as default
|
|
72
4
|
};
|