@scalar/api-client 2.0.50 → 2.0.51
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 +13 -0
- package/dist/components/CommandPalette/TheCommandPalette.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/TheCommandPalette.vue.js +1 -1
- package/dist/components/CommandPalette/TheCommandPalette.vue2.js +105 -99
- package/dist/components/ScalarHotkey.vue.d.ts.map +1 -1
- package/dist/components/ScalarHotkey.vue.js +4 -4
- package/dist/components/Sidebar/Sidebar.vue.d.ts +4 -8
- package/dist/components/Sidebar/Sidebar.vue.d.ts.map +1 -1
- package/dist/components/Sidebar/Sidebar.vue.js +32 -43
- 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 +36 -32
- package/dist/layouts/App/ApiClientApp.vue.d.ts.map +1 -1
- package/dist/layouts/App/ApiClientApp.vue.js +1 -1
- package/dist/layouts/App/create-api-client-app.d.ts +15 -13
- package/dist/layouts/App/create-api-client-app.d.ts.map +1 -1
- package/dist/layouts/Modal/create-api-client-modal.d.ts +30 -26
- package/dist/layouts/Modal/create-api-client-modal.d.ts.map +1 -1
- package/dist/libs/create-client.d.ts +15 -13
- package/dist/libs/create-client.d.ts.map +1 -1
- package/dist/libs/event-busses/hot-keys-bus.d.ts +3 -3
- package/dist/libs/event-busses/hot-keys-bus.d.ts.map +1 -1
- package/dist/libs/event-busses/hot-keys-bus.js +45 -15
- package/dist/libs/local-storage.js +1 -1
- package/dist/store/workspace.d.ts +186 -94
- package/dist/store/workspace.d.ts.map +1 -1
- package/dist/store/workspace.js +117 -113
- 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 +62 -62
- 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 +205 -199
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @scalar/api-client
|
|
2
2
|
|
|
3
|
+
## 2.0.51
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- f2b4b3f: fix: request sidebar draft native context menu
|
|
8
|
+
- c386d64: fix: enable sidebar resizer on request page
|
|
9
|
+
- 5c877b8: fix: command palette navigation
|
|
10
|
+
- 1c81549: feat: topnav navigation hotkeys
|
|
11
|
+
- Updated dependencies [48693d7]
|
|
12
|
+
- Updated dependencies [1c81549]
|
|
13
|
+
- @scalar/components@0.12.32
|
|
14
|
+
- @scalar/oas-utils@0.2.32
|
|
15
|
+
|
|
3
16
|
## 2.0.50
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TheCommandPalette.vue.d.ts","sourceRoot":"","sources":["../../../src/components/CommandPalette/TheCommandPalette.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TheCommandPalette.vue.d.ts","sourceRoot":"","sources":["../../../src/components/CommandPalette/TheCommandPalette.vue"],"names":[],"mappings":"AA6WA;;;;GAIG;;AACH,wBAuYI;AAEJ,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAOpB,CAAA;AAEV,yCAAyC;AACzC,MAAM,MAAM,YAAY,GAAG,MAAM,OAAO,iBAAiB,CACxD"}
|
|
@@ -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 r = /* @__PURE__ */ t(o, [["__scopeId", "data-v-
|
|
5
|
+
const r = /* @__PURE__ */ t(o, [["__scopeId", "data-v-3597a300"]]);
|
|
6
6
|
export {
|
|
7
7
|
s as PaletteComponents,
|
|
8
8
|
r as default
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useModal as
|
|
3
|
-
import { useRouter as
|
|
4
|
-
import { useWorkspace as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import { commandPaletteBus as
|
|
12
|
-
import { hotKeyBus as
|
|
13
|
-
const
|
|
1
|
+
import { defineComponent as F, ref as i, computed as B, onMounted as T, onBeforeUnmount as U, openBlock as a, createElementBlock as l, Fragment as u, withDirectives as h, createElementVNode as s, vShow as b, unref as f, createVNode as x, vModelText as q, renderList as E, toDisplayString as I, normalizeClass as K, createTextVNode as H, createCommentVNode as G, createBlock as Q, resolveDynamicComponent as j, nextTick as J } from "vue";
|
|
2
|
+
import { useModal as O, ScalarIcon as w } from "@scalar/components";
|
|
3
|
+
import { useRouter as X } from "vue-router";
|
|
4
|
+
import { useWorkspace as Y } from "../../store/workspace.js";
|
|
5
|
+
import Z from "./CommandPaletteCollection.vue.js";
|
|
6
|
+
import ee from "./CommandPaletteExample.vue.js";
|
|
7
|
+
import oe from "./CommandPaletteFolder.vue.js";
|
|
8
|
+
import te from "./CommandPaletteImport.vue.js";
|
|
9
|
+
import ne from "./CommandPaletteRequest.vue.js";
|
|
10
|
+
import ae from "./CommandPaletteWorkspace.vue.js";
|
|
11
|
+
import { commandPaletteBus as V } from "../../libs/event-busses/command-palette-bus.js";
|
|
12
|
+
import { hotKeyBus as W } 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" }, ce = { for: "commandmenu" }, me = ["onClick"], re = {
|
|
14
14
|
key: 0,
|
|
15
15
|
class: "text-c-3 text-center text-sm p-2 pt-3"
|
|
16
|
-
},
|
|
16
|
+
}, ie = {
|
|
17
17
|
name: "TheCommandPalette"
|
|
18
|
-
},
|
|
19
|
-
"Import Collection":
|
|
20
|
-
"Create Request":
|
|
21
|
-
"Create Workspace":
|
|
22
|
-
"Add Folder":
|
|
23
|
-
"Create Collection":
|
|
24
|
-
"Add Example":
|
|
25
|
-
},
|
|
26
|
-
...
|
|
27
|
-
setup(
|
|
28
|
-
const
|
|
18
|
+
}, ue = {
|
|
19
|
+
"Import Collection": te,
|
|
20
|
+
"Create Request": ne,
|
|
21
|
+
"Create Workspace": ae,
|
|
22
|
+
"Add Folder": oe,
|
|
23
|
+
"Create Collection": Z,
|
|
24
|
+
"Add Example": ee
|
|
25
|
+
}, $e = /* @__PURE__ */ F({
|
|
26
|
+
...ie,
|
|
27
|
+
setup(de) {
|
|
28
|
+
const y = [
|
|
29
29
|
{
|
|
30
30
|
label: "Add to Request Sidebar",
|
|
31
31
|
commands: [
|
|
@@ -75,132 +75,138 @@ const ne = { class: "commandmenu" }, ae = { class: "bg-b-2 flex items-center rou
|
|
|
75
75
|
}
|
|
76
76
|
]
|
|
77
77
|
}
|
|
78
|
-
],
|
|
79
|
-
() =>
|
|
80
|
-
const o =
|
|
81
|
-
(
|
|
78
|
+
], c = O(), { push: z } = X(), { activeWorkspace: M } = Y(), S = i(), m = i(""), r = i(null), d = i(-1), $ = i([]), C = B(
|
|
79
|
+
() => y.reduce((e, n) => {
|
|
80
|
+
const o = n.commands.filter(
|
|
81
|
+
(t) => t.name.toLowerCase().includes(m.value.toLowerCase())
|
|
82
82
|
);
|
|
83
83
|
return [...e, ...o];
|
|
84
84
|
}, [])
|
|
85
|
-
),
|
|
86
|
-
|
|
85
|
+
), p = () => {
|
|
86
|
+
c.hide(), m.value = "", r.value = null, d.value = -1;
|
|
87
87
|
}, A = (e) => {
|
|
88
|
-
"path" in e ? (
|
|
89
|
-
},
|
|
88
|
+
"path" in e ? (z(`/workspace/${M.value.uid}${e.path}`), p()) : r.value = e.name;
|
|
89
|
+
}, D = i(), P = ({
|
|
90
90
|
commandName: e,
|
|
91
|
-
metaData:
|
|
91
|
+
metaData: n
|
|
92
92
|
} = {}) => {
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
93
|
+
r.value = e ?? null, S.value = n, c.show(), J(() => {
|
|
94
|
+
var o;
|
|
95
|
+
return (o = D.value) == null ? void 0 : o.focus();
|
|
96
|
+
});
|
|
97
|
+
}, R = (e, n) => {
|
|
98
|
+
var v;
|
|
99
|
+
if (!c.open) return;
|
|
100
|
+
n.preventDefault();
|
|
101
|
+
const o = e === "up" ? -1 : 1, t = C.value.length;
|
|
102
|
+
d.value = (d.value + o + t) % t, (v = $.value[d.value]) == null || v.scrollIntoView({
|
|
100
103
|
behavior: "smooth",
|
|
101
104
|
block: "center"
|
|
102
105
|
});
|
|
103
|
-
},
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
A(
|
|
107
|
-
},
|
|
108
|
-
|
|
106
|
+
}, k = B(
|
|
107
|
+
() => C.value[d.value]
|
|
108
|
+
), N = () => {
|
|
109
|
+
k.value && A(k.value);
|
|
110
|
+
}, g = (e) => {
|
|
111
|
+
c.open && (e.closeModal && p(), e.commandPaletteUp && R("up", e.commandPaletteUp), e.commandPaletteDown && R("down", e.commandPaletteDown), e.commandPaletteSelect && N());
|
|
109
112
|
};
|
|
110
|
-
return
|
|
111
|
-
|
|
112
|
-
}),
|
|
113
|
-
|
|
114
|
-
}), (e,
|
|
115
|
-
h(
|
|
113
|
+
return T(() => {
|
|
114
|
+
V.on(P), W.on(g);
|
|
115
|
+
}), U(() => {
|
|
116
|
+
V.off(P), W.off(g);
|
|
117
|
+
}), (e, n) => (a(), l(u, null, [
|
|
118
|
+
h(s("div", {
|
|
116
119
|
class: "commandmenu-clickout",
|
|
117
|
-
onClick:
|
|
120
|
+
onClick: n[0] || (n[0] = (o) => p())
|
|
118
121
|
}, null, 512), [
|
|
119
|
-
[
|
|
122
|
+
[b, f(c).open]
|
|
120
123
|
]),
|
|
121
|
-
h(
|
|
122
|
-
|
|
123
|
-
|
|
124
|
+
h(s("div", le, [
|
|
125
|
+
r.value ? (a(), l(u, { key: 1 }, [
|
|
126
|
+
s("button", {
|
|
124
127
|
class: "absolute p-0.75 hover:bg-b-3 rounded text-c-3 active:text-c-1 m-1.5 z-10",
|
|
125
128
|
type: "button",
|
|
126
|
-
onClick:
|
|
129
|
+
onClick: n[2] || (n[2] = (o) => r.value = null)
|
|
127
130
|
}, [
|
|
128
|
-
|
|
131
|
+
x(f(w), {
|
|
129
132
|
icon: "ChevronLeft",
|
|
130
133
|
size: "md",
|
|
131
134
|
thickness: "1.5"
|
|
132
135
|
})
|
|
133
136
|
]),
|
|
134
|
-
(
|
|
137
|
+
(a(), Q(j(ue[r.value]), {
|
|
135
138
|
metaData: S.value,
|
|
136
|
-
onClose:
|
|
139
|
+
onClose: p
|
|
137
140
|
}, null, 40, ["metaData"]))
|
|
138
|
-
], 64)) : (
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
141
|
+
], 64)) : (a(), l(u, { key: 0 }, [
|
|
142
|
+
s("div", se, [
|
|
143
|
+
s("label", ce, [
|
|
144
|
+
x(f(w), {
|
|
142
145
|
class: "text-c-1 mr-2.5",
|
|
143
146
|
icon: "Search",
|
|
144
147
|
size: "sm",
|
|
145
148
|
thickness: "1.5"
|
|
146
149
|
})
|
|
147
150
|
]),
|
|
148
|
-
h(
|
|
151
|
+
h(s("input", {
|
|
149
152
|
id: "commandmenu",
|
|
150
153
|
ref_key: "commandInputRef",
|
|
151
|
-
ref:
|
|
152
|
-
"onUpdate:modelValue":
|
|
154
|
+
ref: D,
|
|
155
|
+
"onUpdate:modelValue": n[1] || (n[1] = (o) => m.value = o),
|
|
153
156
|
autocomplete: "off",
|
|
154
157
|
autofocus: "",
|
|
155
158
|
class: "w-full rounded bg-none border-none py-1.5 text-sm focus:outline-none",
|
|
156
159
|
placeholder: "Search commands...",
|
|
157
160
|
type: "text"
|
|
158
161
|
}, null, 512), [
|
|
159
|
-
[
|
|
162
|
+
[q, m.value]
|
|
160
163
|
])
|
|
161
164
|
]),
|
|
162
|
-
(
|
|
165
|
+
(a(), l(u, null, E(y, (o) => (a(), l(u, {
|
|
163
166
|
key: o.label
|
|
164
167
|
}, [
|
|
165
|
-
h(
|
|
168
|
+
h(s("div", { class: "text-c-3 font-medium text-xs mt-2" }, I(o.label), 513), [
|
|
166
169
|
[
|
|
167
|
-
|
|
170
|
+
b,
|
|
168
171
|
o.commands.filter(
|
|
169
|
-
(
|
|
172
|
+
(t) => t.name.toLowerCase().includes(m.value.toLowerCase())
|
|
170
173
|
).length > 0
|
|
171
174
|
]
|
|
172
175
|
]),
|
|
173
|
-
(
|
|
174
|
-
(
|
|
175
|
-
), (
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
176
|
+
(a(!0), l(u, null, E(o.commands.filter(
|
|
177
|
+
(t) => t.name.toLowerCase().includes(m.value.toLowerCase())
|
|
178
|
+
), (t, v) => {
|
|
179
|
+
var L;
|
|
180
|
+
return a(), l("div", {
|
|
181
|
+
key: t.name,
|
|
182
|
+
ref_for: !0,
|
|
183
|
+
ref: (_) => {
|
|
184
|
+
_ && ($.value[v] = _);
|
|
185
|
+
},
|
|
186
|
+
class: K(["commandmenu-item text-sm flex items-center py-1.5 px-2 rounded hover:bg-b-2 cursor-pointer", {
|
|
187
|
+
"bg-b-2": t.name === ((L = k.value) == null ? void 0 : L.name)
|
|
188
|
+
}]),
|
|
189
|
+
onClick: (_) => A(t)
|
|
190
|
+
}, [
|
|
191
|
+
x(f(w), {
|
|
192
|
+
class: "text-c-1 mr-2.5",
|
|
193
|
+
icon: t.icon,
|
|
194
|
+
size: "md",
|
|
195
|
+
thickness: "1.5"
|
|
196
|
+
}, null, 8, ["icon"]),
|
|
197
|
+
H(" " + I(t.name), 1)
|
|
198
|
+
], 10, me);
|
|
199
|
+
}), 128))
|
|
194
200
|
], 64))), 64)),
|
|
195
|
-
|
|
201
|
+
C.value.length ? G("", !0) : (a(), l("div", re, " No commands found "))
|
|
196
202
|
], 64))
|
|
197
203
|
], 512), [
|
|
198
|
-
[
|
|
204
|
+
[b, f(c).open]
|
|
199
205
|
])
|
|
200
206
|
], 64));
|
|
201
207
|
}
|
|
202
208
|
});
|
|
203
209
|
export {
|
|
204
|
-
|
|
205
|
-
|
|
210
|
+
ue as PaletteComponents,
|
|
211
|
+
$e as default
|
|
206
212
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScalarHotkey.vue.d.ts","sourceRoot":"","sources":["../../src/components/ScalarHotkey.vue"],"names":[],"mappings":";YAoDU,MAAM;;;;YAAN,MAAM;;;;
|
|
1
|
+
{"version":3,"file":"ScalarHotkey.vue.d.ts","sourceRoot":"","sources":["../../src/components/ScalarHotkey.vue"],"names":[],"mappings":";YAoDU,MAAM;;;;YAAN,MAAM;;;;AAgFhB,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"}
|
|
@@ -8,16 +8,16 @@ const P = /* @__PURE__ */ l({
|
|
|
8
8
|
hotkey: {}
|
|
9
9
|
},
|
|
10
10
|
emits: ["hotkeyPressed"],
|
|
11
|
-
setup(n, { emit:
|
|
12
|
-
const o = n,
|
|
11
|
+
setup(n, { emit: a }) {
|
|
12
|
+
const o = n, i = a, p = t(() => r() ? "⌘" : "⌃"), s = t(() => h().get(o.hotkey)), c = t(() => `${p.value}${o.hotkey}`), m = f({
|
|
13
13
|
passive: !1,
|
|
14
14
|
onEventFired(e) {
|
|
15
15
|
!r() && e.ctrlKey && e.key === s.value && (e.preventDefault(), e.stopPropagation());
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
18
|
return v(m[`${r() ? "meta" : "control"}_${o.hotkey}`], () => {
|
|
19
|
-
|
|
20
|
-
}), (e, b) => (d(), y("div", k(e.$attrs, { class: "bg-
|
|
19
|
+
i("hotkeyPressed", s.value || "");
|
|
20
|
+
}), (e, b) => (d(), y("div", k(e.$attrs, { class: "bg-c-btn border-b-3 inline-block overflow-hidden rounded border-1/2 text-xxs rounded-b px-1 font-medium uppercase" }), u(c.value), 17));
|
|
21
21
|
}
|
|
22
22
|
});
|
|
23
23
|
export {
|
|
@@ -5,19 +5,15 @@ declare function __VLS_template(): {
|
|
|
5
5
|
};
|
|
6
6
|
declare const __VLS_component: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<{
|
|
7
7
|
title?: string;
|
|
8
|
-
showSideBar
|
|
8
|
+
showSideBar?: boolean;
|
|
9
9
|
}>, {
|
|
10
10
|
showSideBar: boolean;
|
|
11
|
-
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
12
|
-
"update:showSideBar": (v: boolean) => void;
|
|
13
|
-
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<{
|
|
11
|
+
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<{
|
|
14
12
|
title?: string;
|
|
15
|
-
showSideBar
|
|
13
|
+
showSideBar?: boolean;
|
|
16
14
|
}>, {
|
|
17
15
|
showSideBar: boolean;
|
|
18
|
-
}
|
|
19
|
-
"onUpdate:showSideBar"?: ((v: boolean) => any) | undefined;
|
|
20
|
-
}, {
|
|
16
|
+
}>>>, {
|
|
21
17
|
showSideBar: boolean;
|
|
22
18
|
}, {}>;
|
|
23
19
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
|
|
@@ -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":"AAoMA,iBAAS,cAAc;oBAoEK,GAAG;qBACF,GAAG;oBACJ,GAAG;EAmB9B;AACD,QAAA,MAAM,eAAe;YAxJT,MAAM;kBACA,OAAO;;;;YADb,MAAM;kBACA,OAAO;;;;iBAAP,OAAO;MA6JvB,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,67 +1,56 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useWorkspace as
|
|
3
|
-
const
|
|
1
|
+
import { defineComponent as S, ref as f, withDirectives as x, openBlock as p, createElementBlock as v, normalizeClass as h, normalizeStyle as D, unref as r, renderSlot as a, createElementVNode as l, toDisplayString as k, createCommentVNode as L, vShow as _ } from "vue";
|
|
2
|
+
import { useWorkspace as B } from "../../store/workspace.js";
|
|
3
|
+
const W = {
|
|
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
|
+
}, C = { class: "font-medium m-0 text-sm whitespace-nowrap" }, I = /* @__PURE__ */ S({
|
|
7
7
|
__name: "Sidebar",
|
|
8
8
|
props: {
|
|
9
9
|
title: {},
|
|
10
10
|
showSideBar: { type: Boolean, default: !0 }
|
|
11
11
|
},
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
const d = S, l = w, { isReadOnly: c } = C(), a = r(!1), m = r(null), s = r(localStorage.getItem("sidebarWidth") || "280px"), u = () => {
|
|
15
|
-
(s.value === "0px" || localStorage.getItem("sidebarWidth") === "0px") && (s.value = "280px");
|
|
16
|
-
}, y = (e) => {
|
|
12
|
+
setup(g) {
|
|
13
|
+
const b = g, { isReadOnly: i, sidebarWidth: s, setSidebarWidth: o } = B(), n = f(!1), d = f(null), w = (e) => {
|
|
17
14
|
e.preventDefault();
|
|
18
|
-
const
|
|
19
|
-
getComputedStyle(
|
|
15
|
+
const m = e.clientX, y = parseInt(
|
|
16
|
+
getComputedStyle(d.value).width || s.value,
|
|
20
17
|
10
|
|
21
|
-
),
|
|
22
|
-
|
|
23
|
-
let t =
|
|
24
|
-
t > 420 && (t = 420 + (t - 420) * 0.2), t < 240
|
|
25
|
-
},
|
|
26
|
-
|
|
18
|
+
), c = (E) => {
|
|
19
|
+
n.value = !0, document.body.classList.add("dragging");
|
|
20
|
+
let t = y + E.clientX - m;
|
|
21
|
+
t > 420 && (t = 420 + (t - 420) * 0.2), t < 240 && (t = 240), o(`${t}px`);
|
|
22
|
+
}, u = () => {
|
|
23
|
+
n.value = !1, document.body.classList.remove("dragging"), document.documentElement.removeEventListener("mousemove", c, !1), document.documentElement.removeEventListener("mouseup", u, !1), parseInt(s.value, 10) > 420 ? o("360px") : parseInt(s.value, 10) < 240 && o("240px");
|
|
27
24
|
};
|
|
28
|
-
document.documentElement.addEventListener("mousemove",
|
|
25
|
+
document.documentElement.addEventListener("mousemove", c, !1), document.documentElement.addEventListener("mouseup", u, !1);
|
|
29
26
|
};
|
|
30
|
-
return
|
|
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) => D((h(), v("aside", {
|
|
27
|
+
return (e, m) => x((p(), v("aside", {
|
|
39
28
|
ref_key: "sidebarRef",
|
|
40
|
-
ref:
|
|
41
|
-
class:
|
|
42
|
-
style:
|
|
29
|
+
ref: d,
|
|
30
|
+
class: h(["sidebar overflow-hidden relative flex flex-col border-r-1/2 bg-b-1", { dragging: n.value }]),
|
|
31
|
+
style: D({ width: r(s) })
|
|
43
32
|
}, [
|
|
44
|
-
|
|
45
|
-
!
|
|
46
|
-
|
|
47
|
-
])) :
|
|
48
|
-
|
|
49
|
-
class:
|
|
50
|
-
"sidebar-mask": !
|
|
33
|
+
a(e.$slots, "header"),
|
|
34
|
+
!r(i) && e.title ? (p(), v("div", W, [
|
|
35
|
+
l("h2", C, k(e.title), 1)
|
|
36
|
+
])) : L("", !0),
|
|
37
|
+
l("div", {
|
|
38
|
+
class: h(["custom-scroll sidebar-height", {
|
|
39
|
+
"sidebar-mask": !r(i)
|
|
51
40
|
}])
|
|
52
41
|
}, [
|
|
53
|
-
|
|
42
|
+
a(e.$slots, "content")
|
|
54
43
|
], 2),
|
|
55
|
-
|
|
56
|
-
|
|
44
|
+
a(e.$slots, "button"),
|
|
45
|
+
l("div", {
|
|
57
46
|
class: "resizer",
|
|
58
|
-
onMousedown:
|
|
47
|
+
onMousedown: w
|
|
59
48
|
}, null, 32)
|
|
60
49
|
], 6)), [
|
|
61
|
-
[
|
|
50
|
+
[_, b.showSideBar]
|
|
62
51
|
]);
|
|
63
52
|
}
|
|
64
53
|
});
|
|
65
54
|
export {
|
|
66
|
-
|
|
55
|
+
I as default
|
|
67
56
|
};
|
|
@@ -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":";AAmaA,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
|
|
4
|
+
const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-91b3e5a4"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
m as default
|
|
7
7
|
};
|
|
@@ -1,41 +1,41 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { ROUTES as
|
|
3
|
-
import { ScalarIcon as
|
|
1
|
+
import { defineComponent as T, reactive as x, ref as S, watch as C, computed as j, onMounted as B, onBeforeUnmount as R, openBlock as u, createElementBlock as p, createElementVNode as s, createVNode as b, unref as _, toDisplayString as w, Fragment as A, renderList as L, createBlock as M, pushScopeId as z, popScopeId as E } from "vue";
|
|
2
|
+
import { ROUTES as V } from "../../constants.js";
|
|
3
|
+
import { ScalarIcon as g } from "@scalar/components";
|
|
4
4
|
import { capitalize as q } from "@scalar/oas-utils/helpers";
|
|
5
5
|
import K from "./TopNavItem.vue.js";
|
|
6
6
|
import { useWorkspace as U } from "../../store/workspace.js";
|
|
7
7
|
import { hotKeyBus as k } from "../../libs/event-busses/hot-keys-bus.js";
|
|
8
|
-
const $ = (
|
|
8
|
+
const $ = (i) => (z("data-v-91b3e5a4"), i = i(), E(), i), D = { class: "flex h-10 t-app__top-nav" }, F = /* @__PURE__ */ $(() => /* @__PURE__ */ s("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 = {
|
|
9
9
|
key: 0,
|
|
10
10
|
class: "flex items-center gap-1 w-full justify-center"
|
|
11
|
-
}, Z = /* @__PURE__ */
|
|
11
|
+
}, Z = /* @__PURE__ */ T({
|
|
12
12
|
__name: "TopNav",
|
|
13
|
-
setup(
|
|
14
|
-
const { activeRequest: N, router:
|
|
13
|
+
setup(i) {
|
|
14
|
+
const { activeRequest: N, router: n } = U(), t = x([{ label: "", path: "", icon: "Add" }]), a = S(0);
|
|
15
15
|
function m() {
|
|
16
|
-
var
|
|
17
|
-
const e =
|
|
16
|
+
var o;
|
|
17
|
+
const e = V.find((r) => n.currentRoute.value.name == r.name);
|
|
18
18
|
e && ((e == null ? void 0 : e.name) === "request" ? t[a.value] = {
|
|
19
|
-
label: ((
|
|
20
|
-
path:
|
|
19
|
+
label: ((o = N.value) == null ? void 0 : o.summary) || "",
|
|
20
|
+
path: n.currentRoute.value.path,
|
|
21
21
|
icon: e.icon
|
|
22
22
|
} : t[a.value] = {
|
|
23
23
|
label: q(e == null ? void 0 : e.name) || "",
|
|
24
|
-
path:
|
|
24
|
+
path: n.currentRoute.value.path,
|
|
25
25
|
icon: e.icon
|
|
26
26
|
});
|
|
27
27
|
}
|
|
28
28
|
function v() {
|
|
29
|
-
|
|
29
|
+
n.push(t[a.value].path);
|
|
30
30
|
}
|
|
31
31
|
function d() {
|
|
32
32
|
t.push({ label: "", path: "", icon: "Add" }), a.value = t.length - 1, m();
|
|
33
33
|
}
|
|
34
|
-
function
|
|
34
|
+
function l(e) {
|
|
35
35
|
a.value = e, v();
|
|
36
36
|
}
|
|
37
37
|
C(
|
|
38
|
-
() =>
|
|
38
|
+
() => n.currentRoute.value.path,
|
|
39
39
|
() => {
|
|
40
40
|
m();
|
|
41
41
|
},
|
|
@@ -47,34 +47,38 @@ const $ = (l) => (L("data-v-19efa966"), l = l(), V(), l), D = { class: "flex h-1
|
|
|
47
47
|
t.length - 1
|
|
48
48
|
), v();
|
|
49
49
|
}
|
|
50
|
-
const I =
|
|
51
|
-
e.addTopNav && d(), e.closeTopNav && f(a.value), e.navigateTopNavLeft &&
|
|
50
|
+
const I = j(() => a.value), h = (e) => {
|
|
51
|
+
if (e.addTopNav && d(), e.closeTopNav && f(a.value), e.navigateTopNavLeft && l(Math.max(a.value - 1, 0)), e.navigateTopNavRight && l(Math.min(a.value + 1, t.length - 1)), e.jumpToTab) {
|
|
52
|
+
const o = Number(e.jumpToTab.key) - 1;
|
|
53
|
+
o >= 0 && o < t.length && l(o);
|
|
54
|
+
}
|
|
55
|
+
e.jumpToLastTab && l(t.length - 1);
|
|
52
56
|
};
|
|
53
|
-
return
|
|
57
|
+
return B(() => k.on(h)), R(() => k.off(h)), (e, o) => (u(), p("nav", D, [
|
|
54
58
|
F,
|
|
55
|
-
|
|
56
|
-
t.length === 1 ? (
|
|
57
|
-
_(g
|
|
59
|
+
s("div", H, [
|
|
60
|
+
t.length === 1 ? (u(), p("div", O, [
|
|
61
|
+
b(_(g), {
|
|
58
62
|
icon: t[0].icon,
|
|
59
63
|
size: "xs",
|
|
60
64
|
thickness: "2.5"
|
|
61
65
|
}, null, 8, ["icon"]),
|
|
62
|
-
|
|
63
|
-
])) : (
|
|
64
|
-
key:
|
|
65
|
-
active:
|
|
66
|
-
hotkey: (
|
|
67
|
-
icon:
|
|
68
|
-
label:
|
|
69
|
-
onClick: (y) =>
|
|
70
|
-
onClose: (y) => f(
|
|
66
|
+
s("div", null, w(t[0].label), 1)
|
|
67
|
+
])) : (u(!0), p(A, { key: 1 }, L(t, (r, c) => (u(), M(K, {
|
|
68
|
+
key: c,
|
|
69
|
+
active: c === I.value,
|
|
70
|
+
hotkey: (c + 1).toString(),
|
|
71
|
+
icon: r.icon,
|
|
72
|
+
label: r.label,
|
|
73
|
+
onClick: (y) => l(c),
|
|
74
|
+
onClose: (y) => f(c)
|
|
71
75
|
}, null, 8, ["active", "hotkey", "icon", "label", "onClick", "onClose"]))), 128)),
|
|
72
|
-
|
|
76
|
+
s("button", {
|
|
73
77
|
class: "text-c-3 hover:bg-b-3 p-1.5 rounded-lg webkit-app-no-drag",
|
|
74
78
|
type: "button",
|
|
75
79
|
onClick: d
|
|
76
80
|
}, [
|
|
77
|
-
_(g
|
|
81
|
+
b(_(g), {
|
|
78
82
|
icon: "Add",
|
|
79
83
|
size: "xs",
|
|
80
84
|
thickness: "2.5"
|
|
@@ -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":";AAkVA,wBAKG"}
|
|
@@ -13,7 +13,7 @@ import { useDarkModeState as b } from "../../hooks/useDarkModeState.js";
|
|
|
13
13
|
import { handleHotKeyDown as H } from "../../libs/event-busses/hot-keys-bus.js";
|
|
14
14
|
const V = ["innerHTML"], F = {
|
|
15
15
|
key: 0,
|
|
16
|
-
class: "flex min-h-0 flex-1"
|
|
16
|
+
class: "flex min-h-0 flex-1 z-0"
|
|
17
17
|
}, O = { class: "flex flex-1 flex-col min-w-0" }, ee = /* @__PURE__ */ _({
|
|
18
18
|
__name: "ApiClientApp",
|
|
19
19
|
setup(P) {
|