@scalar/api-client 2.0.36 → 2.0.38

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 (39) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/dist/components/CommandPalette/CommandPaletteCollection.vue.d.ts.map +1 -1
  3. package/dist/components/CommandPalette/CommandPaletteCollection.vue.js +35 -42
  4. package/dist/components/CommandPalette/CommandPaletteExample.vue.d.ts.map +1 -1
  5. package/dist/components/CommandPalette/CommandPaletteExample.vue.js +54 -64
  6. package/dist/components/CommandPalette/CommandPaletteFolder.vue.d.ts.map +1 -1
  7. package/dist/components/CommandPalette/CommandPaletteFolder.vue.js +37 -44
  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 -57
  12. package/dist/components/CommandPalette/CommandPaletteWorkspace.vue.d.ts.map +1 -1
  13. package/dist/components/CommandPalette/CommandPaletteWorkspace.vue.js +29 -36
  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/components/Sidebar/Actions/DeleteSidebarListElement.vue.d.ts.map +1 -1
  20. package/dist/components/Sidebar/Actions/DeleteSidebarListElement.vue.js +12 -12
  21. package/dist/components/Sidebar/Actions/SidebarListElementForm.vue.js +14 -14
  22. package/dist/layouts/App/create-api-client-app.d.ts +5 -5
  23. package/dist/layouts/Modal/create-api-client-modal.d.ts +10 -10
  24. package/dist/libs/create-client.d.ts +6 -5
  25. package/dist/libs/create-client.d.ts.map +1 -1
  26. package/dist/store/workspace.d.ts +12 -12
  27. package/dist/store/workspace.d.ts.map +1 -1
  28. package/dist/store/workspace.js +185 -181
  29. package/dist/style.css +1 -1
  30. package/dist/views/Request/RequestSidebarItem.vue.d.ts.map +1 -1
  31. package/dist/views/Request/RequestSidebarItem.vue.js +1 -1
  32. package/dist/views/Request/RequestSidebarItem.vue2.js +112 -101
  33. package/dist/views/Request/RequestSidebarItemMenu.vue.d.ts +8 -2
  34. package/dist/views/Request/RequestSidebarItemMenu.vue.d.ts.map +1 -1
  35. package/dist/views/Request/RequestSidebarItemMenu.vue.js +92 -82
  36. package/package.json +4 -4
  37. package/dist/components/CommandPalette/handleKeyDown.d.ts +0 -2
  38. package/dist/components/CommandPalette/handleKeyDown.d.ts.map +0 -1
  39. package/dist/components/CommandPalette/handleKeyDown.js +0 -7
package/CHANGELOG.md CHANGED
@@ -1,5 +1,25 @@
1
1
  # @scalar/api-client
2
2
 
3
+ ## 2.0.38
4
+
5
+ ### Patch Changes
6
+
7
+ - de25d01: feat(api-client): add the ability to delete and rename folders and collections
8
+ - Updated dependencies [de25d01]
9
+ - @scalar/components@0.12.24
10
+ - @scalar/themes@0.9.17
11
+ - @scalar/oas-utils@0.2.20
12
+
13
+ ## 2.0.37
14
+
15
+ ### Patch Changes
16
+
17
+ - b21b419: feat(api-client): add submit to enter on command pallette
18
+ - 7b58f10: fix: add discord and github line icons
19
+ - 3d9e948: fix: add request on enter triggering in command palette
20
+ - Updated dependencies [7b58f10]
21
+ - @scalar/components@0.12.23
22
+
3
23
  ## 2.0.36
4
24
 
5
25
  ### 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":";;;;;AAiNA,wBAMG"}
