@scalar/api-client 2.0.38 → 2.0.39
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 +18 -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 +84 -80
- package/dist/components/DataTable/DataTableInput.vue.d.ts.map +1 -1
- package/dist/components/DataTable/DataTableInput.vue.js +2 -2
- package/dist/components/DataTable/DataTableInput.vue2.js +1 -1
- package/dist/components/DataTable/DataTableInputSelect.vue.d.ts.map +1 -1
- package/dist/components/DataTable/DataTableInputSelect.vue.js +1 -1
- package/dist/components/Sidebar/Actions/DeleteSidebarListElement.vue.d.ts +2 -0
- package/dist/components/Sidebar/Actions/DeleteSidebarListElement.vue.d.ts.map +1 -1
- package/dist/components/Sidebar/Actions/DeleteSidebarListElement.vue.js +18 -14
- package/dist/components/Sidebar/Actions/SidebarListElementForm.vue.d.ts.map +1 -1
- package/dist/components/Sidebar/Actions/SidebarListElementForm.vue.js +5 -40
- package/dist/components/Sidebar/Actions/SidebarListElementForm.vue2.js +48 -2
- package/dist/components/Sidebar/SidebarListElement.vue.d.ts +2 -0
- 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 +24 -22
- package/dist/components/Sidebar/SidebarListElementActions.vue.d.ts.map +1 -1
- package/dist/components/Sidebar/SidebarListElementActions.vue.js +26 -25
- package/dist/components/SubpageHeader.vue.d.ts.map +1 -1
- package/dist/components/SubpageHeader.vue.js +5 -29
- package/dist/components/SubpageHeader.vue2.js +31 -2
- package/dist/style.css +1 -1
- package/dist/views/Cookies/Cookies.vue.d.ts.map +1 -1
- package/dist/views/Cookies/Cookies.vue2.js +46 -36
- package/dist/views/Environment/Environment.vue2.js +26 -26
- package/dist/views/Environment/EnvironmentVariableDropdown.vue.d.ts.map +1 -1
- package/dist/views/Environment/EnvironmentVariableDropdown.vue.js +37 -34
- package/dist/views/Request/RequestSection/RequestAuth.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestAuth.vue.js +5 -311
- package/dist/views/Request/RequestSection/RequestAuth.vue2.js +312 -2
- package/dist/views/Request/RequestSection/RequestSection.vue.js +19 -19
- package/dist/views/Request/RequestSidebarItem.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSidebarItem.vue.js +3 -3
- package/dist/views/Request/RequestSidebarItem.vue2.js +56 -48
- package/dist/views/Request/RequestSidebarItemMenu.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSidebarItemMenu.vue.js +5 -162
- package/dist/views/Request/RequestSidebarItemMenu.vue2.js +166 -2
- package/dist/views/Servers/Servers.vue2.js +17 -17
- package/package.json +4 -4
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as A, computed as f, ref as S, watch as q, openBlock as k, createBlock as R, withCtx as h, createVNode as l, unref as o, createElementVNode as u, createTextVNode as B, toDisplayString as C, withDirectives as i, vShow as a } from "vue";
|
|
2
2
|
import E from "../../../components/ContextBar.vue.js";
|
|
3
3
|
import O from "../../../components/ViewLayout/ViewLayoutSection.vue.js";
|
|
4
|
-
import { useWorkspace as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
4
|
+
import { useWorkspace as g } from "../../../store/workspace.js";
|
|
5
|
+
import H from "./RequestAuth.vue.js";
|
|
6
|
+
import P from "./RequestBody.vue.js";
|
|
7
7
|
import r from "./RequestParams.vue.js";
|
|
8
|
-
import
|
|
9
|
-
import { ScalarIcon as
|
|
10
|
-
const w = { class: "flex-1" }, K = { class: "text-c-3 pl-1" }, N = { class: "request-section-content custom-scroll flex flex-1 flex-col px-2 xl:px-5 py-2.5" }, W = /* @__PURE__ */
|
|
8
|
+
import T from "./RequestPathParams.vue.js";
|
|
9
|
+
import { ScalarIcon as $ } from "@scalar/components";
|
|
10
|
+
const w = { class: "flex-1" }, K = { class: "text-c-3 pl-1" }, N = { class: "request-section-content custom-scroll flex flex-1 flex-col px-2 xl:px-5 py-2.5" }, W = /* @__PURE__ */ A({
|
|
11
11
|
__name: "RequestSection",
|
|
12
12
|
setup(V) {
|
|
13
13
|
const {
|
|
14
14
|
activeRequest: s,
|
|
15
|
-
activeSecuritySchemes:
|
|
15
|
+
activeSecuritySchemes: y,
|
|
16
16
|
activeExample: m,
|
|
17
17
|
activeSecurityRequirements: d,
|
|
18
|
-
isReadOnly:
|
|
19
|
-
} =
|
|
18
|
+
isReadOnly: _
|
|
19
|
+
} = g(), n = ["POST", "PUT", "PATCH", "DELETE"], x = f(() => {
|
|
20
20
|
const t = [
|
|
21
21
|
"All",
|
|
22
22
|
"Auth",
|
|
@@ -28,15 +28,15 @@ const w = { class: "flex-1" }, K = { class: "text-c-3 pl-1" }, N = { class: "req
|
|
|
28
28
|
];
|
|
29
29
|
return m.value.parameters.path.length || t.splice(t.indexOf("Request"), 1), n.includes(s.value.method) || t.splice(t.indexOf("Body"), 1), p.value && t.splice(t.indexOf("Auth"), 1), t;
|
|
30
30
|
}), p = f(
|
|
31
|
-
() =>
|
|
32
|
-
), e =
|
|
33
|
-
return
|
|
31
|
+
() => _.value && (d.value.length === 0 || JSON.stringify(d.value) === "[{}]")
|
|
32
|
+
), e = S("All");
|
|
33
|
+
return q(s, (t) => {
|
|
34
34
|
e.value === "Body" && !n.includes(t.method) && (e.value = "All");
|
|
35
|
-
}), (t, v) => (
|
|
35
|
+
}), (t, v) => (k(), R(O, null, {
|
|
36
36
|
title: h(() => {
|
|
37
37
|
var c;
|
|
38
38
|
return [
|
|
39
|
-
l(o(
|
|
39
|
+
l(o($), {
|
|
40
40
|
class: "text-c-3 mr-2",
|
|
41
41
|
icon: "ExternalLink",
|
|
42
42
|
size: "sm",
|
|
@@ -55,9 +55,9 @@ const w = { class: "flex-1" }, K = { class: "text-c-3 pl-1" }, N = { class: "req
|
|
|
55
55
|
sections: x.value,
|
|
56
56
|
onSetActiveSection: v[0] || (v[0] = (c) => e.value = c)
|
|
57
57
|
}, null, 8, ["activeSection", "sections"]),
|
|
58
|
-
i(l(
|
|
58
|
+
i(l(H, {
|
|
59
59
|
index: 0,
|
|
60
|
-
securityScheme: o(
|
|
60
|
+
securityScheme: o(y)[0],
|
|
61
61
|
title: "Authentication"
|
|
62
62
|
}, null, 8, ["securityScheme"]), [
|
|
63
63
|
[
|
|
@@ -65,7 +65,7 @@ const w = { class: "flex-1" }, K = { class: "text-c-3 pl-1" }, N = { class: "req
|
|
|
65
65
|
!p.value && (e.value === "All" || e.value === "Auth")
|
|
66
66
|
]
|
|
67
67
|
]),
|
|
68
|
-
i(l(
|
|
68
|
+
i(l(T, {
|
|
69
69
|
paramKey: "path",
|
|
70
70
|
title: "Path Variables"
|
|
71
71
|
}, null, 512), [
|
|
@@ -92,7 +92,7 @@ const w = { class: "flex-1" }, K = { class: "text-c-3 pl-1" }, N = { class: "req
|
|
|
92
92
|
}, null, 512), [
|
|
93
93
|
[a, e.value === "All" || e.value === "Query"]
|
|
94
94
|
]),
|
|
95
|
-
i(l(
|
|
95
|
+
i(l(P, {
|
|
96
96
|
body: "foo",
|
|
97
97
|
title: "Body"
|
|
98
98
|
}, null, 512), [
|
|
@@ -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":"AAmRA,OAAO,EAEL,KAAK,YAAY,EACjB,KAAK,WAAW,EACjB,MAAM,mBAAmB,CAAA;AAC1B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iDAAiD,CAAA;AACjF,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,6CAA6C,CAAA;AACzE,OAAO,KAAK,EACV,OAAO,EACP,cAAc,EACf,MAAM,2CAA2C,CAAA;AA0HlD,iBAAS,cAAc;gBAvFT,IAAI;;gBAAJ,IAAI;EAyZjB;AACD,QAAA,MAAM,eAAe;IApbjB;;;;OAIG;kBACW,OAAO;IACrB;;;;OAIG;kBACW,OAAO;IACrB,qEAAqE;gBACzD,MAAM,EAAE;UACd,UAAU,GAAG,MAAM,GAAG,OAAO,GAAG,cAAc;;;;;;;;IAdpD;;;;OAIG;kBACW,OAAO;IACrB;;;;OAIG;kBACW,OAAO;IACrB,qEAAqE;gBACzD,MAAM,EAAE;UACd,UAAU,GAAG,MAAM,GAAG,OAAO,GAAG,cAAc;;;;;;;;iBATtC,OAAO;iBAMP,OAAO;MAgbvB,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,8 +1,8 @@
|
|
|
1
1
|
import t from "./RequestSidebarItem.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
/* empty css */
|
|
4
|
-
import
|
|
5
|
-
const
|
|
4
|
+
import e from "../../_virtual/_plugin-vue_export-helper.js";
|
|
5
|
+
const a = /* @__PURE__ */ e(t, [["__scopeId", "data-v-ec2878eb"]]);
|
|
6
6
|
export {
|
|
7
|
-
|
|
7
|
+
a as default
|
|
8
8
|
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { defineComponent as P, useCssVars as T, computed as o, resolveComponent as W, openBlock as
|
|
2
|
-
import { PathId as
|
|
1
|
+
import { defineComponent as P, useCssVars as T, computed as o, resolveComponent as W, openBlock as a, createElementBlock as p, normalizeClass as d, unref as i, createVNode as b, withCtx as k, createBlock as m, createElementVNode as l, toDisplayString as y, createCommentVNode as f, createTextVNode as q, renderSlot as A, withDirectives as M, Fragment as G, renderList as H, vShow as J } from "vue";
|
|
2
|
+
import { PathId as K } from "../../router.js";
|
|
3
3
|
import { useWorkspace as Q } from "../../store/workspace.js";
|
|
4
4
|
import { ScalarIcon as X } from "@scalar/components";
|
|
5
5
|
import { Draggable as Y } from "@scalar/draggable";
|
|
6
6
|
import { RouterLink as Z } from "vue-router";
|
|
7
|
-
import
|
|
7
|
+
import x from "./RequestSidebarItemMenu.vue.js";
|
|
8
8
|
import _ from "../../components/HttpMethod/HttpMethod.vue.js";
|
|
9
9
|
import { useSidebar as ee } from "../../hooks/useSidebar.js";
|
|
10
|
-
const te = { class: "
|
|
10
|
+
const te = { class: "flex flex-row gap-1" }, ie = { class: "flex" }, re = { class: "z-10 flex h-fit items-center justify-center max-w-[14px]" }, se = { class: "flex flex-1 flex-row justify-between sidebar-folderitem editable-sidebar-hover" }, ae = { key: 2 }, $ = "hover:bg-sidebar-active-b indent-padding-left", ge = /* @__PURE__ */ P({
|
|
11
11
|
__name: "RequestSidebarItem",
|
|
12
12
|
props: {
|
|
13
13
|
isDraggable: { type: Boolean, default: !1 },
|
|
@@ -18,71 +18,75 @@ const te = { class: "z-10 font-medium w-full editable-sidebar-hover-item pl-2" }
|
|
|
18
18
|
emits: ["onDragEnd"],
|
|
19
19
|
setup(C) {
|
|
20
20
|
T((e) => ({
|
|
21
|
-
"
|
|
22
|
-
"
|
|
21
|
+
"2b445812": z.value,
|
|
22
|
+
"78a7cc6c": B.value
|
|
23
23
|
}));
|
|
24
24
|
const t = C, {
|
|
25
|
-
activeRequest:
|
|
25
|
+
activeRequest: g,
|
|
26
26
|
activeRouterParams: S,
|
|
27
|
-
activeWorkspace:
|
|
27
|
+
activeWorkspace: c,
|
|
28
28
|
folders: R,
|
|
29
|
-
isReadOnly:
|
|
29
|
+
isReadOnly: r,
|
|
30
30
|
requests: h,
|
|
31
|
-
requestExamples:
|
|
32
|
-
} = Q(), { collapsedSidebarFolders: v, toggleSidebarFolder:
|
|
31
|
+
requestExamples: I
|
|
32
|
+
} = Q(), { collapsedSidebarFolders: v, toggleSidebarFolder: E } = ee(), U = o(() => "childUids" in t.item), z = o(() => t.parentUids.length ? r.value ? `${(t.parentUids.length - 1) * 12}px` : `${t.parentUids.length * 12}px` : "12px"), B = o(() => t.parentUids.length ? r.value ? `${(t.parentUids.length - 1) * 12}px` : `${t.parentUids.length * 12}px` : "0px"), D = (e) => {
|
|
33
33
|
var s;
|
|
34
34
|
return "spec" in e ? (s = e.spec.info) == null ? void 0 : s.title : "summary" in e ? e.summary || e.path : "name" in e ? e.name : "";
|
|
35
35
|
}, O = o(() => ("requestUid" in t.item ? h[t.item.requestUid] : t.item).method), V = o(
|
|
36
36
|
() => {
|
|
37
37
|
var e;
|
|
38
|
-
return v[t.item.uid] || ((e =
|
|
38
|
+
return v[t.item.uid] || ((e = g.value) == null ? void 0 : e.uid) === t.item.uid && t.item.childUids.length > 1;
|
|
39
39
|
}
|
|
40
|
-
), j = () => "requestUid" in t.item ? `/workspace/${
|
|
41
|
-
() => S.value[
|
|
40
|
+
), j = () => "requestUid" in t.item ? `/workspace/${c.value.uid}/request/${t.item.requestUid}/examples/${t.item.uid}` : `/workspace/${c.value.uid}/request/${t.item.uid}`, N = o(
|
|
41
|
+
() => S.value[K.Request] === "default" && g.value.uid === t.item.uid
|
|
42
42
|
);
|
|
43
43
|
return (e, s) => {
|
|
44
44
|
const F = W("RequestSidebarItem", !0);
|
|
45
|
-
return
|
|
46
|
-
class:
|
|
47
|
-
i(
|
|
45
|
+
return a(), p("div", {
|
|
46
|
+
class: d(["relative flex flex-row", [
|
|
47
|
+
i(r) && e.parentUids.length > 1 || !i(r) && 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-px mb-[.5px] last:mb-0 indent-border-line-offset" : ""
|
|
48
48
|
]])
|
|
49
49
|
}, [
|
|
50
|
-
|
|
50
|
+
b(i(Y), {
|
|
51
51
|
id: e.item.uid,
|
|
52
52
|
ceiling: U.value ? 0.8 : 0.5,
|
|
53
|
-
class: "flex flex-1 flex-col gap-[.5px] text-sm",
|
|
53
|
+
class: "flex flex-1 flex-col gap-[.5px] text-sm max-w-full",
|
|
54
54
|
floor: U.value ? 0.2 : 0.5,
|
|
55
55
|
isDraggable: e.parentUids.length > 0 && e.isDraggable,
|
|
56
56
|
isDroppable: e.isDroppable,
|
|
57
57
|
parentIds: e.parentUids,
|
|
58
|
-
onOnDragEnd: s[2] || (s[2] = (...
|
|
58
|
+
onOnDragEnd: s[2] || (s[2] = (...u) => e.$emit("onDragEnd", ...u))
|
|
59
59
|
}, {
|
|
60
60
|
default: k(() => {
|
|
61
|
-
var
|
|
61
|
+
var u, w;
|
|
62
62
|
return [
|
|
63
|
-
"summary" in e.item || "requestUid" in e.item ? (
|
|
63
|
+
"summary" in e.item || "requestUid" in e.item ? (a(), m(i(Z), {
|
|
64
64
|
key: 0,
|
|
65
65
|
class: "no-underline",
|
|
66
66
|
to: j()
|
|
67
67
|
}, {
|
|
68
|
-
default: k(({ isExactActive:
|
|
69
|
-
|
|
70
|
-
class:
|
|
71
|
-
|
|
72
|
-
|
|
68
|
+
default: k(({ isExactActive: n }) => [
|
|
69
|
+
l("div", {
|
|
70
|
+
class: d(["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", [
|
|
71
|
+
$,
|
|
72
|
+
n || N.value ? "bg-sidebar-active-b text-sidebar-active-c transition-none" : "text-sidebar-c-2"
|
|
73
73
|
]]),
|
|
74
74
|
tabindex: "0"
|
|
75
75
|
}, [
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
76
|
+
l("span", {
|
|
77
|
+
class: d(["z-10 font-medium w-full pl-2 word-break-break-word", {
|
|
78
|
+
"editable-sidebar-hover-item": !i(r)
|
|
79
|
+
}])
|
|
80
|
+
}, y(D(e.item)), 3),
|
|
81
|
+
l("div", te, [
|
|
82
|
+
i(r) ? f("", !0) : (a(), m(x, {
|
|
79
83
|
key: 0,
|
|
80
84
|
item: e.item,
|
|
81
85
|
parentUids: e.parentUids
|
|
82
86
|
}, null, 8, ["item", "parentUids"])),
|
|
83
|
-
|
|
87
|
+
l("span", ie, [
|
|
84
88
|
q(" "),
|
|
85
|
-
|
|
89
|
+
b(i(_), {
|
|
86
90
|
class: "font-bold",
|
|
87
91
|
method: O.value
|
|
88
92
|
}, null, 8, ["method"])
|
|
@@ -91,20 +95,20 @@ const te = { class: "z-10 font-medium w-full editable-sidebar-hover-item pl-2" }
|
|
|
91
95
|
], 2)
|
|
92
96
|
]),
|
|
93
97
|
_: 1
|
|
94
|
-
}, 8, ["to"])) : !i(
|
|
98
|
+
}, 8, ["to"])) : !i(r) || e.parentUids.length ? (a(), p("button", {
|
|
95
99
|
key: 1,
|
|
96
|
-
class:
|
|
100
|
+
class: d(["hover:bg-b-2 group relative flex w-full flex-row justify-start gap-1.5 rounded p-1.5 z-[1]", $]),
|
|
97
101
|
type: "button",
|
|
98
|
-
onClick: s[0] || (s[0] = (
|
|
102
|
+
onClick: s[0] || (s[0] = (n) => i(E)(e.item.uid))
|
|
99
103
|
}, [
|
|
100
|
-
|
|
104
|
+
l("span", re, [
|
|
101
105
|
A(e.$slots, "leftIcon", {}, () => [
|
|
102
|
-
|
|
103
|
-
class:
|
|
106
|
+
l("div", {
|
|
107
|
+
class: d({
|
|
104
108
|
"rotate-90": i(v)[e.item.uid]
|
|
105
109
|
})
|
|
106
110
|
}, [
|
|
107
|
-
|
|
111
|
+
b(i(X), {
|
|
108
112
|
class: "text-c-3 text-sm",
|
|
109
113
|
icon: "ChevronRight",
|
|
110
114
|
size: "sm",
|
|
@@ -114,26 +118,30 @@ const te = { class: "z-10 font-medium w-full editable-sidebar-hover-item pl-2" }
|
|
|
114
118
|
], !0),
|
|
115
119
|
q(" ")
|
|
116
120
|
]),
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
121
|
+
l("div", se, [
|
|
122
|
+
l("span", {
|
|
123
|
+
class: d(["z-10 font-medium w-full word-break-break-word text-left", {
|
|
124
|
+
"editable-sidebar-hover-item": !i(r)
|
|
125
|
+
}])
|
|
126
|
+
}, y(D(e.item)), 3),
|
|
127
|
+
!i(r) && ((w = (u = e.item.spec) == null ? void 0 : u.info) == null ? void 0 : w.title) !== "Drafts" ? (a(), m(x, {
|
|
120
128
|
key: 0,
|
|
121
129
|
item: e.item,
|
|
122
130
|
parentUids: e.parentUids
|
|
123
131
|
}, null, 8, ["item", "parentUids"])) : f("", !0)
|
|
124
132
|
])
|
|
125
133
|
])) : f("", !0),
|
|
126
|
-
"childUids" in e.item ?
|
|
127
|
-
(
|
|
128
|
-
key:
|
|
134
|
+
"childUids" in e.item ? M((a(), p("div", ae, [
|
|
135
|
+
(a(!0), p(G, null, H("summary" in e.item ? e.item.childUids.slice(1) : e.item.childUids, (n) => (a(), m(F, {
|
|
136
|
+
key: n,
|
|
129
137
|
isDraggable: e.isDraggable,
|
|
130
138
|
isDroppable: e.isDroppable,
|
|
131
|
-
item: i(R)[
|
|
139
|
+
item: i(R)[n] || i(h)[n] || i(I)[n],
|
|
132
140
|
parentUids: [...e.parentUids, e.item.uid],
|
|
133
141
|
onOnDragEnd: s[1] || (s[1] = (...L) => e.$emit("onDragEnd", ...L))
|
|
134
142
|
}, null, 8, ["isDraggable", "isDroppable", "item", "parentUids"]))), 128))
|
|
135
143
|
], 512)), [
|
|
136
|
-
[
|
|
144
|
+
[J, V.value]
|
|
137
145
|
]) : f("", !0)
|
|
138
146
|
];
|
|
139
147
|
}),
|
|
@@ -144,5 +152,5 @@ const te = { class: "z-10 font-medium w-full editable-sidebar-hover-item pl-2" }
|
|
|
144
152
|
}
|
|
145
153
|
});
|
|
146
154
|
export {
|
|
147
|
-
|
|
155
|
+
ge as default
|
|
148
156
|
};
|
|
@@ -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":"AA4PA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iDAAiD,CAAA;AACjF,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,6CAA6C,CAAA;AACzE,OAAO,KAAK,EACV,OAAO,EACP,cAAc,EACf,MAAM,2CAA2C,CAAA;;IAOhD,qEAAqE;gBACzD,MAAM,EAAE;UACd,UAAU,GAAG,MAAM,GAAG,OAAO,GAAG,cAAc;;IAFpD,qEAAqE;gBACzD,MAAM,EAAE;UACd,UAAU,GAAG,MAAM,GAAG,OAAO,GAAG,cAAc;;AAshBtD,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,164 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
import { useWorkspace as G } from "../../store/workspace.js";
|
|
6
|
-
import { useModal as R, ScalarDropdown as H, ScalarDropdownItem as f, ScalarIcon as r, ScalarButton as v, ScalarModal as N, ScalarTextField as J } from "@scalar/components";
|
|
7
|
-
import { useRouter as L } from "vue-router";
|
|
8
|
-
const O = /* @__PURE__ */ u("span", null, "Add Example", -1), Q = /* @__PURE__ */ u("span", null, "Rename", -1), X = /* @__PURE__ */ u("span", null, "Delete", -1), Y = { class: "flex gap-3" }, se = /* @__PURE__ */ V({
|
|
9
|
-
__name: "RequestSidebarItemMenu",
|
|
10
|
-
props: {
|
|
11
|
-
parentUids: {},
|
|
12
|
-
item: {}
|
|
13
|
-
},
|
|
14
|
-
setup(S) {
|
|
15
|
-
const e = S, {
|
|
16
|
-
activeWorkspace: x,
|
|
17
|
-
activeRouterParams: h,
|
|
18
|
-
collectionMutators: k,
|
|
19
|
-
folderMutators: _,
|
|
20
|
-
requestMutators: C,
|
|
21
|
-
requestExampleMutators: y
|
|
22
|
-
} = G(), { replace: g } = L(), U = () => j.emit({
|
|
23
|
-
commandName: "Add Example",
|
|
24
|
-
metaData: e.item.uid
|
|
25
|
-
}), $ = () => {
|
|
26
|
-
"requestUid" in e.item ? (y.delete(e.item), h.value[E.Examples] === e.item.uid && g(`/workspace/${x.value}/request/default`)) : "summary" in e.item ? (C.delete(
|
|
27
|
-
e.item,
|
|
28
|
-
e.parentUids[e.parentUids.length - 1]
|
|
29
|
-
), h.value[E.Request] === e.item.uid && g(`/workspace/${x.value.uid}/request/default`)) : "spec" in e.item ? k.delete(e.item) : "name" in e.item && _.delete(
|
|
30
|
-
e.item,
|
|
31
|
-
e.parentUids[e.parentUids.length - 1]
|
|
32
|
-
);
|
|
33
|
-
}, z = p(() => "summary" in e.item), w = p(() => {
|
|
34
|
-
var c;
|
|
35
|
-
return "summary" in e.item ? e.item.summary || "" : "name" in e.item ? e.item.name || "" : "spec" in e.item && ((c = e.item.spec.info) == null ? void 0 : c.title) || "";
|
|
36
|
-
}), n = I(""), q = () => {
|
|
37
|
-
"summary" in e.item ? C.edit(e.item.uid, "summary", n.value) : "requestUid" in e.item ? y.edit(e.item.uid, "name", n.value) : "spec" in e.item ? k.edit(e.item.uid, "spec.info.title", n.value) : _.edit(e.item.uid, "name", n.value), m.hide();
|
|
38
|
-
}, m = R(), d = R(), D = () => {
|
|
39
|
-
n.value = w.value, m.show();
|
|
40
|
-
}, o = p(() => "requestUid" in e.item ? "Example" : "summary" in e.item ? "Request" : "spec" in e.item ? "Collection" : "Folder");
|
|
41
|
-
return (c, i) => (M(), B(A, null, [
|
|
42
|
-
l(t(H), { teleport: "#scalar-client" }, {
|
|
43
|
-
items: a(() => [
|
|
44
|
-
z.value ? (M(), F(t(f), {
|
|
45
|
-
key: 0,
|
|
46
|
-
class: "flex !gap-2",
|
|
47
|
-
onClick: U
|
|
48
|
-
}, {
|
|
49
|
-
default: a(() => [
|
|
50
|
-
l(t(r), {
|
|
51
|
-
class: "inline-flex",
|
|
52
|
-
icon: "Add",
|
|
53
|
-
size: "sm"
|
|
54
|
-
}),
|
|
55
|
-
O
|
|
56
|
-
]),
|
|
57
|
-
_: 1
|
|
58
|
-
})) : P("", !0),
|
|
59
|
-
l(t(f), {
|
|
60
|
-
class: "flex !gap-2",
|
|
61
|
-
onClick: D
|
|
62
|
-
}, {
|
|
63
|
-
default: a(() => [
|
|
64
|
-
l(t(r), {
|
|
65
|
-
class: "inline-flex",
|
|
66
|
-
icon: "Edit",
|
|
67
|
-
size: "sm"
|
|
68
|
-
}),
|
|
69
|
-
Q
|
|
70
|
-
]),
|
|
71
|
-
_: 1
|
|
72
|
-
}),
|
|
73
|
-
l(t(f), {
|
|
74
|
-
class: "flex !gap-2",
|
|
75
|
-
onClick: i[1] || (i[1] = (s) => t(d).show())
|
|
76
|
-
}, {
|
|
77
|
-
default: a(() => [
|
|
78
|
-
l(t(r), {
|
|
79
|
-
class: "inline-flex",
|
|
80
|
-
icon: "Trash",
|
|
81
|
-
size: "sm"
|
|
82
|
-
}),
|
|
83
|
-
X
|
|
84
|
-
]),
|
|
85
|
-
_: 1
|
|
86
|
-
})
|
|
87
|
-
]),
|
|
88
|
-
default: a(() => [
|
|
89
|
-
l(t(v), {
|
|
90
|
-
class: "px-1 py-0 z-10 hover:bg-b-3 hidden group-hover:flex ui-open:flex",
|
|
91
|
-
size: "sm",
|
|
92
|
-
variant: "ghost",
|
|
93
|
-
onClick: i[0] || (i[0] = (s) => {
|
|
94
|
-
(o.value === "Collection" || o.value === "Folder") && s.stopPropagation();
|
|
95
|
-
})
|
|
96
|
-
}, {
|
|
97
|
-
default: a(() => [
|
|
98
|
-
l(t(r), {
|
|
99
|
-
icon: "Ellipses",
|
|
100
|
-
size: "sm"
|
|
101
|
-
})
|
|
102
|
-
]),
|
|
103
|
-
_: 1
|
|
104
|
-
})
|
|
105
|
-
]),
|
|
106
|
-
_: 1
|
|
107
|
-
}),
|
|
108
|
-
l(t(N), {
|
|
109
|
-
size: "sm",
|
|
110
|
-
state: t(d),
|
|
111
|
-
title: `Delete ${o.value}`
|
|
112
|
-
}, {
|
|
113
|
-
default: a(() => [
|
|
114
|
-
l(W, {
|
|
115
|
-
variableName: w.value,
|
|
116
|
-
onClose: i[2] || (i[2] = (s) => t(d).hide()),
|
|
117
|
-
onDelete: $
|
|
118
|
-
}, null, 8, ["variableName"])
|
|
119
|
-
]),
|
|
120
|
-
_: 1
|
|
121
|
-
}, 8, ["state", "title"]),
|
|
122
|
-
l(t(N), {
|
|
123
|
-
state: t(m),
|
|
124
|
-
title: `Rename ${o.value}`
|
|
125
|
-
}, {
|
|
126
|
-
default: a(() => [
|
|
127
|
-
l(t(J), {
|
|
128
|
-
modelValue: n.value,
|
|
129
|
-
"onUpdate:modelValue": i[3] || (i[3] = (s) => n.value = s),
|
|
130
|
-
label: o.value,
|
|
131
|
-
labelShadowColor: "var(--scalar-background-1)",
|
|
132
|
-
onKeydown: T(K(q, ["prevent"]), ["enter"])
|
|
133
|
-
}, null, 8, ["modelValue", "label", "onKeydown"]),
|
|
134
|
-
u("div", Y, [
|
|
135
|
-
l(t(v), {
|
|
136
|
-
class: "flex-1",
|
|
137
|
-
variant: "outlined",
|
|
138
|
-
onClick: i[4] || (i[4] = (s) => t(m).hide())
|
|
139
|
-
}, {
|
|
140
|
-
default: a(() => [
|
|
141
|
-
b(" Cancel ")
|
|
142
|
-
]),
|
|
143
|
-
_: 1
|
|
144
|
-
}),
|
|
145
|
-
l(t(v), {
|
|
146
|
-
class: "flex-1",
|
|
147
|
-
type: "submit",
|
|
148
|
-
onClick: q
|
|
149
|
-
}, {
|
|
150
|
-
default: a(() => [
|
|
151
|
-
b(" Save ")
|
|
152
|
-
]),
|
|
153
|
-
_: 1
|
|
154
|
-
})
|
|
155
|
-
])
|
|
156
|
-
]),
|
|
157
|
-
_: 1
|
|
158
|
-
}, 8, ["state", "title"])
|
|
159
|
-
], 64));
|
|
160
|
-
}
|
|
161
|
-
});
|
|
1
|
+
import t from "./RequestSidebarItemMenu.vue2.js";
|
|
2
|
+
/* empty css */
|
|
3
|
+
import e from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
+
const a = /* @__PURE__ */ e(t, [["__scopeId", "data-v-b4744bc5"]]);
|
|
162
5
|
export {
|
|
163
|
-
|
|
6
|
+
a as default
|
|
164
7
|
};
|
|
@@ -1,4 +1,168 @@
|
|
|
1
|
-
import f from "
|
|
1
|
+
import { defineComponent as V, computed as f, ref as B, openBlock as q, createElementBlock as A, Fragment as F, createVNode as i, unref as t, withCtx as a, createBlock as P, createCommentVNode as T, withKeys as K, withModifiers as W, createElementVNode as d, createTextVNode as E, pushScopeId as j, popScopeId as G } from "vue";
|
|
2
|
+
import H from "../../components/Sidebar/Actions/DeleteSidebarListElement.vue.js";
|
|
3
|
+
import { commandPaletteBus as J } from "../../libs/eventBusses/command-palette.js";
|
|
4
|
+
import { PathId as R } from "../../router.js";
|
|
5
|
+
import { useWorkspace as L } from "../../store/workspace.js";
|
|
6
|
+
import { useModal as I, ScalarDropdown as O, ScalarDropdownItem as v, ScalarIcon as u, ScalarButton as x, ScalarModal as N, ScalarTextField as Q } from "@scalar/components";
|
|
7
|
+
import { useRouter as X } from "vue-router";
|
|
8
|
+
const h = (o) => (j("data-v-b4744bc5"), o = o(), G(), o), Y = /* @__PURE__ */ h(() => /* @__PURE__ */ d("span", null, "Add Example", -1)), Z = /* @__PURE__ */ h(() => /* @__PURE__ */ d("span", null, "Rename", -1)), ee = /* @__PURE__ */ h(() => /* @__PURE__ */ d("span", null, "Delete", -1)), te = { class: "flex gap-3" }, re = /* @__PURE__ */ V({
|
|
9
|
+
__name: "RequestSidebarItemMenu",
|
|
10
|
+
props: {
|
|
11
|
+
parentUids: {},
|
|
12
|
+
item: {}
|
|
13
|
+
},
|
|
14
|
+
setup(o) {
|
|
15
|
+
const e = o, {
|
|
16
|
+
activeWorkspace: k,
|
|
17
|
+
activeRouterParams: g,
|
|
18
|
+
collectionMutators: _,
|
|
19
|
+
folderMutators: w,
|
|
20
|
+
requestMutators: C,
|
|
21
|
+
requestExampleMutators: b
|
|
22
|
+
} = L(), { replace: y } = X(), U = () => J.emit({
|
|
23
|
+
commandName: "Add Example",
|
|
24
|
+
metaData: e.item.uid
|
|
25
|
+
}), D = () => {
|
|
26
|
+
"requestUid" in e.item ? (b.delete(e.item), g.value[R.Examples] === e.item.uid && y(`/workspace/${k.value}/request/default`)) : "summary" in e.item ? (C.delete(
|
|
27
|
+
e.item,
|
|
28
|
+
e.parentUids[e.parentUids.length - 1]
|
|
29
|
+
), g.value[R.Request] === e.item.uid && y(`/workspace/${k.value.uid}/request/default`)) : "spec" in e.item ? _.delete(e.item) : "name" in e.item && w.delete(
|
|
30
|
+
e.item,
|
|
31
|
+
e.parentUids[e.parentUids.length - 1]
|
|
32
|
+
);
|
|
33
|
+
}, $ = f(() => "summary" in e.item), M = f(() => {
|
|
34
|
+
var p;
|
|
35
|
+
return "summary" in e.item ? e.item.summary || "" : "name" in e.item ? e.item.name || "" : "spec" in e.item && ((p = e.item.spec.info) == null ? void 0 : p.title) || "";
|
|
36
|
+
}), s = B(""), S = () => {
|
|
37
|
+
"summary" in e.item ? C.edit(e.item.uid, "summary", s.value) : "requestUid" in e.item ? b.edit(e.item.uid, "name", s.value) : "spec" in e.item ? _.edit(e.item.uid, "spec.info.title", s.value) : w.edit(e.item.uid, "name", s.value), r.hide();
|
|
38
|
+
}, r = I(), c = I(), z = () => {
|
|
39
|
+
s.value = M.value, r.show();
|
|
40
|
+
}, m = f(() => "requestUid" in e.item ? "Example" : "summary" in e.item ? "Request" : "spec" in e.item ? "Collection" : "Folder");
|
|
41
|
+
return (p, l) => (q(), A(F, null, [
|
|
42
|
+
i(t(O), { teleport: "#scalar-client" }, {
|
|
43
|
+
items: a(() => [
|
|
44
|
+
$.value ? (q(), P(t(v), {
|
|
45
|
+
key: 0,
|
|
46
|
+
class: "flex !gap-2",
|
|
47
|
+
onClick: U
|
|
48
|
+
}, {
|
|
49
|
+
default: a(() => [
|
|
50
|
+
i(t(u), {
|
|
51
|
+
class: "inline-flex",
|
|
52
|
+
icon: "Add",
|
|
53
|
+
size: "sm",
|
|
54
|
+
thickness: "1.5"
|
|
55
|
+
}),
|
|
56
|
+
Y
|
|
57
|
+
]),
|
|
58
|
+
_: 1
|
|
59
|
+
})) : T("", !0),
|
|
60
|
+
i(t(v), {
|
|
61
|
+
class: "flex !gap-2",
|
|
62
|
+
onClick: z
|
|
63
|
+
}, {
|
|
64
|
+
default: a(() => [
|
|
65
|
+
i(t(u), {
|
|
66
|
+
class: "inline-flex",
|
|
67
|
+
icon: "Edit",
|
|
68
|
+
size: "sm",
|
|
69
|
+
thickness: "1.5"
|
|
70
|
+
}),
|
|
71
|
+
Z
|
|
72
|
+
]),
|
|
73
|
+
_: 1
|
|
74
|
+
}),
|
|
75
|
+
i(t(v), {
|
|
76
|
+
class: "flex !gap-2",
|
|
77
|
+
onClick: l[1] || (l[1] = (n) => t(c).show())
|
|
78
|
+
}, {
|
|
79
|
+
default: a(() => [
|
|
80
|
+
i(t(u), {
|
|
81
|
+
class: "inline-flex",
|
|
82
|
+
icon: "Trash",
|
|
83
|
+
size: "sm",
|
|
84
|
+
thickness: "1.5"
|
|
85
|
+
}),
|
|
86
|
+
ee
|
|
87
|
+
]),
|
|
88
|
+
_: 1
|
|
89
|
+
})
|
|
90
|
+
]),
|
|
91
|
+
default: a(() => [
|
|
92
|
+
i(t(x), {
|
|
93
|
+
class: "px-1 py-0 z-10 hover:bg-b-3 hidden group-hover:flex ui-open:flex absolute h-[20px] ellipsis-position",
|
|
94
|
+
size: "sm",
|
|
95
|
+
variant: "ghost",
|
|
96
|
+
onClick: l[0] || (l[0] = (n) => {
|
|
97
|
+
(m.value === "Collection" || m.value === "Folder") && n.stopPropagation();
|
|
98
|
+
})
|
|
99
|
+
}, {
|
|
100
|
+
default: a(() => [
|
|
101
|
+
i(t(u), {
|
|
102
|
+
icon: "Ellipses",
|
|
103
|
+
size: "sm"
|
|
104
|
+
})
|
|
105
|
+
]),
|
|
106
|
+
_: 1
|
|
107
|
+
})
|
|
108
|
+
]),
|
|
109
|
+
_: 1
|
|
110
|
+
}),
|
|
111
|
+
i(t(N), {
|
|
112
|
+
size: "sm",
|
|
113
|
+
state: t(c),
|
|
114
|
+
title: `Delete ${m.value}`
|
|
115
|
+
}, {
|
|
116
|
+
default: a(() => [
|
|
117
|
+
i(H, {
|
|
118
|
+
variableName: M.value,
|
|
119
|
+
warningMessage: "Warning: Deleting this will delete all items inside of this",
|
|
120
|
+
onClose: l[2] || (l[2] = (n) => t(c).hide()),
|
|
121
|
+
onDelete: D
|
|
122
|
+
}, null, 8, ["variableName"])
|
|
123
|
+
]),
|
|
124
|
+
_: 1
|
|
125
|
+
}, 8, ["state", "title"]),
|
|
126
|
+
i(t(N), {
|
|
127
|
+
state: t(r),
|
|
128
|
+
title: `Rename ${m.value}`
|
|
129
|
+
}, {
|
|
130
|
+
default: a(() => [
|
|
131
|
+
i(t(Q), {
|
|
132
|
+
modelValue: s.value,
|
|
133
|
+
"onUpdate:modelValue": l[3] || (l[3] = (n) => s.value = n),
|
|
134
|
+
label: m.value,
|
|
135
|
+
labelShadowColor: "var(--scalar-background-1)",
|
|
136
|
+
onKeydown: K(W(S, ["prevent"]), ["enter"])
|
|
137
|
+
}, null, 8, ["modelValue", "label", "onKeydown"]),
|
|
138
|
+
d("div", te, [
|
|
139
|
+
i(t(x), {
|
|
140
|
+
class: "flex-1",
|
|
141
|
+
variant: "outlined",
|
|
142
|
+
onClick: l[4] || (l[4] = (n) => t(r).hide())
|
|
143
|
+
}, {
|
|
144
|
+
default: a(() => [
|
|
145
|
+
E(" Cancel ")
|
|
146
|
+
]),
|
|
147
|
+
_: 1
|
|
148
|
+
}),
|
|
149
|
+
i(t(x), {
|
|
150
|
+
class: "flex-1",
|
|
151
|
+
type: "submit",
|
|
152
|
+
onClick: S
|
|
153
|
+
}, {
|
|
154
|
+
default: a(() => [
|
|
155
|
+
E(" Save ")
|
|
156
|
+
]),
|
|
157
|
+
_: 1
|
|
158
|
+
})
|
|
159
|
+
])
|
|
160
|
+
]),
|
|
161
|
+
_: 1
|
|
162
|
+
}, 8, ["state", "title"])
|
|
163
|
+
], 64));
|
|
164
|
+
}
|
|
165
|
+
});
|
|
2
166
|
export {
|
|
3
|
-
|
|
167
|
+
re as default
|
|
4
168
|
};
|