@scalar/api-client 2.1.16 → 2.1.18
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 +22 -0
- package/dist/components/AddressBar/AddressBar.vue.d.ts.map +1 -1
- package/dist/components/AddressBar/AddressBar.vue.js +2 -2
- package/dist/components/AddressBar/AddressBar.vue2.js +67 -66
- package/dist/components/CommandPalette/CommandActionForm.vue.d.ts +3 -0
- package/dist/components/CommandPalette/CommandActionForm.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/CommandActionForm.vue.js +13 -11
- package/dist/components/CommandPalette/CommandActionInput.vue.d.ts +0 -2
- package/dist/components/CommandPalette/CommandActionInput.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/CommandActionInput.vue.js +36 -38
- package/dist/components/CommandPalette/CommandPaletteImport.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/CommandPaletteImport.vue.js +100 -80
- package/dist/components/CommandPalette/TheCommandPalette.vue.js +1 -1
- package/dist/components/CommandPalette/TheCommandPalette.vue2.js +24 -24
- package/dist/components/ContextBar.vue.js +2 -2
- package/dist/components/EnvironmentSelector/EnvironmentSelector.vue.js +2 -2
- package/dist/components/SideNav/SideNav.vue.js +2 -2
- package/dist/components/SideNav/SideNav.vue2.js +1 -1
- package/dist/components/TopNav/TopNav.vue.js +2 -2
- package/dist/components/TopNav/TopNav.vue2.js +11 -11
- package/dist/components/ViewLayout/ViewLayoutCollapse.vue.js +1 -1
- package/dist/layouts/App/ApiClientApp.vue.d.ts.map +1 -1
- package/dist/layouts/App/ApiClientApp.vue.js +36 -40
- package/dist/layouts/App/hotkeys.d.ts +6 -0
- package/dist/layouts/App/hotkeys.d.ts.map +1 -0
- package/dist/layouts/App/hotkeys.js +21 -0
- package/dist/layouts/Web/ApiClientWeb.vue.d.ts +3 -0
- package/dist/layouts/Web/ApiClientWeb.vue.d.ts.map +1 -0
- package/dist/layouts/Web/ApiClientWeb.vue.js +54 -0
- package/dist/layouts/Web/ApiClientWeb.vue3.js +5 -0
- package/dist/layouts/Web/create-api-client-web.d.ts +3593 -0
- package/dist/layouts/Web/create-api-client-web.d.ts.map +1 -0
- package/dist/layouts/Web/create-api-client-web.js +18 -0
- package/dist/layouts/Web/index.d.ts +3 -0
- package/dist/layouts/Web/index.d.ts.map +1 -0
- package/dist/layouts/Web/index.js +7 -0
- package/dist/libs/event-busses/hot-keys-bus.d.ts +0 -1
- package/dist/libs/event-busses/hot-keys-bus.d.ts.map +1 -1
- package/dist/libs/event-busses/hot-keys-bus.js +19 -35
- package/dist/libs/extractAttachmentFilename.d.ts +2 -0
- package/dist/libs/extractAttachmentFilename.d.ts.map +1 -0
- package/dist/libs/extractAttachmentFilename.js +20 -0
- package/dist/libs/getOpenApiDocumentDetails.d.ts +10 -0
- package/dist/libs/getOpenApiDocumentDetails.d.ts.map +1 -0
- package/dist/libs/getOpenApiDocumentDetails.js +40 -0
- package/dist/libs/index.d.ts +1 -2
- package/dist/libs/index.d.ts.map +1 -1
- package/dist/libs/index.js +21 -23
- package/dist/libs/isUrl.d.ts +1 -1
- package/dist/libs/isUrl.d.ts.map +1 -1
- package/dist/libs/isUrl.js +4 -3
- package/dist/store/import-spec.d.ts.map +1 -1
- package/dist/store/import-spec.js +21 -26
- package/dist/style.css +1 -1
- package/dist/views/Request/RequestSection/RequestSection.vue.js +1 -1
- package/dist/views/Request/RequestSubpageHeader.vue.js +3 -3
- package/dist/views/Request/RequestSubpageHeader.vue2.js +2 -2
- package/dist/views/Request/ResponseSection/ResponseBody.vue.d.ts.map +1 -1
- package/dist/views/Request/ResponseSection/ResponseBody.vue.js +63 -55
- package/dist/views/Request/ResponseSection/ResponseBodyDownload.vue.d.ts +2 -0
- package/dist/views/Request/ResponseSection/ResponseBodyDownload.vue.d.ts.map +1 -1
- package/dist/views/Request/ResponseSection/ResponseBodyDownload.vue.js +14 -14
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
- package/dist/views/Request/components/WorkspaceDropdown.vue.js +2 -2
- package/package.json +10 -6
- package/dist/libs/getOpenApiDocumentVersion.d.ts +0 -8
- package/dist/libs/getOpenApiDocumentVersion.d.ts.map +0 -1
- package/dist/libs/getOpenApiDocumentVersion.js +0 -20
- package/dist/libs/isDocument.d.ts +0 -3
- package/dist/libs/isDocument.d.ts.map +0 -1
- package/dist/libs/isDocument.js +0 -7
|
@@ -1,76 +1,83 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { ScalarButton as
|
|
3
|
-
import { useToasts as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
const X = /* @__PURE__ */ V({
|
|
1
|
+
import { defineComponent as O, ref as P, computed as v, openBlock as l, createBlock as k, unref as n, withCtx as p, createVNode as y, createTextVNode as s, createElementBlock as c, Fragment as u, toDisplayString as _, createElementVNode as w, createCommentVNode as $ } from "vue";
|
|
2
|
+
import { useLoadingState as R, ScalarButton as h, ScalarIcon as T, ScalarCodeBlock as j } from "@scalar/components";
|
|
3
|
+
import { useToasts as M } from "@scalar/use-toasts";
|
|
4
|
+
import z from "./CommandActionForm.vue.js";
|
|
5
|
+
import E from "./CommandActionInput.vue.js";
|
|
6
|
+
import { getOpenApiDocumentDetails as W } from "../../libs/getOpenApiDocumentDetails.js";
|
|
7
|
+
import { isUrl as x } from "../../libs/isUrl.js";
|
|
8
|
+
import { useFileDialog as J } from "../../hooks/useFileDialog.js";
|
|
9
|
+
import { useWorkspace as Y } from "../../store/store.js";
|
|
10
|
+
const q = { class: "flex justify-between" }, G = /* @__PURE__ */ w("div", { class: "pl-8 text-xs min-h-8 py-2 text-c-2" }, "Preview", -1), ne = /* @__PURE__ */ O({
|
|
12
11
|
__name: "CommandPaletteImport",
|
|
13
12
|
emits: ["close", "back"],
|
|
14
|
-
setup(
|
|
15
|
-
const
|
|
13
|
+
setup(H, { emit: U }) {
|
|
14
|
+
const f = U, { activeWorkspace: g, importSpecFile: b, importSpecFromUrl: D } = Y(), { toast: m } = M(), i = R(), e = P(""), o = v(
|
|
15
|
+
() => W(e.value)
|
|
16
|
+
), C = v(
|
|
17
|
+
() => o.value ? o.value.type : "json"
|
|
18
|
+
), S = v(() => x(e.value)), F = v(() => !!o.value), { open: L } = J({
|
|
16
19
|
onChange: async (a) => {
|
|
17
|
-
const
|
|
18
|
-
if (
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
var
|
|
22
|
-
const
|
|
20
|
+
const t = a == null ? void 0 : a[0];
|
|
21
|
+
if (t) {
|
|
22
|
+
const r = new FileReader();
|
|
23
|
+
r.onload = async (A) => {
|
|
24
|
+
var I;
|
|
25
|
+
const B = (I = A.target) == null ? void 0 : I.result;
|
|
23
26
|
try {
|
|
24
|
-
await
|
|
25
|
-
} catch (
|
|
26
|
-
console.error(
|
|
27
|
-
const
|
|
28
|
-
|
|
27
|
+
await b(B, g.value.uid), m("Import successful", "info"), f("close");
|
|
28
|
+
} catch (d) {
|
|
29
|
+
console.error(d);
|
|
30
|
+
const N = (d == null ? void 0 : d.message) || "Unknown error";
|
|
31
|
+
m(`Import failed: ${N}`, "error");
|
|
29
32
|
}
|
|
30
|
-
},
|
|
33
|
+
}, r.readAsText(t);
|
|
31
34
|
}
|
|
32
35
|
},
|
|
33
36
|
multiple: !1,
|
|
34
37
|
accept: ".json,.yaml,.yml"
|
|
35
38
|
});
|
|
36
|
-
async function
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
39
|
+
async function V() {
|
|
40
|
+
if (!(!e.value || i.isLoading)) {
|
|
41
|
+
i.startLoading();
|
|
42
|
+
try {
|
|
43
|
+
if (S.value)
|
|
44
|
+
await D(
|
|
45
|
+
e.value,
|
|
46
|
+
void 0,
|
|
47
|
+
void 0,
|
|
48
|
+
g.value.uid
|
|
49
|
+
);
|
|
50
|
+
else if (F.value)
|
|
51
|
+
await b(
|
|
52
|
+
String(e.value),
|
|
53
|
+
g.value.uid
|
|
54
|
+
);
|
|
55
|
+
else {
|
|
56
|
+
m("Import failed: Invalid URL or OpenAPI document", "error"), i.invalidate(2e3, !0);
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
i.clear(), f("close"), m("Import successful", "info");
|
|
60
|
+
} catch (a) {
|
|
61
|
+
console.error("[importCollection]", a);
|
|
62
|
+
const t = (a == null ? void 0 : a.message) || "Unknown error";
|
|
63
|
+
i.invalidate(2e3, !0), m(`Import failed: ${t}`, "error");
|
|
64
|
+
}
|
|
51
65
|
}
|
|
52
66
|
}
|
|
53
|
-
|
|
54
|
-
return (f(e.value) || {}).type ?? "json";
|
|
55
|
-
}
|
|
56
|
-
function D(a) {
|
|
57
|
-
var t;
|
|
58
|
-
const o = (t = a.clipboardData) == null ? void 0 : t.getData("text");
|
|
59
|
-
o && (e.value = o);
|
|
60
|
-
}
|
|
61
|
-
return (a, o) => (s(), u(N, {
|
|
67
|
+
return (a, t) => (l(), k(z, {
|
|
62
68
|
disabled: !e.value.trim(),
|
|
63
|
-
|
|
69
|
+
loading: n(i),
|
|
70
|
+
onSubmit: V
|
|
64
71
|
}, {
|
|
65
|
-
options:
|
|
66
|
-
|
|
72
|
+
options: p(() => [
|
|
73
|
+
y(n(h), {
|
|
67
74
|
class: "p-2 max-h-8 gap-1.5 text-xs hover:bg-b-2 relative",
|
|
68
75
|
variant: "outlined",
|
|
69
|
-
onClick:
|
|
76
|
+
onClick: n(L)
|
|
70
77
|
}, {
|
|
71
|
-
default:
|
|
72
|
-
|
|
73
|
-
|
|
78
|
+
default: p(() => [
|
|
79
|
+
s(" JSON, or YAML File "),
|
|
80
|
+
y(n(T), {
|
|
74
81
|
class: "text-c-3",
|
|
75
82
|
icon: "UploadSimple",
|
|
76
83
|
size: "md"
|
|
@@ -79,41 +86,54 @@ const X = /* @__PURE__ */ V({
|
|
|
79
86
|
_: 1
|
|
80
87
|
}, 8, ["onClick"])
|
|
81
88
|
]),
|
|
82
|
-
submit:
|
|
83
|
-
|
|
89
|
+
submit: p(() => [
|
|
90
|
+
s(" Import "),
|
|
91
|
+
S.value ? (l(), c(u, { key: 0 }, [
|
|
92
|
+
s(" from URL ")
|
|
93
|
+
], 64)) : o.value && C.value ? (l(), c(u, { key: 1 }, [
|
|
94
|
+
o.value.title ? (l(), c(u, { key: 0 }, [
|
|
95
|
+
s(' "' + _(o.value.title) + '" ', 1)
|
|
96
|
+
], 64)) : (l(), c(u, { key: 1 }, [
|
|
97
|
+
s(_(o.value.version) + " Spec", 1)
|
|
98
|
+
], 64))
|
|
99
|
+
], 64)) : (l(), c(u, { key: 2 }, [
|
|
100
|
+
s("Collection")
|
|
101
|
+
], 64))
|
|
84
102
|
]),
|
|
85
|
-
default:
|
|
86
|
-
!
|
|
103
|
+
default: p(() => [
|
|
104
|
+
!o.value || n(x)(e.value) ? (l(), k(E, {
|
|
87
105
|
key: 0,
|
|
88
106
|
modelValue: e.value,
|
|
89
|
-
"onUpdate:modelValue":
|
|
107
|
+
"onUpdate:modelValue": t[0] || (t[0] = (r) => e.value = r),
|
|
90
108
|
placeholder: "Paste Swagger/OpenAPI File URL or content",
|
|
91
|
-
onOnDelete:
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
109
|
+
onOnDelete: t[1] || (t[1] = (r) => f("back", r))
|
|
110
|
+
}, null, 8, ["modelValue"])) : (l(), c(u, { key: 1 }, [
|
|
111
|
+
w("div", q, [
|
|
112
|
+
G,
|
|
113
|
+
y(n(h), {
|
|
114
|
+
class: "ml-auto p-2 max-h-8 gap-1.5 text-xs hover:bg-b-2 relative",
|
|
115
|
+
variant: "ghost",
|
|
116
|
+
onClick: t[2] || (t[2] = (r) => e.value = "")
|
|
117
|
+
}, {
|
|
118
|
+
default: p(() => [
|
|
119
|
+
s(" Clear ")
|
|
120
|
+
]),
|
|
121
|
+
_: 1
|
|
122
|
+
})
|
|
123
|
+
]),
|
|
124
|
+
o.value && !n(x)(e.value) ? (l(), k(n(j), {
|
|
105
125
|
key: 0,
|
|
106
|
-
class: "
|
|
126
|
+
class: "border max-h-[40dvh] mt-1 bg-b-2 rounded [--scalar-small:--scalar-font-size-4]",
|
|
107
127
|
content: e.value,
|
|
108
128
|
copy: !1,
|
|
109
|
-
lang:
|
|
110
|
-
}, null, 8, ["content", "lang"])) :
|
|
129
|
+
lang: C.value
|
|
130
|
+
}, null, 8, ["content", "lang"])) : $("", !0)
|
|
111
131
|
], 64))
|
|
112
132
|
]),
|
|
113
133
|
_: 1
|
|
114
|
-
}, 8, ["disabled"]));
|
|
134
|
+
}, 8, ["disabled", "loading"]));
|
|
115
135
|
}
|
|
116
136
|
});
|
|
117
137
|
export {
|
|
118
|
-
|
|
138
|
+
ne as default
|
|
119
139
|
};
|
|
@@ -2,7 +2,7 @@ import o from "./TheCommandPalette.vue2.js";
|
|
|
2
2
|
import { PaletteComponents as s } from "./TheCommandPalette.vue2.js";
|
|
3
3
|
/* empty css */
|
|
4
4
|
import t from "../../_virtual/_plugin-vue_export-helper.js";
|
|
5
|
-
const a = /* @__PURE__ */ t(o, [["__scopeId", "data-v-
|
|
5
|
+
const a = /* @__PURE__ */ t(o, [["__scopeId", "data-v-272ef6cf"]]);
|
|
6
6
|
export {
|
|
7
7
|
s as PaletteComponents,
|
|
8
8
|
a as default
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent as F, ref as u, computed as P, watch as U, onMounted as G, onBeforeUnmount as Q, openBlock as a, createElementBlock as r, Fragment as d, withDirectives as h, createElementVNode as m, vShow as w, unref as f, createVNode as y, withKeys as g, withModifiers as
|
|
2
|
-
import { useModal as oe, ScalarIcon as
|
|
1
|
+
import { defineComponent as F, ref as u, computed as P, watch as U, onMounted as G, onBeforeUnmount as Q, openBlock as a, createElementBlock as r, Fragment as d, withDirectives as h, createElementVNode as m, vShow as w, unref as f, createVNode as y, withKeys as g, withModifiers as $, vModelText as j, renderList as K, toDisplayString as M, normalizeClass as J, createTextVNode as O, createCommentVNode as X, createBlock as Y, resolveDynamicComponent as Z, mergeProps as ee, nextTick as T } from "vue";
|
|
2
|
+
import { useModal as oe, ScalarIcon as S } from "@scalar/components";
|
|
3
3
|
import { useRouter as te } from "vue-router";
|
|
4
4
|
import ne from "./CommandPaletteCollection.vue.js";
|
|
5
5
|
import ae from "./CommandPaletteExample.vue.js";
|
|
@@ -29,7 +29,7 @@ const ue = { class: "commandmenu custom-scroll" }, de = { class: "bg-b-2 flex it
|
|
|
29
29
|
setup(be) {
|
|
30
30
|
const A = [
|
|
31
31
|
{
|
|
32
|
-
label: "
|
|
32
|
+
label: "",
|
|
33
33
|
commands: [
|
|
34
34
|
{
|
|
35
35
|
name: "Create Request",
|
|
@@ -76,7 +76,7 @@ const ue = { class: "commandmenu custom-scroll" }, de = { class: "bg-b-2 flex it
|
|
|
76
76
|
}
|
|
77
77
|
]
|
|
78
78
|
}
|
|
79
|
-
], c = oe(), { push: z } = te(), { activeWorkspace: N } = ie(), k = u(), l = u(""), s = u(null), i = u(-1),
|
|
79
|
+
], c = oe(), { push: z } = te(), { activeWorkspace: N } = ie(), k = u(), l = u(""), s = u(null), i = u(-1), D = u([]), p = P(
|
|
80
80
|
() => A.reduce((e, o) => {
|
|
81
81
|
const t = o.commands.filter(
|
|
82
82
|
(n) => n.name.toLowerCase().includes(l.value.toLowerCase())
|
|
@@ -85,14 +85,14 @@ const ue = { class: "commandmenu custom-scroll" }, de = { class: "bg-b-2 flex it
|
|
|
85
85
|
}, [])
|
|
86
86
|
), v = () => {
|
|
87
87
|
c.hide(), l.value = "", s.value = null, i.value = -1;
|
|
88
|
-
},
|
|
88
|
+
}, H = (e) => {
|
|
89
89
|
l.value !== "" && (e == null || e.preventDefault()), s.value = null, T(() => {
|
|
90
90
|
var o;
|
|
91
91
|
return (o = b.value) == null ? void 0 : o.focus();
|
|
92
92
|
});
|
|
93
|
-
},
|
|
93
|
+
}, L = (e) => {
|
|
94
94
|
"path" in e ? (z(`/workspace/${N.value.uid}${e.path}`), v()) : s.value = e.name;
|
|
95
|
-
}, b = u(),
|
|
95
|
+
}, b = u(), R = ({
|
|
96
96
|
commandName: e,
|
|
97
97
|
metaData: o
|
|
98
98
|
} = {}) => {
|
|
@@ -109,21 +109,21 @@ const ue = { class: "commandmenu custom-scroll" }, de = { class: "bg-b-2 flex it
|
|
|
109
109
|
if (!c.open) return;
|
|
110
110
|
o.preventDefault();
|
|
111
111
|
const t = e === "up" ? -1 : 1, n = p.value.length;
|
|
112
|
-
i.value = (i.value + t + n) % n, (C =
|
|
112
|
+
i.value = (i.value + t + n) % n, (C = D.value[i.value]) == null || C.scrollIntoView({
|
|
113
113
|
behavior: "smooth",
|
|
114
114
|
block: "nearest"
|
|
115
115
|
});
|
|
116
116
|
}, x = P(
|
|
117
117
|
() => p.value[i.value]
|
|
118
|
-
),
|
|
119
|
-
!x.value || s.value || (e.preventDefault(), e.stopPropagation(),
|
|
118
|
+
), q = (e) => {
|
|
119
|
+
!x.value || s.value || (e.preventDefault(), e.stopPropagation(), L(x.value));
|
|
120
120
|
}, E = (e) => {
|
|
121
121
|
c.open && e.closeModal && v();
|
|
122
122
|
};
|
|
123
123
|
return G(() => {
|
|
124
|
-
V.on(
|
|
124
|
+
V.on(R), W.on(E);
|
|
125
125
|
}), Q(() => {
|
|
126
|
-
V.off(
|
|
126
|
+
V.off(R), W.off(E);
|
|
127
127
|
}), (e, o) => (a(), r(d, null, [
|
|
128
128
|
h(m("div", {
|
|
129
129
|
class: "commandmenu-clickout",
|
|
@@ -138,23 +138,23 @@ const ue = { class: "commandmenu custom-scroll" }, de = { class: "bg-b-2 flex it
|
|
|
138
138
|
type: "button",
|
|
139
139
|
onClick: o[4] || (o[4] = (t) => s.value = null)
|
|
140
140
|
}, [
|
|
141
|
-
y(f(
|
|
141
|
+
y(f(S), {
|
|
142
142
|
icon: "ChevronLeft",
|
|
143
143
|
size: "md",
|
|
144
144
|
thickness: "1.5"
|
|
145
145
|
})
|
|
146
146
|
]),
|
|
147
147
|
(a(), Y(Z(ke[s.value]), ee(k.value ? { metaData: k.value } : {}, {
|
|
148
|
-
onBack: o[5] || (o[5] = (t) =>
|
|
148
|
+
onBack: o[5] || (o[5] = (t) => H(t)),
|
|
149
149
|
onClose: v
|
|
150
150
|
}), null, 16))
|
|
151
151
|
], 64)) : (a(), r(d, { key: 0 }, [
|
|
152
152
|
m("div", de, [
|
|
153
153
|
m("label", fe, [
|
|
154
|
-
y(f(
|
|
155
|
-
class: "text-c-
|
|
154
|
+
y(f(S), {
|
|
155
|
+
class: "text-c-2 mr-2.5",
|
|
156
156
|
icon: "Search",
|
|
157
|
-
size: "
|
|
157
|
+
size: "md",
|
|
158
158
|
thickness: "1.5"
|
|
159
159
|
})
|
|
160
160
|
]),
|
|
@@ -169,9 +169,9 @@ const ue = { class: "commandmenu custom-scroll" }, de = { class: "bg-b-2 flex it
|
|
|
169
169
|
placeholder: "Search commands...",
|
|
170
170
|
type: "text",
|
|
171
171
|
onKeydown: [
|
|
172
|
-
o[2] || (o[2] = g(
|
|
173
|
-
g(
|
|
174
|
-
o[3] || (o[3] = g(
|
|
172
|
+
o[2] || (o[2] = g($((t) => B("down", t), ["stop"]), ["down"])),
|
|
173
|
+
g($(q, ["stop"]), ["enter"]),
|
|
174
|
+
o[3] || (o[3] = g($((t) => B("up", t), ["stop"]), ["up"]))
|
|
175
175
|
]
|
|
176
176
|
}, null, 40, pe), [
|
|
177
177
|
[j, l.value]
|
|
@@ -196,15 +196,15 @@ const ue = { class: "commandmenu custom-scroll" }, de = { class: "bg-b-2 flex it
|
|
|
196
196
|
key: n.name,
|
|
197
197
|
ref_for: !0,
|
|
198
198
|
ref: (_) => {
|
|
199
|
-
_ && (
|
|
199
|
+
_ && (D.value[C] = _);
|
|
200
200
|
},
|
|
201
201
|
class: J(["commandmenu-item text-sm flex items-center py-1.5 px-2 rounded hover:bg-b-2 cursor-pointer", {
|
|
202
202
|
"bg-b-2": n.name === ((I = x.value) == null ? void 0 : I.name)
|
|
203
203
|
}]),
|
|
204
|
-
onClick: (_) =>
|
|
204
|
+
onClick: (_) => L(n)
|
|
205
205
|
}, [
|
|
206
|
-
y(f(
|
|
207
|
-
class: "text-c-
|
|
206
|
+
y(f(S), {
|
|
207
|
+
class: "text-c-2 mr-2.5",
|
|
208
208
|
icon: n.icon,
|
|
209
209
|
size: "md",
|
|
210
210
|
thickness: "1.5"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./ContextBar.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-ba672e06"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
m as default
|
|
7
7
|
};
|
|
@@ -94,9 +94,9 @@ const W = { class: "font-medium m-0 text-sm flex gap-1.5 items-center" }, $ = {
|
|
|
94
94
|
r("h2", W, [
|
|
95
95
|
l(k(((t = e(_)) == null ? void 0 : t.name) ?? "No Environment") + " ", 1),
|
|
96
96
|
n(e(c), {
|
|
97
|
-
class: "size-
|
|
97
|
+
class: "size-3",
|
|
98
98
|
icon: "ChevronDown",
|
|
99
|
-
thickness: "3
|
|
99
|
+
thickness: "3"
|
|
100
100
|
})
|
|
101
101
|
])
|
|
102
102
|
];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./SideNav.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-985878af"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
m as default
|
|
7
7
|
};
|
|
@@ -8,7 +8,7 @@ const b = {
|
|
|
8
8
|
"aria-label": "Side Navigation",
|
|
9
9
|
class: "text-c-2 w-15 flex flex-col items-center px-2 py-2 scalar-sidenav relative drag-region bg-b-1 border-t-1/2",
|
|
10
10
|
role: "navigation"
|
|
11
|
-
}, S = { class: "flex flex-col gap-1.5" }, k = { class: "mt-auto flex flex-col py-
|
|
11
|
+
}, S = { class: "flex flex-col gap-1.5" }, k = { class: "mt-auto flex flex-col py-0.5" }, E = { class: "flex items-center no-drag-region" }, R = { class: "flex items-center no-drag-region" }, O = /* @__PURE__ */ _({
|
|
12
12
|
__name: "SideNav",
|
|
13
13
|
setup(V) {
|
|
14
14
|
const { currentRoute: s } = v();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./TopNav.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-9a66e94b"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
m as default
|
|
7
7
|
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { defineComponent as z, reactive as A, ref as B, computed as M, watch as y, onMounted as j, onBeforeUnmount as E, openBlock as d, createElementBlock as g, createElementVNode as
|
|
1
|
+
import { defineComponent as z, reactive as A, ref as B, computed as M, watch as y, onMounted as j, onBeforeUnmount as E, openBlock as d, createElementBlock as g, createElementVNode as f, createVNode as n, unref as l, withCtx as u, toDisplayString as O, createTextVNode as C, Fragment as V, renderList as D, createBlock as q, pushScopeId as K, popScopeId as F } from "vue";
|
|
2
2
|
import H from "../ScalarHotkey.vue.js";
|
|
3
3
|
import { ROUTES as W } from "../../constants.js";
|
|
4
4
|
import { useClipboard as G } from "../../hooks/useClipboard.js";
|
|
5
|
-
import { ScalarContextMenu as J, ScalarIcon as
|
|
5
|
+
import { ScalarContextMenu as J, ScalarIcon as h, ScalarDropdown as P, ScalarDropdownItem as x } from "@scalar/components";
|
|
6
6
|
import { capitalize as Q } from "@scalar/oas-utils/helpers";
|
|
7
7
|
import X from "./TopNavItem.vue.js";
|
|
8
8
|
import { useWorkspace as Y } from "../../store/store.js";
|
|
9
9
|
import { hotKeyBus as I } from "../../libs/event-busses/hot-keys-bus.js";
|
|
10
|
-
const Z = (s) => (K("data-v-
|
|
10
|
+
const Z = (s) => (K("data-v-9a66e94b"), s = s(), F(), s), ee = { class: "flex h-10 t-app__top-nav" }, te = /* @__PURE__ */ Z(() => /* @__PURE__ */ f("div", { class: "t-app__top-nav-draggable" }, null, -1)), oe = { class: "flex h-10 flex-1 items-center gap-1.5 text-sm font-medium pr-1 relative overflow-hidden" }, ae = {
|
|
11
11
|
key: 0,
|
|
12
12
|
class: "h-full w-full overflow-hidden"
|
|
13
13
|
}, de = /* @__PURE__ */ z({
|
|
@@ -78,16 +78,16 @@ const Z = (s) => (K("data-v-df123a3c"), s = s(), F(), s), ee = { class: "flex h-
|
|
|
78
78
|
{ immediate: !0 }
|
|
79
79
|
), j(() => I.on(w)), E(() => I.off(w)), (e, a) => (d(), g("nav", ee, [
|
|
80
80
|
te,
|
|
81
|
-
|
|
81
|
+
f("div", oe, [
|
|
82
82
|
t.length === 1 ? (d(), g("div", ae, [
|
|
83
83
|
n(l(J), { triggerClass: "flex custom-scroll gap-1.5 h-full items-center justify-center w-full whitespace-nowrap" }, {
|
|
84
84
|
trigger: u(() => [
|
|
85
|
-
n(l(
|
|
85
|
+
n(l(h), {
|
|
86
86
|
icon: t[0].icon,
|
|
87
87
|
size: "xs",
|
|
88
88
|
thickness: "2.5"
|
|
89
89
|
}, null, 8, ["icon"]),
|
|
90
|
-
|
|
90
|
+
f("span", null, O(t[0].label), 1)
|
|
91
91
|
]),
|
|
92
92
|
content: u(() => [
|
|
93
93
|
n(l(P), {
|
|
@@ -100,7 +100,7 @@ const Z = (s) => (K("data-v-df123a3c"), s = s(), F(), s), ee = { class: "flex h-
|
|
|
100
100
|
onClick: m
|
|
101
101
|
}, {
|
|
102
102
|
default: u(() => [
|
|
103
|
-
n(l(
|
|
103
|
+
n(l(h), {
|
|
104
104
|
icon: "AddTab",
|
|
105
105
|
size: "sm",
|
|
106
106
|
thickness: "1.5"
|
|
@@ -118,7 +118,7 @@ const Z = (s) => (K("data-v-df123a3c"), s = s(), F(), s), ee = { class: "flex h-
|
|
|
118
118
|
onClick: a[0] || (a[0] = (p) => N(T.value))
|
|
119
119
|
}, {
|
|
120
120
|
default: u(() => [
|
|
121
|
-
n(l(
|
|
121
|
+
n(l(h), {
|
|
122
122
|
icon: "Link",
|
|
123
123
|
size: "sm",
|
|
124
124
|
thickness: "1.5"
|
|
@@ -145,12 +145,12 @@ const Z = (s) => (K("data-v-df123a3c"), s = s(), F(), s), ee = { class: "flex h-
|
|
|
145
145
|
onCopyUrl: (b) => N(c),
|
|
146
146
|
onNewTab: m
|
|
147
147
|
}, null, 8, ["active", "hotkey", "icon", "label", "onClick", "onClose", "onCloseOtherTabs", "onCopyUrl"]))), 128)),
|
|
148
|
-
|
|
149
|
-
class: "text-c-3 hover:bg-b-3 p-1.5 rounded
|
|
148
|
+
f("button", {
|
|
149
|
+
class: "text-c-3 hover:bg-b-3 p-1.5 rounded webkit-app-no-drag",
|
|
150
150
|
type: "button",
|
|
151
151
|
onClick: m
|
|
152
152
|
}, [
|
|
153
|
-
n(l(
|
|
153
|
+
n(l(h), {
|
|
154
154
|
icon: "Add",
|
|
155
155
|
size: "xs",
|
|
156
156
|
thickness: "2.5"
|
|
@@ -20,7 +20,7 @@ const x = { class: "flex flex-1 items-center gap-1.5 text-c-1" }, g = {
|
|
|
20
20
|
defaultOpen: e.defaultOpen
|
|
21
21
|
}, {
|
|
22
22
|
default: n(({ open: t }) => [
|
|
23
|
-
i(o(m), { class: "hover:text-c-1 group flex w-full items-center gap-
|
|
23
|
+
i(o(m), { class: "hover:text-c-1 group flex w-full items-center gap-2.5 overflow-hidden py-1.5 text-sm font-medium px-1.5" }, {
|
|
24
24
|
default: n(() => [
|
|
25
25
|
i(o(b), {
|
|
26
26
|
class: "text-c-3 group-hover:text-c-1 ui-open:rotate-90 ui-not-open:rotate-0",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ApiClientApp.vue.d.ts","sourceRoot":"","sources":["../../../src/layouts/App/ApiClientApp.vue"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"ApiClientApp.vue.d.ts","sourceRoot":"","sources":["../../../src/layouts/App/ApiClientApp.vue"],"names":[],"mappings":";;cA0I8B,MAAM;aAAO,MAAM;;;;cAAnB,MAAM;aAAO,MAAM;;;AAoMjD,wBAMG"}
|
|
@@ -1,65 +1,61 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
1
|
+
import { defineComponent as T, ref as _, onMounted as c, watchEffect as h, onBeforeMount as k, onBeforeUnmount as y, computed as b, openBlock as t, createElementBlock as i, Fragment as N, createElementVNode as d, createVNode as e, unref as n, withCtx as S, createBlock as p, KeepAlive as g, resolveDynamicComponent as x, createCommentVNode as E } from "vue";
|
|
2
|
+
import C from "../../components/SideNav/SideNav.vue.js";
|
|
3
3
|
import L from "../../components/TopNav/TopNav.vue.js";
|
|
4
|
-
import { addScalarClassesToHeadless as
|
|
5
|
-
import { getThemeStyles as
|
|
6
|
-
import { ScalarToasts as
|
|
7
|
-
import { RouterView as
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
|
|
4
|
+
import { addScalarClassesToHeadless as D } from "@scalar/components";
|
|
5
|
+
import { getThemeStyles as H } from "@scalar/themes";
|
|
6
|
+
import { ScalarToasts as K } from "@scalar/use-toasts";
|
|
7
|
+
import { RouterView as A } from "vue-router";
|
|
8
|
+
import { APP_HOTKEYS as B } from "./hotkeys.js";
|
|
9
|
+
import M from "../../components/CommandPalette/TheCommandPalette.vue.js";
|
|
10
|
+
import { DEFAULT_HOTKEYS as V, handleHotKeyDown as W } from "../../libs/event-busses/hot-keys-bus.js";
|
|
11
|
+
import { useDarkModeState as P } from "../../hooks/useDarkModeState.js";
|
|
12
|
+
import { useWorkspace as F } from "../../store/store.js";
|
|
13
|
+
const O = ["innerHTML"], U = {
|
|
13
14
|
key: 0,
|
|
14
15
|
class: "flex min-h-0 flex-1 z-0"
|
|
15
|
-
},
|
|
16
|
+
}, Y = { class: "flex flex-1 flex-col min-w-0 border-l-1/2 border-t-1/2" }, ne = /* @__PURE__ */ T({
|
|
16
17
|
__name: "ApiClientApp",
|
|
17
18
|
emits: ["newTab"],
|
|
18
|
-
setup(
|
|
19
|
-
const
|
|
20
|
-
|
|
19
|
+
setup(z) {
|
|
20
|
+
const u = { ...V, ...B }, a = _(null), f = (o) => {
|
|
21
|
+
a.value = o;
|
|
21
22
|
};
|
|
22
23
|
c(() => {
|
|
23
24
|
h(() => {
|
|
24
25
|
document.body.classList.toggle("dark-mode", l.value), document.body.classList.toggle("light-mode", !l.value);
|
|
25
26
|
});
|
|
26
27
|
});
|
|
27
|
-
const { isDark: l } =
|
|
28
|
-
k(
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
const f = y(
|
|
34
|
-
() => a.activeWorkspace.value && `<style>
|
|
35
|
-
${D(a.activeWorkspace.value.themeId, {
|
|
36
|
-
fonts: !0
|
|
37
|
-
})}</style>`
|
|
28
|
+
const { isDark: l } = P(), r = F();
|
|
29
|
+
k(() => D());
|
|
30
|
+
const s = (o) => W(o, { hotKeys: u });
|
|
31
|
+
c(() => window.addEventListener("keydown", s)), y(() => window.removeEventListener("keydown", s));
|
|
32
|
+
const v = b(
|
|
33
|
+
() => r.activeWorkspace.value && `<style>${H(r.activeWorkspace.value.themeId)}</style>`
|
|
38
34
|
);
|
|
39
|
-
return (o,
|
|
35
|
+
return (o, I) => {
|
|
40
36
|
var m;
|
|
41
|
-
return t(), i(
|
|
42
|
-
d("div", { innerHTML:
|
|
43
|
-
e(L, { openNewTab:
|
|
44
|
-
(m = n(
|
|
45
|
-
e(
|
|
46
|
-
e(n(
|
|
47
|
-
d("div",
|
|
48
|
-
e(n(
|
|
49
|
-
default:
|
|
37
|
+
return t(), i(N, null, [
|
|
38
|
+
d("div", { innerHTML: v.value }, null, 8, O),
|
|
39
|
+
e(L, { openNewTab: a.value }, null, 8, ["openNewTab"]),
|
|
40
|
+
(m = n(r).activeWorkspace.value) != null && m.uid ? (t(), i("main", U, [
|
|
41
|
+
e(C),
|
|
42
|
+
e(n(M)),
|
|
43
|
+
d("div", Y, [
|
|
44
|
+
e(n(A), { onNewTab: f }, {
|
|
45
|
+
default: S(({ Component: w }) => [
|
|
50
46
|
(t(), p(g, null, [
|
|
51
|
-
(t(), p(x(
|
|
47
|
+
(t(), p(x(w)))
|
|
52
48
|
], 1024))
|
|
53
49
|
]),
|
|
54
50
|
_: 1
|
|
55
51
|
})
|
|
56
52
|
])
|
|
57
|
-
])) :
|
|
58
|
-
e(n(
|
|
53
|
+
])) : E("", !0),
|
|
54
|
+
e(n(K))
|
|
59
55
|
], 64);
|
|
60
56
|
};
|
|
61
57
|
}
|
|
62
58
|
});
|
|
63
59
|
export {
|
|
64
|
-
|
|
60
|
+
ne as default
|
|
65
61
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hotkeys.d.ts","sourceRoot":"","sources":["../../../src/layouts/App/hotkeys.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sCAAsC,CAAA;AAExE;;GAEG;AACH,eAAO,MAAM,WAAW,EAAE,YAiBzB,CAAA"}
|