@scalar/api-client 2.0.55 → 2.0.56

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 (33) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/components/CodeInput/CodeInput.vue.d.ts.map +1 -1
  3. package/dist/components/CodeInput/CodeInput.vue.js +2 -2
  4. package/dist/components/CodeInput/CodeInput.vue2.js +6 -6
  5. package/dist/components/CommandPalette/TheCommandPalette.vue.d.ts.map +1 -1
  6. package/dist/components/CommandPalette/TheCommandPalette.vue.js +4 -4
  7. package/dist/components/CommandPalette/TheCommandPalette.vue2.js +45 -45
  8. package/dist/components/Search/useSearch.d.ts +29 -0
  9. package/dist/components/Search/useSearch.d.ts.map +1 -0
  10. package/dist/components/Search/useSearch.js +62 -0
  11. package/dist/layouts/App/create-api-client-app.d.ts +13 -13
  12. package/dist/layouts/App/create-api-client-app.d.ts.map +1 -1
  13. package/dist/layouts/Modal/create-api-client-modal.d.ts +26 -26
  14. package/dist/layouts/Modal/create-api-client-modal.d.ts.map +1 -1
  15. package/dist/libs/create-client.d.ts +13 -13
  16. package/dist/libs/create-client.d.ts.map +1 -1
  17. package/dist/libs/event-busses/hot-keys-bus.d.ts +3 -3
  18. package/dist/libs/event-busses/hot-keys-bus.d.ts.map +1 -1
  19. package/dist/libs/event-busses/hot-keys-bus.js +17 -16
  20. package/dist/libs/local-storage.js +1 -1
  21. package/dist/store/workspace.d.ts +26 -26
  22. package/dist/store/workspace.d.ts.map +1 -1
  23. package/dist/style.css +1 -1
  24. package/dist/views/Request/Request.vue.d.ts.map +1 -1
  25. package/dist/views/Request/Request.vue.js +2 -2
  26. package/dist/views/Request/Request.vue2.js +259 -215
  27. package/dist/views/Request/RequestSection/RequestParams.vue.d.ts.map +1 -1
  28. package/dist/views/Request/RequestSection/RequestParams.vue.js +45 -41
  29. package/dist/views/Request/RequestSection/RequestTableTooltip.vue.d.ts.map +1 -1
  30. package/dist/views/Request/RequestSection/RequestTableTooltip.vue.js +31 -25
  31. package/package.json +7 -7
  32. package/dist/components/Search/SearchButton.vue.js +0 -7
  33. package/dist/components/Search/SearchButton.vue2.js +0 -30
package/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # @scalar/api-client
2
2
 
3
+ ## 2.0.56
4
+
5
+ ### Patch Changes
6
+
7
+ - af75550: feat: sidebar request search
8
+ - f9c88a9: fix: request table tooltip
9
+ - 5de17ce: fix: request params deletion
10
+ - f3b9adf: fix(api-client): force code mirror to scroll on overflow
11
+ - Updated dependencies [af75550]
12
+ - Updated dependencies [af75550]
13
+ - @scalar/oas-utils@0.2.36
14
+ - @scalar/components@0.12.37
15
+
3
16
  ## 2.0.55
4
17
 
5
18
  ### Patch Changes
