@scalar/api-client 2.0.36 → 2.0.37

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 (23) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/dist/components/CommandPalette/CommandPaletteCollection.vue.d.ts.map +1 -1
  3. package/dist/components/CommandPalette/CommandPaletteCollection.vue.js +29 -39
  4. package/dist/components/CommandPalette/CommandPaletteExample.vue.d.ts.map +1 -1
  5. package/dist/components/CommandPalette/CommandPaletteExample.vue.js +55 -65
  6. package/dist/components/CommandPalette/CommandPaletteFolder.vue.d.ts.map +1 -1
  7. package/dist/components/CommandPalette/CommandPaletteFolder.vue.js +35 -45
  8. package/dist/components/CommandPalette/CommandPaletteImport.vue.d.ts.map +1 -1
  9. package/dist/components/CommandPalette/CommandPaletteImport.vue.js +33 -43
  10. package/dist/components/CommandPalette/CommandPaletteRequest.vue.d.ts.map +1 -1
  11. package/dist/components/CommandPalette/CommandPaletteRequest.vue.js +50 -60
  12. package/dist/components/CommandPalette/CommandPaletteWorkspace.vue.d.ts.map +1 -1
  13. package/dist/components/CommandPalette/CommandPaletteWorkspace.vue.js +24 -34
  14. package/dist/components/CommandPalette/TheCommandPalette.vue.d.ts.map +1 -1
  15. package/dist/components/CommandPalette/TheCommandPalette.vue.js +1 -1
  16. package/dist/components/CommandPalette/TheCommandPalette.vue2.js +34 -34
  17. package/dist/components/SideNav/SideHelp.vue.d.ts.map +1 -1
  18. package/dist/components/SideNav/SideHelp.vue.js +34 -34
  19. package/dist/style.css +1 -1
  20. package/package.json +6 -6
  21. package/dist/components/CommandPalette/handleKeyDown.d.ts +0 -2
  22. package/dist/components/CommandPalette/handleKeyDown.d.ts.map +0 -1
  23. package/dist/components/CommandPalette/handleKeyDown.js +0 -7
package/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # @scalar/api-client
2
2
 
3
+ ## 2.0.37
4
+
5
+ ### Patch Changes
6
+
7
+ - b21b419: feat(api-client): add submit to enter on command pallette
8
+ - 7b58f10: fix: add discord and github line icons
9
+ - 3d9e948: fix: add request on enter triggering in command palette
10
+ - Updated dependencies [7b58f10]
11
+ - @scalar/components@0.12.23
12
+
3
13
  ## 2.0.36
4
14
 
5
15
  ### Patch Changes
@@ -1 +1 @@
1
- {"version":3,"file":"CommandPaletteCollection.vue.d.ts","sourceRoot":"","sources":["../../../src/components/CommandPalette/CommandPaletteCollection.vue"],"names":[],"mappings":";;;;;AA2OA,wBAMG"}
1
+ {"version":3,"file":"CommandPaletteCollection.vue.d.ts","sourceRoot":"","sources":["../../../src/components/CommandPalette/CommandPaletteCollection.vue"],"names":[],"mappings":";;;;;AA8MA,wBAMG"}
@@ -1,63 +1,53 @@
1
- import { defineComponent as p, ref as c, onMounted as f, onBeforeUnmount as _, openBlock as h, createElementBlock as v, createElementVNode as o, withDirectives as x, vModelText as w, createVNode as b, unref as k, withCtx as C, createTextVNode as y } from "vue";
1
+ import { defineComponent as p, ref as c, onMounted as m, openBlock as f, createElementBlock as _, createElementVNode as e, withDirectives as h, withKeys as x, withModifiers as v, vModelText as w, createVNode as b, unref as C, withCtx as k, createTextVNode as y } from "vue";
2
2
  import { useWorkspace as N } from "../../store/workspace.js";
3
3
  import { ScalarButton as g } from "@scalar/components";
