@scalar/api-client 2.1.6 → 2.1.8
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/CommandPalette/CommandPaletteCollection.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/CommandPaletteCollection.vue.js +48 -21
- package/dist/components/DataTable/DataTableInput.vue.d.ts +1 -1
- package/dist/components/DataTable/DataTableInput.vue.d.ts.map +1 -1
- package/dist/components/HttpMethod/HttpMethod.vue.d.ts +2 -2
- package/dist/components/IconSelector.vue.d.ts +35 -0
- package/dist/components/IconSelector.vue.d.ts.map +1 -0
- package/dist/components/IconSelector.vue.js +73 -0
- package/dist/components/IconSelector.vue2.js +4 -0
- package/dist/components/Sidebar/Actions/EditSidebarListCollection.vue.d.ts +24 -0
- package/dist/components/Sidebar/Actions/EditSidebarListCollection.vue.d.ts.map +1 -0
- package/dist/components/Sidebar/Actions/EditSidebarListCollection.vue.js +58 -0
- package/dist/components/Sidebar/Actions/EditSidebarListCollection.vue2.js +4 -0
- package/dist/components/Sidebar/Actions/{RenameSidebarListElement.vue.d.ts → EditSidebarListElement.vue.d.ts} +3 -3
- package/dist/components/Sidebar/Actions/EditSidebarListElement.vue.d.ts.map +1 -0
- package/dist/components/Sidebar/Actions/{RenameSidebarListElement.vue.js → EditSidebarListElement.vue.js} +9 -9
- package/dist/components/Sidebar/Actions/EditSidebarListElement.vue2.js +4 -0
- package/dist/layouts/App/create-api-client-app.d.ts +32 -20
- package/dist/layouts/App/create-api-client-app.d.ts.map +1 -1
- package/dist/layouts/Modal/create-api-client-modal.d.ts +64 -40
- package/dist/layouts/Modal/create-api-client-modal.d.ts.map +1 -1
- package/dist/libs/create-client.d.ts +32 -20
- package/dist/libs/create-client.d.ts.map +1 -1
- package/dist/libs/environment-parser.js +8 -8
- package/dist/libs/event-busses/hot-keys-bus.d.ts +1 -1
- package/dist/store/collections.d.ts +14 -4
- package/dist/store/collections.d.ts.map +1 -1
- package/dist/store/request-example.d.ts +2 -2
- package/dist/store/requests.d.ts +2 -2
- package/dist/store/security-schemes.d.ts +4 -4
- package/dist/store/store.d.ts +64 -40
- package/dist/store/store.d.ts.map +1 -1
- package/dist/store/tags.d.ts +4 -4
- package/dist/store/workspace.d.ts +4 -4
- package/dist/style.css +1 -1
- package/dist/views/Environment/Environment.vue.d.ts.map +1 -1
- package/dist/views/Environment/Environment.vue2.js +19 -18
- 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 +73 -74
- package/dist/views/Request/RequestSidebarItem.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSidebarItem.vue.js +2 -2
- package/dist/views/Request/RequestSidebarItem.vue2.js +94 -91
- 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 +93 -79
- package/dist/views/Request/components/WorkspaceDropdown.vue.d.ts.map +1 -1
- package/dist/views/Request/components/WorkspaceDropdown.vue.js +109 -95
- package/dist/views/Request/types/sidebar-item.d.ts +2 -1
- package/dist/views/Request/types/sidebar-item.d.ts.map +1 -1
- package/package.json +8 -7
- package/dist/components/Sidebar/Actions/RenameSidebarListElement.vue.d.ts.map +0 -1
- package/dist/components/Sidebar/Actions/RenameSidebarListElement.vue2.js +0 -4
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { defineComponent as te, useCssVars as ie, computed as c, ref as ne, resolveComponent as re, openBlock as p, createElementBlock as
|
|
2
|
-
import { PathId as
|
|
3
|
-
import { ScalarButton as
|
|
1
|
+
import { defineComponent as te, useCssVars as ie, computed as c, ref as ne, resolveComponent as re, openBlock as p, createElementBlock as w, normalizeClass as m, unref as n, createVNode as h, withCtx as y, createBlock as b, withModifiers as R, createElementVNode as d, toDisplayString as B, createCommentVNode as g, createTextVNode as j, renderSlot as le, Fragment as se, renderList as ae, pushScopeId as oe, popScopeId as de } from "vue";
|
|
2
|
+
import { PathId as ue } from "../../router.js";
|
|
3
|
+
import { ScalarButton as $, ScalarIcon as q } from "@scalar/components";
|
|
4
4
|
import { Draggable as pe } from "@scalar/draggable";
|
|
5
5
|
import { RouterLink as fe } from "vue-router";
|
|
6
6
|
import me from "../../components/HttpMethod/HttpMethod.vue.js";
|
|
@@ -8,7 +8,7 @@ import { useSidebar as ce } from "../../hooks/useSidebar.js";
|
|
|
8
8
|
import { getModifiers as be } from "../../libs/event-busses/hot-keys-bus.js";
|
|
9
9
|
import { useWorkspace as ge } from "../../store/store.js";
|
|
10
10
|
import { commandPaletteBus as ve } from "../../libs/event-busses/command-palette-bus.js";
|
|
11
|
-
const
|
|
11
|
+
const V = (v) => (oe("data-v-d3581d0d"), v = v(), de(), v), he = { class: "flex flex-row gap-1 items-center" }, ye = { class: "relative" }, xe = { class: "flex items-start" }, ke = { class: "z-10 flex h-5 items-center justify-center max-w-[14px]" }, we = { class: "flex flex-1 flex-row justify-between editable-sidebar-hover" }, qe = { class: "relative flex h-fit" }, Ue = /* @__PURE__ */ V(() => /* @__PURE__ */ d("span", null, " ", -1)), De = { key: 2 }, Ce = /* @__PURE__ */ V(() => /* @__PURE__ */ d("span", null, "Add Request", -1)), P = "hover:bg-sidebar-active-b indent-padding-left", Be = /* @__PURE__ */ te({
|
|
12
12
|
__name: "RequestSidebarItem",
|
|
13
13
|
props: {
|
|
14
14
|
isDraggable: { type: Boolean, default: !1 },
|
|
@@ -18,44 +18,47 @@ const P = (v) => (oe("data-v-4a6dd4d2"), v = v(), ue(), v), he = { class: "flex
|
|
|
18
18
|
menuItem: {}
|
|
19
19
|
},
|
|
20
20
|
emits: ["onDragEnd", "newTab", "openMenu"],
|
|
21
|
-
setup(v, { emit:
|
|
21
|
+
setup(v, { emit: F }) {
|
|
22
22
|
ie((e) => ({
|
|
23
|
-
"
|
|
24
|
-
"
|
|
23
|
+
"30e2fca9": J.value,
|
|
24
|
+
"711b4c75": K.value
|
|
25
25
|
}));
|
|
26
|
-
const r = v,
|
|
27
|
-
activeRequest:
|
|
28
|
-
activeRouterParams:
|
|
26
|
+
const r = v, Y = F, {
|
|
27
|
+
activeRequest: T,
|
|
28
|
+
activeRouterParams: A,
|
|
29
29
|
activeWorkspace: x,
|
|
30
|
-
collections:
|
|
31
|
-
tags:
|
|
30
|
+
collections: U,
|
|
31
|
+
tags: L,
|
|
32
32
|
isReadOnly: f,
|
|
33
|
-
requests:
|
|
34
|
-
requestExamples:
|
|
35
|
-
collectionMutators:
|
|
36
|
-
tagMutators:
|
|
37
|
-
requestMutators:
|
|
38
|
-
requestExampleMutators:
|
|
39
|
-
router:
|
|
40
|
-
} = ge(), { collapsedSidebarFolders:
|
|
41
|
-
var s,
|
|
42
|
-
const e =
|
|
33
|
+
requests: M,
|
|
34
|
+
requestExamples: D,
|
|
35
|
+
collectionMutators: C,
|
|
36
|
+
tagMutators: z,
|
|
37
|
+
requestMutators: E,
|
|
38
|
+
requestExampleMutators: S,
|
|
39
|
+
router: W
|
|
40
|
+
} = ge(), { collapsedSidebarFolders: N, toggleSidebarFolder: H } = ce(), i = c(() => {
|
|
41
|
+
var s, u;
|
|
42
|
+
const e = U[r.uid], t = L[r.uid], l = M[r.uid], a = D[r.uid];
|
|
43
43
|
return e ? {
|
|
44
44
|
title: ((s = e.info) == null ? void 0 : s.title) ?? "Unknown title",
|
|
45
45
|
entity: e,
|
|
46
46
|
resourceTitle: "Collection",
|
|
47
47
|
children: e.children,
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
48
|
+
icon: e["x-scalar-icon"],
|
|
49
|
+
warning: "This cannot be undone. You’re about to delete the collection and all folders and requests inside it.",
|
|
50
|
+
edit: (o, k) => {
|
|
51
|
+
C.edit(e.uid, "info.title", o), k && C.edit(e.uid, "x-scalar-icon", k);
|
|
52
|
+
},
|
|
53
|
+
delete: () => C.delete(e, x.value)
|
|
51
54
|
} : t ? {
|
|
52
55
|
title: t.name,
|
|
53
56
|
entity: t,
|
|
54
57
|
resourceTitle: "Tag",
|
|
55
58
|
children: t.children,
|
|
56
59
|
warning: "This cannot be undone. You’re about to delete the tag and all requests inside it",
|
|
57
|
-
|
|
58
|
-
delete: () =>
|
|
60
|
+
edit: (o) => z.edit(t.uid, "name", o),
|
|
61
|
+
delete: () => z.delete(t, r.parentUids[0])
|
|
59
62
|
} : l ? {
|
|
60
63
|
title: l.summary ?? [l.method, l.path].join(" - "),
|
|
61
64
|
link: `/workspace/${x.value.uid}/request/${l.uid}`,
|
|
@@ -64,40 +67,40 @@ const P = (v) => (oe("data-v-4a6dd4d2"), v = v(), ue(), v), he = { class: "flex
|
|
|
64
67
|
resourceTitle: "Request",
|
|
65
68
|
warning: "This cannot be undone. You’re about to delete the request.",
|
|
66
69
|
children: l.examples,
|
|
67
|
-
|
|
68
|
-
delete: () =>
|
|
70
|
+
edit: (o) => E.edit(l.uid, "summary", o),
|
|
71
|
+
delete: () => E.delete(l, r.parentUids[0])
|
|
69
72
|
} : {
|
|
70
73
|
title: a.name,
|
|
71
74
|
link: `/workspace/${x.value.uid}/request/${a.requestUid}/examples/${a.uid}`,
|
|
72
|
-
method: (
|
|
75
|
+
method: (u = M[a.requestUid]) == null ? void 0 : u.method,
|
|
73
76
|
entity: a,
|
|
74
77
|
resourceTitle: "Example",
|
|
75
78
|
warning: "This cannot be undone. You’re about to delete the example from the request.",
|
|
76
79
|
children: [],
|
|
77
|
-
|
|
78
|
-
delete: () =>
|
|
80
|
+
edit: (o) => S.edit(a.uid, "name", o),
|
|
81
|
+
delete: () => S.delete(a)
|
|
79
82
|
};
|
|
80
|
-
}),
|
|
83
|
+
}), G = c(
|
|
81
84
|
() => i.value.entity.type === "collection" && i.value.title === "Drafts"
|
|
82
|
-
),
|
|
85
|
+
), J = c(() => r.parentUids.length ? f.value ? `${(r.parentUids.length - 1) * 12}px` : `${r.parentUids.length * 12}px` : "12px"), K = c(() => r.parentUids.length ? f.value ? `${(r.parentUids.length - 1) * 12}px` : `${r.parentUids.length * 12}px` : "0px"), Q = c(
|
|
83
86
|
() => {
|
|
84
87
|
var e;
|
|
85
|
-
return
|
|
88
|
+
return N[r.uid] || ((e = T.value) == null ? void 0 : e.uid) === r.uid && i.value.entity.examples.length > 1;
|
|
86
89
|
}
|
|
87
|
-
),
|
|
90
|
+
), X = c(
|
|
88
91
|
() => {
|
|
89
92
|
var e;
|
|
90
|
-
return
|
|
93
|
+
return A.value[ue.Request] === "default" && ((e = T.value) == null ? void 0 : e.uid) === r.uid;
|
|
91
94
|
}
|
|
92
|
-
),
|
|
95
|
+
), I = ne(null), O = c(() => {
|
|
93
96
|
let e = 0.5, t = 0.5;
|
|
94
|
-
if (!
|
|
95
|
-
const { draggingItem: l } =
|
|
96
|
-
return !
|
|
97
|
-
}),
|
|
98
|
-
e && (be(["default"]).some((s) => e[s]) ?
|
|
97
|
+
if (!I.value) return { ceiling: e, floor: t };
|
|
98
|
+
const { draggingItem: l } = I.value;
|
|
99
|
+
return !U[l == null ? void 0 : l.id] && i.value.entity.type === "collection" ? (e = 1, t = 0) : i.value.entity.type === "tag" && (e = 0.8, t = 0.2), { ceiling: e, floor: t };
|
|
100
|
+
}), Z = (e, t) => !(x.value.isReadOnly || D[t.id] || U[e.id]), _ = (e, t) => {
|
|
101
|
+
e && (be(["default"]).some((s) => e[s]) ? Y("newTab", t.title || "", t.entity.uid) : t.link && W.push(t.link));
|
|
99
102
|
};
|
|
100
|
-
function
|
|
103
|
+
function ee() {
|
|
101
104
|
ve.emit({
|
|
102
105
|
commandName: "Create Request",
|
|
103
106
|
metaData: {
|
|
@@ -108,7 +111,7 @@ const P = (v) => (oe("data-v-4a6dd4d2"), v = v(), ue(), v), he = { class: "flex
|
|
|
108
111
|
}
|
|
109
112
|
return (e, t) => {
|
|
110
113
|
const l = re("RequestSidebarItem", !0);
|
|
111
|
-
return p(),
|
|
114
|
+
return p(), w("div", {
|
|
112
115
|
class: m(["relative flex flex-row", [
|
|
113
116
|
n(f) && e.parentUids.length > 1 || !n(f) && e.parentUids.length ? "before:bg-b-3 before:absolute before:left-[calc(.75rem_+_.5px)] before:top-0 before:z-10 before:h-[calc(100%_+_.5px)] last:before:h-full before:w-[.5px] mb-[.5px] last:mb-0 indent-border-line-offset" : ""
|
|
114
117
|
]])
|
|
@@ -116,10 +119,10 @@ const P = (v) => (oe("data-v-4a6dd4d2"), v = v(), ue(), v), he = { class: "flex
|
|
|
116
119
|
h(n(pe), {
|
|
117
120
|
id: i.value.entity.uid,
|
|
118
121
|
ref_key: "draggableRef",
|
|
119
|
-
ref:
|
|
120
|
-
ceiling:
|
|
122
|
+
ref: I,
|
|
123
|
+
ceiling: O.value.ceiling,
|
|
121
124
|
class: "flex flex-1 flex-col gap-[.5px] text-sm",
|
|
122
|
-
floor:
|
|
125
|
+
floor: O.value.floor,
|
|
123
126
|
isDraggable: e.isDraggable,
|
|
124
127
|
isDroppable: e.isDroppable,
|
|
125
128
|
parentIds: e.parentUids,
|
|
@@ -132,48 +135,48 @@ const P = (v) => (oe("data-v-4a6dd4d2"), v = v(), ue(), v), he = { class: "flex
|
|
|
132
135
|
key: 0,
|
|
133
136
|
class: "no-underline",
|
|
134
137
|
to: i.value.link,
|
|
135
|
-
onClick: t[1] || (t[1] =
|
|
136
|
-
(s) =>
|
|
138
|
+
onClick: t[1] || (t[1] = R(
|
|
139
|
+
(s) => _(s, i.value),
|
|
137
140
|
["prevent"]
|
|
138
141
|
))
|
|
139
142
|
}, {
|
|
140
143
|
default: y(({ isExactActive: s }) => {
|
|
141
|
-
var
|
|
144
|
+
var u, o;
|
|
142
145
|
return [
|
|
143
|
-
|
|
146
|
+
d("div", {
|
|
144
147
|
class: m(["group relative flex min-h-8 cursor-pointer flex-row items-start justify-between gap-2 py-1.5 pr-2 rounded editable-sidebar-hover w-full", [
|
|
145
|
-
|
|
146
|
-
s ||
|
|
148
|
+
P,
|
|
149
|
+
s || X.value ? "bg-sidebar-active-b text-sidebar-active-c transition-none" : "text-sidebar-c-2"
|
|
147
150
|
]]),
|
|
148
151
|
tabindex: "0"
|
|
149
152
|
}, [
|
|
150
|
-
|
|
153
|
+
d("span", {
|
|
151
154
|
class: m(["line-clamp-3 z-10 font-medium w-full pl-2 word-break-break-word", {
|
|
152
155
|
"editable-sidebar-hover-item": !n(f)
|
|
153
156
|
}])
|
|
154
|
-
},
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
n(f) ? g("", !0) : (p(), b(n(
|
|
157
|
+
}, B(i.value.title), 3),
|
|
158
|
+
d("div", he, [
|
|
159
|
+
d("div", ye, [
|
|
160
|
+
n(f) ? g("", !0) : (p(), b(n($), {
|
|
158
161
|
key: 0,
|
|
159
162
|
class: m(["px-0.5 py-0 z-10 hover:bg-b-3 hidden group-hover:flex absolute -translate-y-1/2 right-0 aspect-square inset-y-2/4 h-fit", {
|
|
160
|
-
flex: ((o = (
|
|
163
|
+
flex: ((o = (u = e.menuItem) == null ? void 0 : u.item) == null ? void 0 : o.entity.uid) === i.value.entity.uid && e.menuItem.open
|
|
161
164
|
}]),
|
|
162
165
|
size: "sm",
|
|
163
166
|
type: "button",
|
|
164
167
|
variant: "ghost",
|
|
165
|
-
onClick: t[0] || (t[0] =
|
|
166
|
-
(
|
|
168
|
+
onClick: t[0] || (t[0] = R(
|
|
169
|
+
(k) => e.$emit("openMenu", {
|
|
167
170
|
item: i.value,
|
|
168
171
|
parentUids: e.parentUids,
|
|
169
|
-
targetRef:
|
|
172
|
+
targetRef: k.currentTarget.parentNode,
|
|
170
173
|
open: !0
|
|
171
174
|
}),
|
|
172
175
|
["stop", "prevent"]
|
|
173
176
|
))
|
|
174
177
|
}, {
|
|
175
178
|
default: y(() => [
|
|
176
|
-
h(n(
|
|
179
|
+
h(n(q), {
|
|
177
180
|
icon: "Ellipses",
|
|
178
181
|
size: "sm"
|
|
179
182
|
})
|
|
@@ -181,8 +184,8 @@ const P = (v) => (oe("data-v-4a6dd4d2"), v = v(), ue(), v), he = { class: "flex
|
|
|
181
184
|
_: 1
|
|
182
185
|
}, 8, ["class"]))
|
|
183
186
|
]),
|
|
184
|
-
|
|
185
|
-
|
|
187
|
+
d("span", xe, [
|
|
188
|
+
j(" "),
|
|
186
189
|
i.value.method ? (p(), b(n(me), {
|
|
187
190
|
key: 0,
|
|
188
191
|
class: "font-bold",
|
|
@@ -194,20 +197,20 @@ const P = (v) => (oe("data-v-4a6dd4d2"), v = v(), ue(), v), he = { class: "flex
|
|
|
194
197
|
];
|
|
195
198
|
}),
|
|
196
199
|
_: 1
|
|
197
|
-
}, 8, ["to"])) : !n(f) || e.parentUids.length ? (p(),
|
|
200
|
+
}, 8, ["to"])) : !n(f) || e.parentUids.length ? (p(), w("button", {
|
|
198
201
|
key: 1,
|
|
199
|
-
class: m(["hover:bg-b-2 group relative flex w-full flex-row justify-start gap-1.5 rounded p-1.5 z-[1]",
|
|
202
|
+
class: m(["hover:bg-b-2 group relative flex w-full flex-row justify-start gap-1.5 rounded p-1.5 z-[1]", P]),
|
|
200
203
|
type: "button",
|
|
201
|
-
onClick: t[3] || (t[3] = (s) => n(
|
|
204
|
+
onClick: t[3] || (t[3] = (s) => n(H)(i.value.entity.uid))
|
|
202
205
|
}, [
|
|
203
|
-
|
|
206
|
+
d("span", ke, [
|
|
204
207
|
le(e.$slots, "leftIcon", {}, () => [
|
|
205
|
-
|
|
208
|
+
d("div", {
|
|
206
209
|
class: m({
|
|
207
|
-
"rotate-90": n(
|
|
210
|
+
"rotate-90": n(N)[i.value.entity.uid]
|
|
208
211
|
})
|
|
209
212
|
}, [
|
|
210
|
-
h(n(
|
|
213
|
+
h(n(q), {
|
|
211
214
|
class: "text-c-3 text-sm",
|
|
212
215
|
icon: "ChevronRight",
|
|
213
216
|
size: "sm",
|
|
@@ -215,23 +218,23 @@ const P = (v) => (oe("data-v-4a6dd4d2"), v = v(), ue(), v), he = { class: "flex
|
|
|
215
218
|
})
|
|
216
219
|
], 2)
|
|
217
220
|
], !0),
|
|
218
|
-
|
|
221
|
+
j(" ")
|
|
219
222
|
]),
|
|
220
|
-
|
|
221
|
-
|
|
223
|
+
d("div", we, [
|
|
224
|
+
d("span", {
|
|
222
225
|
class: m(["line-clamp-3 z-10 font-medium text-left w-full word-break-break-word", {
|
|
223
226
|
"editable-sidebar-hover-item": !n(f)
|
|
224
227
|
}])
|
|
225
|
-
},
|
|
226
|
-
|
|
227
|
-
!n(f) && !
|
|
228
|
+
}, B(i.value.title), 3),
|
|
229
|
+
d("div", qe, [
|
|
230
|
+
!n(f) && !G.value ? (p(), b(n($), {
|
|
228
231
|
key: 0,
|
|
229
232
|
class: m(["px-0.5 py-0 z-10 hover:bg-b-3 hidden group-hover:flex absolute -translate-y-1/2 right-0 aspect-square inset-y-2/4 h-fit", {
|
|
230
233
|
flex: ((a = e.menuItem.item) == null ? void 0 : a.entity.uid) === i.value.entity.uid && e.menuItem.open
|
|
231
234
|
}]),
|
|
232
235
|
size: "sm",
|
|
233
236
|
variant: "ghost",
|
|
234
|
-
onClick: t[2] || (t[2] =
|
|
237
|
+
onClick: t[2] || (t[2] = R(
|
|
235
238
|
(s) => e.$emit("openMenu", {
|
|
236
239
|
item: i.value,
|
|
237
240
|
parentUids: e.parentUids,
|
|
@@ -242,7 +245,7 @@ const P = (v) => (oe("data-v-4a6dd4d2"), v = v(), ue(), v), he = { class: "flex
|
|
|
242
245
|
))
|
|
243
246
|
}, {
|
|
244
247
|
default: y(() => [
|
|
245
|
-
h(n(
|
|
248
|
+
h(n(q), {
|
|
246
249
|
icon: "Ellipses",
|
|
247
250
|
size: "sm"
|
|
248
251
|
})
|
|
@@ -253,26 +256,26 @@ const P = (v) => (oe("data-v-4a6dd4d2"), v = v(), ue(), v), he = { class: "flex
|
|
|
253
256
|
])
|
|
254
257
|
])
|
|
255
258
|
])) : g("", !0),
|
|
256
|
-
|
|
257
|
-
(p(!0),
|
|
259
|
+
Q.value ? (p(), w("div", De, [
|
|
260
|
+
(p(!0), w(se, null, ae(i.value.children, (s) => (p(), b(l, {
|
|
258
261
|
key: s,
|
|
259
|
-
isDraggable: !n(
|
|
260
|
-
isDroppable:
|
|
262
|
+
isDraggable: !n(D)[s],
|
|
263
|
+
isDroppable: Z,
|
|
261
264
|
menuItem: e.menuItem,
|
|
262
265
|
parentUids: [...e.parentUids, e.uid],
|
|
263
266
|
uid: s,
|
|
264
|
-
onNewTab: t[4] || (t[4] = (
|
|
265
|
-
onOnDragEnd: t[5] || (t[5] = (...
|
|
266
|
-
onOpenMenu: t[6] || (t[6] = (
|
|
267
|
+
onNewTab: t[4] || (t[4] = (u, o) => e.$emit("newTab", u, o)),
|
|
268
|
+
onOnDragEnd: t[5] || (t[5] = (...u) => e.$emit("onDragEnd", ...u)),
|
|
269
|
+
onOpenMenu: t[6] || (t[6] = (u) => e.$emit("openMenu", u))
|
|
267
270
|
}, null, 8, ["isDraggable", "menuItem", "parentUids", "uid"]))), 128)),
|
|
268
|
-
i.value.children.length === 0 ? (p(), b(n(
|
|
271
|
+
i.value.children.length === 0 ? (p(), b(n($), {
|
|
269
272
|
key: 0,
|
|
270
273
|
class: m(["mb-[.5px] flex gap-1.5 h-8 text-c-1 py-0 justify-start text-xs w-full hover:bg-b-2", e.parentUids.length ? "pl-9" : ""]),
|
|
271
274
|
variant: "ghost",
|
|
272
|
-
onClick: t[7] || (t[7] = (s) =>
|
|
275
|
+
onClick: t[7] || (t[7] = (s) => ee())
|
|
273
276
|
}, {
|
|
274
277
|
default: y(() => [
|
|
275
|
-
h(n(
|
|
278
|
+
h(n(q), {
|
|
276
279
|
class: "ml-0.5 h-2.5 w-2.5",
|
|
277
280
|
icon: "Add",
|
|
278
281
|
thickness: "3"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RequestSidebarItemMenu.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Request/RequestSidebarItemMenu.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RequestSidebarItemMenu.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Request/RequestSidebarItemMenu.vue"],"names":[],"mappings":"AAqLA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;;cAa1B,eAAe;;;;cAAf,eAAe;;;;AA+bjD,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
|
-
import
|
|
1
|
+
import e from "./RequestSidebarItemMenu.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
|
-
import
|
|
4
|
-
const
|
|
3
|
+
import t from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
+
const m = /* @__PURE__ */ t(e, [["__scopeId", "data-v-eb0a2336"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
m as default
|
|
7
7
|
};
|
|
@@ -1,137 +1,151 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
|
|
1
|
+
import { defineComponent as P, ref as K, watch as U, onMounted as W, onBeforeUnmount as F, openBlock as s, createElementBlock as k, Fragment as v, createBlock as f, unref as n, withKeys as j, withCtx as r, createVNode as l, createCommentVNode as S, createElementVNode as y, createTextVNode as N, pushScopeId as G, popScopeId as H } from "vue";
|
|
2
|
+
import J from "../../components/Sidebar/Actions/DeleteSidebarListElement.vue.js";
|
|
3
|
+
import O from "../../components/Sidebar/Actions/EditSidebarListCollection.vue.js";
|
|
4
|
+
import Q from "../../components/Sidebar/Actions/EditSidebarListElement.vue.js";
|
|
5
|
+
import { PathId as b } from "../../router.js";
|
|
6
|
+
import { useModal as q, ScalarDropdown as X, ScalarDropdownItem as w, ScalarIcon as $, ScalarModal as x } from "@scalar/components";
|
|
7
|
+
import { useRouter as Y } from "vue-router";
|
|
8
|
+
import { useWorkspace as Z } from "../../store/store.js";
|
|
9
|
+
import { commandPaletteBus as _ } from "../../libs/event-busses/command-palette-bus.js";
|
|
10
|
+
const z = (u) => (G("data-v-eb0a2336"), u = u(), H(), u), ee = /* @__PURE__ */ z(() => /* @__PURE__ */ y("span", null, "Add Example", -1)), te = /* @__PURE__ */ z(() => /* @__PURE__ */ y("span", null, "Delete", -1)), de = /* @__PURE__ */ P({
|
|
10
11
|
__name: "RequestSidebarItemMenu",
|
|
11
12
|
props: {
|
|
12
13
|
menuItem: {}
|
|
13
14
|
},
|
|
14
15
|
emits: ["closeMenu"],
|
|
15
|
-
setup(
|
|
16
|
-
const
|
|
16
|
+
setup(u, { emit: B }) {
|
|
17
|
+
const a = u, T = B, { replace: E } = Y(), { activeWorkspace: g, activeRouterParams: C } = Z(), d = q(), p = q(), V = () => {
|
|
17
18
|
var e;
|
|
18
|
-
return
|
|
19
|
+
return _.emit({
|
|
19
20
|
commandName: "Add Example",
|
|
20
21
|
metaData: {
|
|
21
|
-
itemUid: (e =
|
|
22
|
+
itemUid: (e = a.menuItem.item) == null ? void 0 : e.entity.uid
|
|
22
23
|
}
|
|
23
24
|
});
|
|
24
|
-
},
|
|
25
|
-
var
|
|
26
|
-
|
|
27
|
-
},
|
|
28
|
-
var t;
|
|
29
|
-
|
|
30
|
-
},
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
L([() => o.menuItem.open, d], async ([e]) => {
|
|
35
|
-
var t, l;
|
|
36
|
-
e && ((l = (t = d.value) == null ? void 0 : t.$parent) != null && l.$el) && d.value.$parent.$el.focus();
|
|
25
|
+
}, M = (e, t) => {
|
|
26
|
+
var m;
|
|
27
|
+
(m = a.menuItem.item) == null || m.edit(e, t), d.hide();
|
|
28
|
+
}, A = () => {
|
|
29
|
+
var e, t, m;
|
|
30
|
+
(e = a.menuItem.item) == null || e.delete(), C.value[b.Request] === ((t = a.menuItem.item) == null ? void 0 : t.entity.uid) && E(`/workspace/${g.value.uid}/request/default`), C.value[b.Examples] === ((m = a.menuItem.item) == null ? void 0 : m.entity.uid) && E(`/workspace/${g.value}/request/default`), p.hide();
|
|
31
|
+
}, c = K(null);
|
|
32
|
+
U([() => a.menuItem.open, c], async ([e]) => {
|
|
33
|
+
var t, m;
|
|
34
|
+
e && ((m = (t = c.value) == null ? void 0 : t.$parent) != null && m.$el) && c.value.$parent.$el.focus();
|
|
37
35
|
});
|
|
38
|
-
const
|
|
39
|
-
return
|
|
40
|
-
var
|
|
41
|
-
return
|
|
42
|
-
e.menuItem.targetRef && e.menuItem.open ? (
|
|
36
|
+
const R = () => a.menuItem.open && T("closeMenu");
|
|
37
|
+
return W(() => window.addEventListener("click", R)), F(() => window.removeEventListener("click", R)), (e, t) => {
|
|
38
|
+
var m, h;
|
|
39
|
+
return s(), k(v, null, [
|
|
40
|
+
e.menuItem.targetRef && e.menuItem.open ? (s(), f(n(X), {
|
|
43
41
|
key: 0,
|
|
44
42
|
static: "",
|
|
45
43
|
targetRef: e.menuItem.targetRef,
|
|
46
44
|
teleport: "",
|
|
47
|
-
onKeydown: t[
|
|
45
|
+
onKeydown: t[2] || (t[2] = j((o) => e.$emit("closeMenu"), ["escape"]))
|
|
48
46
|
}, {
|
|
49
|
-
items:
|
|
50
|
-
var
|
|
47
|
+
items: r(() => {
|
|
48
|
+
var o;
|
|
51
49
|
return [
|
|
52
|
-
((
|
|
50
|
+
((o = e.menuItem.item) == null ? void 0 : o.entity.type) === "request" ? (s(), f(n(w), {
|
|
53
51
|
key: 0,
|
|
54
52
|
class: "flex gap-2",
|
|
55
|
-
onClick:
|
|
53
|
+
onClick: V
|
|
56
54
|
}, {
|
|
57
|
-
default:
|
|
58
|
-
|
|
55
|
+
default: r(() => [
|
|
56
|
+
l(n($), {
|
|
59
57
|
class: "inline-flex",
|
|
60
58
|
icon: "Example",
|
|
61
59
|
size: "md",
|
|
62
60
|
thickness: "1.5"
|
|
63
61
|
}),
|
|
64
|
-
|
|
62
|
+
ee
|
|
65
63
|
]),
|
|
66
64
|
_: 1
|
|
67
|
-
})) :
|
|
68
|
-
|
|
65
|
+
})) : S("", !0),
|
|
66
|
+
l(n(w), {
|
|
69
67
|
ref_key: "menuRef",
|
|
70
|
-
ref:
|
|
68
|
+
ref: c,
|
|
71
69
|
class: "flex gap-2",
|
|
72
|
-
onClick:
|
|
70
|
+
onClick: t[0] || (t[0] = (i) => n(d).show())
|
|
73
71
|
}, {
|
|
74
|
-
default:
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
72
|
+
default: r(() => {
|
|
73
|
+
var i;
|
|
74
|
+
return [
|
|
75
|
+
l(n($), {
|
|
76
|
+
class: "inline-flex",
|
|
77
|
+
icon: "Edit",
|
|
78
|
+
size: "md",
|
|
79
|
+
thickness: "1.5"
|
|
80
|
+
}),
|
|
81
|
+
y("span", null, [
|
|
82
|
+
((i = e.menuItem.item) == null ? void 0 : i.entity.type) === "collection" ? (s(), k(v, { key: 0 }, [
|
|
83
|
+
N(" Edit ")
|
|
84
|
+
], 64)) : (s(), k(v, { key: 1 }, [
|
|
85
|
+
N(" Rename ")
|
|
86
|
+
], 64))
|
|
87
|
+
])
|
|
88
|
+
];
|
|
89
|
+
}),
|
|
83
90
|
_: 1
|
|
84
91
|
}, 512),
|
|
85
|
-
|
|
92
|
+
l(n(w), {
|
|
86
93
|
class: "flex gap-2",
|
|
87
|
-
onClick: t[
|
|
94
|
+
onClick: t[1] || (t[1] = (i) => n(p).show())
|
|
88
95
|
}, {
|
|
89
|
-
default:
|
|
90
|
-
|
|
96
|
+
default: r(() => [
|
|
97
|
+
l(n($), {
|
|
91
98
|
class: "inline-flex",
|
|
92
99
|
icon: "Delete",
|
|
93
100
|
size: "md",
|
|
94
101
|
thickness: "1.5"
|
|
95
102
|
}),
|
|
96
|
-
|
|
103
|
+
te
|
|
97
104
|
]),
|
|
98
105
|
_: 1
|
|
99
106
|
})
|
|
100
107
|
];
|
|
101
108
|
}),
|
|
102
109
|
_: 1
|
|
103
|
-
}, 8, ["targetRef"])) :
|
|
104
|
-
|
|
110
|
+
}, 8, ["targetRef"])) : S("", !0),
|
|
111
|
+
l(n(x), {
|
|
105
112
|
size: "xxs",
|
|
106
|
-
state: n(
|
|
107
|
-
title: `Delete ${(
|
|
113
|
+
state: n(p),
|
|
114
|
+
title: `Delete ${(m = e.menuItem.item) == null ? void 0 : m.resourceTitle}`
|
|
108
115
|
}, {
|
|
109
|
-
default:
|
|
110
|
-
var
|
|
116
|
+
default: r(() => {
|
|
117
|
+
var o, i;
|
|
111
118
|
return [
|
|
112
|
-
|
|
113
|
-
variableName: ((
|
|
114
|
-
warningMessage: (
|
|
115
|
-
onClose: t[
|
|
116
|
-
onDelete:
|
|
119
|
+
l(J, {
|
|
120
|
+
variableName: ((o = e.menuItem.item) == null ? void 0 : o.title) ?? "",
|
|
121
|
+
warningMessage: (i = e.menuItem.item) == null ? void 0 : i.warning,
|
|
122
|
+
onClose: t[3] || (t[3] = (I) => n(p).hide()),
|
|
123
|
+
onDelete: A
|
|
117
124
|
}, null, 8, ["variableName", "warningMessage"])
|
|
118
125
|
];
|
|
119
126
|
}),
|
|
120
127
|
_: 1
|
|
121
128
|
}, 8, ["state", "title"]),
|
|
122
|
-
|
|
129
|
+
l(n(x), {
|
|
123
130
|
size: "xxs",
|
|
124
|
-
state: n(
|
|
125
|
-
title: `
|
|
131
|
+
state: n(d),
|
|
132
|
+
title: `Edit ${(h = e.menuItem.item) == null ? void 0 : h.resourceTitle}`
|
|
126
133
|
}, {
|
|
127
|
-
default:
|
|
128
|
-
var
|
|
134
|
+
default: r(() => {
|
|
135
|
+
var o, i, I, D;
|
|
129
136
|
return [
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
137
|
+
((o = e.menuItem.item) == null ? void 0 : o.resourceTitle) === "Collection" ? (s(), f(O, {
|
|
138
|
+
key: 0,
|
|
139
|
+
icon: ((i = e.menuItem.item) == null ? void 0 : i.icon) || "interface-content-folder",
|
|
140
|
+
name: (I = e.menuItem.item) == null ? void 0 : I.title,
|
|
141
|
+
onClose: t[4] || (t[4] = (L) => n(d).hide()),
|
|
142
|
+
onEdit: M
|
|
143
|
+
}, null, 8, ["icon", "name"])) : (s(), f(Q, {
|
|
144
|
+
key: 1,
|
|
145
|
+
name: ((D = e.menuItem.item) == null ? void 0 : D.title) ?? "",
|
|
146
|
+
onClose: t[5] || (t[5] = (L) => n(d).hide()),
|
|
147
|
+
onEdit: M
|
|
148
|
+
}, null, 8, ["name"]))
|
|
135
149
|
];
|
|
136
150
|
}),
|
|
137
151
|
_: 1
|
|
@@ -141,5 +155,5 @@ const k = (s) => (W("data-v-b6270746"), s = s(), F(), s), X = /* @__PURE__ */ k(
|
|
|
141
155
|
}
|
|
142
156
|
});
|
|
143
157
|
export {
|
|
144
|
-
|
|
158
|
+
de as default
|
|
145
159
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WorkspaceDropdown.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/components/WorkspaceDropdown.vue"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"WorkspaceDropdown.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/components/WorkspaceDropdown.vue"],"names":[],"mappings":";AA67BA,wBAKG"}
|