@scalar/api-reference 1.25.22 → 1.25.23

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.
Files changed (29) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/dist/browser/standalone.js +8501 -8501
  3. package/dist/browser/webpack-stats.json +1 -1
  4. package/dist/components/ApiClientModal.vue.d.ts +2 -0
  5. package/dist/components/ApiClientModal.vue.d.ts.map +1 -1
  6. package/dist/components/ApiClientModal.vue.js +13 -11
  7. package/dist/components/ApiReferenceLayout.vue.d.ts.map +1 -1
  8. package/dist/components/ApiReferenceLayout.vue.js +1 -1
  9. package/dist/components/ApiReferenceLayout.vue2.js +92 -91
  10. package/dist/components/Content/Schema/SchemaProperty.vue.d.ts.map +1 -1
  11. package/dist/components/Content/Schema/SchemaProperty.vue.js +1 -1
  12. package/dist/components/Content/Schema/SchemaProperty.vue2.js +91 -81
  13. package/dist/features/Search/SearchButton.vue.js +2 -2
  14. package/dist/features/Search/SearchButton.vue2.js +14 -14
  15. package/dist/features/Search/SearchModal.vue.d.ts.map +1 -1
  16. package/dist/features/Search/SearchModal.vue.js +2 -2
  17. package/dist/features/Search/SearchModal.vue2.js +87 -74
  18. package/dist/features/Search/index.d.ts +0 -1
  19. package/dist/features/Search/index.d.ts.map +1 -1
  20. package/dist/index.js +98 -100
  21. package/dist/style.css +1 -1
  22. package/package.json +6 -6
  23. package/dist/features/Search/Search.vue.d.ts +0 -20
  24. package/dist/features/Search/Search.vue.d.ts.map +0 -1
  25. package/dist/features/Search/Search.vue.js +0 -18
  26. package/dist/features/Search/Search.vue2.js +0 -4
  27. package/dist/features/Search/useKeyboardNavigation.d.ts +0 -13
  28. package/dist/features/Search/useKeyboardNavigation.d.ts.map +0 -1
  29. package/dist/features/Search/useKeyboardNavigation.js +0 -30