@@ -1,64 +1,57 @@
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";
2
- import { useWorkspace as N } from "../../store/workspace.js";
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", {
1
+ import { defineComponent as p, ref as a, onMounted as m, openBlock as f, createElementBlock as h, createElementVNode as e, withDirectives as _, withKeys as x, withModifiers as v, vModelText as w, createVNode as b, unref as C, withCtx as y, createTextVNode as g } from "vue";
2
+ import { useWorkspace as k } from "../../store/workspace.js";
3
+ import { ScalarButton as N } from "@scalar/components";
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: c }) {
11
+ const i = c, { activeWorkspace: r, collectionMutators: u } = k(), o = a(""), 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
+ ), i("close");
24
+ }, n = a(null);
25
+ return m(() => {
26
+ var t;
27
+ (t = n.value) == null || t.focus();
28
+ }), (t, s) => (f(), h("div", M, [
29
+ e("div", V, [
30
+ B,
31
+ _(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),
36
+ autocomplete: "off",
47
37
  class: "border-transparent outline-none w-full pl-8 text-sm min-h-8 py-1.5",
38
+ "data-form-type": "other",
39
+ "data-lpignore": "true",
48
40
  label: "Collection Name",
49
- placeholder: "Collection Name"
50
- }, null, 512), [
51
- [w, l.value]
41
+ placeholder: "Collection Name",
42
+ onKeydown: x(v(l, ["prevent"]), ["enter"])
43
+ }, null, 40, K), [
44
+ [w, o.value]
52
45
  ])
53
46
  ]),
