@scalar/api-client 2.1.35 → 2.1.36
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 +14 -0
- package/dist/components/CommandPalette/CommandPaletteImport.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/CommandPaletteImport.vue.js +105 -119
- 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 +14 -14
- package/dist/components/CommandPalette/WatchModeToggle.vue.d.ts +15 -0
- package/dist/components/CommandPalette/WatchModeToggle.vue.d.ts.map +1 -0
- package/dist/components/CommandPalette/WatchModeToggle.vue.js +39 -0
- package/dist/components/CommandPalette/WatchModeToggle.vue2.js +4 -0
- package/dist/components/EnvironmentSelector/EnvironmentSelector.vue.js +1 -1
- package/dist/components/ImportCollection/DropEventListener.vue.d.ts.map +1 -1
- package/dist/components/ImportCollection/DropEventListener.vue.js +39 -33
- package/dist/components/ImportCollection/ImportCollectionListener.vue.d.ts.map +1 -1
- package/dist/components/ImportCollection/ImportCollectionListener.vue.js +22 -20
- package/dist/components/ImportCollection/ImportCollectionModal.vue.d.ts +2 -0
- package/dist/components/ImportCollection/ImportCollectionModal.vue.d.ts.map +1 -1
- package/dist/components/ImportCollection/ImportCollectionModal.vue.js +159 -100
- package/dist/components/ImportCollection/ImportCollectionModal.vue3.js +5 -0
- package/dist/components/ImportCollection/ImportNowButton.vue.d.ts +2 -0
- package/dist/components/ImportCollection/ImportNowButton.vue.d.ts.map +1 -1
- package/dist/components/ImportCollection/ImportNowButton.vue.js +35 -31
- package/dist/components/ImportCollection/IntegrationLogo.vue.d.ts +7 -0
- package/dist/components/ImportCollection/IntegrationLogo.vue.d.ts.map +1 -0
- package/dist/components/ImportCollection/IntegrationLogo.vue.js +46 -0
- package/dist/components/ImportCollection/IntegrationLogo.vue2.js +4 -0
- package/dist/components/ImportCollection/PrefetchError.vue.d.ts +8 -0
- package/dist/components/ImportCollection/PrefetchError.vue.d.ts.map +1 -0
- package/dist/components/ImportCollection/UrlQueryParameterChecker.vue.d.ts +2 -2
- package/dist/components/ImportCollection/UrlQueryParameterChecker.vue.d.ts.map +1 -1
- package/dist/components/ImportCollection/UrlQueryParameterChecker.vue.js +7 -7
- package/dist/components/ImportCollection/WorkspaceSelector.vue.d.ts.map +1 -1
- package/dist/components/ImportCollection/WorkspaceSelector.vue.js +2 -2
- package/dist/components/ImportCollection/hooks/useUrlPrefetcher.d.ts +29 -12
- package/dist/components/ImportCollection/hooks/useUrlPrefetcher.d.ts.map +1 -1
- package/dist/components/ImportCollection/hooks/useUrlPrefetcher.js +34 -42
- package/dist/components/OpenApiClientButton.vue.d.ts +13 -0
- package/dist/components/OpenApiClientButton.vue.d.ts.map +1 -0
- package/dist/components/OpenApiClientButton.vue.js +7 -0
- package/dist/components/OpenApiClientButton.vue2.js +36 -0
- package/dist/components/ViewLayout/ViewLayoutSection.vue.d.ts.map +1 -1
- package/dist/components/ViewLayout/ViewLayoutSection.vue.js +6 -6
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +4 -2
- package/dist/layouts/App/create-api-client-app.d.ts +58 -41
- 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 +1 -1
- package/dist/layouts/Modal/create-api-client-modal.d.ts +116 -82
- package/dist/layouts/Modal/create-api-client-modal.d.ts.map +1 -1
- package/dist/layouts/Web/ApiClientWeb.vue.d.ts.map +1 -1
- package/dist/layouts/Web/ApiClientWeb.vue.js +42 -38
- package/dist/layouts/Web/create-api-client-web.d.ts +58 -41
- package/dist/layouts/Web/create-api-client-web.d.ts.map +1 -1
- package/dist/libs/create-client.d.ts +58 -41
- package/dist/libs/create-client.d.ts.map +1 -1
- package/dist/store/collections.d.ts +34 -24
- package/dist/store/collections.d.ts.map +1 -1
- package/dist/store/import-spec.d.ts +6 -4
- package/dist/store/import-spec.d.ts.map +1 -1
- package/dist/store/store.d.ts +116 -82
- package/dist/store/store.d.ts.map +1 -1
- package/dist/style.css +1 -1
- package/dist/views/Request/RequestSection/RequestSection.vue.js +2 -2
- package/dist/views/Request/RequestSection/RequestSection.vue2.js +7 -7
- package/dist/views/Request/RequestSidebar.vue.js +3 -3
- package/dist/views/Request/RequestSidebar.vue2.js +29 -29
- package/dist/views/Request/RequestSidebarItem.vue.js +2 -2
- package/dist/views/Request/RequestSidebarItem.vue2.js +76 -76
- package/dist/views/Request/RequestSidebarItemMenu.vue.d.ts +2 -2
- package/dist/views/Request/RequestSidebarItemMenu.vue.js +3 -3
- package/dist/views/Request/RequestSidebarItemMenu.vue2.js +47 -47
- package/dist/views/Request/RequestSubpageHeader.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSubpageHeader.vue.js +1 -1
- package/dist/views/Request/RequestSubpageHeader.vue2.js +67 -42
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
- package/dist/views/Request/ResponseSection/ResponseSection.vue.d.ts.map +1 -1
- package/dist/views/Request/ResponseSection/ResponseSection.vue.js +3 -3
- package/dist/views/Request/ResponseSection/ResponseSection.vue2.js +1 -1
- package/dist/views/Request/components/WorkspaceDropdown.vue.js +1 -1
- package/dist/views/Request/hooks/useOpenApiWatcher.js +24 -24
- package/dist/views/Request/types/sidebar-item.d.ts +1 -1
- package/dist/views/Request/types/sidebar-item.d.ts.map +1 -1
- package/package.json +6 -6
- package/dist/components/ImportCollection/ImportCollectionModal.vue2.js +0 -4
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./RequestSection.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-55b0bff1"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
m as default
|
|
7
7
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as B, computed as _, ref as q, watch as b, openBlock as m, createBlock as C, withCtx as S, createElementVNode as A, unref as s, createElementBlock as p, createCommentVNode as V, toDisplayString as w, createVNode as u, withDirectives as i, vShow as r } from "vue";
|
|
2
2
|
import H from "../../../components/ContextBar.vue.js";
|
|
3
3
|
import R from "../../../components/ViewLayout/ViewLayoutSection.vue.js";
|
|
4
4
|
import N from "./RequestBody.vue.js";
|
|
@@ -7,20 +7,20 @@ import K from "./RequestPathParams.vue.js";
|
|
|
7
7
|
import { canMethodHaveBody as h } from "@scalar/oas-utils/helpers";
|
|
8
8
|
import U from "./RequestAuth/RequestAuth.vue.js";
|
|
9
9
|
import { useWorkspace as E } from "../../../store/store.js";
|
|
10
|
-
const Q = { class: "flex-1 flex gap-1 items-center lg:pr-24 pointer-events-none
|
|
10
|
+
const Q = { class: "flex-1 flex gap-1 items-center lg:pr-24 pointer-events-none group" }, $ = {
|
|
11
11
|
key: 0,
|
|
12
12
|
class: "absolute w-full h-full top-0 left-0 pointer-events-auto opacity-0 cursor-text",
|
|
13
13
|
for: "requestname"
|
|
14
14
|
}, D = ["value"], M = {
|
|
15
15
|
key: 2,
|
|
16
16
|
class: "text-c-1"
|
|
17
|
-
}, P = { class: "request-section-content custom-scroll flex flex-1 flex-col px-2 xl:px-4 py-2.5" }, X = /* @__PURE__ */
|
|
17
|
+
}, P = { class: "request-section-content custom-scroll flex flex-1 flex-col px-2 xl:px-4 py-2.5" }, X = /* @__PURE__ */ B({
|
|
18
18
|
__name: "RequestSection",
|
|
19
19
|
props: {
|
|
20
20
|
selectedSecuritySchemeUids: {}
|
|
21
21
|
},
|
|
22
22
|
setup(I) {
|
|
23
|
-
const { activeRequest: a, activeExample: f, isReadOnly: d, requestMutators: x } = E(),
|
|
23
|
+
const { activeRequest: a, activeExample: f, isReadOnly: d, requestMutators: x } = E(), g = _(() => {
|
|
24
24
|
var l, o;
|
|
25
25
|
const t = /* @__PURE__ */ new Set([
|
|
26
26
|
"All",
|
|
@@ -41,7 +41,7 @@ const Q = { class: "flex-1 flex gap-1 items-center lg:pr-24 pointer-events-none
|
|
|
41
41
|
b(a, (t) => {
|
|
42
42
|
e.value === "Body" && t && !h(t.method) && (e.value = "All");
|
|
43
43
|
});
|
|
44
|
-
const
|
|
44
|
+
const k = (t) => {
|
|
45
45
|
if (!a.value) return;
|
|
46
46
|
const l = t.target;
|
|
47
47
|
x.edit(a.value.uid, "summary", l.value);
|
|
@@ -58,12 +58,12 @@ const Q = { class: "flex-1 flex gap-1 items-center lg:pr-24 pointer-events-none
|
|
|
58
58
|
class: "text-c-1 rounded pointer-events-auto relative w-full pl-3 -ml-3 has-[:focus-visible]:outline h-8 group-hover-input has-[:focus-visible]:outline",
|
|
59
59
|
placeholder: "Request Name",
|
|
60
60
|
value: (o = s(a)) == null ? void 0 : o.summary,
|
|
61
|
-
onInput:
|
|
61
|
+
onInput: k
|
|
62
62
|
}, null, 40, D))
|
|
63
63
|
]),
|
|
64
64
|
u(H, {
|
|
65
65
|
activeSection: e.value,
|
|
66
|
-
sections:
|
|
66
|
+
sections: g.value,
|
|
67
67
|
onSetActiveSection: l[0] || (l[0] = (c) => e.value = c)
|
|
68
68
|
}, null, 8, ["activeSection", "sections"])
|
|
69
69
|
];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import o from "./RequestSidebar.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
|
-
import
|
|
4
|
-
const m = /* @__PURE__ */ o
|
|
3
|
+
import t from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
+
const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-71517875"]]);
|
|
5
5
|
export {
|
|
6
6
|
m as default
|
|
7
7
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as Q, reactive as X, watch as Y, onMounted as Z, onBeforeUnmount as _, openBlock as a, createElementBlock as h, Fragment as S, withDirectives as ee, createVNode as u, unref as t, normalizeClass as f, createSlots as te, withCtx as i, createElementVNode as n, isRef as oe, withKeys as v, withModifiers as m, createBlock as l, renderList as
|
|
1
|
+
import { defineComponent as Q, reactive as X, watch as Y, onMounted as Z, onBeforeUnmount as _, openBlock as a, createElementBlock as h, Fragment as S, withDirectives as ee, createVNode as u, unref as t, normalizeClass as f, createSlots as te, withCtx as i, createElementVNode as n, isRef as oe, withKeys as v, withModifiers as m, createBlock as l, renderList as D, createTextVNode as C, toDisplayString as se, createCommentVNode as M, vShow as re } from "vue";
|
|
2
2
|
import ae from "../../assets/rabbit.ascii.js";
|
|
3
3
|
import ne from "../../assets/rabbitjump.ascii.js";
|
|
4
4
|
import ie from "../../components/HttpMethod/HttpMethod.vue.js";
|
|
@@ -12,8 +12,8 @@ import { LibraryIcon as be } from "@scalar/icons";
|
|
|
12
12
|
import he from "./RequestSidebarItem.vue.js";
|
|
13
13
|
import Se from "../../components/Sidebar/Sidebar.vue.js";
|
|
14
14
|
import { useSidebar as ve } from "../../hooks/useSidebar.js";
|
|
15
|
-
import { useWorkspace as
|
|
16
|
-
const
|
|
15
|
+
import { useWorkspace as Re } from "../../store/store.js";
|
|
16
|
+
const we = { class: "search-button-fade sticky px-3 py-2.5 top-0 z-10" }, ge = { class: "empty-sidebar-item-content px-2.5 py-2.5" }, ke = { class: "w-[60px] h-[68px] m-auto rabbit-ascii mt-2 relative" }, We = /* @__PURE__ */ Q({
|
|
17
17
|
__name: "RequestSidebar",
|
|
18
18
|
props: {
|
|
19
19
|
showSidebar: { type: Boolean },
|
|
@@ -21,16 +21,16 @@ const Re = { class: "search-button-fade sticky px-3 py-2.5 top-0 z-10" }, we = {
|
|
|
21
21
|
},
|
|
22
22
|
emits: ["update:showSidebar", "newTab"],
|
|
23
23
|
setup(q, { emit: T }) {
|
|
24
|
-
const B = q,
|
|
24
|
+
const B = q, R = T, w = Re(), {
|
|
25
25
|
activeWorkspaceCollections: E,
|
|
26
|
-
activeRequest:
|
|
27
|
-
activeWorkspaceRequests:
|
|
26
|
+
activeRequest: F,
|
|
27
|
+
activeWorkspaceRequests: K,
|
|
28
28
|
findRequestParents: O,
|
|
29
29
|
isReadOnly: W,
|
|
30
30
|
events: b
|
|
31
|
-
} =
|
|
31
|
+
} = w, { handleDragEnd: N, isDroppable: U } = pe(w), { collapsedSidebarFolders: z, setCollapsedSidebarFolder: A } = ve(), p = X({ open: !1 });
|
|
32
32
|
Y(
|
|
33
|
-
|
|
33
|
+
F,
|
|
34
34
|
(o) => {
|
|
35
35
|
o && O(o).forEach(
|
|
36
36
|
(e) => A(e, !0)
|
|
@@ -40,23 +40,23 @@ const Re = { class: "search-button-fade sticky px-3 py-2.5 top-0 z-10" }, we = {
|
|
|
40
40
|
);
|
|
41
41
|
const {
|
|
42
42
|
searchText: c,
|
|
43
|
-
searchResultsWithPlaceholderResults:
|
|
43
|
+
searchResultsWithPlaceholderResults: g,
|
|
44
44
|
selectedSearchResult: k,
|
|
45
45
|
onSearchResultClick: L,
|
|
46
46
|
fuseSearch: P,
|
|
47
47
|
searchInputRef: y,
|
|
48
48
|
searchResultRefs: H,
|
|
49
|
-
navigateSearchResults:
|
|
49
|
+
navigateSearchResults: I,
|
|
50
50
|
selectSearchResult: j
|
|
51
|
-
} = le(),
|
|
51
|
+
} = le(), x = (o) => {
|
|
52
52
|
var e;
|
|
53
|
-
o && (o.toggleSidebar &&
|
|
53
|
+
o && (o.toggleSidebar && R("update:showSidebar", B.showSidebar), o.focusRequestSearch && ((e = y.value) == null || e.focus()));
|
|
54
54
|
};
|
|
55
|
-
Z(() => b.hotKeys.on(
|
|
56
|
-
b.hotKeys.off(
|
|
55
|
+
Z(() => b.hotKeys.on(x)), _(() => {
|
|
56
|
+
b.hotKeys.off(x);
|
|
57
57
|
});
|
|
58
58
|
const G = (o) => {
|
|
59
|
-
o != null && o.documentUrl && (o.
|
|
59
|
+
o != null && o.documentUrl && (o.watchMode = !o.watchMode);
|
|
60
60
|
};
|
|
61
61
|
return (o, e) => (a(), h(S, null, [
|
|
62
62
|
ee(u(t(Se), {
|
|
@@ -65,7 +65,7 @@ const Re = { class: "search-button-fade sticky px-3 py-2.5 top-0 z-10" }, we = {
|
|
|
65
65
|
"onUpdate:showSidebar": e[8] || (e[8] = (s) => o.$emit("update:showSidebar", s))
|
|
66
66
|
}, te({
|
|
67
67
|
content: i(() => [
|
|
68
|
-
n("div",
|
|
68
|
+
n("div", we, [
|
|
69
69
|
u(t(me), {
|
|
70
70
|
ref_key: "searchInputRef",
|
|
71
71
|
ref: y,
|
|
@@ -74,9 +74,9 @@ const Re = { class: "search-button-fade sticky px-3 py-2.5 top-0 z-10" }, we = {
|
|
|
74
74
|
sidebar: "",
|
|
75
75
|
onInput: t(P),
|
|
76
76
|
onKeydown: [
|
|
77
|
-
e[1] || (e[1] = v(m((s) => t(
|
|
77
|
+
e[1] || (e[1] = v(m((s) => t(I)("down"), ["stop"]), ["down"])),
|
|
78
78
|
e[2] || (e[2] = v(m((s) => t(j)(), ["stop"]), ["enter"])),
|
|
79
|
-
e[3] || (e[3] = v(m((s) => t(
|
|
79
|
+
e[3] || (e[3] = v(m((s) => t(I)("up"), ["stop"]), ["up"]))
|
|
80
80
|
]
|
|
81
81
|
}, null, 8, ["modelValue", "onInput"])
|
|
82
82
|
]),
|
|
@@ -92,10 +92,10 @@ const Re = { class: "search-button-fade sticky px-3 py-2.5 top-0 z-10" }, we = {
|
|
|
92
92
|
t(c) ? (a(), l(t(ce), {
|
|
93
93
|
key: 0,
|
|
94
94
|
class: "gap-px custom-scroll",
|
|
95
|
-
noResults: !t(
|
|
95
|
+
noResults: !t(g).length
|
|
96
96
|
}, {
|
|
97
97
|
default: i(() => [
|
|
98
|
-
(a(!0), h(S, null,
|
|
98
|
+
(a(!0), h(S, null, D(t(g), (s, d) => (a(), l(t(fe), {
|
|
99
99
|
id: `#search-input-${s.item.id}`,
|
|
100
100
|
key: s.refIndex,
|
|
101
101
|
ref_for: !0,
|
|
@@ -112,13 +112,13 @@ const Re = { class: "search-button-fade sticky px-3 py-2.5 top-0 z-10" }, we = {
|
|
|
112
112
|
}, null, 8, ["method"])
|
|
113
113
|
]),
|
|
114
114
|
default: i(() => [
|
|
115
|
-
|
|
115
|
+
C(se(s.item.title) + " ", 1)
|
|
116
116
|
]),
|
|
117
117
|
_: 2
|
|
118
118
|
}, 1032, ["id", "active", "onClick", "onFocus"]))), 128))
|
|
119
119
|
]),
|
|
120
120
|
_: 1
|
|
121
|
-
}, 8, ["noResults"])) : (a(!0), h(S, { key: 1 },
|
|
121
|
+
}, 8, ["noResults"])) : (a(!0), h(S, { key: 1 }, D(t(E), (s) => {
|
|
122
122
|
var d;
|
|
123
123
|
return a(), l(he, {
|
|
124
124
|
key: s.uid,
|
|
@@ -127,7 +127,7 @@ const Re = { class: "search-button-fade sticky px-3 py-2.5 top-0 z-10" }, we = {
|
|
|
127
127
|
menuItem: p,
|
|
128
128
|
parentUids: [],
|
|
129
129
|
uid: s.uid,
|
|
130
|
-
onNewTab: e[4] || (e[4] = (r, J) =>
|
|
130
|
+
onNewTab: e[4] || (e[4] = (r, J) => R("newTab", { name: r, uid: J })),
|
|
131
131
|
onOnDragEnd: t(N),
|
|
132
132
|
onOpenMenu: e[5] || (e[5] = (r) => Object.assign(p, r))
|
|
133
133
|
}, {
|
|
@@ -166,10 +166,10 @@ const Re = { class: "search-button-fade sticky px-3 py-2.5 top-0 z-10" }, we = {
|
|
|
166
166
|
button: i(() => [
|
|
167
167
|
n("div", {
|
|
168
168
|
class: f({
|
|
169
|
-
"empty-sidebar-item": t(
|
|
169
|
+
"empty-sidebar-item": t(K).length <= 1
|
|
170
170
|
})
|
|
171
171
|
}, [
|
|
172
|
-
n("div",
|
|
172
|
+
n("div", ge, [
|
|
173
173
|
n("div", ke, [
|
|
174
174
|
u($, {
|
|
175
175
|
art: t(ae),
|
|
@@ -185,13 +185,13 @@ const Re = { class: "search-button-fade sticky px-3 py-2.5 top-0 z-10" }, we = {
|
|
|
185
185
|
n("p", { class: "mt-2" }, " Create request, folder, collection or import OpenAPI document ")
|
|
186
186
|
], -1))
|
|
187
187
|
]),
|
|
188
|
-
o.isReadonly ?
|
|
188
|
+
o.isReadonly ? M("", !0) : (a(), l(de, {
|
|
189
189
|
key: 0,
|
|
190
190
|
click: t(b).commandPalette.emit,
|
|
191
191
|
hotkey: "K"
|
|
192
192
|
}, {
|
|
193
193
|
title: i(() => e[11] || (e[11] = [
|
|
194
|
-
|
|
194
|
+
C("Add Item")
|
|
195
195
|
])),
|
|
196
196
|
_: 1
|
|
197
197
|
}, 8, ["click"]))
|
|
@@ -211,8 +211,8 @@ const Re = { class: "search-button-fade sticky px-3 py-2.5 top-0 z-10" }, we = {
|
|
|
211
211
|
key: 0,
|
|
212
212
|
menuItem: p,
|
|
213
213
|
onCloseMenu: e[9] || (e[9] = (s) => p.open = !1),
|
|
214
|
-
|
|
215
|
-
}, null, 8, ["menuItem"])) :
|
|
214
|
+
onToggleWatchMode: G
|
|
215
|
+
}, null, 8, ["menuItem"])) : M("", !0)
|
|
216
216
|
], 64));
|
|
217
217
|
}
|
|
218
218
|
});
|
|
@@ -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
|
|
5
|
+
const p = /* @__PURE__ */ o(t, [["__scopeId", "data-v-e4ab1065"]]);
|
|
6
6
|
export {
|
|
7
|
-
|
|
7
|
+
p as default
|
|
8
8
|
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { defineComponent as ne, useCssVars as re, computed as c, ref as
|
|
2
|
-
import { PathId as
|
|
3
|
-
import { ScalarButton as
|
|
1
|
+
import { defineComponent as ne, useCssVars as re, computed as c, ref as le, resolveComponent as se, openBlock as p, createElementBlock as k, normalizeClass as f, unref as n, createVNode as h, withCtx as g, createBlock as v, withModifiers as R, createElementVNode as a, toDisplayString as M, createCommentVNode as b, createTextVNode as j, renderSlot as ae, Fragment as oe, renderList as de } from "vue";
|
|
2
|
+
import { PathId as ue } from "../../router.js";
|
|
3
|
+
import { ScalarButton as T, ScalarIcon as x, ScalarTooltip as pe } from "@scalar/components";
|
|
4
4
|
import { Draggable as fe } from "@scalar/draggable";
|
|
5
5
|
import { RouterLink as me } from "vue-router";
|
|
6
6
|
import ce from "../../components/HttpMethod/HttpMethod.vue.js";
|
|
7
7
|
import { useSidebar as ge } from "../../hooks/useSidebar.js";
|
|
8
8
|
import { getModifiers as ve } from "../../libs/hot-keys.js";
|
|
9
9
|
import { useWorkspace as be } from "../../store/store.js";
|
|
10
|
-
const he = { class: "flex flex-row gap-1 items-center" }, xe = { class: "relative" }, ye = { class: "flex items-start" }, we = { class: "flex h-5 items-center justify-center max-w-[14px]" }, ke = { class: "flex flex-1 flex-row justify-between editable-sidebar-hover" }, Ue = { class: "relative flex h-fit" },
|
|
10
|
+
const he = { class: "flex flex-row gap-1 items-center" }, xe = { class: "relative" }, ye = { class: "flex items-start" }, we = { class: "flex h-5 items-center justify-center max-w-[14px]" }, ke = { class: "flex flex-1 flex-row justify-between editable-sidebar-hover" }, Ue = { class: "relative flex h-fit" }, qe = { class: "grid gap-1.5 pointer-events-none max-w-10 w-content shadow-lg rounded bg-b-1 z-100 p-2 text-xxs leading-5 z-10 text-c-1" }, De = { class: "flex items-center text-c-2" }, Ce = { class: "text-pretty break-all" }, Re = { key: 2 }, B = "hover:bg-sidebar-active-b indent-padding-left", je = /* @__PURE__ */ ne({
|
|
11
11
|
__name: "RequestSidebarItem",
|
|
12
12
|
props: {
|
|
13
13
|
isDraggable: { type: Boolean, default: !1 },
|
|
@@ -17,70 +17,70 @@ const he = { class: "flex flex-row gap-1 items-center" }, xe = { class: "relativ
|
|
|
17
17
|
menuItem: {}
|
|
18
18
|
},
|
|
19
19
|
emits: ["onDragEnd", "newTab", "openMenu"],
|
|
20
|
-
setup(
|
|
20
|
+
setup(P, { emit: V }) {
|
|
21
21
|
re((e) => ({
|
|
22
|
-
"
|
|
23
|
-
"
|
|
22
|
+
"2ec00a5e": K.value,
|
|
23
|
+
"5f4d32c0": Q.value
|
|
24
24
|
}));
|
|
25
|
-
const r =
|
|
26
|
-
activeCollection:
|
|
27
|
-
activeRequest:
|
|
28
|
-
activeRouterParams:
|
|
25
|
+
const r = P, W = V, {
|
|
26
|
+
activeCollection: A,
|
|
27
|
+
activeRequest: $,
|
|
28
|
+
activeRouterParams: F,
|
|
29
29
|
activeWorkspace: y,
|
|
30
30
|
collections: U,
|
|
31
31
|
tags: Y,
|
|
32
32
|
isReadOnly: m,
|
|
33
|
-
requests:
|
|
34
|
-
requestExamples:
|
|
35
|
-
collectionMutators:
|
|
36
|
-
tagMutators:
|
|
33
|
+
requests: I,
|
|
34
|
+
requestExamples: q,
|
|
35
|
+
collectionMutators: D,
|
|
36
|
+
tagMutators: E,
|
|
37
37
|
requestMutators: S,
|
|
38
38
|
requestExampleMutators: z,
|
|
39
39
|
router: H,
|
|
40
40
|
events: L
|
|
41
41
|
} = be(), { collapsedSidebarFolders: N, toggleSidebarFolder: G } = ge(), i = c(() => {
|
|
42
|
-
var
|
|
43
|
-
const e = U[r.uid], t = Y[r.uid],
|
|
42
|
+
var s, u;
|
|
43
|
+
const e = U[r.uid], t = Y[r.uid], l = I[r.uid], o = q[r.uid];
|
|
44
44
|
return e ? {
|
|
45
|
-
title: ((
|
|
45
|
+
title: ((s = e.info) == null ? void 0 : s.title) ?? "Unknown title",
|
|
46
46
|
entity: e,
|
|
47
47
|
resourceTitle: "Collection",
|
|
48
48
|
children: e.children,
|
|
49
49
|
icon: e["x-scalar-icon"],
|
|
50
50
|
documentUrl: e.documentUrl,
|
|
51
|
-
|
|
51
|
+
watchMode: e.watchMode,
|
|
52
52
|
warning: "This cannot be undone. You’re about to delete the collection and all folders and requests inside it.",
|
|
53
|
-
edit: (
|
|
54
|
-
|
|
53
|
+
edit: (d, w) => {
|
|
54
|
+
D.edit(e.uid, "info.title", d), w && D.edit(e.uid, "x-scalar-icon", w);
|
|
55
55
|
},
|
|
56
|
-
delete: () =>
|
|
56
|
+
delete: () => D.delete(e, y.value)
|
|
57
57
|
} : t ? {
|
|
58
58
|
title: t.name,
|
|
59
59
|
entity: t,
|
|
60
60
|
resourceTitle: "Tag",
|
|
61
61
|
children: t.children,
|
|
62
62
|
warning: "This cannot be undone. You’re about to delete the tag and all requests inside it",
|
|
63
|
-
edit: (
|
|
64
|
-
delete: () =>
|
|
65
|
-
} :
|
|
66
|
-
title:
|
|
67
|
-
link: `/workspace/${y.value.uid}/request/${
|
|
68
|
-
method:
|
|
69
|
-
entity:
|
|
63
|
+
edit: (d) => E.edit(t.uid, "name", d),
|
|
64
|
+
delete: () => E.delete(t, r.parentUids[0])
|
|
65
|
+
} : l ? {
|
|
66
|
+
title: l.summary ?? [l.method, l.path].join(" - "),
|
|
67
|
+
link: `/workspace/${y.value.uid}/request/${l.uid}`,
|
|
68
|
+
method: l.method,
|
|
69
|
+
entity: l,
|
|
70
70
|
resourceTitle: "Request",
|
|
71
71
|
warning: "This cannot be undone. You’re about to delete the request.",
|
|
72
|
-
children:
|
|
73
|
-
edit: (
|
|
74
|
-
delete: () => S.delete(
|
|
72
|
+
children: l.examples,
|
|
73
|
+
edit: (d) => S.edit(l.uid, "summary", d),
|
|
74
|
+
delete: () => S.delete(l, r.parentUids[0])
|
|
75
75
|
} : {
|
|
76
76
|
title: o.name,
|
|
77
77
|
link: `/workspace/${y.value.uid}/request/${o.requestUid}/examples/${o.uid}`,
|
|
78
|
-
method: (
|
|
78
|
+
method: (u = I[o.requestUid]) == null ? void 0 : u.method,
|
|
79
79
|
entity: o,
|
|
80
80
|
resourceTitle: "Example",
|
|
81
81
|
warning: "This cannot be undone. You’re about to delete the example from the request.",
|
|
82
82
|
children: [],
|
|
83
|
-
edit: (
|
|
83
|
+
edit: (d) => z.edit(o.uid, "name", d),
|
|
84
84
|
delete: () => z.delete(o)
|
|
85
85
|
};
|
|
86
86
|
}), J = c(
|
|
@@ -88,20 +88,20 @@ const he = { class: "flex flex-row gap-1 items-center" }, xe = { class: "relativ
|
|
|
88
88
|
), K = c(() => r.parentUids.length ? m.value ? `${(r.parentUids.length - 1) * 12}px` : `${r.parentUids.length * 12}px` : "12px"), Q = c(() => r.parentUids.length ? m.value ? `${(r.parentUids.length - 1) * 12}px` : `${r.parentUids.length * 12}px` : "0px"), X = c(
|
|
89
89
|
() => {
|
|
90
90
|
var e;
|
|
91
|
-
return N[r.uid] || ((e =
|
|
91
|
+
return N[r.uid] || ((e = $.value) == null ? void 0 : e.uid) === r.uid && i.value.entity.examples.length > 1;
|
|
92
92
|
}
|
|
93
93
|
), Z = c(
|
|
94
94
|
() => {
|
|
95
95
|
var e;
|
|
96
|
-
return
|
|
96
|
+
return F.value[ue.Request] === "default" && ((e = $.value) == null ? void 0 : e.uid) === r.uid;
|
|
97
97
|
}
|
|
98
|
-
),
|
|
98
|
+
), C = le(null), O = c(() => {
|
|
99
99
|
let e = 0.5, t = 0.5;
|
|
100
|
-
if (!
|
|
101
|
-
const { draggingItem:
|
|
102
|
-
return !U[
|
|
103
|
-
}), _ = (e, t) => !(y.value.isReadOnly ||
|
|
104
|
-
e && (ve(["default"]).some((
|
|
100
|
+
if (!C.value) return { ceiling: e, floor: t };
|
|
101
|
+
const { draggingItem: l } = C.value;
|
|
102
|
+
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 };
|
|
103
|
+
}), _ = (e, t) => !(y.value.isReadOnly || q[t.id] || U[e.id]), ee = (e, t) => {
|
|
104
|
+
e && (ve(["default"]).some((s) => e[s]) ? W("newTab", t.title || "", t.entity.uid) : t.link && H.push(t.link));
|
|
105
105
|
};
|
|
106
106
|
function te() {
|
|
107
107
|
L.commandPalette.emit({
|
|
@@ -113,11 +113,11 @@ const he = { class: "flex flex-row gap-1 items-center" }, xe = { class: "relativ
|
|
|
113
113
|
});
|
|
114
114
|
}
|
|
115
115
|
const ie = c(() => {
|
|
116
|
-
const { uid: e,
|
|
116
|
+
const { uid: e, watchModeStatus: t } = A.value || {};
|
|
117
117
|
return e !== i.value.entity.uid ? "text-c-3" : t === "WATCHING" ? "text-c-1" : t === "ERROR" ? "text-red" : "text-c-3";
|
|
118
118
|
});
|
|
119
119
|
return (e, t) => {
|
|
120
|
-
const
|
|
120
|
+
const l = se("RequestSidebarItem", !0);
|
|
121
121
|
return p(), k("div", {
|
|
122
122
|
class: f(["relative flex flex-row", [
|
|
123
123
|
n(m) && e.parentUids.length > 1 || !n(m) && e.parentUids.length ? "before:bg-border before:pointer-events-none before:z-1 before:absolute before:left-[calc(.75rem_+_.5px)] before:top-0 before:h-[calc(100%_+_.5px)] last:before:h-full before:w-[.5px] mb-[.5px] last:mb-0 indent-border-line-offset" : ""
|
|
@@ -126,7 +126,7 @@ const he = { class: "flex flex-row gap-1 items-center" }, xe = { class: "relativ
|
|
|
126
126
|
h(n(fe), {
|
|
127
127
|
id: i.value.entity.uid,
|
|
128
128
|
ref_key: "draggableRef",
|
|
129
|
-
ref:
|
|
129
|
+
ref: C,
|
|
130
130
|
ceiling: O.value.ceiling,
|
|
131
131
|
class: "flex flex-1 flex-col gap-[.5px] text-sm",
|
|
132
132
|
floor: O.value.floor,
|
|
@@ -143,17 +143,17 @@ const he = { class: "flex flex-row gap-1 items-center" }, xe = { class: "relativ
|
|
|
143
143
|
class: "no-underline",
|
|
144
144
|
to: i.value.link,
|
|
145
145
|
onClick: t[1] || (t[1] = R(
|
|
146
|
-
(
|
|
146
|
+
(s) => ee(s, i.value),
|
|
147
147
|
["prevent"]
|
|
148
148
|
))
|
|
149
149
|
}, {
|
|
150
|
-
default: g(({ isExactActive:
|
|
151
|
-
var
|
|
150
|
+
default: g(({ isExactActive: s }) => {
|
|
151
|
+
var u, d;
|
|
152
152
|
return [
|
|
153
153
|
a("div", {
|
|
154
154
|
class: f(["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", [
|
|
155
|
-
|
|
156
|
-
|
|
155
|
+
B,
|
|
156
|
+
s || Z.value ? "bg-sidebar-active-b text-sidebar-active-c transition-none" : "text-sidebar-c-2"
|
|
157
157
|
]]),
|
|
158
158
|
tabindex: "0"
|
|
159
159
|
}, [
|
|
@@ -161,13 +161,13 @@ const he = { class: "flex flex-row gap-1 items-center" }, xe = { class: "relativ
|
|
|
161
161
|
class: f(["line-clamp-3 font-medium w-full pl-2 word-break-break-word", {
|
|
162
162
|
"editable-sidebar-hover-item": !n(m)
|
|
163
163
|
}])
|
|
164
|
-
},
|
|
164
|
+
}, M(i.value.title), 3),
|
|
165
165
|
a("div", he, [
|
|
166
166
|
a("div", xe, [
|
|
167
|
-
n(m) ? b("", !0) : (p(), v(n(
|
|
167
|
+
n(m) ? b("", !0) : (p(), v(n(T), {
|
|
168
168
|
key: 0,
|
|
169
169
|
class: f(["px-0.5 py-0 hover:bg-b-3 hidden group-hover:flex absolute -translate-y-1/2 right-0 aspect-square inset-y-2/4 h-fit", {
|
|
170
|
-
flex: ((
|
|
170
|
+
flex: ((d = (u = e.menuItem) == null ? void 0 : u.item) == null ? void 0 : d.entity.uid) === i.value.entity.uid && e.menuItem.open
|
|
171
171
|
}]),
|
|
172
172
|
size: "sm",
|
|
173
173
|
type: "button",
|
|
@@ -192,7 +192,7 @@ const he = { class: "flex flex-row gap-1 items-center" }, xe = { class: "relativ
|
|
|
192
192
|
}, 8, ["class"]))
|
|
193
193
|
]),
|
|
194
194
|
a("span", ye, [
|
|
195
|
-
t[9] || (t[9] =
|
|
195
|
+
t[9] || (t[9] = j(" ")),
|
|
196
196
|
i.value.method ? (p(), v(n(ce), {
|
|
197
197
|
key: 0,
|
|
198
198
|
class: "font-bold",
|
|
@@ -206,9 +206,9 @@ const he = { class: "flex flex-row gap-1 items-center" }, xe = { class: "relativ
|
|
|
206
206
|
_: 1
|
|
207
207
|
}, 8, ["to"])) : !n(m) || e.parentUids.length ? (p(), k("button", {
|
|
208
208
|
key: 1,
|
|
209
|
-
class: f(["hover:bg-b-2 group relative flex w-full flex-row justify-start gap-1.5 rounded p-1.5",
|
|
209
|
+
class: f(["hover:bg-b-2 group relative flex w-full flex-row justify-start gap-1.5 rounded p-1.5", B]),
|
|
210
210
|
type: "button",
|
|
211
|
-
onClick: t[3] || (t[3] = (
|
|
211
|
+
onClick: t[3] || (t[3] = (s) => n(G)(i.value.entity.uid))
|
|
212
212
|
}, [
|
|
213
213
|
a("span", we, [
|
|
214
214
|
ae(e.$slots, "leftIcon", {}, () => [
|
|
@@ -225,28 +225,28 @@ const he = { class: "flex flex-row gap-1 items-center" }, xe = { class: "relativ
|
|
|
225
225
|
})
|
|
226
226
|
], 2)
|
|
227
227
|
], !0),
|
|
228
|
-
t[10] || (t[10] =
|
|
228
|
+
t[10] || (t[10] = j(" "))
|
|
229
229
|
]),
|
|
230
230
|
a("div", ke, [
|
|
231
231
|
a("span", {
|
|
232
232
|
class: f(["line-clamp-3 font-medium text-left w-full word-break-break-word", {
|
|
233
233
|
"editable-sidebar-hover-item": !n(m)
|
|
234
234
|
}])
|
|
235
|
-
},
|
|
235
|
+
}, M(i.value.title), 3),
|
|
236
236
|
a("div", Ue, [
|
|
237
|
-
!n(m) && !J.value ? (p(), v(n(
|
|
237
|
+
!n(m) && !J.value ? (p(), v(n(T), {
|
|
238
238
|
key: 0,
|
|
239
239
|
class: f(["px-0.5 py-0 hover:bg-b-3 hidden group-hover:flex absolute -translate-y-1/2 right-0 aspect-square inset-y-2/4 h-fit", {
|
|
240
240
|
flex: ((o = e.menuItem.item) == null ? void 0 : o.entity.uid) === i.value.entity.uid && e.menuItem.open,
|
|
241
|
-
"right-5": i.value.
|
|
241
|
+
"right-5": i.value.watchMode
|
|
242
242
|
}]),
|
|
243
243
|
size: "sm",
|
|
244
244
|
variant: "ghost",
|
|
245
245
|
onClick: t[2] || (t[2] = R(
|
|
246
|
-
(
|
|
246
|
+
(s) => e.$emit("openMenu", {
|
|
247
247
|
item: i.value,
|
|
248
248
|
parentUids: e.parentUids,
|
|
249
|
-
targetRef:
|
|
249
|
+
targetRef: s.currentTarget.parentNode,
|
|
250
250
|
open: !0
|
|
251
251
|
}),
|
|
252
252
|
["stop", "prevent"]
|
|
@@ -260,7 +260,7 @@ const he = { class: "flex flex-row gap-1 items-center" }, xe = { class: "relativ
|
|
|
260
260
|
]),
|
|
261
261
|
_: 1
|
|
262
262
|
}, 8, ["class"])) : b("", !0),
|
|
263
|
-
i.value.
|
|
263
|
+
i.value.watchMode ? (p(), v(n(pe), {
|
|
264
264
|
key: 1,
|
|
265
265
|
side: "right",
|
|
266
266
|
sideOffset: 12
|
|
@@ -274,9 +274,9 @@ const he = { class: "flex flex-row gap-1 items-center" }, xe = { class: "relativ
|
|
|
274
274
|
}, null, 8, ["class"])
|
|
275
275
|
]),
|
|
276
276
|
content: g(() => [
|
|
277
|
-
a("div",
|
|
278
|
-
a("div",
|
|
279
|
-
a("p",
|
|
277
|
+
a("div", qe, [
|
|
278
|
+
a("div", De, [
|
|
279
|
+
a("p", Ce, " Watching: " + M(i.value.documentUrl), 1)
|
|
280
280
|
])
|
|
281
281
|
])
|
|
282
282
|
]),
|
|
@@ -287,22 +287,22 @@ const he = { class: "flex flex-row gap-1 items-center" }, xe = { class: "relativ
|
|
|
287
287
|
])
|
|
288
288
|
])) : b("", !0),
|
|
289
289
|
X.value ? (p(), k("div", Re, [
|
|
290
|
-
(p(!0), k(oe, null,
|
|
291
|
-
key:
|
|
292
|
-
isDraggable: !n(
|
|
290
|
+
(p(!0), k(oe, null, de(i.value.children, (s) => (p(), v(l, {
|
|
291
|
+
key: s,
|
|
292
|
+
isDraggable: !n(q)[s],
|
|
293
293
|
isDroppable: _,
|
|
294
294
|
menuItem: e.menuItem,
|
|
295
295
|
parentUids: [...e.parentUids, e.uid],
|
|
296
|
-
uid:
|
|
297
|
-
onNewTab: t[4] || (t[4] = (
|
|
298
|
-
onOnDragEnd: t[5] || (t[5] = (...
|
|
299
|
-
onOpenMenu: t[6] || (t[6] = (
|
|
296
|
+
uid: s,
|
|
297
|
+
onNewTab: t[4] || (t[4] = (u, d) => e.$emit("newTab", u, d)),
|
|
298
|
+
onOnDragEnd: t[5] || (t[5] = (...u) => e.$emit("onDragEnd", ...u)),
|
|
299
|
+
onOpenMenu: t[6] || (t[6] = (u) => e.$emit("openMenu", u))
|
|
300
300
|
}, null, 8, ["isDraggable", "menuItem", "parentUids", "uid"]))), 128)),
|
|
301
|
-
i.value.children.length === 0 ? (p(), v(n(
|
|
301
|
+
i.value.children.length === 0 ? (p(), v(n(T), {
|
|
302
302
|
key: 0,
|
|
303
303
|
class: f(["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" : ""]),
|
|
304
304
|
variant: "ghost",
|
|
305
|
-
onClick: t[7] || (t[7] = (
|
|
305
|
+
onClick: t[7] || (t[7] = (s) => te())
|
|
306
306
|
}, {
|
|
307
307
|
default: g(() => [
|
|
308
308
|
h(n(x), {
|
|
@@ -324,5 +324,5 @@ const he = { class: "flex flex-row gap-1 items-center" }, xe = { class: "relativ
|
|
|
324
324
|
}
|
|
325
325
|
});
|
|
326
326
|
export {
|
|
327
|
-
|
|
327
|
+
je as default
|
|
328
328
|
};
|
|
@@ -3,12 +3,12 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
3
3
|
menuItem: SidebarMenuItem;
|
|
4
4
|
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
5
5
|
closeMenu: () => any;
|
|
6
|
-
|
|
6
|
+
toggleWatchMode: (item: import("../../views/Request/types/index.js").SidebarItem | undefined) => any;
|
|
7
7
|
}, string, import("vue").PublicProps, Readonly<{
|
|
8
8
|
menuItem: SidebarMenuItem;
|
|
9
9
|
}> & Readonly<{
|
|
10
10
|
onCloseMenu?: (() => any) | undefined;
|
|
11
|
-
|
|
11
|
+
onToggleWatchMode?: ((item: import("../../views/Request/types/index.js").SidebarItem | undefined) => any) | undefined;
|
|
12
12
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
13
13
|
export default _default;
|
|
14
14
|
//# sourceMappingURL=RequestSidebarItemMenu.vue.d.ts.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import t from "./RequestSidebarItemMenu.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
|
-
import
|
|
4
|
-
const m = /* @__PURE__ */ t
|
|
3
|
+
import e from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
+
const m = /* @__PURE__ */ e(t, [["__scopeId", "data-v-a29cdf25"]]);
|
|
5
5
|
export {
|
|
6
6
|
m as default
|
|
7
7
|
};
|