4
- import { handleKeyDown as i } from "./handleKeyDown.js";
5
- const B = { class: "flex w-full flex-col gap-3" }, E = { class: "gap-3 rounded bg-b-2 focus-within:bg-b-1 focus-within:shadow-border min-h-20 relative" }, V = /* @__PURE__ */ o("label", {
4
+ const M = { class: "flex w-full flex-col gap-3" }, V = { class: "gap-3 rounded bg-b-2 focus-within:bg-b-1 focus-within:shadow-border min-h-20 relative" }, B = /* @__PURE__ */ e("label", {
6
5
  class: "absolute w-full h-full opacity-0 cursor-text",
7
6
  for: "collectionanme"
8
- }, null, -1), M = { class: "flex" }, D = /* @__PURE__ */ o("div", { class: "flex flex-1 gap-2 max-h-8" }, null, -1), W = /* @__PURE__ */ p({
7
+ }, null, -1), K = ["onKeydown"], E = { class: "flex" }, I = /* @__PURE__ */ e("div", { class: "flex flex-1 gap-2 max-h-8" }, null, -1), P = /* @__PURE__ */ p({
9
8
  __name: "CommandPaletteCollection",
10
9
  emits: ["close"],
11
- setup(I, { emit: a }) {
12
- const r = a, { activeWorkspace: u, collectionMutators: d } = N(), l = c(""), n = () => {
13
- d.add(
10
+ setup(S, { emit: i }) {
11
+ const a = i, { activeWorkspace: r, collectionMutators: u } = N(), o = c(""), l = () => {
12
+ u.add(
14
13
  {
15
14
  spec: {
16
15
  openapi: "3.1.0",
17
16
  info: {
18
- title: l.value,
17
+ title: o.value,
19
18
  version: "0.0.1"
20
19
  }
21
20
  }
22
21
  },
23
- u.value.uid
24
- ), r("close");
25
- }, s = c(null);
26
- return f(() => {
27
- var e;
28
- (e = s.value) == null || e.focus(), window.addEventListener(
29
- "keydown",
30
- (t) => i(t, n),
31
- !0
32
- );
33
- }), _(() => {
34
- window.removeEventListener(
35
- "keydown",
36
- (e) => i(e, n),
37
- !0
38
- );
39
- }), (e, t) => (h(), v("div", B, [
40
- o("div", E, [
41
- V,
42
- x(o("input", {
22
+ r.value.uid
23
+ ), a("close");
24
+ }, n = c(null);
25
+ return m(() => {
26
+ var t;
27
+ (t = n.value) == null || t.focus();
28
+ }), (t, s) => (f(), _("div", M, [
29
+ e("div", V, [
30
+ B,
31
+ h(e("input", {
43
32
  id: "collectionanme",
44
33
  ref_key: "collectionInput",
45
- ref: s,
46
- "onUpdate:modelValue": t[0] || (t[0] = (m) => l.value = m),
34
+ ref: n,
35
+ "onUpdate:modelValue": s[0] || (s[0] = (d) => o.value = d),
47
36
  class: "border-transparent outline-none w-full pl-8 text-sm min-h-8 py-1.5",
48
37
  label: "Collection Name",
49
- placeholder: "Collection Name"
50
- }, null, 512), [
51
- [w, l.value]
38
+ placeholder: "Collection Name",
39
+ onKeydown: x(v(l, ["prevent"]), ["enter"])
40
+ }, null, 40, K), [
41
+ [w, o.value]
52
42
  ])
53
43
  ]),
54
- o("div", M, [
55
- D,
56
- b(k(g), {
44
+ e("div", E, [
45
+ I,
46
+ b(C(g), {
57
47
  class: "max-h-8 text-xs p-0 px-3",
58
- onClick: n
48
+ onClick: l
59
49
  }, {
60
- default: C(() => [
50
+ default: k(() => [
61
51
  y(" Continue ")
62
52
  ]),
63
53
  _: 1
@@ -67,5 +57,5 @@ const B = { class: "flex w-full flex-col gap-3" }, E = { class: "gap-3 rounded b
67
57
  }
68
58
  });
69
59
  export {
70
- W as default
60
+ P as default
71
61
  };
@@ -1 +1 @@
1
- {"version":3,"file":"CommandPaletteExample.vue.d.ts","sourceRoot":"","sources":["../../../src/components/CommandPalette/CommandPaletteExample.vue"],"names":[],"mappings":";IAuJE,oCAAoC;eACzB,MAAM;;;;IADjB,oCAAoC;eACzB,MAAM;;;;AA2TnB,wBAOG;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":"CommandPaletteExample.vue.d.ts","sourceRoot":"","sources":["../../../src/components/CommandPalette/CommandPaletteExample.vue"],"names":[],"mappings":";IAuIE,oCAAoC;eACzB,MAAM;;;;IADjB,oCAAoC;eACzB,MAAM;;;;AA8SnB,wBAOG;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,86 +1,76 @@
1
- import { defineComponent as $, ref as c, onMounted as x, onBeforeUnmount as B, openBlock as d, createElementBlock as v, createElementVNode as l, withDirectives as I, vModelText as R, createVNode as s, unref as n, withCtx as r, Fragment as V, renderList as q, createBlock as L, createTextVNode as p, toDisplayString as h } from "vue";
1
+ import { defineComponent as N, ref as i, onMounted as x, openBlock as m, createElementBlock as h, createElementVNode as l, withDirectives as $, withKeys as B, withModifiers as I, vModelText as M, createVNode as o, unref as s, withCtx as n, Fragment as R, renderList as V, createBlock as q, createTextVNode as d, toDisplayString as v } from "vue";
2
2
  import _ from "../HttpMethod/HttpMethod.vue.js";
3
- import { useWorkspace as M } from "../../store/workspace.js";
3
+ import { useWorkspace as K } from "../../store/workspace.js";
4
4
  import { ScalarDropdown as W, ScalarDropdownItem as j, ScalarButton as w, ScalarIcon as z } from "@scalar/components";
5
5
  import { useRouter as T } from "vue-router";
6
- import { handleKeyDown as b } from "./handleKeyDown.js";
7
- const U = { class: "flex w-full flex-col gap-3" }, F = { class: "gap-3 rounded bg-b-2 focus-within:bg-b-1 focus-within:shadow-border min-h-20 relative" }, K = /* @__PURE__ */ l("label", {
6
+ const F = { class: "flex w-full flex-col gap-3" }, L = { class: "gap-3 rounded bg-b-2 focus-within:bg-b-1 focus-within:shadow-border min-h-20 relative" }, P = /* @__PURE__ */ l("label", {
8
7
  class: "absolute w-full h-full opacity-0 cursor-text",
9
8
  for: "examplename"
10
- }, null, -1), P = { class: "flex gap-2" }, A = { class: "flex flex-1 max-h-8" }, G = { class: "flex items-center gap-2" }, H = { class: "max-h-40 custom-scroll" }, le = /* @__PURE__ */ $({
9
+ }, null, -1), U = ["onKeydown"], A = { class: "flex gap-2" }, G = { class: "flex flex-1 max-h-8" }, H = { class: "flex items-center gap-2" }, J = { class: "max-h-40 custom-scroll" }, te = /* @__PURE__ */ N({
11
10
  __name: "CommandPaletteExample",
12
11
  props: {
13
12
  metaData: {}
14
13
  },
15
14
  emits: ["close"],
16
- setup(k, { emit: J }) {
17
- const y = k, { push: g } = T(), {
18
- activeRequest: C,
19
- activeWorkspace: E,
15
+ setup(b) {
16
+ const k = b, { push: y } = T(), {
17
+ activeRequest: g,
18
+ activeWorkspace: C,
20
19
  activeWorkspaceRequests: D,
21
- requests: S,
22
- requestExampleMutators: N
23
- } = M(), u = c(""), o = c(
20
+ requests: E,
21
+ requestExampleMutators: S
22
+ } = K(), c = i(""), a = i(
24
23
  // Ensure we pre-select the correct request
25
- S[y.metaData ?? ""] ?? C.value
26
- ), f = (e) => o.value = e, m = c(null);
24
+ E[k.metaData ?? ""] ?? g.value
25
+ ), p = (e) => a.value = e, u = i(null);
27
26
  x(() => {
28
27
  var e;
29
- return (e = m.value) == null ? void 0 : e.focus();
28
+ return (e = u.value) == null ? void 0 : e.focus();
30
29
  });
31
- const i = () => {
32
- const e = N.add(
33
- o.value,
34
- u.value
30
+ const f = () => {
31
+ const e = S.add(
32
+ a.value,
33
+ c.value
35
34
  );
36
- e && g(
37
- `/workspace/${E.value.uid}/request/${o.value.uid}/examples/${e.uid}`
35
+ e && y(
36
+ `/workspace/${C.value.uid}/request/${a.value.uid}/examples/${e.uid}`
38
37
  );
39
38
  };
40
39
  return x(() => {
41
40
  var e;
42
- (e = m.value) == null || e.focus(), window.addEventListener(
43
- "keydown",
44
- (a) => b(a, i),
45
- !0
46
- );
47
- }), B(() => {
48
- window.removeEventListener(
49
- "keydown",
50
- (e) => b(e, i),
51
- !0
52
- );
53
- }), (e, a) => (d(), v("div", U, [
54
- l("div", F, [
55
- K,
56
- I(l("input", {
41
+ (e = u.value) == null || e.focus();
42
+ }), (e, r) => (m(), h("div", F, [
43
+ l("div", L, [
44
+ P,
45
+ $(l("input", {
57
46
  id: "examplename",
58
47
  ref_key: "exampleInput",
59
- ref: m,
60
- "onUpdate:modelValue": a[0] || (a[0] = (t) => u.value = t),
48
+ ref: u,
49
+ "onUpdate:modelValue": r[0] || (r[0] = (t) => c.value = t),
61
50
  class: "border-transparent outline-none w-full pl-8 text-sm min-h-8 py-1.5",
62
51
  label: "Example Name",
63
- placeholder: "Example Name"
64
- }, null, 512), [
65
- [R, u.value]
52
+ placeholder: "Example Name",
53
+ onKeydown: B(I(f, ["prevent"]), ["enter"])
54
+ }, null, 40, U), [
55
+ [M, c.value]
66
56
  ])
67
57
  ]),
68
- l("div", P, [
69
- l("div", A, [
70
- s(n(W), {
58
+ l("div", A, [
59
+ l("div", G, [
60
+ o(s(W), {
71
61
  placement: "bottom",
72
62
  resize: ""
73
63
  }, {
74
- items: r(() => [
75
- l("div", H, [
76
- (d(!0), v(V, null, q(n(D), (t) => (d(), L(n(j), {
64
+ items: n(() => [
65
+ l("div", J, [
66
+ (m(!0), h(R, null, V(s(D), (t) => (m(), q(s(j), {
77
67
  key: t.uid,
78
68
  class: "flex h-7 w-full items-center justify-between px-1 pr-[26px]",
79
- onClick: (O) => f(t)
69
+ onClick: (O) => p(t)
80
70
  }, {
81
- default: r(() => [
82
- p(h(t.summary) + " ", 1),
83
- s(_, {
71
+ default: n(() => [
72
+ d(v(t.summary) + " ", 1),
73
+ o(_, {
84
74
  method: t.method
85
75
  }, null, 8, ["method"])
86
76
  ]),
@@ -88,19 +78,19 @@ const U = { class: "flex w-full flex-col gap-3" }, F = { class: "gap-3 rounded b
88
78
  }, 1032, ["onClick"]))), 128))
89
79
  ])
90
80
  ]),
91
- default: r(() => [
92
- s(n(w), {
81
+ default: n(() => [
82
+ o(s(w), {
93
83
  class: "justify-between p-2 max-h-8 w-full gap-1 text-xs hover:bg-b-2",
94
84
  variant: "outlined",
95
- onClick: a[1] || (a[1] = (t) => f(o.value))
85
+ onClick: r[1] || (r[1] = (t) => p(a.value))
96
86
  }, {
97
- default: r(() => [
98
- p(h(o.value.summary) + " ", 1),
99
- l("div", G, [
100
- s(_, {
101
- method: o.value.method
87
+ default: n(() => [
88
+ d(v(a.value.summary) + " ", 1),
89
+ l("div", H, [
90
+ o(_, {
91
+ method: a.value.method
102
92
  }, null, 8, ["method"]),
103
- s(n(z), {
93
+ o(s(z), {
104
94
  class: "text-c-3",
105
95
  icon: "ChevronDown",
106
96
  size: "xs"
@@ -113,12 +103,12 @@ const U = { class: "flex w-full flex-col gap-3" }, F = { class: "gap-3 rounded b
113
103
  _: 1
114
104
  })
115
105
  ]),
116
- s(n(w), {
106
+ o(s(w), {
117
107
  class: "max-h-8 text-xs p-0 px-3",
118
- onClick: i
108
+ onClick: f
119
109
  }, {
120
- default: r(() => [
121
- p(" Create Example ")
110
+ default: n(() => [
111
+ d(" Create Example ")
122
112
  ]),
123
113
  _: 1
124
114
  })
@@ -127,5 +117,5 @@ const U = { class: "flex w-full flex-col gap-3" }, F = { class: "gap-3 rounded b
127
117
  }
128
118
  });
129
119
  export {
130
- le as default
120
+ te as default
131
121
  };
@@ -1 +1 @@
1
- {"version":3,"file":"CommandPaletteFolder.vue.d.ts","sourceRoot":"","sources":["../../../src/components/CommandPalette/CommandPaletteFolder.vue"],"names":[],"mappings":";;;;;AA0VA,wBAMG"}
1
+ {"version":3,"file":"CommandPaletteFolder.vue.d.ts","sourceRoot":"","sources":["../../../src/components/CommandPalette/CommandPaletteFolder.vue"],"names":[],"mappings":";;;;;AA6TA,wBAMG"}
@@ -1,16 +1,15 @@
1
- import { defineComponent as k, ref as u, computed as p, onMounted as y, onBeforeUnmount as V, openBlock as N, createElementBlock as S, createElementVNode as a, withDirectives as B, vModelText as D, createVNode as s, unref as i, withCtx as c, normalizeClass as E, toDisplayString as F, createTextVNode as I } from "vue";
2
- import { useWorkspace as L } from "../../store/workspace.js";
3
- import { ScalarListbox as M, ScalarButton as x, ScalarIcon as U } from "@scalar/components";
4
- import { handleKeyDown as h } from "./handleKeyDown.js";
5
- const z = { class: "flex w-full flex-col gap-3" }, T = { class: "gap-3 rounded bg-b-2 focus-within:bg-b-1 focus-within:shadow-border min-h-20 relative" }, W = /* @__PURE__ */ a("label", {
1
+ import { defineComponent as g, ref as c, computed as p, onMounted as y, openBlock as V, createElementBlock as k, createElementVNode as a, withDirectives as N, withKeys as S, withModifiers as F, vModelText as I, createVNode as n, unref as i, withCtx as r, normalizeClass as M, toDisplayString as B, createTextVNode as D } from "vue";
2
+ import { useWorkspace as K } from "../../store/workspace.js";
3
+ import { ScalarListbox as z, ScalarButton as x, ScalarIcon as E } from "@scalar/components";
4
+ const T = { class: "flex w-full flex-col gap-3" }, U = { class: "gap-3 rounded bg-b-2 focus-within:bg-b-1 focus-within:shadow-border min-h-20 relative" }, W = /* @__PURE__ */ a("label", {
6
5
  class: "absolute w-full h-full opacity-0 cursor-text",
7
6
  for: "foldername"
8
- }, null, -1), j = { class: "flex" }, K = { class: "flex flex-1 gap-2 max-h-8" }, J = /* @__PURE__ */ k({
7
+ }, null, -1), j = ["onKeydown"], L = { class: "flex" }, P = { class: "flex flex-1 gap-2 max-h-8" }, J = /* @__PURE__ */ g({
9
8
  __name: "CommandPaletteFolder",
10
9
  emits: ["close"],
11
- setup(P, { emit: w }) {
10
+ setup(q, { emit: h }) {
12
11
  var v;
13
- const _ = w, { activeWorkspaceCollections: b, folderMutators: C, activeCollection: g } = L(), n = u(""), d = u(((v = g.value) == null ? void 0 : v.uid) ?? ""), f = p(
12
+ const _ = h, { activeWorkspaceCollections: b, folderMutators: w, activeCollection: C } = K(), s = c(""), d = c(((v = C.value) == null ? void 0 : v.uid) ?? ""), u = p(
14
13
  () => b.value.map((e) => {
15
14
  var l, o;
16
15
  return {
@@ -19,65 +18,56 @@ const z = { class: "flex w-full flex-col gap-3" }, T = { class: "gap-3 rounded b
19
18
  };
20
19
  })
21
20
  ), t = p({
22
- get: () => f.value.find(
21
+ get: () => u.value.find(
23
22
  ({ id: e }) => e === d.value
24
23
  ),
25
24
  set: (e) => {
26
25
  e != null && e.id && (d.value = e.id);
27
26
  }
28
- }), r = () => {
29
- n.value && t.value && (C.add(
27
+ }), f = () => {
28
+ s.value && t.value && (w.add(
30
29
  {
31
- name: n.value
30
+ name: s.value
32
31
  },
33
32
  d.value
34
33
  ), _("close"));
35
- }, m = u(null);
34
+ }, m = c(null);
36
35
  return y(() => {
37
36
  var e;
38
- (e = m.value) == null || e.focus(), window.addEventListener(
39
- "keydown",
40
- (l) => h(l, r),
41
- !0
42
- );
43
- }), V(() => {
44
- window.removeEventListener(
45
- "keydown",
46
- (e) => h(e, r),
47
- !0
48
- );
49
- }), (e, l) => (N(), S("div", z, [
50
- a("div", T, [
37
+ (e = m.value) == null || e.focus();
38
+ }), (e, l) => (V(), k("div", T, [
39
+ a("div", U, [
51
40
  W,
52
- B(a("input", {
41
+ N(a("input", {
53
42
  id: "foldername",
54
43
  ref_key: "folderInput",
55
44
  ref: m,
56
- "onUpdate:modelValue": l[0] || (l[0] = (o) => n.value = o),
45
+ "onUpdate:modelValue": l[0] || (l[0] = (o) => s.value = o),
57
46
  class: "border-transparent outline-none w-full pl-8 text-sm min-h-8 py-1.5",
58
47
  label: "Folder Name",
59
- placeholder: "Folder Name"
60
- }, null, 512), [
61
- [D, n.value]
48
+ placeholder: "Folder Name",
49
+ onKeydown: S(F(f, ["prevent"]), ["enter"])
50
+ }, null, 40, j), [
51
+ [I, s.value]
62
52
  ])
63
53
  ]),
64
- a("div", j, [
65
- a("div", K, [
66
- s(i(M), {
54
+ a("div", L, [
55
+ a("div", P, [
56
+ n(i(z), {
67
57
  modelValue: t.value,
68
58
  "onUpdate:modelValue": l[1] || (l[1] = (o) => t.value = o),
69
- options: f.value
59
+ options: u.value
70
60
  }, {
71
- default: c(() => [
72
- s(i(x), {
61
+ default: r(() => [
62
+ n(i(x), {
73
63
  class: "justify-between p-2 max-h-8 w-full gap-1 text-xs hover:bg-b-2",
74
64
  variant: "outlined"
75
65
  }, {
76
- default: c(() => [
66
+ default: r(() => [
77
67
  a("span", {
78
- class: E(t.value ? "text-c-1" : "text-c-3")
79
- }, F(t.value ? t.value.label : "Select Collection"), 3),
80
- s(i(U), {
68
+ class: M(t.value ? "text-c-1" : "text-c-3")
69
+ }, B(t.value ? t.value.label : "Select Collection"), 3),
70
+ n(i(E), {
81
71
  class: "text-c-3",
82
72
  icon: "ChevronDown",
83
73
  size: "xs"
@@ -89,12 +79,12 @@ const z = { class: "flex w-full flex-col gap-3" }, T = { class: "gap-3 rounded b
89
79
  _: 1
90
80
  }, 8, ["modelValue", "options"])
91
81
  ]),
92
- s(i(x), {
82
+ n(i(x), {
93
83
  class: "max-h-8 text-xs p-0 px-3",
94
- onClick: r
84
+ onClick: f
95
85
  }, {
96
- default: c(() => [
97
- I(" Create Folder ")
86
+ default: r(() => [
87
+ D(" Create Folder ")
98
88
  ]),
99
89
  _: 1
100
90
  })
@@ -1 +1 @@
1
- {"version":3,"file":"CommandPaletteImport.vue.d.ts","sourceRoot":"","sources":["../../../src/components/CommandPalette/CommandPaletteImport.vue"],"names":[],"mappings":";;;;;AA4TA,wBAMG"}
1
+ {"version":3,"file":"CommandPaletteImport.vue.d.ts","sourceRoot":"","sources":["../../../src/components/CommandPalette/CommandPaletteImport.vue"],"names":[],"mappings":";;;;;AA+RA,wBAMG"}
@@ -1,67 +1,57 @@
1
- import { defineComponent as k, ref as m, onMounted as S, onBeforeUnmount as C, openBlock as F, createElementBlock as I, createElementVNode as o, createVNode as a, unref as n, withCtx as u, createTextVNode as d } from "vue";
2
- import { useWorkspace as L } from "../../store/workspace.js";
3
- import { ScalarButton as f, ScalarIcon as U } from "@scalar/components";
4
- import { handleKeyDown as h } from "./handleKeyDown.js";
5
- import { useFileDialog as B } from "../../hooks/useFileDialog.js";
6
- const E = { class: "flex w-full flex-col gap-3" }, N = { class: "gap-3 rounded bg-b-2 focus-within:bg-b-1 focus-within:shadow-border min-h-20 relative" }, R = /* @__PURE__ */ o("label", {
1
+ import { defineComponent as y, ref as u, onMounted as S, openBlock as k, createElementBlock as C, createElementVNode as t, withKeys as F, withModifiers as I, createVNode as a, unref as o, withCtx as m, createTextVNode as d } from "vue";
2
+ import { useWorkspace as N } from "../../store/workspace.js";
3
+ import { ScalarButton as f, ScalarIcon as R } from "@scalar/components";
4
+ import { useFileDialog as U } from "../../hooks/useFileDialog.js";
5
+ const A = { class: "flex w-full flex-col gap-3" }, B = { class: "gap-3 rounded bg-b-2 focus-within:bg-b-1 focus-within:shadow-border min-h-20 relative" }, K = /* @__PURE__ */ t("label", {
7
6
  class: "absolute w-full h-full opacity-0 cursor-text",
8
7
  for: "requestimport"
9
- }, null, -1), A = { class: "flex gap-2" }, D = { class: "flex flex-1 gap-2 max-h-8" }, j = /* @__PURE__ */ k({
8
+ }, null, -1), L = ["onKeydown"], M = { class: "flex gap-2" }, P = { class: "flex flex-1 gap-2 max-h-8" }, W = /* @__PURE__ */ y({
10
9
  __name: "CommandPaletteImport",
11
10
  emits: ["close"],
12
- setup(P, { emit: x }) {
13
- const r = x, { activeWorkspace: _, importSpecFile: w, importSpecFromUrl: g } = L(), s = m(""), { open: v } = B({
11
+ setup(V, { emit: h }) {
12
+ const n = h, { activeWorkspace: _, importSpecFile: x, importSpecFromUrl: g } = N(), r = u(""), { open: w } = U({
14
13
  onChange: async (e) => {
15
- const t = e == null ? void 0 : e[0];
16
- if (t) {
14
+ const s = e == null ? void 0 : e[0];
15
+ if (s) {
17
16
  const i = new FileReader();
18
- i.onload = async (b) => {
17
+ i.onload = async (v) => {
19
18
  var p;
20
- const y = (p = b.target) == null ? void 0 : p.result;
21
- w(y, _.value.uid), l(), r("close");
22
- }, i.readAsText(t);
19
+ const b = (p = v.target) == null ? void 0 : p.result;
20
+ x(b, _.value.uid), l(), n("close");
21
+ }, i.readAsText(s);
23
22
  }
24
23
  },
25
24
  multiple: !1,
26
25
  accept: ".json,.yaml,.yml"
27
26
  }), l = async () => {
28
- s.value && (await g(s.value), r("close"));
29
- }, c = m(null);
27
+ r.value && (await g(r.value), n("close"));
28
+ }, c = u(null);
30
29
  return S(() => {
31
30
  var e;
32
- (e = c.value) == null || e.focus(), window.addEventListener(
33
- "keydown",
34
- (t) => h(t, l),
35
- !0
36
- );
37
- }), C(() => {
38
- window.removeEventListener(
39
- "keydown",
40
- (e) => h(e, l),
41
- !0
42
- );
43
- }), (e, t) => (F(), I("div", E, [
44
- o("div", N, [
45
- R,
46
- o("input", {
31
+ (e = c.value) == null || e.focus();
32
+ }), (e, s) => (k(), C("div", A, [
33
+ t("div", B, [
34
+ K,
35
+ t("input", {
47
36
  id: "requestimport",
48
37
  ref_key: "importInput",
49
38
  ref: c,
50
39
  class: "border-transparent outline-none w-full pl-8 text-sm min-h-8 py-1.5",
51
40
  label: "Paste Swagger File URL",
52
- placeholder: "Paste Swagger File URL"
53
- }, null, 512)
41
+ placeholder: "Paste Swagger File URL",
42
+ onKeydown: F(I(l, ["prevent"]), ["enter"])
43
+ }, null, 40, L)
54
44
  ]),
55
- o("div", A, [
56
- o("div", D, [
57
- a(n(f), {
45
+ t("div", M, [
46
+ t("div", P, [
47
+ a(o(f), {
58
48
  class: "p-2 max-h-8 gap-1 text-xs hover:bg-b-2 relative",
59
49
  variant: "outlined",
60
- onClick: n(v)
50
+ onClick: o(w)
61
51
  }, {
62
- default: u(() => [
52
+ default: m(() => [
63
53
  d(" JSON, or YAML Files "),
64
- a(n(U), {
54
+ a(o(R), {
65
55
  class: "text-c-3 -rotate-90",
66
56
  icon: "ArrowRight",
67
57
  size: "sm"
@@ -70,11 +60,11 @@ const E = { class: "flex w-full flex-col gap-3" }, N = { class: "gap-3 rounded b
70
60
  _: 1
71
61
  }, 8, ["onClick"])
72
62
  ]),
73
- a(n(f), {
63
+ a(o(f), {
74
64
  class: "max-h-8 text-xs p-0 px-3",
75
65
  onClick: l
76
66
  }, {
77
- default: u(() => [
67
+ default: m(() => [
78
68
  d(" Import Collection ")
79
69
  ]),
80
70
  _: 1
@@ -84,5 +74,5 @@ const E = { class: "flex w-full flex-col gap-3" }, N = { class: "gap-3 rounded b
84
74
  }
85
75
  });
86
76
  export {
87
- j as default
77
+ W as default
88
78
  };
@@ -1 +1 @@
1
- {"version":3,"file":"CommandPaletteRequest.vue.d.ts","sourceRoot":"","sources":["../../../src/components/CommandPalette/CommandPaletteRequest.vue"],"names":[],"mappings":";;;;;AAgjBA,wBAMG"}
1
+ {"version":3,"file":"CommandPaletteRequest.vue.d.ts","sourceRoot":"","sources":["../../../src/components/CommandPalette/CommandPaletteRequest.vue"],"names":[],"mappings":";;;;;AAmhBA,wBAMG"}