@scalar/api-client 2.0.57 → 2.0.58
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 +18 -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 +61 -58
- package/dist/components/CommandPalette/CommandPaletteCollection.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/CommandPaletteCollection.vue.js +31 -25
- package/dist/components/CommandPalette/CommandPaletteExample.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/CommandPaletteExample.vue.js +51 -45
- package/dist/components/CommandPalette/CommandPaletteFolder.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/CommandPaletteFolder.vue.js +47 -41
- package/dist/components/CommandPalette/CommandPaletteImport.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/CommandPaletteImport.vue.js +56 -40
- package/dist/components/CommandPalette/CommandPaletteRequest.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/CommandPaletteRequest.vue.js +67 -61
- package/dist/components/CommandPalette/TheCommandPalette.vue.js +4 -4
- package/dist/components/CommandPalette/TheCommandPalette.vue2.js +30 -30
- package/dist/components/TopNav/TopNav.vue.d.ts +20 -1
- package/dist/components/TopNav/TopNav.vue.d.ts.map +1 -1
- package/dist/components/TopNav/TopNav.vue.js +2 -2
- package/dist/components/TopNav/TopNav.vue2.js +64 -49
- package/dist/layouts/App/ApiClientApp.vue.d.ts +11 -1
- package/dist/layouts/App/ApiClientApp.vue.d.ts.map +1 -1
- package/dist/layouts/App/ApiClientApp.vue.js +53 -49
- package/dist/libs/event-busses/cancel-request-bus.d.ts +2 -0
- package/dist/libs/event-busses/cancel-request-bus.d.ts.map +1 -0
- package/dist/libs/event-busses/cancel-request-bus.js +5 -0
- package/dist/libs/event-busses/hot-keys-bus.d.ts +3 -1
- package/dist/libs/event-busses/hot-keys-bus.d.ts.map +1 -1
- package/dist/libs/event-busses/hot-keys-bus.js +1 -0
- package/dist/libs/event-busses/index.d.ts +2 -1
- package/dist/libs/event-busses/index.d.ts.map +1 -1
- package/dist/libs/event-busses/index.js +11 -8
- package/dist/libs/index.js +21 -18
- package/dist/libs/local-storage.js +1 -1
- package/dist/libs/sendRequest.d.ts +2 -2
- package/dist/libs/sendRequest.d.ts.map +1 -1
- package/dist/libs/sendRequest.js +22 -21
- package/dist/store/workspace.d.ts.map +1 -1
- package/dist/store/workspace.js +100 -103
- package/dist/style.css +1 -1
- package/dist/views/Request/Request.vue.d.ts +11 -1
- package/dist/views/Request/Request.vue.d.ts.map +1 -1
- package/dist/views/Request/Request.vue.js +3 -3
- package/dist/views/Request/Request.vue2.js +184 -174
- package/dist/views/Request/RequestSidebarItem.vue.d.ts +2 -0
- package/dist/views/Request/RequestSidebarItem.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSidebarItem.vue.js +2 -2
- package/dist/views/Request/RequestSidebarItem.vue2.js +139 -130
- package/dist/views/Request/ResponseSection/ResponseLoadingOverlay.vue.d.ts +3 -0
- package/dist/views/Request/ResponseSection/ResponseLoadingOverlay.vue.d.ts.map +1 -0
- package/dist/views/Request/ResponseSection/ResponseLoadingOverlay.vue.js +7 -0
- package/dist/views/Request/ResponseSection/ResponseLoadingOverlay.vue2.js +39 -0
- package/dist/views/Request/ResponseSection/ResponseMetaInformation.vue.d.ts.map +1 -1
- package/dist/views/Request/ResponseSection/ResponseMetaInformation.vue.js +37 -30
- package/dist/views/Request/ResponseSection/ResponseSection.vue.d.ts.map +1 -1
- package/dist/views/Request/ResponseSection/ResponseSection.vue.js +23 -21
- package/package.json +7 -7
|
@@ -10,7 +10,7 @@ import ne from "./CommandPaletteRequest.vue.js";
|
|
|
10
10
|
import ae from "./CommandPaletteWorkspace.vue.js";
|
|
11
11
|
import { commandPaletteBus as W } from "../../libs/event-busses/command-palette-bus.js";
|
|
12
12
|
import { hotKeyBus as z } from "../../libs/event-busses/hot-keys-bus.js";
|
|
13
|
-
const le = { class: "commandmenu" }, se = { class: "bg-b-2 flex items-center rounded mb-2 pl-2 focus-within:bg-b-1 focus-within:shadow-border" },
|
|
13
|
+
const le = { class: "commandmenu" }, se = { class: "bg-b-2 flex items-center rounded mb-2 pl-2 focus-within:bg-b-1 focus-within:shadow-border" }, ce = { for: "commandmenu" }, re = ["onClick"], me = {
|
|
14
14
|
key: 0,
|
|
15
15
|
class: "text-c-3 text-center text-sm p-2 pt-3"
|
|
16
16
|
}, ie = {
|
|
@@ -22,7 +22,7 @@ const le = { class: "commandmenu" }, se = { class: "bg-b-2 flex items-center rou
|
|
|
22
22
|
"Add Folder": oe,
|
|
23
23
|
"Create Collection": Z,
|
|
24
24
|
"Add Example": ee
|
|
25
|
-
},
|
|
25
|
+
}, Se = /* @__PURE__ */ F({
|
|
26
26
|
...ie,
|
|
27
27
|
setup(de) {
|
|
28
28
|
const y = [
|
|
@@ -58,14 +58,14 @@ const le = { class: "commandmenu" }, se = { class: "bg-b-2 flex items-center rou
|
|
|
58
58
|
name: "Create Workspace",
|
|
59
59
|
icon: "Workspace"
|
|
60
60
|
},
|
|
61
|
-
{
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
},
|
|
61
|
+
// {
|
|
62
|
+
// name: 'Add Server',
|
|
63
|
+
// icon: 'Server',
|
|
64
|
+
// path: '/servers',
|
|
65
|
+
// },
|
|
66
66
|
{
|
|
67
67
|
name: "Add Environment",
|
|
68
|
-
icon: "
|
|
68
|
+
icon: "Brackets",
|
|
69
69
|
path: "/environment"
|
|
70
70
|
},
|
|
71
71
|
{
|
|
@@ -75,31 +75,31 @@ const le = { class: "commandmenu" }, se = { class: "bg-b-2 flex items-center rou
|
|
|
75
75
|
}
|
|
76
76
|
]
|
|
77
77
|
}
|
|
78
|
-
],
|
|
78
|
+
], c = O(), { push: M } = X(), { activeWorkspace: N } = Y(), R = i(), r = i(""), m = i(null), d = i(-1), S = i([]), C = E(
|
|
79
79
|
() => y.reduce((e, n) => {
|
|
80
80
|
const o = n.commands.filter(
|
|
81
|
-
(t) => t.name.toLowerCase().includes(
|
|
81
|
+
(t) => t.name.toLowerCase().includes(r.value.toLowerCase())
|
|
82
82
|
);
|
|
83
83
|
return [...e, ...o];
|
|
84
84
|
}, [])
|
|
85
85
|
), p = () => {
|
|
86
|
-
|
|
86
|
+
c.hide(), r.value = "", m.value = null, d.value = -1;
|
|
87
87
|
}, g = (e) => {
|
|
88
88
|
"path" in e ? (M(`/workspace/${N.value.uid}${e.path}`), p()) : m.value = e.name;
|
|
89
|
-
}, $ = i(),
|
|
89
|
+
}, $ = i(), D = ({
|
|
90
90
|
commandName: e,
|
|
91
91
|
metaData: n
|
|
92
92
|
} = {}) => {
|
|
93
|
-
m.value = e ?? null,
|
|
93
|
+
m.value = e ?? null, R.value = n, c.show(), J(() => {
|
|
94
94
|
var o;
|
|
95
95
|
return (o = $.value) == null ? void 0 : o.focus();
|
|
96
96
|
});
|
|
97
|
-
},
|
|
97
|
+
}, A = (e, n) => {
|
|
98
98
|
var v;
|
|
99
|
-
if (!
|
|
99
|
+
if (!c.open) return;
|
|
100
100
|
n.preventDefault();
|
|
101
101
|
const o = e === "up" ? -1 : 1, t = C.value.length;
|
|
102
|
-
d.value = (d.value + o + t) % t, (v =
|
|
102
|
+
d.value = (d.value + o + t) % t, (v = S.value[d.value]) == null || v.scrollIntoView({
|
|
103
103
|
behavior: "smooth",
|
|
104
104
|
block: "center"
|
|
105
105
|
});
|
|
@@ -108,18 +108,18 @@ const le = { class: "commandmenu" }, se = { class: "bg-b-2 flex items-center rou
|
|
|
108
108
|
), P = () => {
|
|
109
109
|
k.value && g(k.value);
|
|
110
110
|
}, L = (e) => {
|
|
111
|
-
|
|
111
|
+
c.open && (e.closeModal && p(), e.navigateSearchResultsUp && A("up", e.navigateSearchResultsUp), e.navigateSearchResultsDown && A("down", e.navigateSearchResultsDown), e.selectSearchResult && P());
|
|
112
112
|
};
|
|
113
113
|
return T(() => {
|
|
114
|
-
W.on(
|
|
114
|
+
W.on(D), z.on(L);
|
|
115
115
|
}), U(() => {
|
|
116
|
-
W.off(
|
|
116
|
+
W.off(D), z.off(L);
|
|
117
117
|
}), (e, n) => (a(), l(u, null, [
|
|
118
118
|
h(s("div", {
|
|
119
119
|
class: "commandmenu-clickout",
|
|
120
120
|
onClick: n[0] || (n[0] = (o) => p())
|
|
121
121
|
}, null, 512), [
|
|
122
|
-
[b, f(
|
|
122
|
+
[b, f(c).open]
|
|
123
123
|
]),
|
|
124
124
|
h(s("div", le, [
|
|
125
125
|
m.value ? (a(), l(u, { key: 1 }, [
|
|
@@ -135,12 +135,12 @@ const le = { class: "commandmenu" }, se = { class: "bg-b-2 flex items-center rou
|
|
|
135
135
|
})
|
|
136
136
|
]),
|
|
137
137
|
(a(), Q(j(ue[m.value]), {
|
|
138
|
-
metaData:
|
|
138
|
+
metaData: R.value,
|
|
139
139
|
onClose: p
|
|
140
140
|
}, null, 40, ["metaData"]))
|
|
141
141
|
], 64)) : (a(), l(u, { key: 0 }, [
|
|
142
142
|
s("div", se, [
|
|
143
|
-
s("label",
|
|
143
|
+
s("label", ce, [
|
|
144
144
|
x(f(w), {
|
|
145
145
|
class: "text-c-1 mr-2.5",
|
|
146
146
|
icon: "Search",
|
|
@@ -152,14 +152,14 @@ const le = { class: "commandmenu" }, se = { class: "bg-b-2 flex items-center rou
|
|
|
152
152
|
id: "commandmenu",
|
|
153
153
|
ref_key: "commandInputRef",
|
|
154
154
|
ref: $,
|
|
155
|
-
"onUpdate:modelValue": n[1] || (n[1] = (o) =>
|
|
155
|
+
"onUpdate:modelValue": n[1] || (n[1] = (o) => r.value = o),
|
|
156
156
|
autocomplete: "off",
|
|
157
157
|
autofocus: "",
|
|
158
158
|
class: "w-full rounded bg-none border-none py-1.5 text-sm focus:outline-none",
|
|
159
159
|
placeholder: "Search commands...",
|
|
160
160
|
type: "text"
|
|
161
161
|
}, null, 512), [
|
|
162
|
-
[q,
|
|
162
|
+
[q, r.value]
|
|
163
163
|
])
|
|
164
164
|
]),
|
|
165
165
|
(a(), l(u, null, I(y, (o) => (a(), l(u, {
|
|
@@ -169,19 +169,19 @@ const le = { class: "commandmenu" }, se = { class: "bg-b-2 flex items-center rou
|
|
|
169
169
|
[
|
|
170
170
|
b,
|
|
171
171
|
o.commands.filter(
|
|
172
|
-
(t) => t.name.toLowerCase().includes(
|
|
172
|
+
(t) => t.name.toLowerCase().includes(r.value.toLowerCase())
|
|
173
173
|
).length > 0
|
|
174
174
|
]
|
|
175
175
|
]),
|
|
176
176
|
(a(!0), l(u, null, I(o.commands.filter(
|
|
177
|
-
(t) => t.name.toLowerCase().includes(
|
|
177
|
+
(t) => t.name.toLowerCase().includes(r.value.toLowerCase())
|
|
178
178
|
), (t, v) => {
|
|
179
179
|
var B;
|
|
180
180
|
return a(), l("div", {
|
|
181
181
|
key: t.name,
|
|
182
182
|
ref_for: !0,
|
|
183
183
|
ref: (_) => {
|
|
184
|
-
_ && (
|
|
184
|
+
_ && (S.value[v] = _);
|
|
185
185
|
},
|
|
186
186
|
class: K(["commandmenu-item text-sm flex items-center py-1.5 px-2 rounded hover:bg-b-2 cursor-pointer", {
|
|
187
187
|
"bg-b-2": t.name === ((B = k.value) == null ? void 0 : B.name)
|
|
@@ -195,18 +195,18 @@ const le = { class: "commandmenu" }, se = { class: "bg-b-2 flex items-center rou
|
|
|
195
195
|
thickness: "1.5"
|
|
196
196
|
}, null, 8, ["icon"]),
|
|
197
197
|
H(" " + V(t.name), 1)
|
|
198
|
-
], 10,
|
|
198
|
+
], 10, re);
|
|
199
199
|
}), 128))
|
|
200
200
|
], 64))), 64)),
|
|
201
201
|
C.value.length ? G("", !0) : (a(), l("div", me, " No commands found "))
|
|
202
202
|
], 64))
|
|
203
203
|
], 512), [
|
|
204
|
-
[b, f(
|
|
204
|
+
[b, f(c).open]
|
|
205
205
|
])
|
|
206
206
|
], 64));
|
|
207
207
|
}
|
|
208
208
|
});
|
|
209
209
|
export {
|
|
210
210
|
ue as PaletteComponents,
|
|
211
|
-
|
|
211
|
+
Se as default
|
|
212
212
|
};
|
|
@@ -1,3 +1,22 @@
|
|
|
1
|
-
declare const _default: import("vue").DefineComponent<
|
|
1
|
+
declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<{
|
|
2
|
+
openNewTab: {
|
|
3
|
+
name: string;
|
|
4
|
+
uid: string;
|
|
5
|
+
} | null;
|
|
6
|
+
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<{
|
|
7
|
+
openNewTab: {
|
|
8
|
+
name: string;
|
|
9
|
+
uid: string;
|
|
10
|
+
} | null;
|
|
11
|
+
}>>>, {}, {}>;
|
|
2
12
|
export default _default;
|
|
13
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
14
|
+
type __VLS_TypePropsToOption<T> = {
|
|
15
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
16
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
17
|
+
} : {
|
|
18
|
+
type: import('vue').PropType<T[K]>;
|
|
19
|
+
required: true;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
3
22
|
//# sourceMappingURL=TopNav.vue.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TopNav.vue.d.ts","sourceRoot":"","sources":["../../../src/components/TopNav/TopNav.vue"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"TopNav.vue.d.ts","sourceRoot":"","sources":["../../../src/components/TopNav/TopNav.vue"],"names":[],"mappings":";gBAoNc;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI;;gBAApC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI;;AAwUlD,wBAMG;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,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 e = /* @__PURE__ */ t(o, [["__scopeId", "data-v-ec38eda3"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
e as default
|
|
7
7
|
};
|
|
@@ -1,44 +1,47 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { ROUTES as
|
|
3
|
-
import { useClipboard as
|
|
4
|
-
import { ScalarIcon as
|
|
5
|
-
import { capitalize as
|
|
6
|
-
import
|
|
7
|
-
import { useWorkspace as
|
|
8
|
-
import { hotKeyBus as
|
|
9
|
-
const
|
|
1
|
+
import { defineComponent as L, reactive as R, ref as j, computed as B, watch as T, onMounted as A, onBeforeUnmount as E, openBlock as s, createElementBlock as h, createElementVNode as p, createVNode as g, unref as N, toDisplayString as M, Fragment as O, renderList as $, createBlock as z, pushScopeId as V, popScopeId as q } from "vue";
|
|
2
|
+
import { ROUTES as K } from "../../constants.js";
|
|
3
|
+
import { useClipboard as D } from "../../hooks/useClipboard.js";
|
|
4
|
+
import { ScalarIcon as _ } from "@scalar/components";
|
|
5
|
+
import { capitalize as F } from "@scalar/oas-utils/helpers";
|
|
6
|
+
import H from "./TopNavItem.vue.js";
|
|
7
|
+
import { useWorkspace as W } from "../../store/workspace.js";
|
|
8
|
+
import { hotKeyBus as k } from "../../libs/event-busses/hot-keys-bus.js";
|
|
9
|
+
const G = (l) => (V("data-v-ec38eda3"), l = l(), q(), l), J = { class: "flex h-10 t-app__top-nav" }, P = /* @__PURE__ */ G(() => /* @__PURE__ */ p("div", { class: "t-app__top-nav-draggable" }, null, -1)), Q = { class: "flex h-10 flex-1 items-center justify-center gap-1.5 text-sm font-medium relative" }, X = {
|
|
10
10
|
key: 0,
|
|
11
11
|
class: "flex items-center gap-1 w-full justify-center"
|
|
12
|
-
},
|
|
12
|
+
}, ce = /* @__PURE__ */ L({
|
|
13
13
|
__name: "TopNav",
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
props: {
|
|
15
|
+
openNewTab: {}
|
|
16
|
+
},
|
|
17
|
+
setup(l) {
|
|
18
|
+
const y = l, { activeRequest: I, router: c } = W(), { copyToClipboard: C } = D(), t = R([{ label: "", path: "", icon: "Add" }]), o = j(0), x = B(() => o.value);
|
|
19
|
+
function v() {
|
|
17
20
|
var a;
|
|
18
|
-
const e =
|
|
21
|
+
const e = K.find((r) => c.currentRoute.value.name == r.name);
|
|
19
22
|
e && ((e == null ? void 0 : e.name) === "request" ? t[o.value] = {
|
|
20
|
-
label: ((a =
|
|
21
|
-
path:
|
|
23
|
+
label: ((a = I.value) == null ? void 0 : a.summary) || "",
|
|
24
|
+
path: c.currentRoute.value.path,
|
|
22
25
|
icon: e.icon
|
|
23
26
|
} : t[o.value] = {
|
|
24
|
-
label:
|
|
25
|
-
path:
|
|
27
|
+
label: F(e == null ? void 0 : e.name) || "",
|
|
28
|
+
path: c.currentRoute.value.path,
|
|
26
29
|
icon: e.icon
|
|
27
30
|
});
|
|
28
31
|
}
|
|
29
|
-
function
|
|
30
|
-
|
|
32
|
+
function u() {
|
|
33
|
+
c.push(t[o.value].path);
|
|
31
34
|
}
|
|
32
35
|
function m() {
|
|
33
|
-
t.push({ label: "", path: "", icon: "Add" }), o.value = t.length - 1,
|
|
36
|
+
t.push({ label: "", path: "", icon: "Add" }), o.value = t.length - 1, v();
|
|
34
37
|
}
|
|
35
|
-
function
|
|
36
|
-
o.value = e,
|
|
38
|
+
function i(e) {
|
|
39
|
+
o.value = e, u();
|
|
37
40
|
}
|
|
38
|
-
|
|
39
|
-
() =>
|
|
41
|
+
T(
|
|
42
|
+
() => c.currentRoute.value.path,
|
|
40
43
|
() => {
|
|
41
|
-
|
|
44
|
+
v();
|
|
42
45
|
},
|
|
43
46
|
{ immediate: !0 }
|
|
44
47
|
);
|
|
@@ -46,48 +49,60 @@ const H = (i) => (z("data-v-dca235f9"), i = i(), E(), i), W = { class: "flex h-1
|
|
|
46
49
|
t.splice(e, 1), o.value = Math.min(
|
|
47
50
|
o.value,
|
|
48
51
|
t.length - 1
|
|
49
|
-
),
|
|
52
|
+
), u();
|
|
50
53
|
}
|
|
51
|
-
const
|
|
54
|
+
const w = (e) => {
|
|
52
55
|
const a = new URL(window.location.href);
|
|
53
|
-
a.pathname = t[e].path,
|
|
54
|
-
},
|
|
55
|
-
t.splice(0, e), t.splice(1), o.value = 0,
|
|
56
|
-
},
|
|
57
|
-
if (e.addTopNav && m(), e.closeTopNav && f(o.value), e.navigateTopNavLeft &&
|
|
56
|
+
a.pathname = t[e].path, C(a.toString());
|
|
57
|
+
}, S = (e) => {
|
|
58
|
+
t.splice(0, e), t.splice(1), o.value = 0, u();
|
|
59
|
+
}, b = (e) => {
|
|
60
|
+
if (e.addTopNav && m(), e.closeTopNav && f(o.value), e.navigateTopNavLeft && i(Math.max(o.value - 1, 0)), e.navigateTopNavRight && i(Math.min(o.value + 1, t.length - 1)), e.jumpToTab) {
|
|
58
61
|
const a = Number(e.jumpToTab.key) - 1;
|
|
59
|
-
a >= 0 && a < t.length &&
|
|
62
|
+
a >= 0 && a < t.length && i(a);
|
|
60
63
|
}
|
|
61
|
-
e.jumpToLastTab &&
|
|
64
|
+
e.jumpToLastTab && i(t.length - 1);
|
|
65
|
+
}, U = (e) => {
|
|
66
|
+
t.push({
|
|
67
|
+
label: e.name,
|
|
68
|
+
path: e.uid,
|
|
69
|
+
icon: "ExternalLink"
|
|
70
|
+
});
|
|
62
71
|
};
|
|
63
|
-
return
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
72
|
+
return T(
|
|
73
|
+
() => y.openNewTab,
|
|
74
|
+
(e) => {
|
|
75
|
+
e && U(e);
|
|
76
|
+
},
|
|
77
|
+
{ immediate: !0 }
|
|
78
|
+
), A(() => k.on(b)), E(() => k.off(b)), (e, a) => (s(), h("nav", J, [
|
|
79
|
+
P,
|
|
80
|
+
p("div", Q, [
|
|
81
|
+
t.length === 1 ? (s(), h("div", X, [
|
|
82
|
+
g(N(_), {
|
|
68
83
|
icon: t[0].icon,
|
|
69
84
|
size: "xs",
|
|
70
85
|
thickness: "2.5"
|
|
71
86
|
}, null, 8, ["icon"]),
|
|
72
|
-
|
|
73
|
-
])) : (s(!0),
|
|
87
|
+
p("div", null, M(t[0].label), 1)
|
|
88
|
+
])) : (s(!0), h(O, { key: 1 }, $(t, (r, n) => (s(), z(H, {
|
|
74
89
|
key: n,
|
|
75
90
|
active: n === x.value,
|
|
76
91
|
hotkey: (n + 1).toString(),
|
|
77
92
|
icon: r.icon,
|
|
78
93
|
label: r.label,
|
|
79
|
-
onClick: (
|
|
80
|
-
onClose: (
|
|
81
|
-
onCloseOtherTabs: (
|
|
82
|
-
onCopyUrl: (
|
|
94
|
+
onClick: (d) => i(n),
|
|
95
|
+
onClose: (d) => f(n),
|
|
96
|
+
onCloseOtherTabs: (d) => S(n),
|
|
97
|
+
onCopyUrl: (d) => w(n),
|
|
83
98
|
onNewTab: m
|
|
84
99
|
}, null, 8, ["active", "hotkey", "icon", "label", "onClick", "onClose", "onCloseOtherTabs", "onCopyUrl"]))), 128)),
|
|
85
|
-
|
|
100
|
+
p("button", {
|
|
86
101
|
class: "text-c-3 hover:bg-b-3 p-1.5 rounded-lg webkit-app-no-drag",
|
|
87
102
|
type: "button",
|
|
88
103
|
onClick: m
|
|
89
104
|
}, [
|
|
90
|
-
|
|
105
|
+
g(N(_), {
|
|
91
106
|
icon: "Add",
|
|
92
107
|
size: "xs",
|
|
93
108
|
thickness: "2.5"
|
|
@@ -98,5 +113,5 @@ const H = (i) => (z("data-v-dca235f9"), i = i(), E(), i), W = { class: "flex h-1
|
|
|
98
113
|
}
|
|
99
114
|
});
|
|
100
115
|
export {
|
|
101
|
-
|
|
116
|
+
ce as default
|
|
102
117
|
};
|
|
@@ -1,3 +1,13 @@
|
|
|
1
|
-
declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
2
|
+
newTab: (item: {
|
|
3
|
+
name: string;
|
|
4
|
+
uid: string;
|
|
5
|
+
}) => void;
|
|
6
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{}>> & {
|
|
7
|
+
onNewTab?: ((item: {
|
|
8
|
+
name: string;
|
|
9
|
+
uid: string;
|
|
10
|
+
}) => any) | undefined;
|
|
11
|
+
}, {}, {}>;
|
|
2
12
|
export default _default;
|
|
3
13
|
//# sourceMappingURL=ApiClientApp.vue.d.ts.map
|
|
@@ -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":";;cA+J8B,MAAM;aAAO,MAAM;;;;cAAnB,MAAM;aAAO,MAAM;;;AAiOjD,wBAMG"}
|
|
@@ -1,75 +1,79 @@
|
|
|
1
|
-
import { defineComponent as _, onMounted as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { useWorkspace as
|
|
5
|
-
import { addScalarClassesToHeadless as
|
|
6
|
-
import { LS_KEYS as
|
|
7
|
-
import { getThemeStyles as
|
|
8
|
-
import { ScalarToasts as
|
|
9
|
-
import { RouterView as
|
|
10
|
-
import { loadAllResources as
|
|
11
|
-
import
|
|
12
|
-
import { useDarkModeState as
|
|
13
|
-
import { handleHotKeyDown as
|
|
14
|
-
const
|
|
1
|
+
import { defineComponent as _, ref as h, onMounted as d, watchEffect as y, onBeforeMount as k, onBeforeUnmount as T, computed as g, openBlock as n, createElementBlock as p, Fragment as S, createElementVNode as u, createVNode as l, unref as r, withCtx as x, createBlock as f, KeepAlive as b, resolveDynamicComponent as N, createCommentVNode as C } from "vue";
|
|
2
|
+
import L from "../../components/SideNav/SideNav.vue.js";
|
|
3
|
+
import B from "../../components/TopNav/TopNav.vue.js";
|
|
4
|
+
import { useWorkspace as E } from "../../store/workspace.js";
|
|
5
|
+
import { addScalarClassesToHeadless as K } from "@scalar/components";
|
|
6
|
+
import { LS_KEYS as M } from "@scalar/object-utils/mutator-record";
|
|
7
|
+
import { getThemeStyles as W } from "@scalar/themes";
|
|
8
|
+
import { ScalarToasts as A } from "@scalar/use-toasts";
|
|
9
|
+
import { RouterView as D } from "vue-router";
|
|
10
|
+
import { loadAllResources as H } from "../../libs/local-storage.js";
|
|
11
|
+
import V from "../../components/CommandPalette/TheCommandPalette.vue.js";
|
|
12
|
+
import { useDarkModeState as F } from "../../hooks/useDarkModeState.js";
|
|
13
|
+
import { handleHotKeyDown as O } from "../../libs/event-busses/hot-keys-bus.js";
|
|
14
|
+
const P = ["innerHTML"], R = {
|
|
15
15
|
key: 0,
|
|
16
16
|
class: "flex min-h-0 flex-1 z-0"
|
|
17
|
-
},
|
|
17
|
+
}, z = { class: "flex flex-1 flex-col min-w-0" }, ae = /* @__PURE__ */ _({
|
|
18
18
|
__name: "ApiClientApp",
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
emits: ["newTab"],
|
|
20
|
+
setup(I) {
|
|
21
|
+
const c = h(null), w = (e) => {
|
|
22
|
+
c.value = e;
|
|
23
|
+
};
|
|
24
|
+
d(() => {
|
|
25
|
+
y(() => {
|
|
26
|
+
document.body.classList.toggle("dark-mode", m.value), document.body.classList.toggle("light-mode", !m.value);
|
|
23
27
|
});
|
|
24
28
|
});
|
|
25
|
-
const { isDark:
|
|
26
|
-
|
|
27
|
-
if (localStorage.getItem(
|
|
28
|
-
const
|
|
29
|
-
let s = 0, t = 0,
|
|
30
|
-
for (
|
|
31
|
-
Object.prototype.hasOwnProperty.call(localStorage,
|
|
32
|
-
|
|
29
|
+
const { isDark: m } = F(), a = E();
|
|
30
|
+
k(async () => {
|
|
31
|
+
if (localStorage.getItem(M.WORKSPACE)) {
|
|
32
|
+
const e = {};
|
|
33
|
+
let s = 0, t = 0, o = "";
|
|
34
|
+
for (o in localStorage)
|
|
35
|
+
Object.prototype.hasOwnProperty.call(localStorage, o) && (t = (localStorage[o].length + o.length) * 2, s += t, e[o] = (t / 1024).toFixed(2) + " KB");
|
|
36
|
+
e.Total = (s / 1024).toFixed(2) + " KB", console.table(e), H(a);
|
|
33
37
|
} else
|
|
34
|
-
|
|
38
|
+
a.workspaceMutators.add({
|
|
35
39
|
uid: "default",
|
|
36
40
|
name: "Workspace",
|
|
37
41
|
proxyUrl: "https://proxy.scalar.com"
|
|
38
42
|
});
|
|
39
|
-
|
|
43
|
+
K();
|
|
40
44
|
});
|
|
41
|
-
const
|
|
42
|
-
|
|
43
|
-
const
|
|
44
|
-
() =>
|
|
45
|
-
${
|
|
45
|
+
const i = (e) => O(e);
|
|
46
|
+
d(() => window.addEventListener("keydown", i)), T(() => window.removeEventListener("keydown", i));
|
|
47
|
+
const v = g(
|
|
48
|
+
() => a.activeWorkspace.value && `<style>
|
|
49
|
+
${W(a.activeWorkspace.value.themeId, {
|
|
46
50
|
fonts: !0
|
|
47
51
|
})}</style>`
|
|
48
52
|
);
|
|
49
|
-
return (
|
|
53
|
+
return (e, s) => {
|
|
50
54
|
var t;
|
|
51
|
-
return
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
(t =
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
default:
|
|
60
|
-
(
|
|
61
|
-
(
|
|
55
|
+
return n(), p(S, null, [
|
|
56
|
+
u("div", { innerHTML: v.value }, null, 8, P),
|
|
57
|
+
l(B, { openNewTab: c.value }, null, 8, ["openNewTab"]),
|
|
58
|
+
(t = r(a).activeWorkspace.value) != null && t.uid ? (n(), p("main", R, [
|
|
59
|
+
l(L),
|
|
60
|
+
l(r(V)),
|
|
61
|
+
u("div", z, [
|
|
62
|
+
l(r(D), { onNewTab: w }, {
|
|
63
|
+
default: x(({ Component: o }) => [
|
|
64
|
+
(n(), f(b, null, [
|
|
65
|
+
(n(), f(N(o)))
|
|
62
66
|
], 1024))
|
|
63
67
|
]),
|
|
64
68
|
_: 1
|
|
65
69
|
})
|
|
66
70
|
])
|
|
67
|
-
])) :
|
|
68
|
-
|
|
71
|
+
])) : C("", !0),
|
|
72
|
+
l(r(A))
|
|
69
73
|
], 64);
|
|
70
74
|
};
|
|
71
75
|
}
|
|
72
76
|
});
|
|
73
77
|
export {
|
|
74
|
-
|
|
78
|
+
ae as default
|
|
75
79
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cancel-request-bus.d.ts","sourceRoot":"","sources":["../../../src/libs/event-busses/cancel-request-bus.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,gBAAgB,qDAAmC,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { HotKeyConfig } from '@scalar/oas-utils/entities/workspace';
|
|
1
|
+
import type { HotKeyConfig, HotKeyModifiers } from '@scalar/oas-utils/entities/workspace';
|
|
2
2
|
import type { HotkeyEventName } from '@scalar/oas-utils/entities/workspace/consts';
|
|
3
3
|
export type HotKeyEvents = Partial<Record<HotkeyEventName, KeyboardEvent>>;
|
|
4
4
|
/** Event bus for hot keys */
|
|
@@ -18,6 +18,8 @@ export declare const hotKeyBus: import("@vueuse/core").UseEventBusReturn<Partial
|
|
|
18
18
|
* - if you explicitly set it, the event must match ex: modifier false will not trigger if the modifier was pressed
|
|
19
19
|
*/
|
|
20
20
|
export declare const DEFAULT_HOTKEYS: HotKeyConfig;
|
|
21
|
+
/** Converts our modifier config to the eventKey */
|
|
22
|
+
export declare const getModifiers: (modifiers: HotKeyModifiers) => ("altKey" | "ctrlKey" | "shiftKey" | "metaKey")[];
|
|
21
23
|
/**
|
|
22
24
|
* Global keydown handler for hotkeys
|
|
23
25
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hot-keys-bus.d.ts","sourceRoot":"","sources":["../../../src/libs/event-busses/hot-keys-bus.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,
|
|
1
|
+
{"version":3,"file":"hot-keys-bus.d.ts","sourceRoot":"","sources":["../../../src/libs/event-busses/hot-keys-bus.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,eAAe,EAChB,MAAM,sCAAsC,CAAA;AAC7C,OAAO,KAAK,EACV,eAAe,EAEhB,MAAM,6CAA6C,CAAA;AAIpD,MAAM,MAAM,YAAY,GAAG,OAAO,CAAC,MAAM,CAAC,eAAe,EAAE,aAAa,CAAC,CAAC,CAAA;AAG1E,6BAA6B;AAC7B,eAAO,MAAM,SAAS,+WAA4B,CAAA;AAyBlD;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,eAAe,EAAE,YAsB7B,CAAA;AAsBD,mDAAmD;AACnD,eAAO,MAAM,YAAY,cAAe,eAAe,sDAQtD,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,OACvB,aAAa;;;;;;UA2BlB,CAAA"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export * from './command-palette-bus.js';
|
|
2
|
-
export * from './execute-request-bus.js';
|
|
3
2
|
export * from './hot-keys-bus.js';
|
|
3
|
+
export * from './execute-request-bus.js';
|
|
4
|
+
export * from './cancel-request-bus.js';
|
|
4
5
|
export * from './request-status-bus.js';
|
|
5
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/libs/event-busses/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAA;AACrC,cAAc,uBAAuB,CAAA;AACrC,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/libs/event-busses/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAA;AACrC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,uBAAuB,CAAA;AACrC,cAAc,sBAAsB,CAAA;AACpC,cAAc,sBAAsB,CAAA"}
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import { commandPaletteBus as o } from "./command-palette-bus.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { DEFAULT_HOTKEYS as s, getModifiers as u, handleHotKeyDown as m, hotKeyBus as f } from "./hot-keys-bus.js";
|
|
3
|
+
import { executeRequestBus as a } from "./execute-request-bus.js";
|
|
4
|
+
import { cancelRequestBus as B } from "./cancel-request-bus.js";
|
|
5
|
+
import { requestStatusBus as n } from "./request-status-bus.js";
|
|
5
6
|
export {
|
|
6
|
-
|
|
7
|
+
s as DEFAULT_HOTKEYS,
|
|
8
|
+
B as cancelRequestBus,
|
|
7
9
|
o as commandPaletteBus,
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
a as executeRequestBus,
|
|
11
|
+
u as getModifiers,
|
|
12
|
+
m as handleHotKeyDown,
|
|
13
|
+
f as hotKeyBus,
|
|
14
|
+
n as requestStatusBus
|
|
12
15
|
};
|