@scalar/api-client 2.1.2 → 2.1.4
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 +21 -0
- package/dist/components/AddressBar/AddressBarServer.vue.d.ts.map +1 -1
- package/dist/components/AddressBar/AddressBarServer.vue.js +58 -58
- package/dist/layouts/App/create-api-client-app.d.ts.map +1 -1
- package/dist/layouts/Modal/create-api-client-modal.d.ts.map +1 -1
- package/dist/libs/create-client.d.ts.map +1 -1
- package/dist/libs/send-request.d.ts.map +1 -1
- package/dist/libs/send-request.js +63 -62
- package/dist/store/request-example.d.ts.map +1 -1
- package/dist/store/store.d.ts.map +1 -1
- package/dist/style.css +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.js +2 -2
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue2.js +77 -73
- package/dist/views/Request/RequestSection/RequestBody.vue.d.ts +0 -4
- package/dist/views/Request/RequestSection/RequestBody.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestBody.vue.js +214 -162
- package/dist/views/Request/RequestSection/RequestPathParams.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestPathParams.vue.js +38 -37
- package/dist/views/Request/RequestSection/RequestSection.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestSection.vue.js +5 -8
- package/dist/views/Request/RequestSidebar.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSidebar.vue.js +2 -2
- package/dist/views/Request/RequestSidebar.vue2.js +164 -153
- package/dist/views/Request/RequestSidebarItem.vue.d.ts +7 -0
- 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 +230 -263
- package/dist/views/Request/RequestSidebarItemMenu.vue.d.ts +8 -30
- package/dist/views/Request/RequestSidebarItemMenu.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSidebarItemMenu.vue.js +1 -1
- package/dist/views/Request/RequestSidebarItemMenu.vue2.js +131 -81
- package/dist/views/Request/types/index.d.ts +2 -0
- package/dist/views/Request/types/index.d.ts.map +1 -0
- package/dist/views/Request/types/index.js +1 -0
- package/dist/views/Request/types/sidebar-item.d.ts +23 -0
- package/dist/views/Request/types/sidebar-item.d.ts.map +1 -0
- package/package.json +11 -6
|
@@ -1,65 +1,66 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as $, computed as K, watch as E, openBlock as d, createBlock as f, withCtx as y, createTextVNode as x, toDisplayString as q, createElementBlock as C, createElementVNode as w } from "vue";
|
|
2
2
|
import P from "../../../components/ViewLayout/ViewLayoutCollapse.vue.js";
|
|
3
3
|
import V from "./RequestTable.vue.js";
|
|
4
|
-
import {
|
|
5
|
-
|
|
4
|
+
import { pathRegex as M } from "@scalar/oas-utils/helpers";
|
|
5
|
+
import { useWorkspace as B } from "../../../store/store.js";
|
|
6
|
+
const N = {
|
|
6
7
|
key: 1,
|
|
7
8
|
class: "text-c-3 px-4 text-sm border rounded min-h-12 justify-center flex items-center bg-b-1 mx-1"
|
|
8
|
-
},
|
|
9
|
+
}, U = /* @__PURE__ */ w("code", { class: "bg-b-2 ml-1 px-1 rounded" }, "/endpoint/{my_path_variable}", -1), S = /* @__PURE__ */ $({
|
|
9
10
|
__name: "RequestPathParams",
|
|
10
11
|
props: {
|
|
11
12
|
title: {},
|
|
12
13
|
paramKey: {}
|
|
13
14
|
},
|
|
14
|
-
setup(
|
|
15
|
-
const o =
|
|
15
|
+
setup(g) {
|
|
16
|
+
const o = g, {
|
|
16
17
|
activeRequest: s,
|
|
17
|
-
activeExample:
|
|
18
|
+
activeExample: n,
|
|
18
19
|
requestMutators: h,
|
|
19
20
|
requestExampleMutators: v
|
|
20
|
-
} =
|
|
21
|
-
const e =
|
|
22
|
-
return e ? e.parameters[o.paramKey].map((
|
|
21
|
+
} = B(), u = K(() => {
|
|
22
|
+
const e = n.value;
|
|
23
|
+
return e ? e.parameters[o.paramKey].map((r) => {
|
|
23
24
|
var a;
|
|
24
25
|
return {
|
|
25
|
-
...
|
|
26
|
-
enum:
|
|
26
|
+
...r,
|
|
27
|
+
enum: r.enum || ((a = e.serverVariables) == null ? void 0 : a[r.key])
|
|
27
28
|
};
|
|
28
29
|
}) : [];
|
|
29
|
-
}), _ = (e,
|
|
30
|
-
var
|
|
31
|
-
if (!s.value || !
|
|
32
|
-
const
|
|
33
|
-
if (
|
|
34
|
-
if ((t =
|
|
30
|
+
}), _ = (e, r, a) => {
|
|
31
|
+
var l, t;
|
|
32
|
+
if (!s.value || !n.value) return;
|
|
33
|
+
const p = n.value.parameters[o.paramKey], c = (l = p[e]) == null ? void 0 : l.key;
|
|
34
|
+
if (r === "key") {
|
|
35
|
+
if ((t = p[e]) != null && t.required)
|
|
35
36
|
return;
|
|
36
37
|
if (a) {
|
|
37
|
-
const i = encodeURIComponent(
|
|
38
|
+
const i = encodeURIComponent(c), m = encodeURIComponent(a), k = new RegExp(`(?<=/):${i}(?=[/?#]|$)`, "g"), R = s.value.path.replace(
|
|
38
39
|
k,
|
|
39
40
|
`:${m}`
|
|
40
41
|
);
|
|
41
|
-
h.edit(s.value.uid, "path",
|
|
42
|
+
h.edit(s.value.uid, "path", R);
|
|
42
43
|
} else {
|
|
43
|
-
|
|
44
|
-
const i = new RegExp(`/:${encodeURIComponent(
|
|
44
|
+
p.splice(e, 1);
|
|
45
|
+
const i = new RegExp(`/:${encodeURIComponent(c)}(?=[/?#]|$)`, "g"), m = s.value.path.replace(i, "");
|
|
45
46
|
h.edit(s.value.uid, "path", m);
|
|
46
47
|
}
|
|
47
48
|
}
|
|
48
49
|
v.edit(
|
|
49
|
-
|
|
50
|
-
`parameters.${o.paramKey}.${e}.${
|
|
50
|
+
n.value.uid,
|
|
51
|
+
`parameters.${o.paramKey}.${e}.${r}`,
|
|
51
52
|
a
|
|
52
53
|
);
|
|
53
54
|
}, b = (e) => {
|
|
54
|
-
var
|
|
55
|
-
if (!
|
|
56
|
-
const
|
|
57
|
-
(t) =>
|
|
55
|
+
var l;
|
|
56
|
+
if (!n.value) return;
|
|
57
|
+
const r = ((l = e.match(M)) == null ? void 0 : l.map((t) => t.slice(1, -1))) || [], a = n.value.parameters[o.paramKey], p = new Map(a.map((t) => [t.key, t])), c = r.map(
|
|
58
|
+
(t) => p.get(t) || { key: t, value: "", enabled: !0 }
|
|
58
59
|
);
|
|
59
60
|
a.forEach((t) => {
|
|
60
|
-
!
|
|
61
|
-
}), a.splice(0, a.length, ...
|
|
62
|
-
|
|
61
|
+
!r.includes(t.key) && (t.value || t.required) && c.push(t);
|
|
62
|
+
}), a.splice(0, a.length, ...c), v.edit(
|
|
63
|
+
n.value.uid,
|
|
63
64
|
`parameters.${o.paramKey}`,
|
|
64
65
|
a
|
|
65
66
|
);
|
|
@@ -72,11 +73,11 @@ const B = {
|
|
|
72
73
|
(e) => {
|
|
73
74
|
e && b(e);
|
|
74
75
|
}
|
|
75
|
-
), (e,
|
|
76
|
+
), (e, r) => (d(), f(P, {
|
|
76
77
|
itemCount: u.value.length
|
|
77
78
|
}, {
|
|
78
79
|
title: y(() => [
|
|
79
|
-
|
|
80
|
+
x(q(e.title), 1)
|
|
80
81
|
]),
|
|
81
82
|
default: y(() => [
|
|
82
83
|
u.value.length ? (d(), f(V, {
|
|
@@ -85,9 +86,9 @@ const B = {
|
|
|
85
86
|
isEnabledHidden: "",
|
|
86
87
|
items: u.value,
|
|
87
88
|
onUpdateRow: _
|
|
88
|
-
}, null, 8, ["items"])) : (d(), C("div",
|
|
89
|
-
|
|
90
|
-
|
|
89
|
+
}, null, 8, ["items"])) : (d(), C("div", N, [
|
|
90
|
+
x(" You can use variables in your path: "),
|
|
91
|
+
U
|
|
91
92
|
]))
|
|
92
93
|
]),
|
|
93
94
|
_: 1
|
|
@@ -95,5 +96,5 @@ const B = {
|
|
|
95
96
|
}
|
|
96
97
|
});
|
|
97
98
|
export {
|
|
98
|
-
|
|
99
|
+
S as default
|
|
99
100
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RequestSection.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/RequestSection/RequestSection.vue"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"RequestSection.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/RequestSection/RequestSection.vue"],"names":[],"mappings":";AAsaA,wBAKG"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent as R, computed as _, ref as g, watch as C, openBlock as c, createBlock as w, withCtx as x, createVNode as n, unref as a, createElementVNode as A, createTextVNode as H, createElementBlock as d, createCommentVNode as N, toDisplayString as
|
|
2
|
-
import
|
|
1
|
+
import { defineComponent as R, computed as _, ref as g, watch as C, openBlock as c, createBlock as w, withCtx as x, createVNode as n, unref as a, createElementVNode as A, createTextVNode as H, createElementBlock as d, createCommentVNode as N, toDisplayString as V, withDirectives as r, vShow as u } from "vue";
|
|
2
|
+
import b from "../../../components/ContextBar.vue.js";
|
|
3
3
|
import E from "../../../components/ViewLayout/ViewLayoutSection.vue.js";
|
|
4
4
|
import K from "./RequestBody.vue.js";
|
|
5
5
|
import p from "./RequestParams.vue.js";
|
|
@@ -57,7 +57,7 @@ const M = { class: "flex-1 flex gap-1 items-center pointer-events-none" }, P = {
|
|
|
57
57
|
A("div", M, [
|
|
58
58
|
H(" Request "),
|
|
59
59
|
a(m) ? N("", !0) : (c(), d("label", P)),
|
|
60
|
-
a(m) ? (c(), d("span", L,
|
|
60
|
+
a(m) ? (c(), d("span", L, V((i = a(o)) == null ? void 0 : i.summary), 1)) : (c(), d("input", {
|
|
61
61
|
key: 1,
|
|
62
62
|
id: "requestname",
|
|
63
63
|
class: "outline-none border-0 text-c-2 rounded pointer-events-auto relative w-full",
|
|
@@ -72,7 +72,7 @@ const M = { class: "flex-1 flex gap-1 items-center pointer-events-none" }, P = {
|
|
|
72
72
|
var s, i, y;
|
|
73
73
|
return [
|
|
74
74
|
A("div", O, [
|
|
75
|
-
n(
|
|
75
|
+
n(b, {
|
|
76
76
|
activeSection: e.value,
|
|
77
77
|
sections: q.value,
|
|
78
78
|
onSetActiveSection: l[0] || (l[0] = (B) => e.value = B)
|
|
@@ -110,10 +110,7 @@ const M = { class: "flex-1 flex gap-1 items-center pointer-events-none" }, P = {
|
|
|
110
110
|
}, null, 512), [
|
|
111
111
|
[u, e.value === "All" || e.value === "Query"]
|
|
112
112
|
]),
|
|
113
|
-
r(n(K, {
|
|
114
|
-
body: "foo",
|
|
115
|
-
title: "Body"
|
|
116
|
-
}, null, 512), [
|
|
113
|
+
r(n(K, { title: "Body" }, null, 512), [
|
|
117
114
|
[
|
|
118
115
|
u,
|
|
119
116
|
a(o) && (e.value === "All" || e.value === "Body") && a(v)(a(o).method)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RequestSidebar.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Request/RequestSidebar.vue"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"RequestSidebar.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Request/RequestSidebar.vue"],"names":[],"mappings":";iBAiPe,OAAO;gBACR,OAAO;;;;cAMkB,MAAM;aAAO,MAAM;;;iBAP3C,OAAO;gBACR,OAAO;;;cAMkB,MAAM;aAAO,MAAM;;;;AA0gB1D,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"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./RequestSidebar.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const d = /* @__PURE__ */ t(o, [["__scopeId", "data-v-d4db0c38"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
d as default
|
|
7
7
|
};
|
|
@@ -1,179 +1,190 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import { useSearch as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
|
|
1
|
+
import { defineComponent as J, reactive as Q, watch as X, onBeforeMount as Y, onMounted as Z, onBeforeUnmount as _, openBlock as r, createElementBlock as c, Fragment as b, withDirectives as ee, createVNode as l, unref as t, normalizeClass as f, createSlots as te, withCtx as a, createElementVNode as h, isRef as oe, withKeys as S, withModifiers as u, createBlock as m, renderList as I, createTextVNode as D, toDisplayString as se, createCommentVNode as $, vShow as re } from "vue";
|
|
2
|
+
import ae from "../../components/HttpMethod/HttpMethod.vue.js";
|
|
3
|
+
import { useSearch as ne } from "../../components/Search/useSearch.js";
|
|
4
|
+
import ie from "../../components/Sidebar/SidebarButton.vue.js";
|
|
5
|
+
import le from "./RequestSidebarItemMenu.vue.js";
|
|
6
|
+
import { dragHandlerFactory as de } from "./handle-drag.js";
|
|
7
|
+
import { ScalarSearchInput as ue, ScalarSearchResultList as me, ScalarSearchResultItem as pe, ScalarIcon as B } from "@scalar/components";
|
|
8
|
+
import fe from "./RequestSidebarItem.vue.js";
|
|
9
|
+
import ce from "../../components/Sidebar/Sidebar.vue.js";
|
|
10
|
+
import be from "./components/WorkspaceDropdown.vue.js";
|
|
11
|
+
import { useSidebar as he } from "../../hooks/useSidebar.js";
|
|
12
|
+
import { useWorkspace as Se } from "../../store/store.js";
|
|
13
|
+
import { hotKeyBus as x } from "../../libs/event-busses/hot-keys-bus.js";
|
|
14
|
+
import { commandPaletteBus as V } from "../../libs/event-busses/command-palette-bus.js";
|
|
15
|
+
const ve = { class: "search-button-fade sticky px-3 py-2.5 top-0 z-50" }, Me = /* @__PURE__ */ J({
|
|
15
16
|
__name: "RequestSidebar",
|
|
16
17
|
props: {
|
|
17
18
|
showSidebar: { type: Boolean },
|
|
18
19
|
isReadonly: { type: Boolean }
|
|
19
20
|
},
|
|
20
21
|
emits: ["update:showSidebar", "newTab"],
|
|
21
|
-
setup(
|
|
22
|
-
const
|
|
23
|
-
activeWorkspaceCollections:
|
|
24
|
-
activeRequest:
|
|
22
|
+
setup(E, { emit: F }) {
|
|
23
|
+
const M = E, v = F, R = Se(), {
|
|
24
|
+
activeWorkspaceCollections: q,
|
|
25
|
+
activeRequest: T,
|
|
25
26
|
activeWorkspaceRequests: N,
|
|
26
|
-
findRequestParents:
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
findRequestParents: O,
|
|
28
|
+
isReadOnly: P
|
|
29
|
+
} = R, { handleDragEnd: z, isDroppable: K } = de(R), { collapsedSidebarFolders: U, setCollapsedSidebarFolder: W } = he(), d = Q({ open: !1 });
|
|
30
|
+
X(
|
|
31
|
+
T,
|
|
30
32
|
(s) => {
|
|
31
|
-
s &&
|
|
32
|
-
(
|
|
33
|
+
s && O(s).forEach(
|
|
34
|
+
(e) => W(e, !0)
|
|
33
35
|
);
|
|
34
36
|
},
|
|
35
37
|
{ immediate: !0 }
|
|
36
38
|
);
|
|
37
39
|
const {
|
|
38
40
|
searchText: p,
|
|
39
|
-
searchResultsWithPlaceholderResults:
|
|
40
|
-
selectedSearchResult:
|
|
41
|
-
onSearchResultClick:
|
|
42
|
-
fuseSearch:
|
|
43
|
-
searchInputRef:
|
|
44
|
-
searchResultRefs:
|
|
45
|
-
navigateSearchResults:
|
|
46
|
-
selectSearchResult:
|
|
47
|
-
} =
|
|
48
|
-
var
|
|
49
|
-
s.toggleSidebar &&
|
|
41
|
+
searchResultsWithPlaceholderResults: w,
|
|
42
|
+
selectedSearchResult: g,
|
|
43
|
+
onSearchResultClick: H,
|
|
44
|
+
fuseSearch: L,
|
|
45
|
+
searchInputRef: k,
|
|
46
|
+
searchResultRefs: j,
|
|
47
|
+
navigateSearchResults: y,
|
|
48
|
+
selectSearchResult: A
|
|
49
|
+
} = ne(), C = (s) => {
|
|
50
|
+
var e;
|
|
51
|
+
s.toggleSidebar && v("update:showSidebar", M.showSidebar), s.openCommandPalette && (s.openCommandPalette.preventDefault(), V.emit()), s.focusRequestSearch && ((e = k.value) == null || e.focus());
|
|
50
52
|
};
|
|
51
|
-
return
|
|
52
|
-
|
|
53
|
-
}),
|
|
54
|
-
|
|
55
|
-
}), (s,
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
"pb-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
53
|
+
return Y(() => console.time("sidebar")), Z(() => {
|
|
54
|
+
x.on(C), setTimeout(() => console.timeEnd("sidebar"), 0);
|
|
55
|
+
}), _(() => {
|
|
56
|
+
x.off(C);
|
|
57
|
+
}), (s, e) => (r(), c(b, null, [
|
|
58
|
+
ee(l(t(ce), {
|
|
59
|
+
class: f([s.showSidebar ? "sidebar-active-width" : ""]),
|
|
60
|
+
showSidebar: s.showSidebar,
|
|
61
|
+
"onUpdate:showSidebar": e[8] || (e[8] = (o) => s.$emit("update:showSidebar", o))
|
|
62
|
+
}, te({
|
|
63
|
+
content: a(() => [
|
|
64
|
+
h("div", ve, [
|
|
65
|
+
l(t(ue), {
|
|
66
|
+
ref_key: "searchInputRef",
|
|
67
|
+
ref: k,
|
|
68
|
+
modelValue: t(p),
|
|
69
|
+
"onUpdate:modelValue": e[0] || (e[0] = (o) => oe(p) ? p.value = o : null),
|
|
70
|
+
sidebar: "",
|
|
71
|
+
onInput: t(L),
|
|
72
|
+
onKeydown: [
|
|
73
|
+
e[1] || (e[1] = S(u((o) => t(y)("down"), ["stop"]), ["down"])),
|
|
74
|
+
e[2] || (e[2] = S(u((o) => t(A)(), ["stop"]), ["enter"])),
|
|
75
|
+
e[3] || (e[3] = S(u((o) => t(y)("up"), ["stop"]), ["up"]))
|
|
76
|
+
]
|
|
77
|
+
}, null, 8, ["modelValue", "onInput"])
|
|
78
|
+
]),
|
|
79
|
+
h("div", {
|
|
80
|
+
class: f(["custom-scroll flex flex-1 flex-col overflow-visible px-3 pb-3 pt-0", {
|
|
81
|
+
"pb-14": !s.isReadonly
|
|
82
|
+
}]),
|
|
83
|
+
onDragenter: e[6] || (e[6] = u(() => {
|
|
84
|
+
}, ["prevent"])),
|
|
85
|
+
onDragover: e[7] || (e[7] = u(() => {
|
|
86
|
+
}, ["prevent"]))
|
|
87
|
+
}, [
|
|
88
|
+
t(p) ? (r(), m(t(me), {
|
|
89
|
+
key: 0,
|
|
90
|
+
class: "gap-px custom-scroll",
|
|
91
|
+
noResults: !t(w).length
|
|
92
|
+
}, {
|
|
93
|
+
default: a(() => [
|
|
94
|
+
(r(!0), c(b, null, I(t(w), (o, i) => (r(), m(t(pe), {
|
|
95
|
+
id: `#search-input-${o.item.id}`,
|
|
96
|
+
key: o.refIndex,
|
|
97
|
+
ref_for: !0,
|
|
98
|
+
ref: (n) => t(j)[i] = n,
|
|
99
|
+
active: t(g) === i,
|
|
100
|
+
class: "px-2",
|
|
101
|
+
onClick: (n) => t(H)(o),
|
|
102
|
+
onFocus: (n) => g.value = i
|
|
103
|
+
}, {
|
|
104
|
+
addon: a(() => [
|
|
105
|
+
l(ae, {
|
|
106
|
+
class: "font-bold",
|
|
107
|
+
method: o.item.httpVerb ?? "get"
|
|
108
|
+
}, null, 8, ["method"])
|
|
109
|
+
]),
|
|
110
|
+
default: a(() => [
|
|
111
|
+
D(se(o.item.title) + " ", 1)
|
|
112
|
+
]),
|
|
113
|
+
_: 2
|
|
114
|
+
}, 1032, ["id", "active", "onClick", "onFocus"]))), 128))
|
|
115
|
+
]),
|
|
116
|
+
_: 1
|
|
117
|
+
}, 8, ["noResults"])) : (r(!0), c(b, { key: 1 }, I(t(q), (o) => {
|
|
118
|
+
var i;
|
|
119
|
+
return r(), m(fe, {
|
|
120
|
+
key: o.uid,
|
|
121
|
+
isDraggable: !s.isReadonly && ((i = o.info) == null ? void 0 : i.title) !== "Drafts",
|
|
122
|
+
isDroppable: t(K),
|
|
123
|
+
menuItem: d,
|
|
124
|
+
parentUids: [],
|
|
125
|
+
uid: o.uid,
|
|
126
|
+
onNewTab: e[4] || (e[4] = (n, G) => v("newTab", { name: n, uid: G })),
|
|
127
|
+
onOnDragEnd: t(z),
|
|
128
|
+
onOpenMenu: e[5] || (e[5] = (n) => Object.assign(d, n))
|
|
100
129
|
}, {
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
class: "
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
130
|
+
leftIcon: a(() => [
|
|
131
|
+
l(t(B), {
|
|
132
|
+
class: "text-sidebar-c-2 text-sm group-hover:hidden",
|
|
133
|
+
icon: "CodeFolder",
|
|
134
|
+
size: "sm",
|
|
135
|
+
thickness: "2"
|
|
136
|
+
}),
|
|
137
|
+
h("div", {
|
|
138
|
+
class: f({
|
|
139
|
+
"rotate-90": t(U)[o.uid]
|
|
140
|
+
})
|
|
141
|
+
}, [
|
|
142
|
+
l(t(B), {
|
|
143
|
+
class: "text-c-3 hidden text-sm group-hover:block",
|
|
144
|
+
icon: "ChevronRight",
|
|
145
|
+
size: "sm"
|
|
146
|
+
})
|
|
147
|
+
], 2)
|
|
109
148
|
]),
|
|
110
149
|
_: 2
|
|
111
|
-
}, 1032, ["
|
|
150
|
+
}, 1032, ["isDraggable", "isDroppable", "menuItem", "uid", "onOnDragEnd"]);
|
|
151
|
+
}), 128))
|
|
152
|
+
], 34)
|
|
153
|
+
]),
|
|
154
|
+
button: a(() => [
|
|
155
|
+
s.isReadonly ? $("", !0) : (r(), m(ie, {
|
|
156
|
+
key: 0,
|
|
157
|
+
class: f({
|
|
158
|
+
"empty-sidebar-item": t(N).length === 1
|
|
159
|
+
}),
|
|
160
|
+
click: t(V).emit
|
|
161
|
+
}, {
|
|
162
|
+
title: a(() => [
|
|
163
|
+
D("Add Item")
|
|
112
164
|
]),
|
|
113
165
|
_: 1
|
|
114
|
-
}, 8, ["
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
onNewTab: t[4] || (t[4] = (n, O) => h("newTab", { name: n, uid: O })),
|
|
123
|
-
onOnDragEnd: e(T)
|
|
124
|
-
}, {
|
|
125
|
-
leftIcon: r(() => [
|
|
126
|
-
d(e(I), {
|
|
127
|
-
class: "text-sidebar-c-2 text-sm group-hover:hidden",
|
|
128
|
-
icon: "CodeFolder",
|
|
129
|
-
size: "sm",
|
|
130
|
-
thickness: "2"
|
|
131
|
-
}),
|
|
132
|
-
c("div", {
|
|
133
|
-
class: m({
|
|
134
|
-
"rotate-90": e(K)[o.uid]
|
|
135
|
-
})
|
|
136
|
-
}, [
|
|
137
|
-
d(e(I), {
|
|
138
|
-
class: "text-c-3 hidden text-sm group-hover:block",
|
|
139
|
-
icon: "ChevronRight",
|
|
140
|
-
size: "sm"
|
|
141
|
-
})
|
|
142
|
-
], 2)
|
|
143
|
-
]),
|
|
144
|
-
_: 2
|
|
145
|
-
}, 1032, ["isDraggable", "isDroppable", "uid", "onOnDragEnd"]);
|
|
146
|
-
}), 128))
|
|
147
|
-
], 34)
|
|
148
|
-
]),
|
|
149
|
-
button: r(() => [
|
|
150
|
-
s.isReadonly ? _("", !0) : (a(), l(se, {
|
|
151
|
-
key: 0,
|
|
152
|
-
class: m({
|
|
153
|
-
"empty-sidebar-item": e(N).length === 1
|
|
154
|
-
}),
|
|
155
|
-
click: e(x).emit
|
|
156
|
-
}, {
|
|
157
|
-
title: r(() => [
|
|
158
|
-
D("Add Item")
|
|
166
|
+
}, 8, ["class", "click"]))
|
|
167
|
+
]),
|
|
168
|
+
_: 2
|
|
169
|
+
}, [
|
|
170
|
+
s.isReadonly ? void 0 : {
|
|
171
|
+
name: "header",
|
|
172
|
+
fn: a(() => [
|
|
173
|
+
l(t(be))
|
|
159
174
|
]),
|
|
160
|
-
|
|
161
|
-
}
|
|
175
|
+
key: "0"
|
|
176
|
+
}
|
|
177
|
+
]), 1032, ["class", "showSidebar"]), [
|
|
178
|
+
[re, s.showSidebar]
|
|
162
179
|
]),
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
]),
|
|
170
|
-
key: "0"
|
|
171
|
-
}
|
|
172
|
-
]), 1032, ["class", "showSidebar"])), [
|
|
173
|
-
[ee, s.showSidebar]
|
|
174
|
-
]);
|
|
180
|
+
!t(P) && d ? (r(), m(le, {
|
|
181
|
+
key: 0,
|
|
182
|
+
menuItem: d,
|
|
183
|
+
onCloseMenu: e[9] || (e[9] = (o) => d.open = !1)
|
|
184
|
+
}, null, 8, ["menuItem"])) : $("", !0)
|
|
185
|
+
], 64));
|
|
175
186
|
}
|
|
176
187
|
});
|
|
177
188
|
export {
|
|
178
|
-
|
|
189
|
+
Me as default
|
|
179
190
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { SidebarMenuItem } from '../../views/Request/types/index.js';
|
|
1
2
|
import { type DraggableProps, type DraggingItem, type HoveredItem } from '@scalar/draggable';
|
|
2
3
|
declare function __VLS_template(): Readonly<{
|
|
3
4
|
leftIcon(): void;
|
|
@@ -21,6 +22,8 @@ declare const __VLS_component: import("vue").DefineComponent<__VLS_WithDefaults<
|
|
|
21
22
|
parentUids: string[];
|
|
22
23
|
/** uid of a Collection, Tag, Request or RequestExample */
|
|
23
24
|
uid: string;
|
|
25
|
+
/** To keep track of the menu being open */
|
|
26
|
+
menuItem: SidebarMenuItem;
|
|
24
27
|
}>, {
|
|
25
28
|
isDraggable: boolean;
|
|
26
29
|
isDroppable: boolean;
|
|
@@ -28,6 +31,7 @@ declare const __VLS_component: import("vue").DefineComponent<__VLS_WithDefaults<
|
|
|
28
31
|
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
29
32
|
onDragEnd: (draggingItem: DraggingItem, hoveredItem: HoveredItem) => void;
|
|
30
33
|
newTab: (name: string, uid: string) => void;
|
|
34
|
+
openMenu: (menuItem: SidebarMenuItem) => void;
|
|
31
35
|
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<{
|
|
32
36
|
/**
|
|
33
37
|
* Toggle dragging on and off
|
|
@@ -45,6 +49,8 @@ declare const __VLS_component: import("vue").DefineComponent<__VLS_WithDefaults<
|
|
|
45
49
|
parentUids: string[];
|
|
46
50
|
/** uid of a Collection, Tag, Request or RequestExample */
|
|
47
51
|
uid: string;
|
|
52
|
+
/** To keep track of the menu being open */
|
|
53
|
+
menuItem: SidebarMenuItem;
|
|
48
54
|
}>, {
|
|
49
55
|
isDraggable: boolean;
|
|
50
56
|
isDroppable: boolean;
|
|
@@ -52,6 +58,7 @@ declare const __VLS_component: import("vue").DefineComponent<__VLS_WithDefaults<
|
|
|
52
58
|
}>>> & {
|
|
53
59
|
onOnDragEnd?: ((draggingItem: DraggingItem, hoveredItem: HoveredItem) => any) | undefined;
|
|
54
60
|
onNewTab?: ((name: string, uid: string) => any) | undefined;
|
|
61
|
+
onOpenMenu?: ((menuItem: SidebarMenuItem) => any) | undefined;
|
|
55
62
|
}, {
|
|
56
63
|
isDroppable: boolean | ((draggingItem: DraggingItem, hoveredItem: HoveredItem) => boolean);
|
|
57
64
|
isDraggable: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RequestSidebarItem.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Request/RequestSidebarItem.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RequestSidebarItem.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Request/RequestSidebarItem.vue"],"names":[],"mappings":"AAwbA,OAAO,KAAK,EAAe,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAEzE,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,KAAK,WAAW,EACjB,MAAM,mBAAmB,CAAA;AAmO1B,iBAAS,cAAc;gBA5LT,IAAI;;gBAAJ,IAAI;EAyvBjB;AACD,QAAA,MAAM,eAAe;IAzxBjB;;;;OAIG;kBACW,OAAO;IACrB;;;;OAIG;kBACW,cAAc,CAAC,aAAa,CAAC;IAC3C,oEAAoE;gBACxD,MAAM,EAAE;IACpB,0DAA0D;SACrD,MAAM;IACX,2CAA2C;cACjC,eAAe;;;;;;;;;;IAjBzB;;;;OAIG;kBACW,OAAO;IACrB;;;;OAIG;kBACW,cAAc,CAAC,aAAa,CAAC;IAC3C,oEAAoE;gBACxD,MAAM,EAAE;IACpB,0DAA0D;SACrD,MAAM;IACX,2CAA2C;cACjC,eAAe;;;;;;;;;;;iBAZX,OAAO;MA2xBvB,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"}
|
|
@@ -2,7 +2,7 @@ import t from "./RequestSidebarItem.vue2.js";
|
|
|
2
2
|
/* empty css */
|
|
3
3
|
/* empty css */
|
|
4
4
|
import o from "../../_virtual/_plugin-vue_export-helper.js";
|
|
5
|
-
const a = /* @__PURE__ */ o(t, [["__scopeId", "data-v-
|
|
5
|
+
const a = /* @__PURE__ */ o(t, [["__scopeId", "data-v-49b059d4"]]);
|
|
6
6
|
export {
|
|
7
7
|
a as default
|
|
8
8
|
};
|