@scalar/api-reference 1.25.41 → 1.25.43

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 +1 @@
1
- {"version":3,"file":"SearchButton.vue.d.ts","sourceRoot":"","sources":["../../../src/features/Search/SearchButton.vue"],"names":[],"mappings":"AAkIA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;;UAWtC,IAAI;mBACK,MAAM;;UADf,IAAI;mBACK,MAAM;;kBAAN,MAAM;;AA6HzB,wBAOG"}
1
+ {"version":3,"file":"SearchButton.vue.d.ts","sourceRoot":"","sources":["../../../src/features/Search/SearchButton.vue"],"names":[],"mappings":"AAiIA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;;UAWtC,IAAI;mBACK,MAAM;;UADf,IAAI;mBACK,MAAM;;kBAAN,MAAM;;AAgIzB,wBAOG"}
@@ -1,7 +1,7 @@
1
1
  import o from "./SearchButton.vue2.js";
2
2
  /* empty css */
3
3
  import t from "../../_virtual/_plugin-vue_export-helper.js";
4
- const e = /* @__PURE__ */ t(o, [["__scopeId", "data-v-bc475de3"]]);
4
+ const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-831b7e18"]]);
5
5
  export {
6
- e as default
6
+ m as default
7
7
  };
@@ -1,54 +1,56 @@
1
- import { defineComponent as h, ref as u, onMounted as f, openBlock as S, createElementBlock as y, Fragment as k, createElementVNode as o, normalizeClass as b, unref as a, createVNode as l, toDisplayString as i } from "vue";
1
+ import { defineComponent as u, ref as h, onMounted as f, openBlock as S, createElementBlock as y, Fragment as b, createElementVNode as o, normalizeClass as k, unref as a, createVNode as c, toDisplayString as i } from "vue";
2
2
  import { useModal as v, ScalarIcon as K } from "@scalar/components";
3
3
  import { isMacOS as r } from "@scalar/use-tooltip";