@@ -1 +1 @@
1
- {"version":3,"file":"CodeInput.vue.d.ts","sourceRoot":"","sources":["../../../src/components/CodeInput/CodeInput.vue"],"names":[],"mappings":"AAAA,OAiUO,EAGL,KAAK,kBAAkB,EAExB,MAAM,wBAAwB,CAAA;;kBAeb,OAAO;gBACT,MAAM,GAAG,MAAM;YACnB,OAAO;iBACF,OAAO;kBACN,OAAO;WACd,OAAO;uBACK,OAAO;eACf,kBAAkB;wBACT,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI;wBACnB,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI;kBACzB,MAAM;eACT,OAAO;mBACH,OAAO;2BACC,OAAO;WACvB,MAAM,EAAE;WACR,MAAM;eACF,OAAO;oBACF,OAAO;kBACT,OAAO;;;;;;;;;;;;;;;;kBAlBP,OAAO;gBACT,MAAM,GAAG,MAAM;YACnB,OAAO;iBACF,OAAO;kBACN,OAAO;WACd,OAAO;uBACK,OAAO;eACf,kBAAkB;wBACT,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI;wBACnB,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI;kBACzB,MAAM;eACT,OAAO;mBACH,OAAO;2BACC,OAAO;WACvB,MAAM,EAAE;WACR,MAAM;eACF,OAAO;oBACF,OAAO;kBACT,OAAO;;;;;;;;;;;;;;iBAAP,OAAO;iBAlBP,OAAO;gBAGR,OAAO;sBAGD,OAAO;kBAMX,OAAO;0BACC,OAAO;cAGnB,OAAO;mBACF,OAAO;;qBA4RG,GAAG;kBACN,GAAG;;AAjT9B,wBAqVC;AAMD,KAAK,kBAAkB,CAAC,CAAC,EAAE,CAAC,IAAI;KAC1B,CAAC,IAAI,MAAM,IAAI,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,SAAS,MAAM,CAAC,GAC7C,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG;QAAE,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC,CAAA;KAAC,CAAC,GACvC,CAAC,CAAC,CAAC,CAAC;CACP,CAAC;AAEN,KAAK,cAAc,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC;AAExD,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACpC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC;AAEN,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":"CodeInput.vue.d.ts","sourceRoot":"","sources":["../../../src/components/CodeInput/CodeInput.vue"],"names":[],"mappings":"AAAA,OA0TO,EAGL,KAAK,kBAAkB,EAExB,MAAM,wBAAwB,CAAA;;kBAeb,OAAO;gBACT,MAAM,GAAG,MAAM;YACnB,OAAO;iBACF,OAAO;kBACN,OAAO;WACd,OAAO;uBACK,OAAO;eACf,kBAAkB;wBACT,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI;wBACnB,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI;kBACzB,MAAM;eACT,OAAO;mBACH,OAAO;2BACC,OAAO;WACvB,MAAM,EAAE;WACR,MAAM;eACF,OAAO;oBACF,OAAO;kBACT,OAAO;;;;;;;;;;;;;;;;kBAlBP,OAAO;gBACT,MAAM,GAAG,MAAM;YACnB,OAAO;iBACF,OAAO;kBACN,OAAO;WACd,OAAO;uBACK,OAAO;eACf,kBAAkB;wBACT,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI;wBACnB,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI;kBACzB,MAAM;eACT,OAAO;mBACH,OAAO;2BACC,OAAO;WACvB,MAAM,EAAE;WACR,MAAM;eACF,OAAO;oBACF,OAAO;kBACT,OAAO;;;;;;;;;;;;;;iBAAP,OAAO;iBAlBP,OAAO;gBAGR,OAAO;sBAGD,OAAO;kBAMX,OAAO;0BACC,OAAO;cAGnB,OAAO;mBACF,OAAO;;qBA4RG,GAAG;kBACN,GAAG;;AAjT9B,wBAqVC;AAMD,KAAK,kBAAkB,CAAC,CAAC,EAAE,CAAC,IAAI;KAC1B,CAAC,IAAI,MAAM,IAAI,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,SAAS,MAAM,CAAC,GAC7C,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG;QAAE,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC,CAAA;KAAC,CAAC,GACvC,CAAC,CAAC,CAAC,CAAC;CACP,CAAC;AAEN,KAAK,cAAc,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC;AAExD,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACpC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC;AAEN,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"}
@@ -2,7 +2,7 @@ import o from "./CodeInput.vue2.js";
2
2
  /* empty css */
3
3
  /* empty css */
4
4
  import t from "../../_virtual/_plugin-vue_export-helper.js";
5
- const _ = /* @__PURE__ */ t(o, [["__scopeId", "data-v-b044f01b"]]);
5
+ const f = /* @__PURE__ */ t(o, [["__scopeId", "data-v-6a33f062"]]);
6
6
  export {
7
- _ as default
7
+ f as default
8
8
  };
