@scalar/api-client 2.0.46 → 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 +44 -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/HttpMethod/HttpMethod.vue.d.ts.map +1 -1
- package/dist/components/HttpMethod/HttpMethod.vue.js +1 -1
- package/dist/components/HttpMethod/HttpMethod.vue2.js +10 -10
- package/dist/components/Search/SearchModal.vue.d.ts.map +1 -1
- package/dist/components/Search/SearchModal.vue.js +1 -1
- package/dist/components/Search/SearchModal.vue2.js +43 -41
- package/dist/components/SideNav/SideNav.vue.d.ts.map +1 -1
- package/dist/components/SideNav/SideNav.vue.js +1 -1
- package/dist/components/SideNav/SideNav.vue2.js +22 -19
- 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/Sidebar/SidebarListElement.vue.d.ts.map +1 -1
- package/dist/components/Sidebar/SidebarListElement.vue.js +2 -2
- package/dist/components/Sidebar/SidebarListElement.vue2.js +1 -1
- package/dist/components/Sidebar/SidebarListElementActions.vue.d.ts +2 -0
- package/dist/components/Sidebar/SidebarListElementActions.vue.d.ts.map +1 -1
- package/dist/components/Sidebar/SidebarListElementActions.vue.js +22 -21
- 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/Cookies/CookieForm.vue.d.ts.map +1 -1
- package/dist/views/Cookies/CookieForm.vue.js +14 -15
- package/dist/views/Cookies/Cookies.vue.d.ts.map +1 -1
- package/dist/views/Cookies/Cookies.vue2.js +114 -55
- package/dist/views/Environment/Environment.vue.d.ts.map +1 -1
- package/dist/views/Environment/Environment.vue2.js +21 -20
- 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 +132 -128
- 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 +253 -139
- 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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HttpMethod.vue.d.ts","sourceRoot":"","sources":["../../../src/components/HttpMethod/HttpMethod.vue"],"names":[],"mappings":";eA0Ge,OAAO;YACV,MAAM;iBACD,OAAO;;;;;;;;eAFT,OAAO;YACV,MAAM;iBACD,OAAO;;;;;;;;cAFT,OAAO;gBAEL,OAAO;;
|
|
1
|
+
{"version":3,"file":"HttpMethod.vue.d.ts","sourceRoot":"","sources":["../../../src/components/HttpMethod/HttpMethod.vue"],"names":[],"mappings":";eA0Ge,OAAO;YACV,MAAM;iBACD,OAAO;;;;;;;;eAFT,OAAO;YACV,MAAM;iBACD,OAAO;;;;;;;;cAFT,OAAO;gBAEL,OAAO;;AAgIxB,wBAOG;AAOH,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,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 t from "./HttpMethod.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import o from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const f = /* @__PURE__ */ o(t, [["__scopeId", "data-v-
|
|
4
|
+
const f = /* @__PURE__ */ o(t, [["__scopeId", "data-v-5fe98831"]]);
|
|
5
5
|
export {
|
|
6
6
|
f as default
|
|
7
7
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { defineComponent as S, computed as s, openBlock as
|
|
2
|
-
import { ScalarListbox as
|
|
3
|
-
import { getRequest as
|
|
4
|
-
import { cva as
|
|
1
|
+
import { defineComponent as S, computed as s, openBlock as p, createBlock as g, unref as t, withCtx as y, createElementVNode as l, normalizeClass as r, toDisplayString as c, createElementBlock as q } from "vue";
|
|
2
|
+
import { ScalarListbox as w } from "@scalar/components";
|
|
3
|
+
import { getRequest as k, REQUEST_METHODS as x } from "@scalar/oas-utils/helpers";
|
|
4
|
+
import { cva as B, cx as m } from "cva";
|
|
5
5
|
const O = /* @__PURE__ */ S({
|
|
6
6
|
__name: "HttpMethod",
|
|
7
7
|
props: {
|
|
@@ -11,7 +11,7 @@ const O = /* @__PURE__ */ S({
|
|
|
11
11
|
},
|
|
12
12
|
emits: ["change"],
|
|
13
13
|
setup(f, { emit: b }) {
|
|
14
|
-
const i = f, h = b, o = s(() =>
|
|
14
|
+
const i = f, h = b, o = s(() => k(i.method)), n = Object.entries(x).map(
|
|
15
15
|
([e, { short: a }]) => ({
|
|
16
16
|
id: e,
|
|
17
17
|
label: e.charAt(0) + e.toLowerCase().slice(1)
|
|
@@ -19,7 +19,7 @@ const O = /* @__PURE__ */ S({
|
|
|
19
19
|
), d = s({
|
|
20
20
|
get: () => n.find(({ id: e }) => e === i.method),
|
|
21
21
|
set: (e) => (e == null ? void 0 : e.id) && h("change", e.id)
|
|
22
|
-
}), u =
|
|
22
|
+
}), u = B({
|
|
23
23
|
base: "text-center font-code text-3xs justify-center items-center flex",
|
|
24
24
|
variants: {
|
|
25
25
|
isSquare: {
|
|
@@ -32,7 +32,7 @@ const O = /* @__PURE__ */ S({
|
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
34
|
}), v = s(() => o.value.short);
|
|
35
|
-
return (e, a) => e.isEditable ? (
|
|
35
|
+
return (e, a) => e.isEditable ? (p(), g(t(w), {
|
|
36
36
|
key: 0,
|
|
37
37
|
modelValue: d.value,
|
|
38
38
|
"onUpdate:modelValue": a[0] || (a[0] = (E) => d.value = E),
|
|
@@ -43,7 +43,7 @@ const O = /* @__PURE__ */ S({
|
|
|
43
43
|
class: r(["h-full", { "pointer-events-none": !e.isEditable }])
|
|
44
44
|
}, [
|
|
45
45
|
l("button", {
|
|
46
|
-
class: r(["relative h-full", t(
|
|
46
|
+
class: r(["relative h-full", t(m)(t(u)({ isSquare: e.isSquare, isEditable: e.isEditable }), o.value.color)]),
|
|
47
47
|
type: "button"
|
|
48
48
|
}, [
|
|
49
49
|
l("span", null, c(v.value), 1)
|
|
@@ -51,9 +51,9 @@ const O = /* @__PURE__ */ S({
|
|
|
51
51
|
], 2)
|
|
52
52
|
]),
|
|
53
53
|
_: 1
|
|
54
|
-
}, 8, ["modelValue", "options"])) : (
|
|
54
|
+
}, 8, ["modelValue", "options"])) : (p(), q("div", {
|
|
55
55
|
key: 1,
|
|
56
|
-
class: r(["relative gap-1", t(
|
|
56
|
+
class: r(["relative gap-1 whitespace-nowrap", t(m)(t(u)({ isSquare: e.isSquare, isEditable: e.isEditable }), o.value.color)]),
|
|
57
57
|
type: "button"
|
|
58
58
|
}, c(o.value.short), 3));
|
|
59
59
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchModal.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Search/SearchModal.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SearchModal.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Search/SearchModal.vue"],"names":[],"mappings":"AA2PA,OAAO,EACL,KAAK,UAAU,EAKhB,MAAM,oBAAoB,CAAA;;gBAUb,UAAU;;gBAAV,UAAU;;AA4WxB,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 "./SearchModal.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import r from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const m = /* @__PURE__ */ r(o, [["__scopeId", "data-v-
|
|
4
|
+
const m = /* @__PURE__ */ r(o, [["__scopeId", "data-v-905c8bd2"]]);
|
|
5
5
|
export {
|
|
6
6
|
m as default
|
|
7
7
|
};
|
|
@@ -1,25 +1,35 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useWorkspace as
|
|
3
|
-
import { ScalarModal as
|
|
4
|
-
import { useMagicKeys as
|
|
5
|
-
import
|
|
6
|
-
import { useRouter as
|
|
7
|
-
import
|
|
8
|
-
const
|
|
1
|
+
import { defineComponent as A, ref as i, watch as M, computed as y, openBlock as w, createBlock as B, unref as d, withCtx as r, createElementVNode as h, createVNode as R, createTextVNode as m, toDisplayString as p, createElementBlock as D, Fragment as N, renderList as T, createSlots as W, pushScopeId as L, popScopeId as U } from "vue";
|
|
2
|
+
import { useWorkspace as H } from "../../store/workspace.js";
|
|
3
|
+
import { ScalarModal as K, ScalarSearchInput as P, ScalarSearchResultList as j, ScalarSearchResultItem as z } from "@scalar/components";
|
|
4
|
+
import { useMagicKeys as G, whenever as g } from "@vueuse/core";
|
|
5
|
+
import J from "fuse.js";
|
|
6
|
+
import { useRouter as O } from "vue-router";
|
|
7
|
+
import Q from "../HttpMethod/HttpMethod.vue.js";
|
|
8
|
+
const X = (u) => (L("data-v-905c8bd2"), u = u(), U(), u), Y = /* @__PURE__ */ X(() => /* @__PURE__ */ h("div", { class: "ref-search-meta" }, [
|
|
9
9
|
/* @__PURE__ */ h("span", null, "↑↓ Navigate"),
|
|
10
10
|
/* @__PURE__ */ h("span", null, "⏎ Select")
|
|
11
|
-
], -1)),
|
|
11
|
+
], -1)), re = /* @__PURE__ */ A({
|
|
12
12
|
__name: "SearchModal",
|
|
13
13
|
props: {
|
|
14
14
|
modalState: {}
|
|
15
15
|
},
|
|
16
16
|
setup(u) {
|
|
17
|
-
const c = u,
|
|
17
|
+
const c = u, E = O(), { activeWorkspaceRequests: I } = H(), v = G(), l = i([]), f = i([]), o = i(0), s = i(""), V = i(null), S = new J(l.value, {
|
|
18
18
|
keys: ["title", "description", "body"]
|
|
19
|
-
}),
|
|
19
|
+
}), F = () => {
|
|
20
|
+
s.value = "", o.value = 0, f.value = [];
|
|
21
|
+
}, _ = (e) => {
|
|
22
|
+
l.value = e.map((a) => ({
|
|
23
|
+
id: a.uid,
|
|
24
|
+
title: a.summary ?? a.method,
|
|
25
|
+
description: a.description ?? "",
|
|
26
|
+
httpVerb: a.method,
|
|
27
|
+
path: a.path
|
|
28
|
+
})), S.setCollection(l.value);
|
|
29
|
+
}, $ = () => {
|
|
20
30
|
o.value = 0, f.value = S.search(s.value);
|
|
21
31
|
};
|
|
22
|
-
|
|
32
|
+
M(
|
|
23
33
|
() => c.modalState.open,
|
|
24
34
|
(e) => {
|
|
25
35
|
var a;
|
|
@@ -27,35 +37,27 @@ const J = (u) => (T("data-v-67d6f77b"), u = u(), W(), u), Q = /* @__PURE__ */ J(
|
|
|
27
37
|
l.value.length > 0 && (l.value = [], S.setCollection(l.value));
|
|
28
38
|
return;
|
|
29
39
|
}
|
|
30
|
-
(a =
|
|
40
|
+
(a = V.value) == null || a.focus(), F(), _(I.value);
|
|
31
41
|
}
|
|
32
|
-
),
|
|
33
|
-
|
|
42
|
+
), M(
|
|
43
|
+
I,
|
|
34
44
|
(e) => {
|
|
35
|
-
|
|
36
|
-
l.value.push({
|
|
37
|
-
id: a.uid,
|
|
38
|
-
title: a.summary ?? a.method,
|
|
39
|
-
description: a.description ?? "",
|
|
40
|
-
httpVerb: a.method,
|
|
41
|
-
path: a.path
|
|
42
|
-
});
|
|
43
|
-
}), S.setCollection(l.value);
|
|
45
|
+
_(e);
|
|
44
46
|
},
|
|
45
47
|
{ immediate: !0 }
|
|
46
48
|
);
|
|
47
|
-
function
|
|
48
|
-
|
|
49
|
+
function b(e) {
|
|
50
|
+
E.push(e.item.id), c.modalState.hide();
|
|
49
51
|
}
|
|
50
|
-
const k =
|
|
52
|
+
const k = y(
|
|
51
53
|
() => n.value[o.value]
|
|
52
|
-
), n =
|
|
54
|
+
), n = y(
|
|
53
55
|
() => s.value.length === 0 ? l.value.map((e) => ({
|
|
54
56
|
item: e
|
|
55
57
|
})) : f.value
|
|
56
58
|
);
|
|
57
59
|
return g(v.enter, () => {
|
|
58
|
-
c.modalState.open && window &&
|
|
60
|
+
c.modalState.open && window && b(k.value);
|
|
59
61
|
}), g(v.ArrowDown, () => {
|
|
60
62
|
var e;
|
|
61
63
|
c.modalState.open && window && (o.value < n.value.length - 1 ? o.value++ : o.value = 0, (e = document.getElementById(`search-modal-${k.value.item.id}`)) == null || e.scrollIntoView({
|
|
@@ -68,23 +70,23 @@ const J = (u) => (T("data-v-67d6f77b"), u = u(), W(), u), Q = /* @__PURE__ */ J(
|
|
|
68
70
|
behavior: "smooth",
|
|
69
71
|
block: "center"
|
|
70
72
|
}));
|
|
71
|
-
}), (e, a) => (w(),
|
|
73
|
+
}), (e, a) => (w(), B(d(K), {
|
|
72
74
|
state: e.modalState,
|
|
73
75
|
variant: "search"
|
|
74
76
|
}, {
|
|
75
77
|
default: r(() => [
|
|
76
78
|
h("div", {
|
|
77
79
|
ref_key: "searchModalRef",
|
|
78
|
-
ref:
|
|
80
|
+
ref: V,
|
|
79
81
|
class: "ref-search-container"
|
|
80
82
|
}, [
|
|
81
|
-
R(d(
|
|
83
|
+
R(d(P), {
|
|
82
84
|
modelValue: s.value,
|
|
83
85
|
"onUpdate:modelValue": a[0] || (a[0] = (t) => s.value = t),
|
|
84
86
|
onInput: $
|
|
85
87
|
}, null, 8, ["modelValue"])
|
|
86
88
|
], 512),
|
|
87
|
-
R(d(
|
|
89
|
+
R(d(j), {
|
|
88
90
|
class: "ref-search-results custom-scroll",
|
|
89
91
|
noResults: !n.value.length
|
|
90
92
|
}, {
|
|
@@ -92,16 +94,16 @@ const J = (u) => (T("data-v-67d6f77b"), u = u(), W(), u), Q = /* @__PURE__ */ J(
|
|
|
92
94
|
m(p(s.value), 1)
|
|
93
95
|
]),
|
|
94
96
|
default: r(() => [
|
|
95
|
-
(w(!0),
|
|
97
|
+
(w(!0), D(N, null, T(n.value, (t, C) => (w(), B(d(z), {
|
|
96
98
|
id: `#search-modal-${t.item.id}`,
|
|
97
99
|
key: t.refIndex,
|
|
98
|
-
active: o.value ===
|
|
100
|
+
active: o.value === C,
|
|
99
101
|
icon: "Terminal",
|
|
100
|
-
onClick: (x) =>
|
|
101
|
-
onFocus: (x) => o.value =
|
|
102
|
-
},
|
|
102
|
+
onClick: (x) => b(t),
|
|
103
|
+
onFocus: (x) => o.value = C
|
|
104
|
+
}, W({
|
|
103
105
|
addon: r(() => [
|
|
104
|
-
R(d(
|
|
106
|
+
R(d(Q), {
|
|
105
107
|
method: t.item.httpVerb ?? "get"
|
|
106
108
|
}, null, 8, ["method"])
|
|
107
109
|
]),
|
|
@@ -127,12 +129,12 @@ const J = (u) => (T("data-v-67d6f77b"), u = u(), W(), u), Q = /* @__PURE__ */ J(
|
|
|
127
129
|
]),
|
|
128
130
|
_: 1
|
|
129
131
|
}, 8, ["noResults"]),
|
|
130
|
-
|
|
132
|
+
Y
|
|
131
133
|
]),
|
|
132
134
|
_: 1
|
|
133
135
|
}, 8, ["state"]));
|
|
134
136
|
}
|
|
135
137
|
});
|
|
136
138
|
export {
|
|
137
|
-
|
|
139
|
+
re as default
|
|
138
140
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SideNav.vue.d.ts","sourceRoot":"","sources":["../../../src/components/SideNav/SideNav.vue"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"SideNav.vue.d.ts","sourceRoot":"","sources":["../../../src/components/SideNav/SideNav.vue"],"names":[],"mappings":";AAmLA,wBAKG"}
|
|
@@ -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 m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-
|
|
4
|
+
const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-ed782b2b"]]);
|
|
5
5
|
export {
|
|
6
6
|
m as default
|
|
7
7
|
};
|
|
@@ -1,33 +1,36 @@
|
|
|
1
|
-
import { defineComponent as _, openBlock as r, createElementBlock as
|
|
2
|
-
import
|
|
3
|
-
import { ROUTES as
|
|
4
|
-
import { useRouter as
|
|
5
|
-
import
|
|
1
|
+
import { defineComponent as _, openBlock as r, createElementBlock as a, createVNode as e, createElementVNode as t, Fragment as f, renderList as d, unref as n, withCtx as p, createTextVNode as u, toDisplayString as g } from "vue";
|
|
2
|
+
import x from "../DarkModeToggle/DarkModeIconToggle.vue.js";
|
|
3
|
+
import { ROUTES as h } from "../../constants.js";
|
|
4
|
+
import { useRouter as v } from "vue-router";
|
|
5
|
+
import N from "./SideHelp.vue.js";
|
|
6
6
|
import y from "./SideNavLink.vue.js";
|
|
7
7
|
import S from "./WorkspaceProfileIcon.vue.js";
|
|
8
8
|
/* empty css */
|
|
9
9
|
const $ = {
|
|
10
10
|
"aria-label": "Side Navigation",
|
|
11
|
-
class: "text-c-2 w-15 flex flex-col items-center px-2 py-2 scalar-sidenav relative",
|
|
11
|
+
class: "text-c-2 w-15 flex flex-col items-center px-2 py-2 scalar-sidenav relative drag-region",
|
|
12
12
|
role: "navigation"
|
|
13
|
-
}, k = { class: "mt-3.5 flex flex-col gap-1.5" }, E = { class: "mt-auto flex flex-col py-1.5" }, R = { class: "flex items-center" }, V = { class: "flex items-center" }, j = /* @__PURE__ */ _({
|
|
13
|
+
}, k = { class: "mt-3.5 flex flex-col gap-1.5" }, E = { class: "mt-auto flex flex-col py-1.5" }, R = { class: "flex items-center no-drag-region" }, V = { class: "flex items-center no-drag-region" }, j = /* @__PURE__ */ _({
|
|
14
14
|
__name: "SideNav",
|
|
15
15
|
setup(w) {
|
|
16
|
-
const { currentRoute:
|
|
17
|
-
return (B, C) => (r(),
|
|
18
|
-
e(S),
|
|
16
|
+
const { currentRoute: s } = v();
|
|
17
|
+
return (B, C) => (r(), a("nav", $, [
|
|
18
|
+
e(S, { class: "no-drag-region" }),
|
|
19
19
|
t("ul", k, [
|
|
20
|
-
(r(!0),
|
|
21
|
-
var
|
|
22
|
-
return r(),
|
|
20
|
+
(r(!0), a(f, null, d(n(h), ({ icon: c, name: o, prettyName: l }, m) => {
|
|
21
|
+
var i;
|
|
22
|
+
return r(), a("li", {
|
|
23
|
+
key: m,
|
|
24
|
+
class: "no-drag-region"
|
|
25
|
+
}, [
|
|
23
26
|
e(y, {
|
|
24
|
-
active: (
|
|
25
|
-
icon:
|
|
27
|
+
active: (i = n(s).name) == null ? void 0 : i.startsWith(o),
|
|
28
|
+
icon: c,
|
|
26
29
|
name: o,
|
|
27
30
|
prettyName: l
|
|
28
31
|
}, {
|
|
29
|
-
default:
|
|
30
|
-
|
|
32
|
+
default: p(() => [
|
|
33
|
+
u(g(o), 1)
|
|
31
34
|
]),
|
|
32
35
|
_: 2
|
|
33
36
|
}, 1032, ["active", "icon", "name", "prettyName"])
|
|
@@ -36,10 +39,10 @@ const $ = {
|
|
|
36
39
|
]),
|
|
37
40
|
t("ul", E, [
|
|
38
41
|
t("li", R, [
|
|
39
|
-
e(
|
|
42
|
+
e(N)
|
|
40
43
|
]),
|
|
41
44
|
t("li", V, [
|
|
42
|
-
e(
|
|
45
|
+
e(x)
|
|
43
46
|
])
|
|
44
47
|
])
|
|
45
48
|
]));
|