4
- import { useMagicKeys as M, whenever as _ } from "@vueuse/core";
5
- import { modalStateBus as g } from "../../components/api-client-bus.js";
6
- import w from "./SearchModal.vue.js";
7
- const B = { class: "sidebar-search-input" }, C = { class: "sidebar-search-shortcut" }, H = { class: "sidebar-search-key" }, V = /* @__PURE__ */ h({
4
+ import { useMagicKeys as M, whenever as g } from "@vueuse/core";
5
+ import { modalStateBus as w } from "../../components/api-client-bus.js";
6
+ import B from "./SearchModal.vue.js";
7
+ const C = { class: "sidebar-search-input" }, H = { class: "sidebar-search-shortcut" }, E = { class: "sidebar-search-key" }, V = /* @__PURE__ */ u({
8
8
  __name: "SearchButton",
9
9
  props: {
10
10
  spec: {},
11
11
  searchHotKey: { default: "k" }
12
12
  },
13
13
  setup(p) {
14
- const n = p, s = v(), c = u(null), d = M({
14
+ const n = p, t = v(), l = h(null), d = M({
15
15
  passive: !1,
16
16
  onEventFired(e) {
17
17
  !r() && e.ctrlKey && e.key === n.searchHotKey && (e.preventDefault(), e.stopPropagation());
18
18
  }
19
19
  });
20
20
  return f(() => {
21
- g.on((e) => {
22
- c.value = e;
21
+ w.on((e) => {
22
+ l.value = e;
23
23
  });
24
- }), _(
24
+ }), g(
25
25
  d[`${r() ? "meta" : "control"}_${n.searchHotKey}`],
26
26
  () => {
27
27
  var e;
28
- (e = c.value) != null && e.open || (s.open ? s.hide() : s.show());
28
+ (e = l.value) != null && e.open || (t.open ? t.hide() : t.show());
29
29
  }
30
- ), (e, t) => (S(), y(k, null, [
30
+ ), (e, s) => (S(), y(b, null, [
31
31
  o("button", {
32
- class: b(["sidebar-search", e.$attrs.class]),
32
+ class: k(["sidebar-search", e.$attrs.class]),
33
33
  type: "button",
34
- onClick: t[0] || (t[0] = //@ts-ignore
35
- (...m) => a(s).show && a(s).show(...m))
34
+ onClick: s[0] || (s[0] = //@ts-ignore
35
+ (...m) => a(t).show && a(t).show(...m))
36
36
  }, [
37
- l(a(K), {
37
+ c(a(K), {
38
38
  class: "search-icon",
39
39
  icon: "Search",
40
40
  size: "sm",
41
41
  thickness: "2.5"
42
42
  }),
43
- o("div", B, [
44
- t[1] || (t[1] = o("span", { class: "sidebar-search-placeholder" }, "Search", -1)),
45
- o("span", C, [
46
- o("span", H, i(a(r)() ? "⌘" : "⌃") + i(e.searchHotKey), 1)
43
+ o("div", C, [
44
+ s[2] || (s[2] = o("span", { class: "sr-only" }, "Open ", -1)),
45
+ s[3] || (s[3] = o("span", { class: "sidebar-search-placeholder" }, "Search", -1)),
46
+ o("span", H, [
47
+ s[1] || (s[1] = o("span", { class: "sr-only" }, "(Keyboard Shortcut)", -1)),
48
+ o("kbd", E, i(a(r)() ? "⌘" : "⌃") + i(e.searchHotKey), 1)
47
49
  ])
48
50
  ])
49
51
  ], 2),
50
- l(w, {
51
- modalState: a(s),
52
+ c(B, {
53
+ modalState: a(t),
52
54
  parsedSpec: e.spec
53
55
  }, null, 8, ["modalState", "parsedSpec"])
54
56
  ], 64));
@@ -1 +1 @@
1
- {"version":3,"file":"SearchModal.vue.d.ts","sourceRoot":"","sources":["../../../src/features/Search/SearchModal.vue"],"names":[],"mappings":"AAiNA,OAAO,EAEL,KAAK,UAAU,EAKhB,MAAM,oBAAoB,CAAA;AAC3B,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;;gBAalC,IAAI;gBACJ,UAAU;;gBADV,IAAI;gBACJ,UAAU;;AAyWxB,wBAMG"}
1
+ {"version":3,"file":"SearchModal.vue.d.ts","sourceRoot":"","sources":["../../../src/features/Search/SearchModal.vue"],"names":[],"mappings":"AAyQA,OAAO,EAEL,KAAK,UAAU,EAKhB,MAAM,oBAAoB,CAAA;AAC3B,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;;gBAclC,IAAI;gBACJ,UAAU;;gBADV,IAAI;gBACJ,UAAU;;AA6ZxB,wBAMG"}
@@ -1,7 +1,7 @@
1
1
  import o from "./SearchModal.vue2.js";
2
2
  /* empty css */
3
3
  import r from "../../_virtual/_plugin-vue_export-helper.js";
4
- const d = /* @__PURE__ */ r(o, [["__scopeId", "data-v-fc89d20d"]]);
4
+ const p = /* @__PURE__ */ r(o, [["__scopeId", "data-v-829b4762"]]);
5
5
  export {
6
- d as default
6
+ p as default
7
7
  };
@@ -1,139 +1,171 @@
1
- import { defineComponent as M, toRef as U, ref as q, watch as I, openBlock as f, createBlock as k, unref as a, withKeys as h, withModifiers as S, withCtx as n, createElementVNode as c, createVNode as v, isRef as L, createTextVNode as g, toDisplayString as p, createElementBlock as z, Fragment as D, renderList as H, createSlots as K, normalizeClass as P } from "vue";
2
- import { ScalarModal as O, ScalarSearchInput as W, ScalarSearchResultList as Y, ScalarSearchResultItem as j } from "@scalar/components";
3
- import { lazyBus as A } from "../../components/Content/Lazy/lazyBus.js";
4
- import G from "../../components/Sidebar/SidebarHttpBadge.vue.js";
5
- import { useSearchIndex as J } from "./useSearchIndex.js";
6
- import { useSidebar as Q } from "../../hooks/useSidebar.js";
7
- import { scrollToId as b } from "../../helpers/scrollToId.js";
8
- const ae = /* @__PURE__ */ M({
1
+ import { defineComponent as O, toRef as W, ref as Y, watch as x, computed as A, openBlock as h, createBlock as B, unref as s, withKeys as R, withModifiers as b, withCtx as i, createElementVNode as r, createVNode as I, isRef as j, createTextVNode as c, toDisplayString as m, createElementBlock as $, Fragment as N, renderList as G, createSlots as J, normalizeClass as Q, createCommentVNode as X } from "vue";
2
+ import { ScalarModal as Z, ScalarSearchInput as _, ScalarSearchResultList as ee, ScalarSearchResultItem as te } from "@scalar/components";
3
+ import { nanoid as oe } from "nanoid";
4
+ import { lazyBus as ae } from "../../components/Content/Lazy/lazyBus.js";
5
+ import se from "../../components/Sidebar/SidebarHttpBadge.vue.js";
6
+ import { useSearchIndex as re } from "./useSearchIndex.js";
7
+ import { useSidebar as ne } from "../../hooks/useSidebar.js";
8
+ import { scrollToId as E } from "../../helpers/scrollToId.js";
9
+ const ie = { class: "sr-only" }, le = { class: "sr-only" }, ve = /* @__PURE__ */ O({
9
10
  __name: "SearchModal",
10
11
  props: {
11
12
  parsedSpec: {},
12
13
  modalState: {}
13
14
  },
14
- setup(C) {
15
- const d = C, V = U(d, "parsedSpec"), {
16
- resetSearch: B,
17
- fuseSearch: x,
18
- selectedSearchResult: r,
19
- searchResultsWithPlaceholderResults: i,
20
- searchText: m
21
- } = J({
22
- specification: V
23
- }), F = {
15
+ setup(y) {
16
+ const p = y, F = W(p, "parsedSpec"), S = oe(), k = `${S}-search-result`, v = `${S}-search-instructions`, g = (o) => `${S}${o}`, {
17
+ resetSearch: q,
18
+ fuseSearch: D,
19
+ selectedSearchResult: n,
20
+ searchResultsWithPlaceholderResults: l,
21
+ searchText: u
22
+ } = re({
23
+ specification: F
24
+ }), L = {
24
25
  heading: "DocsPage",
25
26
  model: "Brackets",
26
27
  req: "Terminal",
27
28
  tag: "CodeFolder",
28
29
  webhook: "Terminal"
29
- }, N = q(null);
30
- I(
31
- () => d.modalState.open,
30
+ }, M = {
31
+ heading: "Document Heading",
32
+ model: "",
33
+ // The title of the entry is already :"Model"
34
+ req: "Request",
35
+ tag: "Tag",
36
+ webhook: "Webhook"
37
+ }, P = Y(null);
38
+ x(
39
+ () => p.modalState.open,
32
40
  (o) => {
33
- o && B();
41
+ o && q();
34
42
  }
35
43
  );
36
- const { setCollapsedSidebarItem: T } = Q(), E = /#(tag\/[^/]*)/;
37
- function R(o) {
44
+ const { setCollapsedSidebarItem: H } = ne(), U = /#(tag\/[^/]*)/;
45
+ function w(o) {
38
46
  let t = "models";
39
- const e = o.item.href.match(E);
40
- e != null && e.length && e.length > 1 && (t = e[1]), T(t, !0);
41
- const l = o.item.href.replace("#", "");
42
- if (document.getElementById(l))
43
- b(l), d.modalState.hide();
47
+ const e = o.item.href.match(U);
48
+ e != null && e.length && e.length > 1 && (t = e[1]), H(t, !0);
49
+ const a = o.item.href.replace("#", "");
50
+ if (document.getElementById(a))
51
+ E(a), p.modalState.hide();
44
52
  else {
45
- const s = A.on((u) => {
46
- u.id === l && (b(l), s(), d.modalState.hide());
53
+ const d = ae.on((f) => {
54
+ f.id === a && (E(a), d(), p.modalState.hide());
47
55
  });
48
56
  }
49
57
  }
50
- I(r, (o) => {
51
- var e;
52
- const t = i.value[o];
53
- (e = document.getElementById(t.item.href)) == null || e.scrollIntoView({
58
+ x(n, (o) => {
59
+ var a;
60
+ const t = l.value[o], e = g(t == null ? void 0 : t.item.href);
61
+ (a = document.getElementById(e)) == null || a.scrollIntoView({
54
62
  behavior: "smooth",
55
63
  block: "nearest"
56
64
  });
57
65
  });
58
- const w = (o) => {
59
- const t = o === "up" ? -1 : 1, e = i.value.length, l = (r.value + t + e) % e;
60
- r.value = l;
66
+ const z = A(() => {
67
+ const o = n.value, t = l.value[o];
68
+ return g(t == null ? void 0 : t.item.href);
69
+ }), V = (o) => {
70
+ const t = o === "up" ? -1 : 1, e = l.value.length, a = (n.value + t + e) % e;
71
+ n.value = a;
61
72
  };
62
- function $(o) {
73
+ function K(o) {
63
74
  const t = new URL(window.location.href);
64
75
  return t.hash = o, t.toString();
65
76
  }
66
- return (o, t) => (f(), k(a(O), {
77
+ return (o, t) => (h(), B(s(Z), {
67
78
  state: o.modalState,
68
79
  variant: "search",
69
80
  onKeydown: [
70
- t[1] || (t[1] = h(S((e) => w("down"), ["stop", "prevent"]), ["down"])),
71
- t[2] || (t[2] = h(S((e) => R(
72
- a(i)[a(r)]
81
+ t[1] || (t[1] = R(b((e) => V("down"), ["stop", "prevent"]), ["down"])),
82
+ t[2] || (t[2] = R(b((e) => w(
83
+ s(l)[s(n)]
73
84
  ), ["stop", "prevent"]), ["enter"])),
74
- t[3] || (t[3] = h(S((e) => w("up"), ["stop", "prevent"]), ["up"]))
85
+ t[3] || (t[3] = R(b((e) => V("up"), ["stop", "prevent"]), ["up"]))
75
86
  ]
76
87
  }, {
77
- default: n(() => [
78
- c("div", {
88
+ default: i(() => [
89
+ r("div", {
79
90
  ref_key: "searchModalRef",
80
- ref: N,
81
- class: "ref-search-container"
91
+ ref: P,
92
+ "aria-label": "Reference Search",
93
+ class: "ref-search-container",
94
+ role: "search"
82
95
  }, [
83
- v(a(W), {
84
- modelValue: a(m),
85
- "onUpdate:modelValue": t[0] || (t[0] = (e) => L(m) ? m.value = e : null),
86
- onInput: a(x)
87
- }, null, 8, ["modelValue", "onInput"])
96
+ I(s(_), {
97
+ modelValue: s(u),
98
+ "onUpdate:modelValue": t[0] || (t[0] = (e) => j(u) ? u.value = e : null),
99
+ "aria-activedescendant": z.value,
100
+ "aria-controls": k,
101
+ "aria-describedby": v,
102
+ onInput: s(D)
103
+ }, null, 8, ["modelValue", "aria-activedescendant", "onInput"])
88
104
  ], 512),
89
- v(a(Y), {
105
+ I(s(ee), {
106
+ id: k,
107
+ "aria-describedby": v,
108
+ "aria-label": "Reference Search Results",
90
109
  class: "ref-search-results custom-scroll",
91
- noResults: !a(i).length
110
+ noResults: !s(l).length
92
111
  }, {
93
- query: n(() => [
94
- g(p(a(m)), 1)
112
+ query: i(() => [
113
+ c(m(s(u)), 1)
95
114
  ]),
96
- default: n(() => [
97
- (f(!0), z(D, null, H(a(i), (e, l) => (f(), k(a(j), {
98
- id: e.item.href,
115
+ default: i(() => [
116
+ (h(!0), $(N, null, G(s(l), (e, a) => (h(), B(s(te), {
117
+ id: g(e.item.href),
99
118
  key: e.refIndex,
100
- active: a(r) === l,
101
- href: $(e.item.href),
102
- icon: F[e.item.type],
103
- onClick: (s) => R(e),
104
- onFocus: (s) => r.value = l
105
- }, K({
106
- default: n(() => {
107
- var s, u;
119
+ active: s(n) === a,
120
+ href: K(e.item.href),
121
+ icon: L[e.item.type],
122
+ onClick: (d) => w(e),
123
+ onFocus: (d) => n.value = a
124
+ }, J({
125
+ default: i(() => {
126
+ var d, f, C, T;
108
127
  return [
109
- c("span", {
110
- class: P({
111
- deprecated: (u = (s = e.item.operation) == null ? void 0 : s.information) == null ? void 0 : u.deprecated
128
+ r("span", {
129
+ class: Q({
130
+ deprecated: (f = (d = e.item.operation) == null ? void 0 : d.information) == null ? void 0 : f.deprecated
112
131
  })
113
- }, p(e.item.title), 3)
132
+ }, [
133
+ r("span", ie, [
134
+ c(m(M[e.item.type]) + ":  ", 1),
135
+ (T = (C = e.item.operation) == null ? void 0 : C.information) != null && T.deprecated ? (h(), $(N, { key: 0 }, [
136
+ c(" (Deprecated)  ")
137
+ ], 64)) : X("", !0)
138
+ ]),
139
+ c(" " + m(e.item.title) + " ", 1),
140
+ t[4] || (t[4] = r("span", { class: "sr-only" }, ",", -1))
141
+ ], 2)
114
142
  ];
115
143
  }),
116
144
  _: 2
117
145
  }, [
118
146
  (e.item.httpVerb || e.item.path) && e.item.path !== e.item.title ? {
119
147
  name: "description",
120
- fn: n(() => [
121
- g(p(e.item.path), 1)
148
+ fn: i(() => [
149
+ t[5] || (t[5] = r("span", { class: "sr-only" }, "Path: ", -1)),
150
+ c(" " + m(e.item.path), 1)
122
151
  ]),
123
152
  key: "0"
124
153
  } : e.item.description ? {
125
154
  name: "description",
126
- fn: n(() => [
127
- g(p(e.item.description), 1)
155
+ fn: i(() => [
156
+ t[6] || (t[6] = r("span", { class: "sr-only" }, "Description: ", -1)),
157
+ c(" " + m(e.item.description), 1)
128
158
  ]),
129
159
  key: "1"
130
160
  } : void 0,
131
161
  e.item.type === "req" ? {
132
162
  name: "addon",
133
- fn: n(() => [
134
- v(G, {
163
+ fn: i(() => [
164
+ I(se, {
165
+ "aria-hidden": "true",
135
166
  method: e.item.httpVerb ?? "get"
136
- }, null, 8, ["method"])
167
+ }, null, 8, ["method"]),
168
+ r("span", le, " HTTP Method: " + m(e.item.httpVerb ?? "get") + ", ", 1)
137
169
  ]),
138
170
  key: "2"
139
171
  } : void 0
@@ -141,15 +173,19 @@ const ae = /* @__PURE__ */ M({
141
173
  ]),
142
174
  _: 1
143
175
  }, 8, ["noResults"]),
144
- t[4] || (t[4] = c("div", { class: "ref-search-meta" }, [
145
- c("span", null, "↑↓ Navigate"),
146
- c("span", null, "⏎ Select")
147
- ], -1))
176
+ t[7] || (t[7] = r("div", { class: "ref-search-meta" }, [
177
+ r("span", null, "↑↓ Navigate"),
178
+ r("span", null, "⏎ Select")
179
+ ], -1)),
180
+ r("div", {
181
+ id: v,
182
+ class: "sr-only"
183
+ }, " Press up arrow / down arrow to navigate, enter to select, type to filter results ")
148
184
  ]),
149
185
  _: 1
150
186
  }, 8, ["state"]));
151
187
  }
152
188
  });
153
189
  export {
154
- ae as default
190
+ ve as default
155
191
  };