@@ -1,38 +1,41 @@
1
- import { defineComponent as V, openBlock as t, createElementBlock as l, normalizeClass as Z, createVNode as s, createSlots as z, withCtx as H, createTextVNode as L, toDisplayString as c, unref as f, createCommentVNode as a, createElementVNode as p, Fragment as n, renderList as i, createBlock as T, pushScopeId as M, popScopeId as $ } from "vue";
2
- import { ScalarMarkdown as h } from "@scalar/components";
3
- import m from "./Schema.vue.js";
4
- import A from "./SchemaPropertyHeading.vue.js";
5
- const G = (d) => (M("data-v-d1d8e2ad"), d = d(), $(), d), J = {
1
+ import { defineComponent as Z, openBlock as l, createElementBlock as t, normalizeClass as z, createVNode as n, createSlots as H, withCtx as L, createTextVNode as M, toDisplayString as i, unref as h, createCommentVNode as r, createElementVNode as u, Fragment as s, renderList as p, createBlock as U, pushScopeId as $, popScopeId as A } from "vue";
2
+ import { ScalarMarkdown as k } from "@scalar/components";
3
+ import v from "./Schema.vue.js";
4
+ import G from "./SchemaPropertyHeading.vue.js";
5
+ const J = (d) => ($("data-v-bfe8efb1"), d = d(), A(), d), K = {
6
6
  key: 0,
7
7
  class: "property-description"
8
- }, K = {
8
+ }, Q = {
9
9
  key: 1,
10
10
  class: "property-description"
11
- }, Q = {
11
+ }, W = {
12
12
  key: 2,
13
13
  class: "property-example custom-scroll"
14
- }, W = /* @__PURE__ */ G(() => /* @__PURE__ */ p("span", { class: "property-example-label" }, "Example", -1)), X = { class: "property-example-value" }, Y = {
14
+ }, X = /* @__PURE__ */ J(() => /* @__PURE__ */ u("span", { class: "property-example-label" }, "Example", -1)), Y = { class: "property-example-value" }, _ = {
15
15
  key: 3,
16
+ class: "property-example custom-scroll"
17
+ }, x = { class: "property-example-label" }, ee = {
18
+ key: 4,
16
19
  class: "property-enum"
17
- }, _ = {
20
+ }, le = {
18
21
  key: 0,
19
22
  class: "property-list"
20
- }, x = { class: "property-heading" }, ee = { class: "property-name" }, te = { class: "property-description" }, le = {
23
+ }, te = { class: "property-heading" }, oe = { class: "property-name" }, ae = { class: "property-description" }, re = {
21
24
  key: 1,
22
25
  class: "property-enum-values"
23
- }, oe = {
24
- key: 4,
26
+ }, se = {
27
+ key: 5,
25
28
  class: "children"
26
- }, re = {
29
+ }, ne = {
27
30
  key: 0,
28
31
  class: "children"
29
- }, ae = {
32
+ }, ie = {
30
33
  key: 0,
31
34
  class: "property-rule"
32
- }, ne = {
35
+ }, pe = {
33
36
  key: 1,
34
37
  class: "property-rule"
35
- }, ue = /* @__PURE__ */ V({
38
+ }, ve = /* @__PURE__ */ Z({
36
39
  __name: "SchemaProperty",
37
40
  props: {
38
41
  value: {},
@@ -44,7 +47,7 @@ const G = (d) => (M("data-v-d1d8e2ad"), d = d(), $(), d), J = {
44
47
  additional: { type: Boolean }
45
48
  },
46
49
  setup(d) {
47
- const k = {
50
+ const b = {
48
51
  integer: {
49
52
  _default: "Integer numbers.",
50
53
  int32: "Signed 32-bit integers (commonly used integer type).",
@@ -57,109 +60,116 @@ const G = (d) => (M("data-v-d1d8e2ad"), d = d(), $(), d), J = {
57
60
  byte: "base64-encoded characters, for example, U3dhZ2dlciByb2Nrcw==",
58
61
  binary: "binary data, used to describe files"
59
62
  }
60
- }, g = function(e, o) {
61
- return o != null && o.properties || o != null && o.additionalProperties ? null : e || (o == null ? void 0 : o.description) || null;
62
- }, b = function(e) {
63
- return !e || !k[e.type] ? null : k[e.type][e.format || "_default"];
64
- }, u = function(e) {
65
- var o;
66
- return (e == null ? void 0 : e.enum) || ((o = e == null ? void 0 : e.items) == null ? void 0 : o.enum) || [];
67
- }, U = ["oneOf", "anyOf", "allOf", "not"];
68
- return (e, o) => {
69
- var S, B, C, w, D, I, N, P, q, E, F;
70
- return t(), l("div", {
71
- class: Z(["property", [
63
+ }, g = function(e, a) {
64
+ return a != null && a.properties || a != null && a.additionalProperties ? null : e || (a == null ? void 0 : a.description) || null;
65
+ }, S = function(e) {
66
+ return !e || !b[e.type] ? null : b[e.type][e.format || "_default"];
67
+ }, c = function(e) {
68
+ var a;
69
+ return (e == null ? void 0 : e.enum) || ((a = e == null ? void 0 : e.items) == null ? void 0 : a.enum) || [];
70
+ }, V = ["oneOf", "anyOf", "allOf", "not"];
71
+ return (e, a) => {
72
+ var B, C, E, j, w, D, I, N, O, P, q, F;
73
+ return l(), t("div", {
74
+ class: z(["property", [
72
75
  `property--level-${e.level}`,
73
76
  {
74
77
  "property--compact": e.compact,
75
- "property--deprecated": (S = e.value) == null ? void 0 : S.deprecated
78
+ "property--deprecated": (B = e.value) == null ? void 0 : B.deprecated
76
79
  }
77
80
  ]])
78
81
  }, [
79
- s(A, {
82
+ n(G, {
80
83
  additional: e.additional,
81
- enum: u(e.value).length > 1,
84
+ enum: c(e.value).length > 1,
82
85
  required: e.required,
83
86
  value: e.value
84
- }, z({ _: 2 }, [
87
+ }, H({ _: 2 }, [
85
88
  e.name ? {
86
89
  name: "name",
87
- fn: H(() => [
88
- L(c(e.name), 1)
90
+ fn: L(() => [
91
+ M(i(e.name), 1)
89
92
  ]),
90
93
  key: "0"
91
94
  } : void 0
92
95
  ]), 1032, ["additional", "enum", "required", "value"]),
93
- g(e.description, e.value) ? (t(), l("div", J, [
94
- s(f(h), {
96
+ g(e.description, e.value) ? (l(), t("div", K, [
97
+ n(h(k), {
95
98
  value: g(e.description, e.value)
96
99
  }, null, 8, ["value"])
97
- ])) : b(e.value) ? (t(), l("div", K, [
98
- s(f(h), {
99
- value: b(e.value) || ""
100
+ ])) : S(e.value) ? (l(), t("div", Q, [
101
+ n(h(k), {
102
+ value: S(e.value) || ""
100
103
  }, null, 8, ["value"])
101
- ])) : a("", !0),
102
- (B = e.value) != null && B.example || (w = (C = e.value) == null ? void 0 : C.items) != null && w.example ? (t(), l("div", Q, [
103
- W,
104
- p("code", X, c(e.value.example || ((D = e.value) == null ? void 0 : D.items.example)), 1)
105
- ])) : a("", !0),
106
- ((I = u(e.value)) == null ? void 0 : I.length) > 1 ? (t(), l("div", Y, [
107
- (N = e.value) != null && N["x-enumDescriptions"] ? (t(), l("div", _, [
108
- (t(!0), l(n, null, i(u(e.value), (r) => (t(), l("div", {
109
- key: r,
104
+ ])) : r("", !0),
105
+ (C = e.value) != null && C.example || (j = (E = e.value) == null ? void 0 : E.items) != null && j.example ? (l(), t("div", W, [
106
+ X,
107
+ u("code", Y, i(e.value.example || ((w = e.value) == null ? void 0 : w.items.example)), 1)
108
+ ])) : r("", !0),
109
+ (D = e.value) != null && D.examples && typeof e.value.examples == "object" && Object.keys(e.value.examples).length > 0 ? (l(), t("div", _, [
110
+ u("span", x, i(Object.keys(e.value.examples).length === 1 ? "Example" : "Examples"), 1),
111
+ (l(!0), t(s, null, p(e.value.examples, (o, m) => (l(), t("code", {
112
+ key: m,
113
+ class: "property-example-value"
114
+ }, i(o), 1))), 128))
115
+ ])) : r("", !0),
116
+ ((I = c(e.value)) == null ? void 0 : I.length) > 1 ? (l(), t("div", ee, [
117
+ (N = e.value) != null && N["x-enumDescriptions"] ? (l(), t("div", le, [
118
+ (l(!0), t(s, null, p(c(e.value), (o) => (l(), t("div", {
119
+ key: o,
110
120
  class: "property"
111
121
  }, [
112
- p("div", x, [
113
- p("div", ee, c(r), 1)
122
+ u("div", te, [
123
+ u("div", oe, i(o), 1)
114
124
  ]),
115
- p("div", te, [
116
- s(f(h), {
117
- value: e.value["x-enumDescriptions"][r]
125
+ u("div", ae, [
126
+ n(h(k), {
127
+ value: e.value["x-enumDescriptions"][o]
118
128
  }, null, 8, ["value"])
119
129
  ])
120
130
  ]))), 128))
121
- ])) : (t(), l("ul", le, [
122
- (t(!0), l(n, null, i(u(e.value), (r) => (t(), l("li", {
123
- key: r,
131
+ ])) : (l(), t("ul", re, [
132
+ (l(!0), t(s, null, p(c(e.value), (o) => (l(), t("li", {
133
+ key: o,
124
134
  class: "property-enum-value"
125
- }, c(r), 1))), 128))
135
+ }, i(o), 1))), 128))
126
136
  ]))
127
- ])) : a("", !0),
128
- ((P = e.value) == null ? void 0 : P.type) === "object" && ((q = e.value) != null && q.properties || (E = e.value) != null && E.additionalProperties) ? (t(), l("div", oe, [
129
- s(m, {
137
+ ])) : r("", !0),
138
+ ((O = e.value) == null ? void 0 : O.type) === "object" && ((P = e.value) != null && P.properties || (q = e.value) != null && q.additionalProperties) ? (l(), t("div", se, [
139
+ n(v, {
130
140
  compact: e.compact,
131
141
  level: e.level + 1,
132
142
  value: e.value
133
143
  }, null, 8, ["compact", "level", "value"])
134
- ])) : a("", !0),
135
- (F = e.value) != null && F.items ? (t(), l(n, { key: 5 }, [
136
- ["object"].includes(e.value.items.type) ? (t(), l("div", re, [
137
- s(m, {
144
+ ])) : r("", !0),
145
+ (F = e.value) != null && F.items ? (l(), t(s, { key: 6 }, [
146
+ ["object"].includes(e.value.items.type) ? (l(), t("div", ne, [
147
+ n(v, {
138
148
  compact: e.compact,
139
149
  level: e.level + 1,
140
150
  value: e.value.items
141
151
  }, null, 8, ["compact", "level", "value"])
142
- ])) : a("", !0)
143
- ], 64)) : a("", !0),
144
- (t(), l(n, null, i(U, (r) => {
145
- var O, j, R;
146
- return t(), l(n, { key: r }, [
147
- (O = e.value) != null && O[r] ? (t(), l("div", ae, [
148
- (t(!0), l(n, null, i(e.value[r], (v, y) => (t(), T(m, {
149
- key: y,
152
+ ])) : r("", !0)
153
+ ], 64)) : r("", !0),
154
+ (l(), t(s, null, p(V, (o) => {
155
+ var m, R, T;
156
+ return l(), t(s, { key: o }, [
157
+ (m = e.value) != null && m[o] ? (l(), t("div", ie, [
158
+ (l(!0), t(s, null, p(e.value[o], (y, f) => (l(), U(v, {
159
+ key: f,
150
160
  compact: e.compact,
151
161
  level: e.level + 1,
152
- value: v
162
+ value: y
153
163
  }, null, 8, ["compact", "level", "value"]))), 128))
154
- ])) : a("", !0),
155
- (R = (j = e.value) == null ? void 0 : j.items) != null && R[r] && e.level < 3 ? (t(), l("div", ne, [
156
- (t(!0), l(n, null, i(e.value.items[r], (v, y) => (t(), T(m, {
157
- key: y,
164
+ ])) : r("", !0),
165
+ (T = (R = e.value) == null ? void 0 : R.items) != null && T[o] && e.level < 3 ? (l(), t("div", pe, [
166
+ (l(!0), t(s, null, p(e.value.items[o], (y, f) => (l(), U(v, {
167
+ key: f,
158
168
  compact: e.compact,
159
169
  level: e.level + 1,
160
- value: v
170
+ value: y
161
171
  }, null, 8, ["compact", "level", "value"]))), 128))
162
- ])) : a("", !0)
172
+ ])) : r("", !0)
163
173
  ], 64);
164
174
  }), 64))
165
175
  ], 2);
@@ -167,5 +177,5 @@ const G = (d) => (M("data-v-d1d8e2ad"), d = d(), $(), d), J = {
167
177
  }
168
178
  });
169
179
  export {
170
- ue as default
180
+ ve as default
171
181
  };
@@ -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 m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-f812b614"]]);
4
+ const e = /* @__PURE__ */ t(o, [["__scopeId", "data-v-bc475de3"]]);
5
5
  export {
6
- m as default
6
+ e as default
7
7
  };
@@ -1,23 +1,23 @@
1
- import { defineComponent as m, ref as u, onMounted as f, openBlock as S, createElementBlock as _, Fragment as y, createElementVNode as a, normalizeClass as b, unref as t, createVNode as i, toDisplayString as l, pushScopeId as k, popScopeId as v } from "vue";
2
- import { useModal as K, ScalarIcon as w } from "@scalar/components";
1
+ import { defineComponent as m, ref as u, onMounted as S, openBlock as f, createElementBlock as y, Fragment as _, createElementVNode as a, normalizeClass as b, unref as t, createVNode as p, toDisplayString as i, pushScopeId as k, popScopeId as v } from "vue";
2
+ import { useModal as K, ScalarIcon as M } from "@scalar/components";
3
3
  import { isMacOS as r } from "@scalar/use-tooltip";
4
- import { useMagicKeys as M, whenever as g } from "@vueuse/core";
4
+ import { useMagicKeys as w, whenever as g } from "@vueuse/core";
5
5
  import { modalStateBus as B } from "../../components/api-client-bus.js";
6
- import C from "./Search.vue.js";
7
- const H = (o) => (k("data-v-f812b614"), o = o(), v(), o), I = { class: "sidebar-search-input" }, $ = /* @__PURE__ */ H(() => /* @__PURE__ */ a("span", { class: "sidebar-search-placeholder" }, "Search", -1)), E = { class: "sidebar-search-shortcut" }, z = { class: "sidebar-search-key" }, j = /* @__PURE__ */ m({
6
+ import C from "./SearchModal.vue.js";
7
+ const H = (o) => (k("data-v-bc475de3"), o = o(), v(), o), I = { class: "sidebar-search-input" }, E = /* @__PURE__ */ H(() => /* @__PURE__ */ a("span", { class: "sidebar-search-placeholder" }, "Search", -1)), $ = { class: "sidebar-search-shortcut" }, z = { class: "sidebar-search-key" }, j = /* @__PURE__ */ m({
8
8
  __name: "SearchButton",
9
9
  props: {
10
10
  spec: {},
11
11
  searchHotKey: { default: "k" }
12
12
  },
13
13
  setup(o) {
14
- const c = o, s = K(), n = u(null), d = M({
14
+ const c = o, s = K(), n = u(null), d = w({
15
15
  passive: !1,
16
16
  onEventFired(e) {
17
17
  !r() && e.ctrlKey && e.key === c.searchHotKey && (e.preventDefault(), e.stopPropagation());
18
18
  }
19
19
  });
20
- return f(() => {
20
+ return S(() => {
21
21
  B.on((e) => {
22
22
  n.value = e;
23
23
  });
@@ -27,27 +27,27 @@ const H = (o) => (k("data-v-f812b614"), o = o(), v(), o), I = { class: "sidebar-
27
27
  var e;
28
28
  (e = n.value) != null && e.open || (s.open ? s.hide() : s.show());
29
29
  }
30
- ), (e, p) => (S(), _(y, null, [
30
+ ), (e, l) => (f(), y(_, null, [
31
31
  a("button", {
32
32
  class: b(["sidebar-search", e.$attrs.class]),
33
33
  type: "button",
34
- onClick: p[0] || (p[0] = //@ts-ignore
34
+ onClick: l[0] || (l[0] = //@ts-ignore
35
35
  (...h) => t(s).show && t(s).show(...h))
36
36
  }, [
37
- i(t(w), {
37
+ p(t(M), {
38
38
  class: "search-icon",
39
39
  icon: "Search",
40
40
  size: "sm",
41
41
  thickness: "2.5"
42
42
  }),
43
43
  a("div", I, [
44
- $,
45
- a("span", E, [
46
- a("span", z, l(t(r)() ? "⌘" : "⌃") + l(e.searchHotKey), 1)
44
+ E,
45
+ a("span", $, [
46
+ a("span", z, i(t(r)() ? "⌘" : "⌃") + i(e.searchHotKey), 1)
47
47
  ])
48
48
  ])
49
49
  ], 2),
50
- i(C, {
50
+ p(C, {
51
51
  modalState: t(s),
52
52
  parsedSpec: e.spec
53
53
  }, null, 8, ["modalState", "parsedSpec"])
@@ -1 +1 @@
1
- {"version":3,"file":"SearchModal.vue.d.ts","sourceRoot":"","sources":["../../../src/features/Search/SearchModal.vue"],"names":[],"mappings":"AA6LA,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;;AAoSxB,wBAMG;AAOH,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"}
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;AAOH,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"}
@@ -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 p = /* @__PURE__ */ r(o, [["__scopeId", "data-v-06438305"]]);
4
+ const d = /* @__PURE__ */ r(o, [["__scopeId", "data-v-fc89d20d"]]);
5
5
  export {
6
- p as default
6
+ d as default
7
7
  };
@@ -1,106 +1,119 @@
1
- import { defineComponent as T, toRef as v, ref as E, watch as U, openBlock as f, createBlock as R, unref as t, withCtx as l, createElementVNode as n, createVNode as S, isRef as q, createTextVNode as g, toDisplayString as p, createElementBlock as L, Fragment as M, renderList as z, createSlots as D, normalizeClass as H, pushScopeId as O, popScopeId as P } from "vue";
2
- import { ScalarModal as $, ScalarSearchInput as K, ScalarSearchResultList as W, ScalarSearchResultItem as Y } from "@scalar/components";
3
- import { lazyBus as j } from "../../components/Content/Lazy/lazyBus.js";
4
- import A from "../../components/Sidebar/SidebarHttpBadge.vue.js";
5
- import { useKeyboardNavigation as G } from "./useKeyboardNavigation.js";
6
- import { useSearchIndex as J } from "./useSearchIndex.js";
7
- import { useSidebar as Q } from "../../hooks/useSidebar.js";
8
- import { scrollToId as k } from "../../helpers/scrollToId.js";
9
- const X = (i) => (O("data-v-06438305"), i = i(), P(), i), Z = /* @__PURE__ */ X(() => /* @__PURE__ */ n("div", { class: "ref-search-meta" }, [
10
- /* @__PURE__ */ n("span", null, "↑↓ Navigate"),
11
- /* @__PURE__ */ n("span", null, "⏎ Select")
12
- ], -1)), ie = /* @__PURE__ */ T({
1
+ import { defineComponent as $, toRef as M, ref as U, watch as k, openBlock as h, createBlock as b, unref as a, withKeys as S, withModifiers as v, withCtx as l, createElementVNode as d, createVNode as g, isRef as q, createTextVNode as I, toDisplayString as f, createElementBlock as L, Fragment as z, renderList as D, createSlots as H, normalizeClass as K, pushScopeId as P, popScopeId as O } from "vue";
2
+ import { ScalarModal as W, ScalarSearchInput as Y, ScalarSearchResultList as j, ScalarSearchResultItem as A } from "@scalar/components";
3
+ import { lazyBus as G } from "../../components/Content/Lazy/lazyBus.js";
4
+ import J from "../../components/Sidebar/SidebarHttpBadge.vue.js";
5
+ import { useSearchIndex as Q } from "./useSearchIndex.js";
6
+ import { useSidebar as X } from "../../hooks/useSidebar.js";
7
+ import { scrollToId as C } from "../../helpers/scrollToId.js";
8
+ const Z = (i) => (P("data-v-fc89d20d"), i = i(), O(), i), y = /* @__PURE__ */ Z(() => /* @__PURE__ */ d("div", { class: "ref-search-meta" }, [
9
+ /* @__PURE__ */ d("span", null, "↑↓ Navigate"),
10
+ /* @__PURE__ */ d("span", null, " Select")
11
+ ], -1)), re = /* @__PURE__ */ $({
13
12
  __name: "SearchModal",
14
13
  props: {
15
14
  parsedSpec: {},
16
15
  modalState: {}
17
16
  },
18
17
  setup(i) {
19
- const c = i, _ = v(c, "parsedSpec"), b = v(c.modalState.open), {
20
- resetSearch: C,
21
- fuseSearch: w,
22
- selectedSearchResult: u,
23
- searchResultsWithPlaceholderResults: h,
24
- searchText: d
25
- } = J({
26
- specification: _
27
- });
28
- G({
29
- selectedSearchResult: u,
30
- active: b,
31
- searchResultsWithPlaceholderResults: h,
32
- onSearchResultClick: I
33
- });
34
- const V = {
18
+ const m = i, V = M(m, "parsedSpec"), {
19
+ resetSearch: B,
20
+ fuseSearch: x,
21
+ selectedSearchResult: n,
22
+ searchResultsWithPlaceholderResults: c,
23
+ searchText: p
24
+ } = Q({
25
+ specification: V
26
+ }), F = {
35
27
  heading: "DocsPage",
36
28
  model: "Brackets",
37
29
  req: "Terminal",
38
30
  tag: "CodeFolder",
39
31
  webhook: "Terminal"
40
- }, B = E(null);
41
- U(
42
- () => c.modalState.open,
43
- (a) => {
44
- a && C();
32
+ }, N = U(null);
33
+ k(
34
+ () => m.modalState.open,
35
+ (o) => {
36
+ o && B();
45
37
  }
46
38
  );
47
- const { setCollapsedSidebarItem: N } = Q(), x = /#(tag\/[^/]*)/;
48
- function I(a) {
49
- let o = "models";
50
- const e = a.item.href.match(x);
51
- e != null && e.length && e.length > 1 && (o = e[1]), N(o, !0);
52
- const r = a.item.href.replace("#", "");
53
- if (document.getElementById(r))
54
- k(r), c.modalState.hide();
39
+ const { setCollapsedSidebarItem: T } = X(), E = /#(tag\/[^/]*)/;
40
+ function R(o) {
41
+ let t = "models";
42
+ const e = o.item.href.match(E);
43
+ e != null && e.length && e.length > 1 && (t = e[1]), T(t, !0);
44
+ const s = o.item.href.replace("#", "");
45
+ if (document.getElementById(s))
46
+ C(s), m.modalState.hide();
55
47
  else {
56
- const s = j.on((m) => {
57
- m.id === r && (k(r), s(), c.modalState.hide());
48
+ const r = G.on((u) => {
49
+ u.id === s && (C(s), r(), m.modalState.hide());
58
50
  });
59
51
  }
60
52
  }
61
- function F(a) {
62
- const o = new URL(window.location.href);
63
- return o.hash = a, o.toString();
53
+ k(n, (o) => {
54
+ var e;
55
+ const t = c.value[o];
56
+ (e = document.getElementById(t.item.href)) == null || e.scrollIntoView({
57
+ behavior: "smooth",
58
+ block: "nearest"
59
+ });
60
+ });
61
+ const w = (o) => {
62
+ const t = o === "up" ? -1 : 1, e = c.value.length, s = (n.value + t + e) % e;
63
+ n.value = s;
64
+ };
65
+ function _(o) {
66
+ const t = new URL(window.location.href);
67
+ return t.hash = o, t.toString();
64
68
  }
65
- return (a, o) => (f(), R(t($), {
66
- state: a.modalState,
67
- variant: "search"
69
+ return (o, t) => (h(), b(a(W), {
70
+ state: o.modalState,
71
+ variant: "search",
72
+ onKeydown: [
73
+ t[1] || (t[1] = S(v((e) => w("down"), ["stop", "prevent"]), ["down"])),
74
+ t[2] || (t[2] = S(v((e) => R(
75
+ a(c)[a(n)]
76
+ ), ["stop", "prevent"]), ["enter"])),
77
+ t[3] || (t[3] = S(v((e) => w("up"), ["stop", "prevent"]), ["up"]))
78
+ ]
68
79
  }, {
69
80
  default: l(() => [
70
- n("div", {
81
+ d("div", {
71
82
  ref_key: "searchModalRef",
72
- ref: B,
83
+ ref: N,
73
84
  class: "ref-search-container"
74
85
  }, [
75
- S(t(K), {
76
- modelValue: t(d),
77
- "onUpdate:modelValue": o[0] || (o[0] = (e) => q(d) ? d.value = e : null),
78
- onInput: t(w)
86
+ g(a(Y), {
87
+ modelValue: a(p),
88
+ "onUpdate:modelValue": t[0] || (t[0] = (e) => q(p) ? p.value = e : null),
89
+ onInput: a(x)
79
90
  }, null, 8, ["modelValue", "onInput"])
80
91
  ], 512),
81
- S(t(W), {
92
+ g(a(j), {
82
93
  class: "ref-search-results custom-scroll",
83
- noResults: !t(h).length
94
+ noResults: !a(c).length
84
95
  }, {
85
96
  query: l(() => [
86
- g(p(t(d)), 1)
97
+ I(f(a(p)), 1)
87
98
  ]),
88
99
  default: l(() => [
89
- (f(!0), L(M, null, z(t(h), (e, r) => (f(), R(t(Y), {
100
+ (h(!0), L(z, null, D(a(c), (e, s) => (h(), b(a(A), {
90
101
  id: e.item.href,
91
102
  key: e.refIndex,
92
- active: t(u) === r,
93
- href: F(e.item.href),
94
- icon: V[e.item.type],
95
- onClick: (s) => I(e),
96
- onFocus: (s) => u.value = r
97
- }, D({
103
+ active: a(n) === s,
104
+ href: _(e.item.href),
105
+ icon: F[e.item.type],
106
+ onClick: (r) => R(e),
107
+ onFocus: (r) => n.value = s
108
+ }, H({
98
109
  default: l(() => {
99
- var s, m;
110
+ var r, u;
100
111
  return [
101
- n("span", {
102
- class: H({ deprecated: (m = (s = e.item.operation) == null ? void 0 : s.information) == null ? void 0 : m.deprecated })
103
- }, p(e.item.title), 3)
112
+ d("span", {
113
+ class: K({
114
+ deprecated: (u = (r = e.item.operation) == null ? void 0 : r.information) == null ? void 0 : u.deprecated
115
+ })
116
+ }, f(e.item.title), 3)
104
117
  ];
105
118
  }),
106
119
  _: 2
@@ -108,20 +121,20 @@ const X = (i) => (O("data-v-06438305"), i = i(), P(), i), Z = /* @__PURE__ */ X(
108
121
  (e.item.httpVerb || e.item.path) && e.item.path !== e.item.title ? {
109
122
  name: "description",
110
123
  fn: l(() => [
111
- g(p(e.item.path), 1)
124
+ I(f(e.item.path), 1)
112
125
  ]),
113
126
  key: "0"
114
127
  } : e.item.description ? {
115
128
  name: "description",
116
129
  fn: l(() => [
117
- g(p(e.item.description), 1)
130
+ I(f(e.item.description), 1)
118
131
  ]),
119
132
  key: "1"
120
133
  } : void 0,
121
134
  e.item.type === "req" ? {
122
135
  name: "addon",
123
136
  fn: l(() => [
124
- S(A, {
137
+ g(J, {
125
138
  method: e.item.httpVerb ?? "get"
126
139
  }, null, 8, ["method"])
127
140
  ]),
@@ -131,12 +144,12 @@ const X = (i) => (O("data-v-06438305"), i = i(), P(), i), Z = /* @__PURE__ */ X(
131
144
  ]),
132
145
  _: 1
133
146
  }, 8, ["noResults"]),
134
- Z
147
+ y
135
148
  ]),
136
149
  _: 1
137
150
  }, 8, ["state"]));
138
151
  }
139
152
  });
140
153
  export {
141
- ie as default
154
+ re as default
142
155
  };
@@ -1,4 +1,3 @@
1
- export { default as Search } from './Search.vue.js';
2
1
  export { default as SearchButton } from './SearchButton.vue.js';
3
2
  export { default as SearchModal } from './SearchModal.vue.js';
4
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/features/Search/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,cAAc,CAAA;AAChD,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAC5D,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,mBAAmB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/features/Search/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAC5D,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,mBAAmB,CAAA"}