@@ -1,4 +1,4 @@
1
- import { defineComponent as E, useAttrs as q, ref as y, toRef as o, watch as I, computed as M, openBlock as t, createElementBlock as s, Fragment as N, createBlock as g, mergeProps as T, unref as A, renderSlot as v, createCommentVNode as B } from "vue";
1
+ import { defineComponent as E, useAttrs as q, ref as y, toRef as o, watch as I, computed as M, openBlock as t, createElementBlock as s, Fragment as N, createBlock as v, mergeProps as T, unref as A, renderSlot as g, createCommentVNode as B } from "vue";
2
2
  import { useCodeMirror as U, colorPicker as W } from "@scalar/use-codemirror";
3
3
  import { nanoid as j } from "nanoid";
4
4
  import V from "../DataTable/DataTableInputSelect.vue.js";
@@ -99,12 +99,12 @@ const J = ["id"], K = {
99
99
  }), (l, u) => {
100
100
  var h;
101
101
  return t(), s(N, null, [
102
- e.enum && e.enum.length ? (t(), g(V, {
102
+ e.enum && e.enum.length ? (t(), v(V, {
103
103
  key: 0,
104
104
  modelValue: e.modelValue,
105
105
  value: e.enum,
106
106
  "onUpdate:modelValue": u[0] || (u[0] = (i) => r("update:modelValue", i))
107
- }, null, 8, ["modelValue", "value"])) : e.type === "boolean" || (h = e.type) != null && h.includes("boolean") ? (t(), g(V, {
107
+ }, null, 8, ["modelValue", "value"])) : e.type === "boolean" || (h = e.type) != null && h.includes("boolean") ? (t(), v(V, {
108
108
  key: 1,
109
109
  modelValue: e.modelValue,
110
110
  value: $.value,
@@ -115,14 +115,14 @@ const J = ["id"], K = {
115
115
  }, l.$attrs, {
116
116
  ref_key: "codeMirrorRef",
117
117
  ref: f,
118
- class: ["peer font-code w-full whitespace-nowrap text-xs leading-[1.44] relative", {
118
+ class: ["peer font-code w-full whitespace-nowrap overflow-hidden text-xs leading-[1.44] relative", {
119
119
  "flow-code-input--error": l.error
120
120
  }]
121
121
  }), null, 16, J)),
122
122
  l.$slots.warning ? (t(), s("div", K, [
123
- v(l.$slots, "warning", {}, void 0, !0)
123
+ g(l.$slots, "warning", {}, void 0, !0)
124
124
  ])) : B("", !0),
125
- v(l.$slots, "icon", {}, void 0, !0),
125
+ g(l.$slots, "icon", {}, void 0, !0),
126
126
  l.required ? (t(), s("div", L, " Required ")) : B("", !0)
127
127
  ], 64);
128
128
  };
@@ -1 +1 @@
1
- {"version":3,"file":"TheCommandPalette.vue.d.ts","sourceRoot":"","sources":["../../../src/components/CommandPalette/TheCommandPalette.vue"],"names":[],"mappings":"AA6WA;;;;GAIG;;AACH,wBAuYI;AAEJ,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAOpB,CAAA;AAEV,yCAAyC;AACzC,MAAM,MAAM,YAAY,GAAG,MAAM,OAAO,iBAAiB,CACxD"}
1
+ {"version":3,"file":"TheCommandPalette.vue.d.ts","sourceRoot":"","sources":["../../../src/components/CommandPalette/TheCommandPalette.vue"],"names":[],"mappings":"AA+WA;;;;GAIG;;AACH,wBAyYI;AAEJ,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAOpB,CAAA;AAEV,yCAAyC;AACzC,MAAM,MAAM,YAAY,GAAG,MAAM,OAAO,iBAAiB,CACxD"}
@@ -1,9 +1,9 @@
1
1
  import o from "./TheCommandPalette.vue2.js";
2
- import { PaletteComponents as s } from "./TheCommandPalette.vue2.js";
2
+ import { PaletteComponents as f } from "./TheCommandPalette.vue2.js";
3
3
  /* empty css */
4
4
  import t from "../../_virtual/_plugin-vue_export-helper.js";
5
- const r = /* @__PURE__ */ t(o, [["__scopeId", "data-v-3597a300"]]);
5
+ const a = /* @__PURE__ */ t(o, [["__scopeId", "data-v-010c52cb"]]);
6
6
  export {
7
- s as PaletteComponents,
8
- r as default
7
+ f as PaletteComponents,
8
+ a as default
9
9
  };
@@ -1,4 +1,4 @@
1
- import { defineComponent as F, ref as i, computed as B, onMounted as T, onBeforeUnmount as U, openBlock as a, createElementBlock as l, Fragment as u, withDirectives as h, createElementVNode as s, vShow as b, unref as f, createVNode as x, vModelText as q, renderList as E, toDisplayString as I, normalizeClass as K, createTextVNode as H, createCommentVNode as G, createBlock as Q, resolveDynamicComponent as j, nextTick as J } from "vue";
1
+ import { defineComponent as F, ref as i, computed as E, onMounted as T, onBeforeUnmount as U, openBlock as a, createElementBlock as l, Fragment as u, withDirectives as h, createElementVNode as s, vShow as b, unref as f, createVNode as x, vModelText as q, renderList as I, toDisplayString as V, normalizeClass as K, createTextVNode as H, createCommentVNode as G, createBlock as Q, resolveDynamicComponent as j, nextTick as J } from "vue";
2
2
  import { useModal as O, ScalarIcon as w } from "@scalar/components";
3
3
  import { useRouter as X } from "vue-router";
4
4
  import { useWorkspace as Y } from "../../store/workspace.js";
@@ -8,9 +8,9 @@ import oe from "./CommandPaletteFolder.vue.js";
8
8
  import te from "./CommandPaletteImport.vue.js";
9
9
  import ne from "./CommandPaletteRequest.vue.js";
10
10
  import ae from "./CommandPaletteWorkspace.vue.js";
11
- import { commandPaletteBus as V } from "../../libs/event-busses/command-palette-bus.js";
12
- import { hotKeyBus as W } from "../../libs/event-busses/hot-keys-bus.js";
13
- const le = { class: "commandmenu" }, se = { class: "bg-b-2 flex items-center rounded mb-2 pl-2 focus-within:bg-b-1 focus-within:shadow-border" }, ce = { for: "commandmenu" }, me = ["onClick"], re = {
11
+ import { commandPaletteBus as W } from "../../libs/event-busses/command-palette-bus.js";
12
+ import { hotKeyBus as z } from "../../libs/event-busses/hot-keys-bus.js";
13
+ const le = { class: "commandmenu" }, se = { class: "bg-b-2 flex items-center rounded mb-2 pl-2 focus-within:bg-b-1 focus-within:shadow-border" }, re = { for: "commandmenu" }, ce = ["onClick"], me = {
14
14
  key: 0,
15
15
  class: "text-c-3 text-center text-sm p-2 pt-3"
16
16
  }, ie = {
@@ -22,7 +22,7 @@ const le = { class: "commandmenu" }, se = { class: "bg-b-2 flex items-center rou
22
22
  "Add Folder": oe,
23
23
  "Create Collection": Z,
24
24
  "Add Example": ee
25
- }, $e = /* @__PURE__ */ F({
25
+ }, Re = /* @__PURE__ */ F({
26
26
  ...ie,
27
27
  setup(de) {
28
28
  const y = [
@@ -75,58 +75,58 @@ const le = { class: "commandmenu" }, se = { class: "bg-b-2 flex items-center rou
75
75
  }
76
76
  ]
77
77
  }
78
- ], c = O(), { push: z } = X(), { activeWorkspace: M } = Y(), S = i(), m = i(""), r = i(null), d = i(-1), $ = i([]), C = B(
78
+ ], r = O(), { push: M } = X(), { activeWorkspace: N } = Y(), S = i(), c = i(""), m = i(null), d = i(-1), R = i([]), C = E(
79
79
  () => y.reduce((e, n) => {
80
80
  const o = n.commands.filter(
81
- (t) => t.name.toLowerCase().includes(m.value.toLowerCase())
81
+ (t) => t.name.toLowerCase().includes(c.value.toLowerCase())
82
82
  );
83
83
  return [...e, ...o];
84
84
  }, [])
85
85
  ), p = () => {
86
- c.hide(), m.value = "", r.value = null, d.value = -1;
87
- }, A = (e) => {
88
- "path" in e ? (z(`/workspace/${M.value.uid}${e.path}`), p()) : r.value = e.name;
89
- }, D = i(), P = ({
86
+ r.hide(), c.value = "", m.value = null, d.value = -1;
87
+ }, g = (e) => {
88
+ "path" in e ? (M(`/workspace/${N.value.uid}${e.path}`), p()) : m.value = e.name;
89
+ }, $ = i(), A = ({
90
90
  commandName: e,
91
91
  metaData: n
92
92
  } = {}) => {
93
- r.value = e ?? null, S.value = n, c.show(), J(() => {
93
+ m.value = e ?? null, S.value = n, r.show(), J(() => {
94
94
  var o;
95
- return (o = D.value) == null ? void 0 : o.focus();
95
+ return (o = $.value) == null ? void 0 : o.focus();
96
96
  });
97
- }, R = (e, n) => {
97
+ }, D = (e, n) => {
98
98
  var v;
99
- if (!c.open) return;
99
+ if (!r.open) return;
100
100
  n.preventDefault();
101
101
  const o = e === "up" ? -1 : 1, t = C.value.length;
102
- d.value = (d.value + o + t) % t, (v = $.value[d.value]) == null || v.scrollIntoView({
102
+ d.value = (d.value + o + t) % t, (v = R.value[d.value]) == null || v.scrollIntoView({
103
103
  behavior: "smooth",
104
104
  block: "center"
105
105
  });
106
- }, k = B(
106
+ }, k = E(
107
107
  () => C.value[d.value]
108
- ), N = () => {
109
- k.value && A(k.value);
110
- }, g = (e) => {
111
- c.open && (e.closeModal && p(), e.commandPaletteUp && R("up", e.commandPaletteUp), e.commandPaletteDown && R("down", e.commandPaletteDown), e.commandPaletteSelect && N());
108
+ ), P = () => {
109
+ k.value && g(k.value);
110
+ }, L = (e) => {
111
+ r.open && (e.closeModal && p(), e.navigateSearchResultsUp && D("up", e.navigateSearchResultsUp), e.navigateSearchResultsDown && D("down", e.navigateSearchResultsDown), e.selectSearchResult && P());
112
112
  };
113
113
  return T(() => {
114
- V.on(P), W.on(g);
114
+ W.on(A), z.on(L);
115
115
  }), U(() => {
116
- V.off(P), W.off(g);
116
+ W.off(A), z.off(L);
117
117
  }), (e, n) => (a(), l(u, null, [
118
118
  h(s("div", {
119
119
  class: "commandmenu-clickout",
120
120
  onClick: n[0] || (n[0] = (o) => p())
121
121
  }, null, 512), [
122
- [b, f(c).open]
122
+ [b, f(r).open]
123
123
  ]),
124
124
  h(s("div", le, [
125
- r.value ? (a(), l(u, { key: 1 }, [
125
+ m.value ? (a(), l(u, { key: 1 }, [
126
126
  s("button", {
127
127
  class: "absolute p-0.75 hover:bg-b-3 rounded text-c-3 active:text-c-1 m-1.5 z-10",
128
128
  type: "button",
129
- onClick: n[2] || (n[2] = (o) => r.value = null)
129
+ onClick: n[2] || (n[2] = (o) => m.value = null)
130
130
  }, [
131
131
  x(f(w), {
132
132
  icon: "ChevronLeft",
@@ -134,13 +134,13 @@ const le = { class: "commandmenu" }, se = { class: "bg-b-2 flex items-center rou
134
134
  thickness: "1.5"
135
135
  })
136
136
  ]),
137
- (a(), Q(j(ue[r.value]), {
137
+ (a(), Q(j(ue[m.value]), {
138
138
  metaData: S.value,
139
139
  onClose: p
140
140
  }, null, 40, ["metaData"]))
141
141
  ], 64)) : (a(), l(u, { key: 0 }, [
142
142
  s("div", se, [
143
- s("label", ce, [
143
+ s("label", re, [
144
144
  x(f(w), {
145
145
  class: "text-c-1 mr-2.5",
146
146
  icon: "Search",
@@ -151,42 +151,42 @@ const le = { class: "commandmenu" }, se = { class: "bg-b-2 flex items-center rou
151
151
  h(s("input", {
152
152
  id: "commandmenu",
153
153
  ref_key: "commandInputRef",
154
- ref: D,
155
- "onUpdate:modelValue": n[1] || (n[1] = (o) => m.value = o),
154
+ ref: $,
155
+ "onUpdate:modelValue": n[1] || (n[1] = (o) => c.value = o),
156
156
  autocomplete: "off",
157
157
  autofocus: "",
158
158
  class: "w-full rounded bg-none border-none py-1.5 text-sm focus:outline-none",
159
159
  placeholder: "Search commands...",
160
160
  type: "text"
161
161
  }, null, 512), [
162
- [q, m.value]
162
+ [q, c.value]
163
163
  ])
164
164
  ]),
165
- (a(), l(u, null, E(y, (o) => (a(), l(u, {
165
+ (a(), l(u, null, I(y, (o) => (a(), l(u, {
166
166
  key: o.label
167
167
  }, [
168
- h(s("div", { class: "text-c-3 font-medium text-xs mt-2" }, I(o.label), 513), [
168
+ h(s("div", { class: "text-c-3 font-medium text-xs mt-2" }, V(o.label), 513), [
169
169
  [
170
170
  b,
171
171
  o.commands.filter(
172
- (t) => t.name.toLowerCase().includes(m.value.toLowerCase())
172
+ (t) => t.name.toLowerCase().includes(c.value.toLowerCase())
173
173
  ).length > 0
174
174
  ]
175
175
  ]),
176
- (a(!0), l(u, null, E(o.commands.filter(
177
- (t) => t.name.toLowerCase().includes(m.value.toLowerCase())
176
+ (a(!0), l(u, null, I(o.commands.filter(
177
+ (t) => t.name.toLowerCase().includes(c.value.toLowerCase())
178
178
  ), (t, v) => {
179
- var L;
179
+ var B;
180
180
  return a(), l("div", {
181
181
  key: t.name,
182
182
  ref_for: !0,
183
183
  ref: (_) => {
184
- _ && ($.value[v] = _);
184
+ _ && (R.value[v] = _);
185
185
  },
186
186
  class: K(["commandmenu-item text-sm flex items-center py-1.5 px-2 rounded hover:bg-b-2 cursor-pointer", {
187
- "bg-b-2": t.name === ((L = k.value) == null ? void 0 : L.name)
187
+ "bg-b-2": t.name === ((B = k.value) == null ? void 0 : B.name)
188
188
  }]),
189
- onClick: (_) => A(t)
189
+ onClick: (_) => g(t)
190
190
  }, [
191
191
  x(f(w), {
192
192
  class: "text-c-1 mr-2.5",
@@ -194,19 +194,19 @@ const le = { class: "commandmenu" }, se = { class: "bg-b-2 flex items-center rou
194
194
  size: "md",
195
195
  thickness: "1.5"
196
196
  }, null, 8, ["icon"]),
197
- H(" " + I(t.name), 1)
198
- ], 10, me);
197
+ H(" " + V(t.name), 1)
198
+ ], 10, ce);
199
199
  }), 128))
200
200
  ], 64))), 64)),
201
- C.value.length ? G("", !0) : (a(), l("div", re, " No commands found "))
201
+ C.value.length ? G("", !0) : (a(), l("div", me, " No commands found "))
202
202
  ], 64))
203
203
  ], 512), [
204
- [b, f(c).open]
204
+ [b, f(r).open]
205
205
  ])
206
206
  ], 64));
207
207
  }
208
208
  });
209
209
  export {
210
210
  ue as PaletteComponents,
211
- $e as default
211
+ Re as default
212
212
  };
@@ -0,0 +1,29 @@
1
+ import { type FuseResult } from 'fuse.js';
2
+ /**
3
+ * Hook for managing search functionality.
4
+ * Provides search state, results, and methods for searching.
5
+ */
6
+ export declare function useSearch(): {
7
+ searchText: import("vue").Ref<string>;
8
+ searchResultsWithPlaceholderResults: import("vue").ComputedRef<FuseResult<{
9
+ title: string;
10
+ description: string;
11
+ httpVerb: string;
12
+ id: string;
13
+ path: string;
14
+ }>[]>;
15
+ selectedSearchResult: import("vue").Ref<number>;
16
+ onSearchResultClick: (entry: FuseResult<{
17
+ title: string;
18
+ description: string;
19
+ httpVerb: string;
20
+ id: string;
21
+ path: string;
22
+ }>) => void;
23
+ fuseSearch: () => void;
24
+ searchInputRef: import("vue").Ref<HTMLInputElement | null>;
25
+ searchResultRefs: import("vue").Ref<HTMLElement[]>;
26
+ navigateSearchResults: (direction: "up" | "down") => void;
27
+ selectSearchResult: () => void;
28
+ };
29
+ //# sourceMappingURL=useSearch.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useSearch.d.ts","sourceRoot":"","sources":["../../../src/components/Search/useSearch.ts"],"names":[],"mappings":"AAEA,OAAa,EAAE,KAAK,UAAU,EAAE,MAAM,SAAS,CAAA;AAI/C;;;GAGG;AACH,wBAAgB,SAAS;;;eAKd,MAAM;qBACA,MAAM;kBACT,MAAM;YACZ,MAAM;cACJ,MAAM;;;iCA4EsB,UAAU;eAhFrC,MAAM;qBACA,MAAM;kBACT,MAAM;YACZ,MAAM;cACJ,MAAM;MA4E0C;sBA1CjC,IAAI;;;uCAKe,IAAI,GAAG,MAAM;;EAmExD"}
@@ -0,0 +1,62 @@
1
+ import { useWorkspace as y } from "../../store/workspace.js";
2
+ import g from "fuse.js";
3
+ import { ref as a, watch as T, computed as w, nextTick as x } from "vue";
4
+ import { useRouter as I } from "vue-router";
5
+ function E() {
6
+ const p = I(), { activeWorkspaceRequests: f } = y(), o = a([]), l = a([]), t = a(0), c = a(""), u = a(null), r = a([]), i = new g(o.value, {
7
+ keys: ["title", "description", "body"]
8
+ }), d = () => {
9
+ c.value = "", t.value = 0, l.value = [], u.value instanceof HTMLInputElement && u.value.blur();
10
+ }, R = (e) => {
11
+ o.value = e.map((s) => ({
12
+ id: s.uid,
13
+ title: s.summary ?? s.method,
14
+ description: s.description ?? "",
15
+ httpVerb: s.method,
16
+ path: s.path
17
+ })), i.setCollection(o.value);
18
+ }, S = () => {
19
+ t.value = 0, l.value = i.search(c.value);
20
+ }, k = (e) => {
21
+ const s = e === "up" ? -1 : 1, v = n.value.length;
22
+ t.value = (t.value + s + v) % v, x(() => {
23
+ const m = r.value[t.value];
24
+ m instanceof HTMLElement && m.scrollIntoView({
25
+ behavior: "smooth",
26
+ block: "center"
27
+ });
28
+ });
29
+ }, b = () => {
30
+ t.value >= 0 && h(
31
+ n.value[t.value]
32
+ );
33
+ };
34
+ T(
35
+ f,
36
+ (e) => {
37
+ R(e);
38
+ },
39
+ { immediate: !0 }
40
+ );
41
+ const h = (e) => {
42
+ p.push(e.item.id), d();
43
+ }, n = w(
44
+ () => c.value.length === 0 ? o.value.map((e) => ({
45
+ item: e
46
+ })) : l.value
47
+ );
48
+ return {
49
+ searchText: c,
50
+ searchResultsWithPlaceholderResults: n,
51
+ selectedSearchResult: t,
52
+ onSearchResultClick: h,
53
+ fuseSearch: S,
54
+ searchInputRef: u,
55
+ searchResultRefs: r,
56
+ navigateSearchResults: k,
57
+ selectSearchResult: b
58
+ };
59
+ }
60
+ export {
61
+ E as useSearch
62
+ };