@scalar/api-reference 1.31.14 → 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.
@@ -1,72 +1,4 @@
1
- import { defineComponent as S, ref as b, watch as w, nextTick as v, onMounted as K, onBeforeUnmount as g, createElementBlock as a, openBlock as n, Fragment as r, createElementVNode as t, createVNode as p, normalizeClass as C, unref as l, createTextVNode as u, toDisplayString as M } from "vue";
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
- G as default
3
+ f as default
72
4
  };