@scalar/api-client 2.0.33 → 2.0.35
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 +28 -0
- package/dist/components/CodeInput/CodeInput.vue.js +2 -2
- package/dist/components/CommandPalette/CommandPaletteCollection.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/CommandPaletteCollection.vue.js +39 -31
- package/dist/components/CommandPalette/CommandPaletteExample.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/CommandPaletteExample.vue.js +65 -55
- package/dist/components/CommandPalette/CommandPaletteFolder.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/CommandPaletteFolder.vue.js +53 -44
- package/dist/components/CommandPalette/CommandPaletteImport.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/CommandPaletteImport.vue.js +42 -34
- package/dist/components/CommandPalette/CommandPaletteRequest.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/CommandPaletteRequest.vue.js +126 -70
- package/dist/components/CommandPalette/CommandPaletteWorkspace.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/CommandPaletteWorkspace.vue.js +37 -29
- package/dist/components/CommandPalette/TheCommandPalette.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/TheCommandPalette.vue.js +4 -4
- package/dist/components/CommandPalette/TheCommandPalette.vue2.js +97 -85
- package/dist/components/CommandPalette/handleKeyDown.d.ts +2 -0
- package/dist/components/CommandPalette/handleKeyDown.d.ts.map +1 -0
- package/dist/components/CommandPalette/handleKeyDown.js +7 -0
- package/dist/components/DataTable/DataTableInput.vue.d.ts +7 -0
- package/dist/components/DataTable/DataTableInput.vue.d.ts.map +1 -1
- package/dist/components/DataTable/DataTableInput.vue.js +3 -3
- package/dist/components/DataTable/DataTableInput.vue2.js +33 -31
- package/dist/components/DataTable/DataTableInputSelect.vue.d.ts +19 -3
- package/dist/components/DataTable/DataTableInputSelect.vue.d.ts.map +1 -1
- package/dist/components/DataTable/DataTableInputSelect.vue.js +37 -35
- package/dist/components/DataTable/index.d.ts +1 -0
- package/dist/components/DataTable/index.d.ts.map +1 -1
- package/dist/components/DataTable/index.js +6 -4
- package/dist/components/Form/Form.vue.js +1 -1
- package/dist/components/Search/SearchButton.vue.d.ts.map +1 -1
- package/dist/components/Search/SearchButton.vue.js +14 -16
- package/dist/components/SideNav/SideHelp.vue.d.ts +3 -0
- package/dist/components/SideNav/SideHelp.vue.d.ts.map +1 -0
- package/dist/components/SideNav/SideHelp.vue.js +125 -0
- package/dist/components/SideNav/SideHelp.vue2.js +4 -0
- package/dist/components/SideNav/SideNav.vue.d.ts.map +1 -1
- package/dist/components/SideNav/SideNav.vue.js +3 -3
- package/dist/components/SideNav/SideNav.vue2.js +28 -24
- package/dist/components/Sidebar/SidebarButton.vue.js +1 -1
- package/dist/components/Sidebar/SidebarList.vue.d.ts.map +1 -1
- package/dist/components/Sidebar/SidebarList.vue.js +1 -1
- package/dist/components/Sidebar/SidebarListElement.vue.d.ts.map +1 -1
- package/dist/components/Sidebar/SidebarListElement.vue.js +1 -1
- package/dist/components/Sidebar/SidebarListElement.vue2.js +9 -9
- package/dist/constants.d.ts +0 -4
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +2 -2
- package/dist/layouts/App/create-api-client-app.d.ts +512 -603
- package/dist/layouts/App/create-api-client-app.d.ts.map +1 -1
- package/dist/layouts/Modal/api-client-modal.d.ts +1036 -1218
- package/dist/layouts/Modal/api-client-modal.d.ts.map +1 -1
- package/dist/libs/create-client.d.ts +513 -603
- package/dist/libs/create-client.d.ts.map +1 -1
- package/dist/libs/create-client.js +58 -68
- package/dist/libs/local-storage.js +5 -5
- package/dist/libs/sendRequest.d.ts +3 -5
- package/dist/libs/sendRequest.d.ts.map +1 -1
- package/dist/libs/sendRequest.js +73 -67
- package/dist/store/workspace.d.ts +1037 -1219
- package/dist/store/workspace.d.ts.map +1 -1
- package/dist/store/workspace.js +350 -277
- package/dist/style.css +1 -1
- package/dist/views/Request/Request.vue.d.ts.map +1 -1
- package/dist/views/Request/Request.vue.js +1 -1
- package/dist/views/Request/Request.vue2.js +101 -102
- package/dist/views/Request/RequestSection/RequestAuth.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestAuth.vue.js +270 -177
- package/dist/views/Request/RequestSection/RequestSection.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestSection.vue.js +52 -42
- package/dist/views/Request/RequestSidebarItemMenu.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSidebarItemMenu.vue.js +141 -104
- package/dist/views/Request/components/OAuth2.vue.d.ts +3 -9
- package/dist/views/Request/components/OAuth2.vue.d.ts.map +1 -1
- package/dist/views/Request/components/OAuth2.vue.js +141 -112
- package/dist/views/Request/components/OAuthScopesInput.vue.d.ts +2 -6
- package/dist/views/Request/components/OAuthScopesInput.vue.d.ts.map +1 -1
- package/dist/views/Request/components/OAuthScopesInput.vue.js +35 -39
- package/dist/views/Request/consts/index.d.ts +2 -0
- package/dist/views/Request/consts/index.d.ts.map +1 -0
- package/dist/views/Request/consts/index.js +5 -0
- package/dist/views/Request/consts/new-auth-options.d.ts +92 -0
- package/dist/views/Request/consts/new-auth-options.d.ts.map +1 -0
- package/dist/views/Request/consts/new-auth-options.js +83 -0
- package/dist/views/Request/libs/oauth2.d.ts +3 -16
- package/dist/views/Request/libs/oauth2.d.ts.map +1 -1
- package/dist/views/Request/libs/oauth2.js +28 -31
- package/package.json +9 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,33 @@
|
|
|
1
1
|
# @scalar/api-client
|
|
2
2
|
|
|
3
|
+
## 2.0.35
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- bf2895e: feat(api-client): add multiple auth to api client
|
|
8
|
+
- 5d2825a: feat: add sidebar request menu
|
|
9
|
+
- Updated dependencies [bf2895e]
|
|
10
|
+
- Updated dependencies [5d2825a]
|
|
11
|
+
- @scalar/components@0.12.22
|
|
12
|
+
- @scalar/oas-utils@0.2.19
|
|
13
|
+
|
|
14
|
+
## 2.0.34
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
- c0cf4ac: fix: hide servers page
|
|
19
|
+
- 225e32a: feat: make the command palette amazing
|
|
20
|
+
- bb5909f: fix: tw-bg-base bug in gitbook and some app polish
|
|
21
|
+
- 9815191: fix: actually add workspace cookies to request
|
|
22
|
+
- a7ea3e3: fix: add default active collection to folder create command
|
|
23
|
+
- 9243580: feat: improve create request command
|
|
24
|
+
- 12bd5b8: fix: upload file in form-data with key
|
|
25
|
+
- Updated dependencies [9815191]
|
|
26
|
+
- Updated dependencies [e8fa353]
|
|
27
|
+
- Updated dependencies [869d255]
|
|
28
|
+
- @scalar/oas-utils@0.2.18
|
|
29
|
+
- @scalar/components@0.12.21
|
|
30
|
+
|
|
3
31
|
## 2.0.33
|
|
4
32
|
|
|
5
33
|
### Patch Changes
|
|
@@ -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
|
|
5
|
+
const _ = /* @__PURE__ */ t(o, [["__scopeId", "data-v-4c6b20da"]]);
|
|
6
6
|
export {
|
|
7
|
-
|
|
7
|
+
_ as default
|
|
8
8
|
};
|
|
@@ -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":";;;;;AA2OA,wBAMG"}
|
|
@@ -1,61 +1,69 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useWorkspace as
|
|
3
|
-
import { ScalarButton as
|
|
4
|
-
|
|
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", {
|
|
5
6
|
class: "absolute w-full h-full opacity-0 cursor-text",
|
|
6
7
|
for: "collectionanme"
|
|
7
|
-
}, null, -1),
|
|
8
|
+
}, null, -1), M = { class: "flex" }, D = /* @__PURE__ */ o("div", { class: "flex flex-1 gap-2 max-h-8" }, null, -1), W = /* @__PURE__ */ p({
|
|
8
9
|
__name: "CommandPaletteCollection",
|
|
9
10
|
emits: ["close"],
|
|
10
|
-
setup(
|
|
11
|
-
const
|
|
12
|
-
|
|
11
|
+
setup(I, { emit: a }) {
|
|
12
|
+
const r = a, { activeWorkspace: u, collectionMutators: d } = N(), l = c(""), n = () => {
|
|
13
|
+
d.add(
|
|
13
14
|
{
|
|
14
15
|
spec: {
|
|
15
16
|
openapi: "3.1.0",
|
|
16
17
|
info: {
|
|
17
|
-
title:
|
|
18
|
+
title: l.value,
|
|
18
19
|
version: "0.0.1"
|
|
19
20
|
}
|
|
20
21
|
}
|
|
21
22
|
},
|
|
22
|
-
|
|
23
|
-
),
|
|
24
|
-
},
|
|
25
|
-
return
|
|
26
|
-
var
|
|
27
|
-
(
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
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", {
|
|
35
43
|
id: "collectionanme",
|
|
36
44
|
ref_key: "collectionInput",
|
|
37
|
-
ref:
|
|
38
|
-
"onUpdate:modelValue":
|
|
45
|
+
ref: s,
|
|
46
|
+
"onUpdate:modelValue": t[0] || (t[0] = (m) => l.value = m),
|
|
39
47
|
class: "border-transparent outline-none w-full pl-8 text-sm min-h-8 py-1.5",
|
|
40
48
|
label: "Collection Name",
|
|
41
49
|
placeholder: "Collection Name"
|
|
42
50
|
}, null, 512), [
|
|
43
|
-
[
|
|
51
|
+
[w, l.value]
|
|
44
52
|
])
|
|
45
53
|
]),
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
b(
|
|
54
|
+
o("div", M, [
|
|
55
|
+
D,
|
|
56
|
+
b(k(g), {
|
|
49
57
|
class: "max-h-8 text-xs p-0 px-3",
|
|
50
|
-
|
|
58
|
+
onClick: n
|
|
51
59
|
}, {
|
|
52
60
|
default: C(() => [
|
|
53
|
-
|
|
61
|
+
y(" Continue ")
|
|
54
62
|
]),
|
|
55
63
|
_: 1
|
|
56
64
|
})
|
|
57
65
|
])
|
|
58
|
-
]
|
|
66
|
+
]));
|
|
59
67
|
}
|
|
60
68
|
});
|
|
61
69
|
export {
|
|
@@ -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":";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,75 +1,86 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import { useWorkspace as
|
|
4
|
-
import { ScalarDropdown as
|
|
5
|
-
import { useRouter as
|
|
6
|
-
|
|
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";
|
|
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", {
|
|
7
8
|
class: "absolute w-full h-full opacity-0 cursor-text",
|
|
8
9
|
for: "examplename"
|
|
9
|
-
}, null, -1),
|
|
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__ */ $({
|
|
10
11
|
__name: "CommandPaletteExample",
|
|
11
12
|
props: {
|
|
12
13
|
metaData: {}
|
|
13
14
|
},
|
|
14
15
|
emits: ["close"],
|
|
15
|
-
setup(
|
|
16
|
-
const
|
|
17
|
-
activeRequest:
|
|
18
|
-
activeWorkspace:
|
|
19
|
-
activeWorkspaceRequests:
|
|
20
|
-
requests:
|
|
21
|
-
requestExampleMutators:
|
|
22
|
-
} =
|
|
16
|
+
setup(k, { emit: J }) {
|
|
17
|
+
const y = k, { push: g } = T(), {
|
|
18
|
+
activeRequest: C,
|
|
19
|
+
activeWorkspace: E,
|
|
20
|
+
activeWorkspaceRequests: D,
|
|
21
|
+
requests: S,
|
|
22
|
+
requestExampleMutators: N
|
|
23
|
+
} = M(), u = c(""), o = c(
|
|
23
24
|
// Ensure we pre-select the correct request
|
|
24
|
-
|
|
25
|
-
),
|
|
26
|
-
|
|
25
|
+
S[y.metaData ?? ""] ?? C.value
|
|
26
|
+
), f = (e) => o.value = e, m = c(null);
|
|
27
|
+
x(() => {
|
|
27
28
|
var e;
|
|
28
|
-
return (e =
|
|
29
|
+
return (e = m.value) == null ? void 0 : e.focus();
|
|
29
30
|
});
|
|
30
|
-
const
|
|
31
|
-
const e =
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
const i = () => {
|
|
32
|
+
const e = N.add(
|
|
33
|
+
o.value,
|
|
34
|
+
u.value
|
|
34
35
|
);
|
|
35
36
|
e && g(
|
|
36
|
-
`/workspace/${
|
|
37
|
+
`/workspace/${E.value.uid}/request/${o.value.uid}/examples/${e.uid}`
|
|
37
38
|
);
|
|
38
39
|
};
|
|
39
|
-
return (
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
40
|
+
return x(() => {
|
|
41
|
+
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", {
|
|
46
57
|
id: "examplename",
|
|
47
58
|
ref_key: "exampleInput",
|
|
48
|
-
ref:
|
|
49
|
-
"onUpdate:modelValue":
|
|
59
|
+
ref: m,
|
|
60
|
+
"onUpdate:modelValue": a[0] || (a[0] = (t) => u.value = t),
|
|
50
61
|
class: "border-transparent outline-none w-full pl-8 text-sm min-h-8 py-1.5",
|
|
51
62
|
label: "Example Name",
|
|
52
63
|
placeholder: "Example Name"
|
|
53
64
|
}, null, 512), [
|
|
54
|
-
[R,
|
|
65
|
+
[R, u.value]
|
|
55
66
|
])
|
|
56
67
|
]),
|
|
57
|
-
l("div",
|
|
58
|
-
l("div",
|
|
59
|
-
s(n(
|
|
68
|
+
l("div", P, [
|
|
69
|
+
l("div", A, [
|
|
70
|
+
s(n(W), {
|
|
60
71
|
placement: "bottom",
|
|
61
72
|
resize: ""
|
|
62
73
|
}, {
|
|
63
74
|
items: r(() => [
|
|
64
|
-
l("div",
|
|
65
|
-
(
|
|
75
|
+
l("div", H, [
|
|
76
|
+
(d(!0), v(V, null, q(n(D), (t) => (d(), L(n(j), {
|
|
66
77
|
key: t.uid,
|
|
67
78
|
class: "flex h-7 w-full items-center justify-between px-1 pr-[26px]",
|
|
68
|
-
onClick: (
|
|
79
|
+
onClick: (O) => f(t)
|
|
69
80
|
}, {
|
|
70
81
|
default: r(() => [
|
|
71
|
-
|
|
72
|
-
s(
|
|
82
|
+
p(h(t.summary) + " ", 1),
|
|
83
|
+
s(_, {
|
|
73
84
|
method: t.method
|
|
74
85
|
}, null, 8, ["method"])
|
|
75
86
|
]),
|
|
@@ -78,18 +89,18 @@ const P = { class: "gap-3 rounded bg-b-2 focus-within:bg-b-1 focus-within:shadow
|
|
|
78
89
|
])
|
|
79
90
|
]),
|
|
80
91
|
default: r(() => [
|
|
81
|
-
s(n(
|
|
92
|
+
s(n(w), {
|
|
82
93
|
class: "justify-between p-2 max-h-8 w-full gap-1 text-xs hover:bg-b-2",
|
|
83
94
|
variant: "outlined",
|
|
84
|
-
onClick:
|
|
95
|
+
onClick: a[1] || (a[1] = (t) => f(o.value))
|
|
85
96
|
}, {
|
|
86
97
|
default: r(() => [
|
|
87
|
-
|
|
88
|
-
l("div",
|
|
89
|
-
s(
|
|
90
|
-
method:
|
|
98
|
+
p(h(o.value.summary) + " ", 1),
|
|
99
|
+
l("div", G, [
|
|
100
|
+
s(_, {
|
|
101
|
+
method: o.value.method
|
|
91
102
|
}, null, 8, ["method"]),
|
|
92
|
-
s(n(
|
|
103
|
+
s(n(z), {
|
|
93
104
|
class: "text-c-3",
|
|
94
105
|
icon: "ChevronDown",
|
|
95
106
|
size: "xs"
|
|
@@ -102,20 +113,19 @@ const P = { class: "gap-3 rounded bg-b-2 focus-within:bg-b-1 focus-within:shadow
|
|
|
102
113
|
_: 1
|
|
103
114
|
})
|
|
104
115
|
]),
|
|
105
|
-
s(n(
|
|
116
|
+
s(n(w), {
|
|
106
117
|
class: "max-h-8 text-xs p-0 px-3",
|
|
107
|
-
|
|
108
|
-
onClick: $
|
|
118
|
+
onClick: i
|
|
109
119
|
}, {
|
|
110
120
|
default: r(() => [
|
|
111
|
-
|
|
121
|
+
p(" Create Example ")
|
|
112
122
|
]),
|
|
113
123
|
_: 1
|
|
114
124
|
})
|
|
115
125
|
])
|
|
116
|
-
]
|
|
126
|
+
]));
|
|
117
127
|
}
|
|
118
128
|
});
|
|
119
129
|
export {
|
|
120
|
-
|
|
130
|
+
le as default
|
|
121
131
|
};
|
|
@@ -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":";;;;;AA0VA,wBAMG"}
|
|
@@ -1,74 +1,83 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useWorkspace as
|
|
3
|
-
import { ScalarListbox as
|
|
4
|
-
|
|
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", {
|
|
5
6
|
class: "absolute w-full h-full opacity-0 cursor-text",
|
|
6
7
|
for: "foldername"
|
|
7
|
-
}, null, -1),
|
|
8
|
+
}, null, -1), j = { class: "flex" }, K = { class: "flex flex-1 gap-2 max-h-8" }, J = /* @__PURE__ */ k({
|
|
8
9
|
__name: "CommandPaletteFolder",
|
|
9
10
|
emits: ["close"],
|
|
10
|
-
setup(
|
|
11
|
-
|
|
12
|
-
|
|
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(
|
|
14
|
+
() => b.value.map((e) => {
|
|
13
15
|
var l, o;
|
|
14
16
|
return {
|
|
15
17
|
id: e.uid,
|
|
16
18
|
label: ((o = (l = e.spec) == null ? void 0 : l.info) == null ? void 0 : o.title) ?? ""
|
|
17
19
|
};
|
|
18
20
|
})
|
|
19
|
-
), t =
|
|
20
|
-
get: () =>
|
|
21
|
-
({ id: e }) => e ===
|
|
21
|
+
), t = p({
|
|
22
|
+
get: () => f.value.find(
|
|
23
|
+
({ id: e }) => e === d.value
|
|
22
24
|
),
|
|
23
25
|
set: (e) => {
|
|
24
|
-
e != null && e.id && (
|
|
26
|
+
e != null && e.id && (d.value = e.id);
|
|
25
27
|
}
|
|
26
|
-
}),
|
|
27
|
-
|
|
28
|
+
}), r = () => {
|
|
29
|
+
n.value && t.value && (C.add(
|
|
28
30
|
{
|
|
29
|
-
name:
|
|
31
|
+
name: n.value
|
|
30
32
|
},
|
|
31
|
-
|
|
32
|
-
),
|
|
33
|
-
},
|
|
34
|
-
return
|
|
33
|
+
d.value
|
|
34
|
+
), _("close"));
|
|
35
|
+
}, m = u(null);
|
|
36
|
+
return y(() => {
|
|
35
37
|
var e;
|
|
36
|
-
(e =
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
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, [
|
|
51
|
+
W,
|
|
52
|
+
B(a("input", {
|
|
44
53
|
id: "foldername",
|
|
45
54
|
ref_key: "folderInput",
|
|
46
|
-
ref:
|
|
47
|
-
"onUpdate:modelValue": l[0] || (l[0] = (o) =>
|
|
55
|
+
ref: m,
|
|
56
|
+
"onUpdate:modelValue": l[0] || (l[0] = (o) => n.value = o),
|
|
48
57
|
class: "border-transparent outline-none w-full pl-8 text-sm min-h-8 py-1.5",
|
|
49
58
|
label: "Folder Name",
|
|
50
59
|
placeholder: "Folder Name"
|
|
51
60
|
}, null, 512), [
|
|
52
|
-
[
|
|
61
|
+
[D, n.value]
|
|
53
62
|
])
|
|
54
63
|
]),
|
|
55
|
-
a("div",
|
|
56
|
-
a("div",
|
|
57
|
-
|
|
64
|
+
a("div", j, [
|
|
65
|
+
a("div", K, [
|
|
66
|
+
s(i(M), {
|
|
58
67
|
modelValue: t.value,
|
|
59
68
|
"onUpdate:modelValue": l[1] || (l[1] = (o) => t.value = o),
|
|
60
|
-
options:
|
|
69
|
+
options: f.value
|
|
61
70
|
}, {
|
|
62
|
-
default:
|
|
63
|
-
|
|
71
|
+
default: c(() => [
|
|
72
|
+
s(i(x), {
|
|
64
73
|
class: "justify-between p-2 max-h-8 w-full gap-1 text-xs hover:bg-b-2",
|
|
65
74
|
variant: "outlined"
|
|
66
75
|
}, {
|
|
67
|
-
default:
|
|
76
|
+
default: c(() => [
|
|
68
77
|
a("span", {
|
|
69
|
-
class:
|
|
78
|
+
class: E(t.value ? "text-c-1" : "text-c-3")
|
|
70
79
|
}, F(t.value ? t.value.label : "Select Collection"), 3),
|
|
71
|
-
|
|
80
|
+
s(i(U), {
|
|
72
81
|
class: "text-c-3",
|
|
73
82
|
icon: "ChevronDown",
|
|
74
83
|
size: "xs"
|
|
@@ -80,19 +89,19 @@ const j = { class: "gap-3 rounded bg-b-2 focus-within:bg-b-1 focus-within:shadow
|
|
|
80
89
|
_: 1
|
|
81
90
|
}, 8, ["modelValue", "options"])
|
|
82
91
|
]),
|
|
83
|
-
|
|
92
|
+
s(i(x), {
|
|
84
93
|
class: "max-h-8 text-xs p-0 px-3",
|
|
85
|
-
|
|
94
|
+
onClick: r
|
|
86
95
|
}, {
|
|
87
|
-
default:
|
|
96
|
+
default: c(() => [
|
|
88
97
|
I(" Create Folder ")
|
|
89
98
|
]),
|
|
90
99
|
_: 1
|
|
91
100
|
})
|
|
92
101
|
])
|
|
93
|
-
]
|
|
102
|
+
]));
|
|
94
103
|
}
|
|
95
104
|
});
|
|
96
105
|
export {
|
|
97
|
-
|
|
106
|
+
J as default
|
|
98
107
|
};
|
|
@@ -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":";;;;;AA4TA,wBAMG"}
|
|
@@ -1,41 +1,49 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useWorkspace as
|
|
3
|
-
import { ScalarButton as f, ScalarIcon as
|
|
4
|
-
import {
|
|
5
|
-
|
|
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", {
|
|
6
7
|
class: "absolute w-full h-full opacity-0 cursor-text",
|
|
7
8
|
for: "requestimport"
|
|
8
|
-
}, null, -1),
|
|
9
|
+
}, null, -1), A = { class: "flex gap-2" }, D = { class: "flex flex-1 gap-2 max-h-8" }, j = /* @__PURE__ */ k({
|
|
9
10
|
__name: "CommandPaletteImport",
|
|
10
11
|
emits: ["close"],
|
|
11
|
-
setup(
|
|
12
|
-
const
|
|
12
|
+
setup(P, { emit: x }) {
|
|
13
|
+
const r = x, { activeWorkspace: _, importSpecFile: w, importSpecFromUrl: g } = L(), s = m(""), { open: v } = B({
|
|
13
14
|
onChange: async (e) => {
|
|
14
|
-
const
|
|
15
|
-
if (
|
|
15
|
+
const t = e == null ? void 0 : e[0];
|
|
16
|
+
if (t) {
|
|
16
17
|
const i = new FileReader();
|
|
17
|
-
i.onload = async (
|
|
18
|
+
i.onload = async (b) => {
|
|
18
19
|
var p;
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
}, i.readAsText(
|
|
20
|
+
const y = (p = b.target) == null ? void 0 : p.result;
|
|
21
|
+
w(y, _.value.uid), l(), r("close");
|
|
22
|
+
}, i.readAsText(t);
|
|
22
23
|
}
|
|
23
24
|
},
|
|
24
25
|
multiple: !1,
|
|
25
26
|
accept: ".json,.yaml,.yml"
|
|
26
|
-
}),
|
|
27
|
-
|
|
27
|
+
}), l = async () => {
|
|
28
|
+
s.value && (await g(s.value), r("close"));
|
|
28
29
|
}, c = m(null);
|
|
29
|
-
return
|
|
30
|
+
return S(() => {
|
|
30
31
|
var e;
|
|
31
|
-
(e = c.value) == null || e.focus()
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
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", {
|
|
39
47
|
id: "requestimport",
|
|
40
48
|
ref_key: "importInput",
|
|
41
49
|
ref: c,
|
|
@@ -44,16 +52,16 @@ const U = { class: "gap-3 rounded bg-b-2 focus-within:bg-b-1 focus-within:shadow
|
|
|
44
52
|
placeholder: "Paste Swagger File URL"
|
|
45
53
|
}, null, 512)
|
|
46
54
|
]),
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
a(
|
|
55
|
+
o("div", A, [
|
|
56
|
+
o("div", D, [
|
|
57
|
+
a(n(f), {
|
|
50
58
|
class: "p-2 max-h-8 gap-1 text-xs hover:bg-b-2 relative",
|
|
51
59
|
variant: "outlined",
|
|
52
|
-
onClick:
|
|
60
|
+
onClick: n(v)
|
|
53
61
|
}, {
|
|
54
62
|
default: u(() => [
|
|
55
63
|
d(" JSON, or YAML Files "),
|
|
56
|
-
a(
|
|
64
|
+
a(n(U), {
|
|
57
65
|
class: "text-c-3 -rotate-90",
|
|
58
66
|
icon: "ArrowRight",
|
|
59
67
|
size: "sm"
|
|
@@ -62,9 +70,9 @@ const U = { class: "gap-3 rounded bg-b-2 focus-within:bg-b-1 focus-within:shadow
|
|
|
62
70
|
_: 1
|
|
63
71
|
}, 8, ["onClick"])
|
|
64
72
|
]),
|
|
65
|
-
a(
|
|
73
|
+
a(n(f), {
|
|
66
74
|
class: "max-h-8 text-xs p-0 px-3",
|
|
67
|
-
|
|
75
|
+
onClick: l
|
|
68
76
|
}, {
|
|
69
77
|
default: u(() => [
|
|
70
78
|
d(" Import Collection ")
|
|
@@ -72,9 +80,9 @@ const U = { class: "gap-3 rounded bg-b-2 focus-within:bg-b-1 focus-within:shadow
|
|
|
72
80
|
_: 1
|
|
73
81
|
})
|
|
74
82
|
])
|
|
75
|
-
]
|
|
83
|
+
]));
|
|
76
84
|
}
|
|
77
85
|
});
|
|
78
86
|
export {
|
|
79
|
-
|
|
87
|
+
j as default
|
|
80
88
|
};
|
|
@@ -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":";;;;;AAgjBA,wBAMG"}
|