@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.
- package/CHANGELOG.md +10 -0
- package/dist/components/CommandPalette/CommandPaletteCollection.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/CommandPaletteCollection.vue.js +29 -39
- package/dist/components/CommandPalette/CommandPaletteExample.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/CommandPaletteExample.vue.js +55 -65
- package/dist/components/CommandPalette/CommandPaletteFolder.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/CommandPaletteFolder.vue.js +35 -45
- package/dist/components/CommandPalette/CommandPaletteImport.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/CommandPaletteImport.vue.js +33 -43
- package/dist/components/CommandPalette/CommandPaletteRequest.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/CommandPaletteRequest.vue.js +50 -60
- package/dist/components/CommandPalette/CommandPaletteWorkspace.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/CommandPaletteWorkspace.vue.js +24 -34
- package/dist/components/CommandPalette/TheCommandPalette.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/TheCommandPalette.vue.js +1 -1
- package/dist/components/CommandPalette/TheCommandPalette.vue2.js +34 -34
- package/dist/components/SideNav/SideHelp.vue.d.ts.map +1 -1
- package/dist/components/SideNav/SideHelp.vue.js +34 -34
- package/dist/style.css +1 -1
- package/package.json +6 -6
- package/dist/components/CommandPalette/handleKeyDown.d.ts +0 -2
- package/dist/components/CommandPalette/handleKeyDown.d.ts.map +0 -1
- 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":";;;;;
|
|
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,
|
|
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
|
-
|
|
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),
|
|
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(
|
|
12
|
-
const
|
|
13
|
-
|
|
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:
|
|
17
|
+
title: o.value,
|
|
19
18
|
version: "0.0.1"
|
|
20
19
|
}
|
|
21
20
|
}
|
|
22
21
|
},
|
|
23
|
-
|
|
24
|
-
),
|
|
25
|
-
},
|
|
26
|
-
return
|
|
27
|
-
var
|
|
28
|
-
(
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
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:
|
|
46
|
-
"onUpdate:modelValue":
|
|
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
|
-
|
|
51
|
-
|
|
38
|
+
placeholder: "Collection Name",
|
|
39
|
+
onKeydown: x(v(l, ["prevent"]), ["enter"])
|
|
40
|
+
}, null, 40, K), [
|
|
41
|
+
[w, o.value]
|
|
52
42
|
])
|
|
53
43
|
]),
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
b(
|
|
44
|
+
e("div", E, [
|
|
45
|
+
I,
|
|
46
|
+
b(C(g), {
|
|
57
47
|
class: "max-h-8 text-xs p-0 px-3",
|
|
58
|
-
onClick:
|
|
48
|
+
onClick: l
|
|
59
49
|
}, {
|
|
60
|
-
default:
|
|
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
|
-
|
|
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":";
|
|
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
|
|
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
|
|
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
|
-
|
|
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),
|
|
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(
|
|
17
|
-
const
|
|
18
|
-
activeRequest:
|
|
19
|
-
activeWorkspace:
|
|
15
|
+
setup(b) {
|
|
16
|
+
const k = b, { push: y } = T(), {
|
|
17
|
+
activeRequest: g,
|
|
18
|
+
activeWorkspace: C,
|
|
20
19
|
activeWorkspaceRequests: D,
|
|
21
|
-
requests:
|
|
22
|
-
requestExampleMutators:
|
|
23
|
-
} =
|
|
20
|
+
requests: E,
|
|
21
|
+
requestExampleMutators: S
|
|
22
|
+
} = K(), c = i(""), a = i(
|
|
24
23
|
// Ensure we pre-select the correct request
|
|
25
|
-
|
|
26
|
-
),
|
|
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 =
|
|
28
|
+
return (e = u.value) == null ? void 0 : e.focus();
|
|
30
29
|
});
|
|
31
|
-
const
|
|
32
|
-
const e =
|
|
33
|
-
|
|
34
|
-
|
|
30
|
+
const f = () => {
|
|
31
|
+
const e = S.add(
|
|
32
|
+
a.value,
|
|
33
|
+
c.value
|
|
35
34
|
);
|
|
36
|
-
e &&
|
|
37
|
-
`/workspace/${
|
|
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 =
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
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:
|
|
60
|
-
"onUpdate:modelValue":
|
|
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
|
-
|
|
65
|
-
|
|
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",
|
|
69
|
-
l("div",
|
|
70
|
-
s(
|
|
58
|
+
l("div", A, [
|
|
59
|
+
l("div", G, [
|
|
60
|
+
o(s(W), {
|
|
71
61
|
placement: "bottom",
|
|
72
62
|
resize: ""
|
|
73
63
|
}, {
|
|
74
|
-
items:
|
|
75
|
-
l("div",
|
|
76
|
-
(
|
|
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) =>
|
|
69
|
+
onClick: (O) => p(t)
|
|
80
70
|
}, {
|
|
81
|
-
default:
|
|
82
|
-
|
|
83
|
-
|
|
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:
|
|
92
|
-
s(
|
|
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:
|
|
85
|
+
onClick: r[1] || (r[1] = (t) => p(a.value))
|
|
96
86
|
}, {
|
|
97
|
-
default:
|
|
98
|
-
|
|
99
|
-
l("div",
|
|
100
|
-
|
|
101
|
-
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(
|
|
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(
|
|
106
|
+
o(s(w), {
|
|
117
107
|
class: "max-h-8 text-xs p-0 px-3",
|
|
118
|
-
onClick:
|
|
108
|
+
onClick: f
|
|
119
109
|
}, {
|
|
120
|
-
default:
|
|
121
|
-
|
|
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
|
-
|
|
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":";;;;;
|
|
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
|
|
2
|
-
import { useWorkspace as
|
|
3
|
-
import { ScalarListbox as
|
|
4
|
-
|
|
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" },
|
|
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(
|
|
10
|
+
setup(q, { emit: h }) {
|
|
12
11
|
var v;
|
|
13
|
-
const _ =
|
|
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: () =>
|
|
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
|
-
}),
|
|
29
|
-
|
|
27
|
+
}), f = () => {
|
|
28
|
+
s.value && t.value && (w.add(
|
|
30
29
|
{
|
|
31
|
-
name:
|
|
30
|
+
name: s.value
|
|
32
31
|
},
|
|
33
32
|
d.value
|
|
34
33
|
), _("close"));
|
|
35
|
-
}, m =
|
|
34
|
+
}, m = c(null);
|
|
36
35
|
return y(() => {
|
|
37
36
|
var e;
|
|
38
|
-
(e = m.value) == null || e.focus()
|
|
39
|
-
|
|
40
|
-
|
|
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
|
-
|
|
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) =>
|
|
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
|
-
|
|
61
|
-
|
|
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",
|
|
65
|
-
a("div",
|
|
66
|
-
|
|
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:
|
|
59
|
+
options: u.value
|
|
70
60
|
}, {
|
|
71
|
-
default:
|
|
72
|
-
|
|
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:
|
|
66
|
+
default: r(() => [
|
|
77
67
|
a("span", {
|
|
78
|
-
class:
|
|
79
|
-
},
|
|
80
|
-
|
|
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
|
-
|
|
82
|
+
n(i(x), {
|
|
93
83
|
class: "max-h-8 text-xs p-0 px-3",
|
|
94
|
-
onClick:
|
|
84
|
+
onClick: f
|
|
95
85
|
}, {
|
|
96
|
-
default:
|
|
97
|
-
|
|
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":";;;;;
|
|
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
|
|
2
|
-
import { useWorkspace as
|
|
3
|
-
import { ScalarButton as f, ScalarIcon as
|
|
4
|
-
import {
|
|
5
|
-
|
|
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),
|
|
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(
|
|
13
|
-
const
|
|
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
|
|
16
|
-
if (
|
|
14
|
+
const s = e == null ? void 0 : e[0];
|
|
15
|
+
if (s) {
|
|
17
16
|
const i = new FileReader();
|
|
18
|
-
i.onload = async (
|
|
17
|
+
i.onload = async (v) => {
|
|
19
18
|
var p;
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
}, i.readAsText(
|
|
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
|
-
|
|
29
|
-
}, c =
|
|
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()
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
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
|
-
|
|
41
|
+
placeholder: "Paste Swagger File URL",
|
|
42
|
+
onKeydown: F(I(l, ["prevent"]), ["enter"])
|
|
43
|
+
}, null, 40, L)
|
|
54
44
|
]),
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
a(
|
|
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:
|
|
50
|
+
onClick: o(w)
|
|
61
51
|
}, {
|
|
62
|
-
default:
|
|
52
|
+
default: m(() => [
|
|
63
53
|
d(" JSON, or YAML Files "),
|
|
64
|
-
a(
|
|
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(
|
|
63
|
+
a(o(f), {
|
|
74
64
|
class: "max-h-8 text-xs p-0 px-3",
|
|
75
65
|
onClick: l
|
|
76
66
|
}, {
|
|
77
|
-
default:
|
|
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
|
-
|
|
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":";;;;;
|
|
1
|
+
{"version":3,"file":"CommandPaletteRequest.vue.d.ts","sourceRoot":"","sources":["../../../src/components/CommandPalette/CommandPaletteRequest.vue"],"names":[],"mappings":";;;;;AAmhBA,wBAMG"}
|