54
- o("div", M, [
55
- D,
56
- b(k(g), {
47
+ e("div", E, [
48
+ I,
49
+ b(C(N), {
57
50
  class: "max-h-8 text-xs p-0 px-3",
58
- onClick: n
51
+ onClick: l
59
52
  }, {
60
- default: C(() => [
61
- y(" Continue ")
53
+ default: y(() => [
54
+ g(" Continue ")
62
55
  ]),
63
56
  _: 1
64
57
  })
@@ -67,5 +60,5 @@ const B = { class: "flex w-full flex-col gap-3" }, E = { class: "gap-3 rounded b
67
60
  }
68
61
  });
69
62
  export {
70
- W as default
63
+ P as default
71
64
  };
@@ -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":";IAwIE,oCAAoC;eACzB,MAAM;;;;IADjB,oCAAoC;eACzB,MAAM;;;;AA+SnB,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 B, ref as u, onMounted as x, openBlock as m, createElementBlock as h, createElementVNode as l, withDirectives as I, withKeys as M, withModifiers as R, vModelText as V, createVNode as a, unref as s, withCtx as n, Fragment as q, renderList as K, createBlock as W, 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";
4
- import { ScalarDropdown as W, ScalarDropdownItem as j, ScalarButton as w, ScalarIcon as z } from "@scalar/components";
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", {
3
+ import { useWorkspace as j } from "../../store/workspace.js";
4
+ import { ScalarDropdown as z, ScalarDropdownItem as T, ScalarButton as w, ScalarIcon as F } from "@scalar/components";
5
+ import { useRouter as L } from "vue-router";
6
+ const P = { 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" }, A = /* @__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), G = ["onKeydown"], H = { class: "flex gap-2" }, J = { class: "flex flex-1 max-h-8" }, O = { class: "flex items-center gap-2" }, Q = { class: "max-h-40 custom-scroll" }, oe = /* @__PURE__ */ B({
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,
15
+ setup(b, { emit: k }) {
16
+ const y = b, g = k, { push: C } = L(), {
17
+ activeRequest: D,
19
18
  activeWorkspace: E,
20
- activeWorkspaceRequests: D,
21
- requests: S,
22
- requestExampleMutators: N
23
- } = M(), u = c(""), o = c(
19
+ activeWorkspaceRequests: S,
20
+ requests: N,
21
+ requestExampleMutators: $
22
+ } = j(), c = u(""), o = u(
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
+ N[y.metaData ?? ""] ?? D.value
25
+ ), p = (e) => o.value = e, i = u(null);
27
26
  x(() => {
28
27
  var e;
29
- return (e = m.value) == null ? void 0 : e.focus();
28
+ return (e = i.value) == null ? void 0 : e.focus();
30
29
  });
31
- const i = () => {
32
- const e = N.add(
30
+ const f = () => {
31
+ const e = $.add(
33
32
  o.value,
34
- u.value
33
+ c.value
35
34
  );
36
- e && g(
35
+ e && (C(
37
36
  `/workspace/${E.value.uid}/request/${o.value.uid}/examples/${e.uid}`
38
- );
37
+ ), g("close"));
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,
41
+ (e = i.value) == null || e.focus();
42
+ }), (e, r) => (m(), h("div", P, [
43
+ l("div", U, [
44
+ A,
56
45
  I(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: i,
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: M(R(f, ["prevent"]), ["enter"])
54
+ }, null, 40, G), [
55
+ [V, c.value]
66
56
  ])
67
57
  ]),
68
- l("div", P, [
69
- l("div", A, [
70
- s(n(W), {
58
+ l("div", H, [
59
+ l("div", J, [
60
+ a(s(z), {
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", Q, [
66
+ (m(!0), h(q, null, K(s(S), (t) => (m(), W(s(T), {
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: (X) => 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
+ a(_, {
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
+ a(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(o.value))
96
86
  }, {
97
- default: r(() => [
98
- p(h(o.value.summary) + " ", 1),
99
- l("div", G, [
100
- s(_, {
87
+ default: n(() => [
88
+ d(v(o.value.summary) + " ", 1),
89
+ l("div", O, [
90
+ a(_, {
101
91
  method: o.value.method
102
92
  }, null, 8, ["method"]),
103
- s(n(z), {
93
+ a(s(F), {
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
+ a(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
+ oe 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":";;;;;AAgUA,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 r, computed as v, 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 c, 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 }) {
12
- 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(
10
+ setup(q, { emit: h }) {
11
+ var p;
12
+ const _ = h, { activeWorkspaceCollections: b, folderMutators: w, activeCollection: C } = K(), s = r(""), d = r(((p = C.value) == null ? void 0 : p.uid) ?? ""), u = v(
14
13
  () => b.value.map((e) => {
15
14
  var l, o;
16
15
  return {
@@ -18,66 +17,60 @@ const z = { class: "flex w-full flex-col gap-3" }, T = { class: "gap-3 rounded b
18
17
  label: ((o = (l = e.spec) == null ? void 0 : l.info) == null ? void 0 : o.title) ?? ""
19
18
  };
20
19
  })
21
- ), t = p({
22
- get: () => f.value.find(
20
+ ), t = v({
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 = r(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),
46
+ autocomplete: "off",
57
47
  class: "border-transparent outline-none w-full pl-8 text-sm min-h-8 py-1.5",
48
+ "data-form-type": "other",
49
+ "data-lpignore": "true",
58
50
  label: "Folder Name",
59
- placeholder: "Folder Name"
60
- }, null, 512), [
61
- [D, n.value]
51
+ placeholder: "Folder Name",
52
+ onKeydown: S(F(f, ["prevent"]), ["enter"])
53
+ }, null, 40, j), [
54
+ [I, s.value]
62
55
  ])
63
56
  ]),
64
- a("div", j, [
65
- a("div", K, [
66
- s(i(M), {
57
+ a("div", L, [
58
+ a("div", P, [
59
+ n(i(z), {
67
60
  modelValue: t.value,
68
61
  "onUpdate:modelValue": l[1] || (l[1] = (o) => t.value = o),
69
- options: f.value
62
+ options: u.value
70
63
  }, {
71
64
  default: c(() => [
72
- s(i(x), {
65
+ n(i(x), {
73
66
  class: "justify-between p-2 max-h-8 w-full gap-1 text-xs hover:bg-b-2",
74
67
  variant: "outlined"
75
68
  }, {
76
69
  default: c(() => [
77
70
  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), {
71
+ class: M(t.value ? "text-c-1" : "text-c-3")
72
+ }, B(t.value ? t.value.label : "Select Collection"), 3),
73
+ n(i(E), {
81
74
  class: "text-c-3",
82
75
  icon: "ChevronDown",
83
76
  size: "xs"
@@ -89,12 +82,12 @@ const z = { class: "flex w-full flex-col gap-3" }, T = { class: "gap-3 rounded b
89
82
  _: 1
90
83
  }, 8, ["modelValue", "options"])
91
84
  ]),
92
- s(i(x), {
85
+ n(i(x), {
93
86
  class: "max-h-8 text-xs p-0 px-3",
94
- onClick: r
87
+ onClick: f
95
88
  }, {
96
89
  default: c(() => [
97
- I(" Create Folder ")
90
+ D(" Create Folder ")
98
91
  ]),
99
92
  _: 1
100
93
  })
@@ -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":";;;;;AAshBA,wBAMG"}