@scalar/api-client 2.0.47 → 2.0.48
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 +25 -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 +77 -71
- package/dist/components/CodeInput/CodeInput.vue.d.ts +3 -1
- package/dist/components/CodeInput/CodeInput.vue.d.ts.map +1 -1
- package/dist/components/CodeInput/CodeInput.vue.js +2 -2
- package/dist/components/CodeInput/CodeInput.vue2.js +49 -44
- package/dist/components/CommandPalette/TheCommandPalette.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/TheCommandPalette.vue.js +2 -2
- package/dist/components/CommandPalette/TheCommandPalette.vue2.js +97 -106
- package/dist/components/Sidebar/Sidebar.vue.d.ts +24 -3
- package/dist/components/Sidebar/Sidebar.vue.d.ts.map +1 -1
- package/dist/components/Sidebar/Sidebar.vue.js +57 -19
- package/dist/components/TopNav/TopNav.vue.d.ts.map +1 -1
- package/dist/components/TopNav/TopNav.vue.js +1 -1
- package/dist/components/TopNav/TopNav.vue2.js +46 -43
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -9
- package/dist/layouts/App/ApiClientApp.vue.js +1 -1
- package/dist/layouts/App/create-api-client-app.d.ts +56 -46
- package/dist/layouts/App/create-api-client-app.d.ts.map +1 -1
- package/dist/layouts/Modal/ApiClientModal.vue.d.ts.map +1 -1
- package/dist/layouts/Modal/ApiClientModal.vue.js +2 -2
- package/dist/layouts/Modal/ApiClientModal.vue2.js +20 -20
- package/dist/layouts/Modal/create-api-client-modal.d.ts +112 -92
- package/dist/layouts/Modal/create-api-client-modal.d.ts.map +1 -1
- package/dist/libs/create-client.d.ts +56 -46
- package/dist/libs/create-client.d.ts.map +1 -1
- package/dist/libs/event-busses/{command-palette.d.ts → command-palette-bus.d.ts} +1 -1
- package/dist/libs/event-busses/command-palette-bus.d.ts.map +1 -0
- package/dist/libs/event-busses/{execute-requestBus.d.ts → execute-request-bus.d.ts} +1 -1
- package/dist/libs/event-busses/execute-request-bus.d.ts.map +1 -0
- package/dist/libs/event-busses/hot-keys-bus.d.ts +33 -0
- package/dist/libs/event-busses/hot-keys-bus.d.ts.map +1 -0
- package/dist/libs/event-busses/hot-keys-bus.js +33 -0
- package/dist/libs/event-busses/index.d.ts +3 -3
- package/dist/libs/event-busses/index.d.ts.map +1 -1
- package/dist/libs/event-busses/index.js +3 -3
- package/dist/libs/index.js +3 -3
- package/dist/libs/local-storage.d.ts +1 -1
- package/dist/libs/local-storage.d.ts.map +1 -1
- package/dist/libs/local-storage.js +15 -30
- package/dist/router.d.ts +2 -2
- package/dist/router.d.ts.map +1 -1
- package/dist/router.js +3 -3
- package/dist/store/workspace.d.ts +112 -92
- package/dist/store/workspace.d.ts.map +1 -1
- package/dist/store/workspace.js +140 -137
- 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 +135 -131
- package/dist/views/Request/RequestSidebarItem.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSidebarItem.vue.js +1 -1
- package/dist/views/Request/RequestSidebarItem.vue2.js +252 -138
- package/dist/views/Request/RequestSidebarItemMenu.vue.d.ts +27 -5
- package/dist/views/Request/RequestSidebarItemMenu.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSidebarItemMenu.vue.js +4 -4
- package/dist/views/Request/RequestSidebarItemMenu.vue2.js +83 -158
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
- package/dist/views/Request/components/WorkspaceDropdown.vue.d.ts.map +1 -1
- package/dist/views/Request/components/WorkspaceDropdown.vue.js +214 -70
- package/package.json +6 -6
- package/dist/libs/event-busses/command-palette.d.ts.map +0 -1
- package/dist/libs/event-busses/execute-requestBus.d.ts.map +0 -1
- package/dist/libs/event-busses/hot-key.d.ts +0 -34
- package/dist/libs/event-busses/hot-key.d.ts.map +0 -1
- package/dist/libs/event-busses/hot-key.js +0 -25
- /package/dist/libs/event-busses/{command-palette.js → command-palette-bus.js} +0 -0
- /package/dist/libs/event-busses/{execute-requestBus.js → execute-request-bus.js} +0 -0
|
@@ -1,32 +1,31 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useModal as
|
|
3
|
-
import { useMagicKeys as j, whenever as b } from "@vueuse/core";
|
|
1
|
+
import { defineComponent as M, ref as d, computed as N, onMounted as F, onBeforeUnmount as q, openBlock as n, createElementBlock as s, Fragment as f, withDirectives as h, createElementVNode as m, vShow as x, unref as p, createVNode as w, vModelText as K, renderList as P, toDisplayString as B, normalizeClass as T, createTextVNode as U, createCommentVNode as H, createBlock as G, resolveDynamicComponent as Q } from "vue";
|
|
2
|
+
import { useModal as j, ScalarIcon as y } from "@scalar/components";
|
|
4
3
|
import { useRouter as J } from "vue-router";
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import {
|
|
14
|
-
const
|
|
4
|
+
import { useWorkspace as O } from "../../store/workspace.js";
|
|
5
|
+
import X from "./CommandPaletteCollection.vue.js";
|
|
6
|
+
import Y from "./CommandPaletteExample.vue.js";
|
|
7
|
+
import Z from "./CommandPaletteFolder.vue.js";
|
|
8
|
+
import ee from "./CommandPaletteImport.vue.js";
|
|
9
|
+
import oe from "./CommandPaletteRequest.vue.js";
|
|
10
|
+
import te from "./CommandPaletteWorkspace.vue.js";
|
|
11
|
+
import { commandPaletteBus as E } from "../../libs/event-busses/command-palette-bus.js";
|
|
12
|
+
import { hotKeyBus as I } from "../../libs/event-busses/hot-keys-bus.js";
|
|
13
|
+
const ne = { class: "commandmenu" }, ae = { class: "bg-b-2 flex items-center rounded mb-2 pl-2 focus-within:bg-b-1 focus-within:shadow-border" }, le = { for: "commandmenu" }, se = ["onClick"], ce = {
|
|
15
14
|
key: 0,
|
|
16
15
|
class: "text-c-3 text-center text-sm p-2 pt-3"
|
|
17
|
-
},
|
|
16
|
+
}, me = {
|
|
18
17
|
name: "TheCommandPalette"
|
|
19
|
-
},
|
|
20
|
-
"Import Collection":
|
|
21
|
-
"Create Request":
|
|
22
|
-
"Create Workspace":
|
|
23
|
-
"Add Folder":
|
|
24
|
-
"Create Collection":
|
|
25
|
-
"Add Example":
|
|
26
|
-
},
|
|
27
|
-
...
|
|
28
|
-
setup(
|
|
29
|
-
const
|
|
18
|
+
}, re = {
|
|
19
|
+
"Import Collection": ee,
|
|
20
|
+
"Create Request": oe,
|
|
21
|
+
"Create Workspace": te,
|
|
22
|
+
"Add Folder": Z,
|
|
23
|
+
"Create Collection": X,
|
|
24
|
+
"Add Example": Y
|
|
25
|
+
}, ye = /* @__PURE__ */ M({
|
|
26
|
+
...me,
|
|
27
|
+
setup(ie) {
|
|
28
|
+
const C = [
|
|
30
29
|
{
|
|
31
30
|
label: "Add to Request Sidebar",
|
|
32
31
|
commands: [
|
|
@@ -76,140 +75,132 @@ const le = { class: "commandmenu" }, re = { class: "bg-b-2 flex items-center rou
|
|
|
76
75
|
}
|
|
77
76
|
]
|
|
78
77
|
}
|
|
79
|
-
],
|
|
80
|
-
() =>
|
|
81
|
-
const
|
|
82
|
-
(
|
|
78
|
+
], r = j(), { push: V } = J(), { activeWorkspace: W } = O(), S = d(), i = d(""), u = d(null), a = d(-1), $ = d([]), k = N(
|
|
79
|
+
() => C.reduce((e, t) => {
|
|
80
|
+
const o = t.commands.filter(
|
|
81
|
+
(c) => c.name.toLowerCase().includes(i.value.toLowerCase())
|
|
83
82
|
);
|
|
84
|
-
return [...e, ...
|
|
83
|
+
return [...e, ...o];
|
|
85
84
|
}, [])
|
|
86
|
-
),
|
|
87
|
-
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
}), b(v.enter, () => {
|
|
92
|
-
if (!l.open || o.value === -1) return;
|
|
93
|
-
const e = f.value[o.value];
|
|
94
|
-
$(e);
|
|
95
|
-
}), b(v.ArrowDown, () => {
|
|
96
|
-
var e;
|
|
97
|
-
l.open && (o.value < f.value.length - 1 ? o.value++ : o.value = 0, (e = _.value[o.value]) == null || e.scrollIntoView({
|
|
98
|
-
behavior: "smooth",
|
|
99
|
-
block: "center"
|
|
100
|
-
}));
|
|
101
|
-
}), b(v.ArrowUp, () => {
|
|
102
|
-
var e;
|
|
103
|
-
l.open && (o.value > 0 ? o.value-- : o.value = f.value.length - 1, (e = _.value[o.value]) == null || e.scrollIntoView({
|
|
104
|
-
behavior: "smooth",
|
|
105
|
-
block: "center"
|
|
106
|
-
}));
|
|
107
|
-
});
|
|
108
|
-
const $ = (e) => {
|
|
109
|
-
"path" in e ? (P(`/workspace/${W.value.uid}${e.path}`), h()) : m.value = e.name;
|
|
110
|
-
}, D = u(), R = ({
|
|
85
|
+
), v = () => {
|
|
86
|
+
r.hide(), i.value = "", u.value = null, a.value = -1;
|
|
87
|
+
}, A = (e) => {
|
|
88
|
+
"path" in e ? (V(`/workspace/${W.value.uid}${e.path}`), v()) : u.value = e.name;
|
|
89
|
+
}, R = d(), g = ({
|
|
111
90
|
commandName: e,
|
|
112
|
-
metaData:
|
|
91
|
+
metaData: t
|
|
113
92
|
} = {}) => {
|
|
114
|
-
var
|
|
115
|
-
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
93
|
+
var o;
|
|
94
|
+
u.value = e ?? null, S.value = t, r.show(), (o = R.value) == null || o.focus();
|
|
95
|
+
}, L = (e) => {
|
|
96
|
+
var c;
|
|
97
|
+
if (!r.open) return;
|
|
98
|
+
const t = e === "up" ? -1 : 1, o = k.value.length;
|
|
99
|
+
a.value = (a.value + t + o) % o, (c = $.value[a.value]) == null || c.scrollIntoView({
|
|
100
|
+
behavior: "smooth",
|
|
101
|
+
block: "center"
|
|
102
|
+
});
|
|
103
|
+
}, z = () => {
|
|
104
|
+
if (a.value === -1) return;
|
|
105
|
+
const e = k.value[a.value];
|
|
106
|
+
A(e);
|
|
107
|
+
}, D = (e) => {
|
|
108
|
+
r.open && (e.closeModal && v(), e.commandPaletteUp && L("up"), e.commandPaletteDown && L("down"), e.commandPaletteSelect && z());
|
|
120
109
|
};
|
|
121
|
-
return
|
|
122
|
-
|
|
123
|
-
}), (
|
|
124
|
-
|
|
110
|
+
return F(() => {
|
|
111
|
+
E.on(g), I.on(D);
|
|
112
|
+
}), q(() => {
|
|
113
|
+
E.off(g), I.off(D);
|
|
114
|
+
}), (e, t) => (n(), s(f, null, [
|
|
115
|
+
h(m("div", {
|
|
125
116
|
class: "commandmenu-clickout",
|
|
126
|
-
onClick:
|
|
117
|
+
onClick: t[0] || (t[0] = (o) => v())
|
|
127
118
|
}, null, 512), [
|
|
128
|
-
[
|
|
119
|
+
[x, p(r).open]
|
|
129
120
|
]),
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
121
|
+
h(m("div", ne, [
|
|
122
|
+
u.value ? (n(), s(f, { key: 1 }, [
|
|
123
|
+
m("button", {
|
|
133
124
|
class: "absolute p-0.75 hover:bg-b-3 rounded text-c-3 active:text-c-1 m-1.5 z-10",
|
|
134
125
|
type: "button",
|
|
135
|
-
onClick:
|
|
126
|
+
onClick: t[2] || (t[2] = (o) => u.value = null)
|
|
136
127
|
}, [
|
|
137
|
-
|
|
128
|
+
w(p(y), {
|
|
138
129
|
icon: "ChevronLeft",
|
|
139
130
|
size: "md",
|
|
140
131
|
thickness: "1.5"
|
|
141
132
|
})
|
|
142
133
|
]),
|
|
143
|
-
(
|
|
144
|
-
metaData:
|
|
145
|
-
onClose:
|
|
134
|
+
(n(), G(Q(re[u.value]), {
|
|
135
|
+
metaData: S.value,
|
|
136
|
+
onClose: v
|
|
146
137
|
}, null, 40, ["metaData"]))
|
|
147
|
-
], 64)) : (
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
138
|
+
], 64)) : (n(), s(f, { key: 0 }, [
|
|
139
|
+
m("div", ae, [
|
|
140
|
+
m("label", le, [
|
|
141
|
+
w(p(y), {
|
|
151
142
|
class: "text-c-1 mr-2.5",
|
|
152
143
|
icon: "Search",
|
|
153
144
|
size: "sm",
|
|
154
145
|
thickness: "1.5"
|
|
155
146
|
})
|
|
156
147
|
]),
|
|
157
|
-
|
|
148
|
+
h(m("input", {
|
|
158
149
|
id: "commandmenu",
|
|
159
150
|
ref_key: "commandInputRef",
|
|
160
|
-
ref:
|
|
161
|
-
"onUpdate:modelValue":
|
|
151
|
+
ref: R,
|
|
152
|
+
"onUpdate:modelValue": t[1] || (t[1] = (o) => i.value = o),
|
|
162
153
|
autocomplete: "off",
|
|
163
154
|
autofocus: "",
|
|
164
155
|
class: "w-full rounded bg-none border-none py-1.5 text-sm focus:outline-none",
|
|
165
156
|
placeholder: "Search commands...",
|
|
166
157
|
type: "text"
|
|
167
158
|
}, null, 512), [
|
|
168
|
-
[
|
|
159
|
+
[K, i.value]
|
|
169
160
|
])
|
|
170
161
|
]),
|
|
171
|
-
(
|
|
172
|
-
key:
|
|
162
|
+
(n(), s(f, null, P(C, (o, c) => (n(), s(f, {
|
|
163
|
+
key: o.label
|
|
173
164
|
}, [
|
|
174
|
-
|
|
165
|
+
h(m("div", { class: "text-c-3 font-medium text-xs mt-2" }, B(o.label), 513), [
|
|
175
166
|
[
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
(
|
|
167
|
+
x,
|
|
168
|
+
o.commands.filter(
|
|
169
|
+
(l) => l.name.toLowerCase().includes(i.value.toLowerCase())
|
|
179
170
|
).length > 0
|
|
180
171
|
]
|
|
181
172
|
]),
|
|
182
|
-
(
|
|
183
|
-
(
|
|
184
|
-
), (
|
|
185
|
-
key:
|
|
173
|
+
(n(!0), s(f, null, P(o.commands.filter(
|
|
174
|
+
(l) => l.name.toLowerCase().includes(i.value.toLowerCase())
|
|
175
|
+
), (l, _) => (n(), s("div", {
|
|
176
|
+
key: l.name,
|
|
186
177
|
ref_for: !0,
|
|
187
|
-
ref: (
|
|
188
|
-
|
|
178
|
+
ref: (b) => {
|
|
179
|
+
b && ($.value[_] = b);
|
|
189
180
|
},
|
|
190
181
|
class: T(["commandmenu-item text-sm flex items-center py-1.5 px-2 rounded hover:bg-b-2 cursor-pointer", {
|
|
191
|
-
"bg-b-2":
|
|
182
|
+
"bg-b-2": c > 0 ? a.value === _ + C[c - 1].commands.length : a.value === _
|
|
192
183
|
}]),
|
|
193
|
-
onClick: (
|
|
184
|
+
onClick: (b) => A(l)
|
|
194
185
|
}, [
|
|
195
|
-
|
|
186
|
+
w(p(y), {
|
|
196
187
|
class: "text-c-1 mr-2.5",
|
|
197
|
-
icon:
|
|
188
|
+
icon: l.icon,
|
|
198
189
|
size: "md",
|
|
199
190
|
thickness: "1.5"
|
|
200
191
|
}, null, 8, ["icon"]),
|
|
201
|
-
U(" " + B(
|
|
202
|
-
], 10,
|
|
192
|
+
U(" " + B(l.name), 1)
|
|
193
|
+
], 10, se))), 128))
|
|
203
194
|
], 64))), 64)),
|
|
204
|
-
|
|
195
|
+
k.value.length ? H("", !0) : (n(), s("div", ce, " No commands found "))
|
|
205
196
|
], 64))
|
|
206
197
|
], 512), [
|
|
207
|
-
[
|
|
198
|
+
[x, p(r).open]
|
|
208
199
|
])
|
|
209
200
|
], 64));
|
|
210
201
|
}
|
|
211
202
|
});
|
|
212
203
|
export {
|
|
213
|
-
|
|
214
|
-
|
|
204
|
+
re as PaletteComponents,
|
|
205
|
+
ye as default
|
|
215
206
|
};
|
|
@@ -1,15 +1,36 @@
|
|
|
1
1
|
declare function __VLS_template(): {
|
|
2
2
|
header?(_: {}): any;
|
|
3
|
+
title?(_: {}): any;
|
|
3
4
|
content?(_: {}): any;
|
|
4
5
|
button?(_: {}): any;
|
|
5
6
|
};
|
|
6
|
-
declare const __VLS_component: import("vue").DefineComponent<__VLS_TypePropsToOption<{
|
|
7
|
+
declare const __VLS_component: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<{
|
|
7
8
|
title?: string;
|
|
8
|
-
|
|
9
|
+
showSideBar: boolean;
|
|
10
|
+
}>, {
|
|
11
|
+
showSideBar: boolean;
|
|
12
|
+
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
13
|
+
"update:showSideBar": (v: boolean) => void;
|
|
14
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<{
|
|
9
15
|
title?: string;
|
|
10
|
-
|
|
16
|
+
showSideBar: boolean;
|
|
17
|
+
}>, {
|
|
18
|
+
showSideBar: boolean;
|
|
19
|
+
}>>> & {
|
|
20
|
+
"onUpdate:showSideBar"?: ((v: boolean) => any) | undefined;
|
|
21
|
+
}, {
|
|
22
|
+
showSideBar: boolean;
|
|
23
|
+
}, {}>;
|
|
11
24
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
|
|
12
25
|
export default _default;
|
|
26
|
+
type __VLS_WithDefaults<P, D> = {
|
|
27
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
28
|
+
default: D[K];
|
|
29
|
+
}> : P[K];
|
|
30
|
+
};
|
|
31
|
+
type __VLS_Prettify<T> = {
|
|
32
|
+
[K in keyof T]: T[K];
|
|
33
|
+
} & {};
|
|
13
34
|
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
14
35
|
new (): {
|
|
15
36
|
$slots: S;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Sidebar.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Sidebar/Sidebar.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Sidebar.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Sidebar/Sidebar.vue"],"names":[],"mappings":"AA+QA,iBAAS,cAAc;oBAqEK,GAAG;mBACJ,GAAG;qBACD,GAAG;oBACJ,GAAG;EAoB9B;AACD,QAAA,MAAM,eAAe;YAlMW,MAAM;iBAAe,OAAO;;;;;;YAA5B,MAAM;iBAAe,OAAO;;;;;;iBAAP,OAAO;MAyM1D,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAAvG,wBAAwG;AAOxG,KAAK,kBAAkB,CAAC,CAAC,EAAE,CAAC,IAAI;KAC1B,CAAC,IAAI,MAAM,IAAI,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,SAAS,MAAM,CAAC,GAC7C,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG;QAAE,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC,CAAA;KAAC,CAAC,GACvC,CAAC,CAAC,CAAC,CAAC;CACP,CAAC;AAEN,KAAK,cAAc,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC;AAExD,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACpC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC;AAEN,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,31 +1,69 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useWorkspace as
|
|
3
|
-
const
|
|
1
|
+
import { defineComponent as B, ref as n, watch as L, onMounted as W, withDirectives as k, openBlock as h, createElementBlock as v, normalizeClass as g, normalizeStyle as D, renderSlot as a, unref as b, createElementVNode as i, createCommentVNode as I, vShow as _ } from "vue";
|
|
2
|
+
import { useWorkspace as $ } from "../../store/workspace.js";
|
|
3
|
+
const C = {
|
|
4
4
|
key: 0,
|
|
5
5
|
class: "xl:min-h-header py-2.5 flex items-center border-b-1/2 px-4 text-sm"
|
|
6
|
-
},
|
|
6
|
+
}, z = { class: "font-medium m-0 text-sm whitespace-nowrap" }, X = /* @__PURE__ */ B({
|
|
7
7
|
__name: "Sidebar",
|
|
8
8
|
props: {
|
|
9
|
-
title: {}
|
|
9
|
+
title: {},
|
|
10
|
+
showSideBar: { type: Boolean, default: !0 }
|
|
10
11
|
},
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
12
|
+
emits: ["update:showSideBar"],
|
|
13
|
+
setup(w, { emit: S }) {
|
|
14
|
+
const d = w, l = S, { isReadOnly: c } = $(), r = n(!1), m = n(null), s = n(localStorage.getItem("sidebarWidth") || "280px"), u = () => {
|
|
15
|
+
(s.value === "0px" || localStorage.getItem("sidebarWidth") === "0px") && (s.value = "280px");
|
|
16
|
+
}, x = (e) => {
|
|
17
|
+
e.preventDefault();
|
|
18
|
+
const o = e.clientX, y = parseInt(
|
|
19
|
+
getComputedStyle(m.value).width || "280px",
|
|
20
|
+
10
|
|
21
|
+
), p = (E) => {
|
|
22
|
+
r.value = !0, document.body.classList.add("dragging");
|
|
23
|
+
let t = y + E.clientX - o;
|
|
24
|
+
t > 420 && (t = 420 + (t - 420) * 0.2), t < 240 ? (t = 0, l("update:showSideBar", !1)) : l("update:showSideBar", !0), s.value = `${t}px`, localStorage.setItem("sidebarWidth", `${Math.min(t, 420)}px`);
|
|
25
|
+
}, f = () => {
|
|
26
|
+
r.value = !1, document.body.classList.remove("dragging"), document.documentElement.removeEventListener("mousemove", p, !1), document.documentElement.removeEventListener("mouseup", f, !1), parseInt(s.value, 10) > 420 && (s.value = "360px");
|
|
27
|
+
};
|
|
28
|
+
document.documentElement.addEventListener("mousemove", p, !1), document.documentElement.addEventListener("mouseup", f, !1);
|
|
29
|
+
};
|
|
30
|
+
return L(
|
|
31
|
+
() => d.showSideBar,
|
|
32
|
+
(e) => {
|
|
33
|
+
const o = document.querySelector(".sidebar");
|
|
34
|
+
o && (e ? o.classList.remove("blur-content") : (o.classList.add("blur-content"), document.body.classList.remove("dragging"))), u();
|
|
35
|
+
}
|
|
36
|
+
), W(() => {
|
|
37
|
+
u();
|
|
38
|
+
}), (e, o) => k((h(), v("aside", {
|
|
39
|
+
ref_key: "sidebarRef",
|
|
40
|
+
ref: m,
|
|
41
|
+
class: g(["sidebar overflow-hidden relative flex flex-col border-r-1/2 bg-b-1", { dragging: r.value }]),
|
|
42
|
+
style: D({ width: s.value })
|
|
43
|
+
}, [
|
|
44
|
+
a(e.$slots, "header"),
|
|
45
|
+
!b(c) && e.title ? (h(), v("div", C, [
|
|
46
|
+
i("h2", z, [
|
|
47
|
+
a(e.$slots, "title")
|
|
48
|
+
])
|
|
49
|
+
])) : I("", !0),
|
|
50
|
+
i("div", {
|
|
51
|
+
class: g(["custom-scroll sidebar-height", {
|
|
52
|
+
"sidebar-mask": !b(c)
|
|
21
53
|
}])
|
|
22
54
|
}, [
|
|
23
|
-
|
|
55
|
+
a(e.$slots, "content")
|
|
24
56
|
], 2),
|
|
25
|
-
|
|
26
|
-
|
|
57
|
+
a(e.$slots, "button"),
|
|
58
|
+
i("div", {
|
|
59
|
+
class: "resizer",
|
|
60
|
+
onMousedown: x
|
|
61
|
+
}, null, 32)
|
|
62
|
+
], 6)), [
|
|
63
|
+
[_, d.showSideBar]
|
|
64
|
+
]);
|
|
27
65
|
}
|
|
28
66
|
});
|
|
29
67
|
export {
|
|
30
|
-
|
|
68
|
+
X as default
|
|
31
69
|
};
|
|
@@ -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":";AAqZA,wBAKG"}
|
|
@@ -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 f = /* @__PURE__ */ t(o, [["__scopeId", "data-v-
|
|
4
|
+
const f = /* @__PURE__ */ t(o, [["__scopeId", "data-v-19efa966"]]);
|
|
5
5
|
export {
|
|
6
6
|
f as default
|
|
7
7
|
};
|
|
@@ -1,77 +1,80 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { ROUTES as
|
|
3
|
-
import { ScalarIcon as
|
|
4
|
-
import { capitalize as
|
|
5
|
-
import
|
|
6
|
-
import { useWorkspace as
|
|
7
|
-
|
|
1
|
+
import { defineComponent as x, reactive as S, ref as T, watch as C, computed as B, onMounted as R, onBeforeUnmount as w, openBlock as i, createElementBlock as p, createElementVNode as r, createVNode as _, unref as g, toDisplayString as A, Fragment as M, renderList as z, createBlock as E, pushScopeId as L, popScopeId as V } from "vue";
|
|
2
|
+
import { ROUTES as j } from "../../constants.js";
|
|
3
|
+
import { ScalarIcon as b } from "@scalar/components";
|
|
4
|
+
import { capitalize as q } from "@scalar/oas-utils/helpers";
|
|
5
|
+
import K from "./TopNavItem.vue.js";
|
|
6
|
+
import { useWorkspace as U } from "../../store/workspace.js";
|
|
7
|
+
import { hotKeyBus as k } from "../../libs/event-busses/hot-keys-bus.js";
|
|
8
|
+
const $ = (l) => (L("data-v-19efa966"), l = l(), V(), l), D = { class: "flex h-10 t-app__top-nav" }, F = /* @__PURE__ */ $(() => /* @__PURE__ */ r("div", { class: "t-app__top-nav-draggable" }, null, -1)), H = { class: "flex h-10 flex-1 items-center justify-center gap-1.5 text-sm font-medium relative" }, O = {
|
|
8
9
|
key: 0,
|
|
9
10
|
class: "flex items-center gap-1 w-full justify-center"
|
|
10
|
-
},
|
|
11
|
+
}, Z = /* @__PURE__ */ x({
|
|
11
12
|
__name: "TopNav",
|
|
12
13
|
setup(l) {
|
|
13
|
-
const { activeRequest:
|
|
14
|
-
function
|
|
14
|
+
const { activeRequest: N, router: o } = U(), t = S([{ label: "", path: "", icon: "Add" }]), a = T(0);
|
|
15
|
+
function m() {
|
|
15
16
|
var s;
|
|
16
|
-
const e =
|
|
17
|
+
const e = j.find((c) => o.currentRoute.value.name == c.name);
|
|
17
18
|
e && ((e == null ? void 0 : e.name) === "request" ? t[a.value] = {
|
|
18
|
-
label: ((s =
|
|
19
|
-
path:
|
|
19
|
+
label: ((s = N.value) == null ? void 0 : s.summary) || "",
|
|
20
|
+
path: o.currentRoute.value.path,
|
|
20
21
|
icon: e.icon
|
|
21
22
|
} : t[a.value] = {
|
|
22
|
-
label:
|
|
23
|
-
path:
|
|
23
|
+
label: q(e == null ? void 0 : e.name) || "",
|
|
24
|
+
path: o.currentRoute.value.path,
|
|
24
25
|
icon: e.icon
|
|
25
26
|
});
|
|
26
27
|
}
|
|
27
|
-
function
|
|
28
|
-
|
|
28
|
+
function v() {
|
|
29
|
+
o.push(t[a.value].path);
|
|
29
30
|
}
|
|
30
|
-
function
|
|
31
|
-
t.push({ label: "", path: "", icon: "Add" }), a.value = t.length - 1,
|
|
31
|
+
function d() {
|
|
32
|
+
t.push({ label: "", path: "", icon: "Add" }), a.value = t.length - 1, m();
|
|
32
33
|
}
|
|
33
|
-
function
|
|
34
|
-
a.value = e,
|
|
34
|
+
function u(e) {
|
|
35
|
+
a.value = e, v();
|
|
35
36
|
}
|
|
36
|
-
|
|
37
|
-
() =>
|
|
37
|
+
C(
|
|
38
|
+
() => o.currentRoute.value.path,
|
|
38
39
|
() => {
|
|
39
|
-
|
|
40
|
+
m();
|
|
40
41
|
},
|
|
41
42
|
{ immediate: !0 }
|
|
42
43
|
);
|
|
43
|
-
function
|
|
44
|
+
function f(e) {
|
|
44
45
|
t.splice(e, 1), a.value = Math.min(
|
|
45
46
|
a.value,
|
|
46
47
|
t.length - 1
|
|
47
|
-
),
|
|
48
|
+
), v();
|
|
48
49
|
}
|
|
49
|
-
const
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
50
|
+
const I = B(() => a.value), h = (e) => {
|
|
51
|
+
e.addTopNav && d(), e.closeTopNav && f(a.value), e.navigateTopNavLeft && u(Math.max(a.value - 1, 0)), e.navigateTopNavRight && u(Math.min(a.value + 1, t.length - 1));
|
|
52
|
+
};
|
|
53
|
+
return R(() => k.on(h)), w(() => k.off(h)), (e, s) => (i(), p("nav", D, [
|
|
54
|
+
F,
|
|
55
|
+
r("div", H, [
|
|
56
|
+
t.length === 1 ? (i(), p("div", O, [
|
|
57
|
+
_(g(b), {
|
|
55
58
|
icon: t[0].icon,
|
|
56
59
|
size: "xs",
|
|
57
60
|
thickness: "2.5"
|
|
58
61
|
}, null, 8, ["icon"]),
|
|
59
|
-
|
|
60
|
-
])) : (
|
|
61
|
-
key:
|
|
62
|
-
active:
|
|
63
|
-
hotkey: (
|
|
62
|
+
r("div", null, A(t[0].label), 1)
|
|
63
|
+
])) : (i(!0), p(M, { key: 1 }, z(t, (c, n) => (i(), E(K, {
|
|
64
|
+
key: n,
|
|
65
|
+
active: n === I.value,
|
|
66
|
+
hotkey: (n + 1).toString(),
|
|
64
67
|
icon: c.icon,
|
|
65
68
|
label: c.label,
|
|
66
|
-
onClick: (
|
|
67
|
-
onClose: (
|
|
69
|
+
onClick: (y) => u(n),
|
|
70
|
+
onClose: (y) => f(n)
|
|
68
71
|
}, null, 8, ["active", "hotkey", "icon", "label", "onClick", "onClose"]))), 128)),
|
|
69
|
-
|
|
72
|
+
r("button", {
|
|
70
73
|
class: "text-c-3 hover:bg-b-3 p-1.5 rounded-lg webkit-app-no-drag",
|
|
71
74
|
type: "button",
|
|
72
|
-
onClick:
|
|
75
|
+
onClick: d
|
|
73
76
|
}, [
|
|
74
|
-
|
|
77
|
+
_(g(b), {
|
|
75
78
|
icon: "Add",
|
|
76
79
|
size: "xs",
|
|
77
80
|
thickness: "2.5"
|
|
@@ -82,5 +85,5 @@ const L = (l) => (B("data-v-76f92299"), l = l(), E(), l), $ = { class: "flex h-1
|
|
|
82
85
|
}
|
|
83
86
|
});
|
|
84
87
|
export {
|
|
85
|
-
|
|
88
|
+
Z as default
|
|
86
89
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export * from './layouts/Modal/index.js';
|
|
2
2
|
export * from './layouts/App/index.js';
|
|
3
3
|
export { useWorkspace } from './store/workspace.js';
|
|
4
|
-
export { createModalRouter,
|
|
4
|
+
export { createModalRouter, createWebHashRouter, router } from './router.js';
|
|
5
5
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAA;AAC/B,cAAc,eAAe,CAAA;AAE7B,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAChD,OAAO,EAAE,iBAAiB,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAA;AAC/B,cAAc,eAAe,CAAA;AAE7B,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAChD,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { useWorkspace as
|
|
2
|
-
import { createModalRouter as a,
|
|
3
|
-
import { default as
|
|
1
|
+
import { useWorkspace as o } from "./store/workspace.js";
|
|
2
|
+
import { createModalRouter as a, createWebHashRouter as i, router as l } from "./router.js";
|
|
3
|
+
import { default as c } from "./layouts/App/ApiClientApp.vue.js";
|
|
4
4
|
/* empty css */
|
|
5
|
-
import { default as
|
|
5
|
+
import { default as A } from "./layouts/Modal/ApiClientModal.vue.js";
|
|
6
6
|
import { createApiClientModal as n, createApiClientModalSync as u } from "./layouts/Modal/create-api-client-modal.js";
|
|
7
7
|
import { createApiClientApp as s } from "./layouts/App/create-api-client-app.js";
|
|
8
8
|
export {
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
c as ApiClientApp,
|
|
10
|
+
A as ApiClientModal,
|
|
11
11
|
s as createApiClientApp,
|
|
12
12
|
n as createApiClientModal,
|
|
13
13
|
u as createApiClientModalSync,
|
|
14
14
|
a as createModalRouter,
|
|
15
|
-
i as
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
i as createWebHashRouter,
|
|
16
|
+
l as router,
|
|
17
|
+
o as useWorkspace
|
|
18
18
|
};
|
|
@@ -10,7 +10,7 @@ import { RouterView as A } from "vue-router";
|
|
|
10
10
|
import { loadAllResources as D } from "../../libs/local-storage.js";
|
|
11
11
|
import N from "../../components/CommandPalette/TheCommandPalette.vue.js";
|
|
12
12
|
import { useDarkModeState as b } from "../../hooks/useDarkModeState.js";
|
|
13
|
-
import { handleHotKeyDown as H } from "../../libs/event-busses/hot-
|
|
13
|
+
import { handleHotKeyDown as H } from "../../libs/event-busses/hot-keys-bus.js";
|
|
14
14
|
const V = ["innerHTML"], F = {
|
|
15
15
|
key: 0,
|
|
16
16
|
class: "flex min-h-0 flex-1"
|