@scalar/api-client 2.17.0 → 2.17.1
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 +16 -0
- package/dist/style.css +1 -1
- package/dist/v2/features/app/components/AppSidebar.vue.d.ts.map +1 -1
- package/dist/v2/features/app/components/AppSidebar.vue.js +3 -3
- package/dist/v2/features/app/components/AppSidebar.vue2.js +112 -103
- package/dist/v2/features/app/components/{ItemDecorator.vue.d.ts → SidebarItemMenu.vue.d.ts} +1 -1
- package/dist/v2/features/app/components/SidebarItemMenu.vue.d.ts.map +1 -0
- package/dist/v2/features/app/components/SidebarItemMenu.vue.js +129 -0
- package/dist/v2/features/app/components/SidebarItemMenu.vue2.js +4 -0
- package/dist/v2/features/operation/Operation.vue.js +1 -1
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
- package/package.json +11 -11
- package/dist/v2/features/app/components/ItemDecorator.vue.d.ts.map +0 -1
- package/dist/v2/features/app/components/ItemDecorator.vue.js +0 -138
- package/dist/v2/features/app/components/ItemDecorator.vue2.js +0 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppSidebar.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/app/components/AppSidebar.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AppSidebar.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/app/components/AppSidebar.vue"],"names":[],"mappings":"AA2cA,OAAO,KAAK,EAA6B,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAC9E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AACpE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAEvE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4CAA4C,CAAA;AAShF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gDAAgD,CAAA;AAE/E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAErD,KAAK,WAAW,GAAG;IACjB;;OAEG;IACH,MAAM,EAAE,YAAY,CAAA;IAEpB;;OAEG;IACH,YAAY,EAAE,YAAY,CAAC,cAAc,CAAC,CAAA;IAE1C;;OAEG;IACH,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB;;;OAGG;IACH,eAAe,EAAE,SAAS,CAAA;IAC1B;;;OAGG;IACH,UAAU,EAAE,SAAS,EAAE,CAAA;IACvB;;;OAGG;IACH,QAAQ,EAAE,iBAAiB,CAAA;IAC3B;;;OAGG;IACH,KAAK,EAAE,cAAc,CAAA;CACtB,CAAC;AA+LF,KAAK,iBAAiB,GAAG,WAAW,GAAG;IACvC,6CAA6C;IAC7C,eAAe,EAAE,OAAO,CAAC;IACzB,wCAAwC;IACxC,cAAc,EAAE,MAAM,CAAC;CACtB,CAAC;;;;;;;;;;;;;;;;;AAicF,wBAOG"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./AppSidebar.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
|
-
import
|
|
4
|
-
const
|
|
3
|
+
import a from "../../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
+
const c = /* @__PURE__ */ a(o, [["__scopeId", "data-v-75aacdc4"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
c as default
|
|
7
7
|
};
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { defineComponent as q, mergeModels as
|
|
2
|
-
import { useModal as
|
|
3
|
-
import { ScalarIconPlus as
|
|
4
|
-
import { getParentEntry as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import { dragHandleFactory as
|
|
11
|
-
import
|
|
12
|
-
const
|
|
1
|
+
import { defineComponent as q, mergeModels as C, computed as b, capitalize as V, useModel as W, ref as G, createElementBlock as I, openBlock as m, createVNode as l, createBlock as g, createCommentVNode as f, unref as n, createSlots as R, withCtx as r, createTextVNode as y, withKeys as k, withModifiers as p, toDisplayString as j, createElementVNode as d, normalizeClass as F, nextTick as H } from "vue";
|
|
2
|
+
import { useModal as L, ScalarSidebarItem as E, ScalarIconButton as U, ScalarButton as O, ScalarModal as J } from "@scalar/components";
|
|
3
|
+
import { ScalarIconPlus as Y, ScalarIconDotsThree as Q, ScalarIconGlobe as X } from "@scalar/icons";
|
|
4
|
+
import { getParentEntry as w } from "@scalar/workspace-store/navigation";
|
|
5
|
+
import Z from "../../../../assets/rabbit.ascii.js";
|
|
6
|
+
import _ from "../../../../assets/rabbitjump.ascii.js";
|
|
7
|
+
import $ from "../../../../components/ScalarAsciiArt.vue.js";
|
|
8
|
+
import ee from "../../../../components/Sidebar/Actions/DeleteSidebarListElement.vue.js";
|
|
9
|
+
import te from "./SidebarItemMenu.vue.js";
|
|
10
|
+
import { dragHandleFactory as ae } from "../../../helpers/drag-handle-factory.js";
|
|
11
|
+
import oe from "../../../components/sidebar/Sidebar.vue.js";
|
|
12
|
+
const ne = { class: "flex" }, se = {
|
|
13
13
|
key: 0,
|
|
14
14
|
class: "empty-sidebar-item-content overflow-hidden px-2.5 py-2.5"
|
|
15
|
-
},
|
|
15
|
+
}, ie = { class: "rabbit-ascii relative m-auto mt-2 h-[68px] w-[60px]" }, re = { class: "gap-1.5 p-2" }, we = /* @__PURE__ */ q({
|
|
16
16
|
__name: "AppSidebar",
|
|
17
|
-
props: /* @__PURE__ */
|
|
17
|
+
props: /* @__PURE__ */ C({
|
|
18
18
|
layout: {},
|
|
19
19
|
sidebarState: {},
|
|
20
20
|
isWorkspaceOpen: { type: Boolean },
|
|
@@ -31,121 +31,130 @@ const te = { class: "flex" }, ae = {
|
|
|
31
31
|
},
|
|
32
32
|
sidebarWidthModifiers: {}
|
|
33
33
|
}),
|
|
34
|
-
emits: /* @__PURE__ */
|
|
35
|
-
setup(
|
|
36
|
-
const
|
|
37
|
-
() =>
|
|
38
|
-
store:
|
|
39
|
-
sidebarState:
|
|
34
|
+
emits: /* @__PURE__ */ C(["click:workspace", "selectItem", "select:workspace", "create:workspace"], ["update:isSidebarOpen", "update:sidebarWidth"]),
|
|
35
|
+
setup(i, { emit: D }) {
|
|
36
|
+
const c = D, N = b(() => V(i.activeWorkspace.name)), B = W(i, "isSidebarOpen"), M = W(i, "sidebarWidth"), S = b(() => i.sidebarState.items.value.length <= 1), h = b(
|
|
37
|
+
() => ae({
|
|
38
|
+
store: i.store,
|
|
39
|
+
sidebarState: i.sidebarState
|
|
40
40
|
})
|
|
41
|
-
),
|
|
42
|
-
const t =
|
|
41
|
+
), A = (t, e) => h.value.handleDragEnd(t, e), T = (t, e) => h.value.isDroppable(t, e), s = G(null), v = L(), x = b(() => {
|
|
42
|
+
const t = s.value?.item;
|
|
43
43
|
return t?.type === "document" ? "This cannot be undone. You're about to delete the document and all tags and operations inside it." : `Are you sure you want to delete this ${t?.type ?? "item"}? This action cannot be undone.`;
|
|
44
|
-
}),
|
|
45
|
-
const t =
|
|
44
|
+
}), z = () => {
|
|
45
|
+
const t = s.value?.item;
|
|
46
46
|
if (!t)
|
|
47
47
|
return;
|
|
48
|
-
const e =
|
|
48
|
+
const e = i.sidebarState.getEntryById(t.id), a = w("document", e), o = w("operation", e);
|
|
49
49
|
if (a) {
|
|
50
50
|
if (t.type === "document")
|
|
51
|
-
|
|
51
|
+
i.eventBus.emit("document:delete:document", { name: a.name });
|
|
52
52
|
else if (t.type === "tag")
|
|
53
|
-
|
|
53
|
+
i.eventBus.emit("tag:delete:tag", {
|
|
54
54
|
documentName: a.name,
|
|
55
55
|
name: t.name
|
|
56
56
|
});
|
|
57
57
|
else if (t.type === "operation") {
|
|
58
|
-
if (!
|
|
58
|
+
if (!o)
|
|
59
59
|
return;
|
|
60
|
-
|
|
60
|
+
i.eventBus.emit("operation:delete:operation", {
|
|
61
61
|
meta: {
|
|
62
|
-
method:
|
|
63
|
-
path:
|
|
62
|
+
method: o.method,
|
|
63
|
+
path: o.path
|
|
64
64
|
},
|
|
65
65
|
documentName: a.name
|
|
66
66
|
});
|
|
67
67
|
} else if (t.type === "example") {
|
|
68
|
-
if (!
|
|
68
|
+
if (!o)
|
|
69
69
|
return;
|
|
70
|
-
|
|
70
|
+
i.eventBus.emit("operation:delete:example", {
|
|
71
71
|
meta: {
|
|
72
|
-
method:
|
|
73
|
-
path:
|
|
72
|
+
method: o.method,
|
|
73
|
+
path: o.path,
|
|
74
74
|
exampleKey: t.name
|
|
75
75
|
},
|
|
76
76
|
documentName: a.name
|
|
77
77
|
});
|
|
78
78
|
}
|
|
79
|
-
|
|
79
|
+
v.hide(), s.value = null;
|
|
80
80
|
}
|
|
81
|
-
},
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
81
|
+
}, u = async (t, e) => {
|
|
82
|
+
if (s.value?.showMenu)
|
|
83
|
+
return;
|
|
84
|
+
const a = t.currentTarget;
|
|
85
|
+
s.value = { item: e, el: a, showMenu: !0 }, await H();
|
|
86
|
+
const o = t instanceof MouseEvent ? new MouseEvent(t.type, t) : new KeyboardEvent(t.type, t);
|
|
87
|
+
s.value?.el.dispatchEvent(o);
|
|
88
|
+
}, K = () => {
|
|
89
|
+
s.value && (s.value.showMenu = !1);
|
|
90
|
+
}, P = (t) => {
|
|
91
|
+
const e = i.sidebarState.getEntryById(t.id), a = w("document", e), o = w("tag", e);
|
|
92
|
+
i.eventBus.emit("ui:open:command-palette", {
|
|
92
93
|
action: "create-request",
|
|
93
94
|
payload: {
|
|
94
95
|
documentId: a?.id,
|
|
95
|
-
tagId:
|
|
96
|
+
tagId: o?.name
|
|
96
97
|
}
|
|
97
98
|
});
|
|
98
99
|
};
|
|
99
|
-
return (t, e) => (m(), I("div",
|
|
100
|
-
l(
|
|
101
|
-
isSidebarOpen:
|
|
102
|
-
"onUpdate:isSidebarOpen": e[3] || (e[3] = (a) =>
|
|
103
|
-
sidebarWidth:
|
|
104
|
-
"onUpdate:sidebarWidth": e[4] || (e[4] = (a) =>
|
|
100
|
+
return (t, e) => (m(), I("div", ne, [
|
|
101
|
+
l(n(oe), {
|
|
102
|
+
isSidebarOpen: B.value,
|
|
103
|
+
"onUpdate:isSidebarOpen": e[3] || (e[3] = (a) => B.value = a),
|
|
104
|
+
sidebarWidth: M.value,
|
|
105
|
+
"onUpdate:sidebarWidth": e[4] || (e[4] = (a) => M.value = a),
|
|
105
106
|
activeWorkspace: t.activeWorkspace,
|
|
106
107
|
documents: Object.values(t.store.workspace.documents),
|
|
107
108
|
eventBus: t.eventBus,
|
|
108
|
-
isDroppable:
|
|
109
|
+
isDroppable: T,
|
|
109
110
|
layout: t.layout,
|
|
110
111
|
sidebarState: t.sidebarState,
|
|
111
112
|
workspaces: t.workspaces,
|
|
112
|
-
"onCreate:workspace": e[5] || (e[5] = (a) =>
|
|
113
|
-
onReorder: e[6] || (e[6] = (a,
|
|
114
|
-
"onSelect:workspace": e[7] || (e[7] = (a) =>
|
|
115
|
-
onSelectItem: e[8] || (e[8] = (a) =>
|
|
116
|
-
},
|
|
113
|
+
"onCreate:workspace": e[5] || (e[5] = (a) => c("create:workspace")),
|
|
114
|
+
onReorder: e[6] || (e[6] = (a, o) => A(a, o)),
|
|
115
|
+
"onSelect:workspace": e[7] || (e[7] = (a) => c("select:workspace", a)),
|
|
116
|
+
onSelectItem: e[8] || (e[8] = (a) => c("selectItem", a))
|
|
117
|
+
}, R({
|
|
117
118
|
workspaceButton: r(() => [
|
|
118
|
-
l(
|
|
119
|
+
l(n(E), {
|
|
119
120
|
is: "button",
|
|
120
121
|
active: t.isWorkspaceOpen,
|
|
121
|
-
icon:
|
|
122
|
-
onClick: e[0] || (e[0] = (a) =>
|
|
122
|
+
icon: n(X),
|
|
123
|
+
onClick: e[0] || (e[0] = (a) => c("click:workspace"))
|
|
123
124
|
}, {
|
|
124
125
|
default: r(() => [
|
|
125
|
-
|
|
126
|
+
y(j(N.value), 1)
|
|
126
127
|
]),
|
|
127
128
|
_: 1
|
|
128
129
|
}, 8, ["active", "icon"])
|
|
129
130
|
]),
|
|
130
131
|
decorator: r(({ item: a }) => [
|
|
131
|
-
l(
|
|
132
|
-
icon:
|
|
132
|
+
l(n(U), {
|
|
133
|
+
icon: n(Q),
|
|
133
134
|
label: "More options",
|
|
134
135
|
size: "sm",
|
|
135
136
|
weight: "bold",
|
|
136
|
-
|
|
137
|
-
|
|
137
|
+
"aria-haspopup": "menu",
|
|
138
|
+
"aria-expanded": "false",
|
|
139
|
+
onClick: p((o) => u(o, a), ["stop"]),
|
|
140
|
+
onKeydown: [
|
|
141
|
+
k(p((o) => u(o, a), ["stop"]), ["enter"]),
|
|
142
|
+
k(p((o) => u(o, a), ["stop"]), ["space"]),
|
|
143
|
+
k(p((o) => u(o, a), ["stop"]), ["down"]),
|
|
144
|
+
k(p((o) => u(o, a), ["stop"]), ["up"])
|
|
145
|
+
]
|
|
146
|
+
}, null, 8, ["icon", "onClick", "onKeydown"])
|
|
138
147
|
]),
|
|
139
148
|
empty: r(({ item: a }) => [
|
|
140
|
-
l(
|
|
149
|
+
l(n(E), {
|
|
141
150
|
is: "button",
|
|
142
|
-
onClick: (
|
|
151
|
+
onClick: (o) => P(a)
|
|
143
152
|
}, {
|
|
144
153
|
icon: r(() => [
|
|
145
|
-
l(
|
|
154
|
+
l(n(Y))
|
|
146
155
|
]),
|
|
147
156
|
default: r(() => [...e[11] || (e[11] = [
|
|
148
|
-
|
|
157
|
+
y("Add operation", -1)
|
|
149
158
|
])]),
|
|
150
159
|
_: 1
|
|
151
160
|
}, 8, ["onClick"])
|
|
@@ -156,18 +165,18 @@ const te = { class: "flex" }, ae = {
|
|
|
156
165
|
name: "footer",
|
|
157
166
|
fn: r(() => [
|
|
158
167
|
d("div", {
|
|
159
|
-
class:
|
|
160
|
-
"empty-sidebar-item border-t":
|
|
168
|
+
class: F({
|
|
169
|
+
"empty-sidebar-item border-t": S.value
|
|
161
170
|
})
|
|
162
171
|
}, [
|
|
163
|
-
|
|
164
|
-
d("div",
|
|
165
|
-
l(
|
|
166
|
-
art:
|
|
172
|
+
S.value ? (m(), I("div", se, [
|
|
173
|
+
d("div", ie, [
|
|
174
|
+
l($, {
|
|
175
|
+
art: n(Z),
|
|
167
176
|
class: "rabbitsit font-bold"
|
|
168
177
|
}, null, 8, ["art"]),
|
|
169
|
-
l(
|
|
170
|
-
art:
|
|
178
|
+
l($, {
|
|
179
|
+
art: n(_),
|
|
171
180
|
class: "rabbitjump absolute top-0 left-0 font-bold"
|
|
172
181
|
}, null, 8, ["art"])
|
|
173
182
|
]),
|
|
@@ -175,9 +184,9 @@ const te = { class: "flex" }, ae = {
|
|
|
175
184
|
d("b", { class: "font-medium" }, "Let's Get Started"),
|
|
176
185
|
d("p", { class: "mt-2 leading-3" }, " Create request, folder, collection or import from OpenAPI/Postman ")
|
|
177
186
|
], -1))
|
|
178
|
-
])) :
|
|
179
|
-
d("div",
|
|
180
|
-
|
|
187
|
+
])) : f("", !0),
|
|
188
|
+
d("div", re, [
|
|
189
|
+
S.value ? (m(), g(n(O), {
|
|
181
190
|
key: 0,
|
|
182
191
|
class: "w-full",
|
|
183
192
|
size: "sm",
|
|
@@ -187,11 +196,11 @@ const te = { class: "flex" }, ae = {
|
|
|
187
196
|
}))
|
|
188
197
|
}, {
|
|
189
198
|
default: r(() => [...e[13] || (e[13] = [
|
|
190
|
-
|
|
199
|
+
y(" Import Collection ", -1)
|
|
191
200
|
])]),
|
|
192
201
|
_: 1
|
|
193
|
-
})) :
|
|
194
|
-
l(
|
|
202
|
+
})) : f("", !0),
|
|
203
|
+
l(n(O), {
|
|
195
204
|
class: "w-full",
|
|
196
205
|
hotkey: "K",
|
|
197
206
|
size: "sm",
|
|
@@ -199,7 +208,7 @@ const te = { class: "flex" }, ae = {
|
|
|
199
208
|
onClick: e[2] || (e[2] = (a) => t.eventBus.emit("ui:open:command-palette"))
|
|
200
209
|
}, {
|
|
201
210
|
default: r(() => [...e[14] || (e[14] = [
|
|
202
|
-
|
|
211
|
+
y(" Add Item ", -1)
|
|
203
212
|
])]),
|
|
204
213
|
_: 1
|
|
205
214
|
})
|
|
@@ -209,34 +218,34 @@ const te = { class: "flex" }, ae = {
|
|
|
209
218
|
key: "0"
|
|
210
219
|
} : void 0
|
|
211
220
|
]), 1032, ["isSidebarOpen", "sidebarWidth", "activeWorkspace", "documents", "eventBus", "layout", "sidebarState", "workspaces"]),
|
|
212
|
-
|
|
221
|
+
s.value?.showMenu ? (m(), g(te, {
|
|
213
222
|
key: 0,
|
|
214
223
|
eventBus: t.eventBus,
|
|
215
|
-
item:
|
|
224
|
+
item: s.value.item,
|
|
216
225
|
sidebarState: t.sidebarState,
|
|
217
|
-
target:
|
|
218
|
-
onCloseMenu:
|
|
219
|
-
onShowDeleteModal: e[9] || (e[9] = (a) =>
|
|
220
|
-
}, null, 8, ["eventBus", "item", "sidebarState", "target"])) :
|
|
221
|
-
|
|
226
|
+
target: s.value.el,
|
|
227
|
+
onCloseMenu: K,
|
|
228
|
+
onShowDeleteModal: e[9] || (e[9] = (a) => n(v).show())
|
|
229
|
+
}, null, 8, ["eventBus", "item", "sidebarState", "target"])) : f("", !0),
|
|
230
|
+
s.value ? (m(), g(n(J), {
|
|
222
231
|
key: 1,
|
|
223
232
|
size: "xxs",
|
|
224
|
-
state:
|
|
225
|
-
title: `Delete ${
|
|
233
|
+
state: n(v),
|
|
234
|
+
title: `Delete ${s.value.item.title}`
|
|
226
235
|
}, {
|
|
227
236
|
default: r(() => [
|
|
228
|
-
l(
|
|
229
|
-
variableName:
|
|
230
|
-
warningMessage:
|
|
231
|
-
onClose: e[10] || (e[10] = (a) =>
|
|
232
|
-
onDelete:
|
|
237
|
+
l(ee, {
|
|
238
|
+
variableName: s.value.item.title,
|
|
239
|
+
warningMessage: x.value,
|
|
240
|
+
onClose: e[10] || (e[10] = (a) => n(v).hide()),
|
|
241
|
+
onDelete: z
|
|
233
242
|
}, null, 8, ["variableName", "warningMessage"])
|
|
234
243
|
]),
|
|
235
244
|
_: 1
|
|
236
|
-
}, 8, ["state", "title"])) :
|
|
245
|
+
}, 8, ["state", "title"])) : f("", !0)
|
|
237
246
|
]));
|
|
238
247
|
}
|
|
239
248
|
});
|
|
240
249
|
export {
|
|
241
|
-
|
|
250
|
+
we as default
|
|
242
251
|
};
|
|
@@ -19,4 +19,4 @@ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {
|
|
|
19
19
|
onShowDeleteModal?: (() => any) | undefined;
|
|
20
20
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
21
21
|
export default _default;
|
|
22
|
-
//# sourceMappingURL=
|
|
22
|
+
//# sourceMappingURL=SidebarItemMenu.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SidebarItemMenu.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/app/components/SidebarItemMenu.vue"],"names":[],"mappings":"AAgLA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AACnD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAEvE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4CAA4C,CAAA;AAGhF,KAAK,WAAW,GAAG;IACjB,4CAA4C;IAC5C,IAAI,EAAE,cAAc,CAAA;IACpB,sCAAsC;IACtC,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,qDAAqD;IACrD,YAAY,EAAE,YAAY,CAAC,cAAc,CAAC,CAAA;IAC1C,sDAAsD;IACtD,MAAM,EAAE,WAAW,CAAA;CACpB,CAAC;;;;;;;;AA6TF,wBAOG"}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { defineComponent as S, ref as C, watch as E, nextTick as b, createBlock as i, openBlock as a, unref as n, withCtx as m, createCommentVNode as l, createElementVNode as r, createVNode as u, createTextVNode as c } from "vue";
|
|
2
|
+
import { ScalarDropdown as M, ScalarDropdownItem as s, ScalarIcon as y, ScalarDropdownDivider as T } from "@scalar/components";
|
|
3
|
+
import { getParentEntry as p } from "@scalar/workspace-store/navigation";
|
|
4
|
+
const z = { class: "flex items-center gap-2" }, N = { class: "flex items-center gap-2" }, V = { class: "flex items-center gap-2" }, $ = { class: "text-red flex items-center gap-2" }, W = /* @__PURE__ */ S({
|
|
5
|
+
__name: "SidebarItemMenu",
|
|
6
|
+
props: {
|
|
7
|
+
item: {},
|
|
8
|
+
eventBus: {},
|
|
9
|
+
sidebarState: {},
|
|
10
|
+
target: {}
|
|
11
|
+
},
|
|
12
|
+
emits: ["closeMenu", "showDeleteModal"],
|
|
13
|
+
setup(e, { emit: I }) {
|
|
14
|
+
const g = I, f = C(!1);
|
|
15
|
+
E(f, async (d, t) => {
|
|
16
|
+
!d && t && (await b(), g("closeMenu"));
|
|
17
|
+
});
|
|
18
|
+
const v = () => e.item.type === "document" || e.item.type === "tag", x = () => e.item.type === "document", k = () => e.item.type === "operation", A = () => e.item.type === "document" && e.item.id !== "drafts" || e.item.type === "tag" || e.item.type === "operation" || e.item.type === "example", B = () => {
|
|
19
|
+
if (e.item.type === "document" && e.eventBus.emit("ui:open:command-palette", {
|
|
20
|
+
action: "create-request",
|
|
21
|
+
payload: {
|
|
22
|
+
documentId: e.item.id
|
|
23
|
+
}
|
|
24
|
+
}), e.item.type === "tag") {
|
|
25
|
+
const d = e.sidebarState.getEntryById(e.item.id);
|
|
26
|
+
e.eventBus.emit("ui:open:command-palette", {
|
|
27
|
+
action: "create-request",
|
|
28
|
+
payload: {
|
|
29
|
+
documentId: p("document", d)?.id,
|
|
30
|
+
tagId: e.item.name
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
}, D = () => {
|
|
35
|
+
e.item.type === "document" && e.eventBus.emit("ui:open:command-palette", {
|
|
36
|
+
action: "add-tag",
|
|
37
|
+
payload: {
|
|
38
|
+
documentId: e.item.id
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
}, w = () => {
|
|
42
|
+
if (e.item.type === "operation") {
|
|
43
|
+
const d = e.sidebarState.getEntryById(e.item.id);
|
|
44
|
+
e.eventBus.emit("ui:open:command-palette", {
|
|
45
|
+
action: "add-example",
|
|
46
|
+
payload: {
|
|
47
|
+
documentId: p("document", d)?.id,
|
|
48
|
+
operationId: e.item.id
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
return (d, t) => (a(), i(n(M), {
|
|
54
|
+
open: f.value,
|
|
55
|
+
"onUpdate:open": t[4] || (t[4] = (o) => f.value = o),
|
|
56
|
+
placement: "bottom-end",
|
|
57
|
+
target: d.target,
|
|
58
|
+
teleport: ""
|
|
59
|
+
}, {
|
|
60
|
+
items: m(() => [
|
|
61
|
+
v() ? (a(), i(n(s), {
|
|
62
|
+
key: 0,
|
|
63
|
+
onClick: t[0] || (t[0] = (o) => B())
|
|
64
|
+
}, {
|
|
65
|
+
default: m(() => [
|
|
66
|
+
r("div", z, [
|
|
67
|
+
u(n(y), {
|
|
68
|
+
icon: "Add",
|
|
69
|
+
size: "sm"
|
|
70
|
+
}),
|
|
71
|
+
t[5] || (t[5] = c(" Add Operation ", -1))
|
|
72
|
+
])
|
|
73
|
+
]),
|
|
74
|
+
_: 1
|
|
75
|
+
})) : l("", !0),
|
|
76
|
+
x() ? (a(), i(n(s), {
|
|
77
|
+
key: 1,
|
|
78
|
+
onClick: t[1] || (t[1] = (o) => D())
|
|
79
|
+
}, {
|
|
80
|
+
default: m(() => [
|
|
81
|
+
r("div", N, [
|
|
82
|
+
u(n(y), {
|
|
83
|
+
icon: "Add",
|
|
84
|
+
size: "sm"
|
|
85
|
+
}),
|
|
86
|
+
t[6] || (t[6] = c(" Add Tag ", -1))
|
|
87
|
+
])
|
|
88
|
+
]),
|
|
89
|
+
_: 1
|
|
90
|
+
})) : l("", !0),
|
|
91
|
+
k() ? (a(), i(n(s), {
|
|
92
|
+
key: 2,
|
|
93
|
+
onClick: t[2] || (t[2] = (o) => w())
|
|
94
|
+
}, {
|
|
95
|
+
default: m(() => [
|
|
96
|
+
r("div", V, [
|
|
97
|
+
u(n(y), {
|
|
98
|
+
icon: "Add",
|
|
99
|
+
size: "sm"
|
|
100
|
+
}),
|
|
101
|
+
t[7] || (t[7] = c(" Add Example ", -1))
|
|
102
|
+
])
|
|
103
|
+
]),
|
|
104
|
+
_: 1
|
|
105
|
+
})) : l("", !0),
|
|
106
|
+
(k() || v() || x()) && A() ? (a(), i(n(T), { key: 3 })) : l("", !0),
|
|
107
|
+
A() ? (a(), i(n(s), {
|
|
108
|
+
key: 4,
|
|
109
|
+
onClick: t[3] || (t[3] = (o) => g("showDeleteModal"))
|
|
110
|
+
}, {
|
|
111
|
+
default: m(() => [
|
|
112
|
+
r("div", $, [
|
|
113
|
+
u(n(y), {
|
|
114
|
+
icon: "Delete",
|
|
115
|
+
size: "sm"
|
|
116
|
+
}),
|
|
117
|
+
t[8] || (t[8] = c(" Delete ", -1))
|
|
118
|
+
])
|
|
119
|
+
]),
|
|
120
|
+
_: 1
|
|
121
|
+
})) : l("", !0)
|
|
122
|
+
]),
|
|
123
|
+
_: 1
|
|
124
|
+
}, 8, ["open", "target"]));
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
export {
|
|
128
|
+
W as default
|
|
129
|
+
};
|
|
@@ -33,7 +33,7 @@ const W = { class: "flex-center relative flex flex-1 flex-col gap-6 p-2 capitali
|
|
|
33
33
|
}));
|
|
34
34
|
}, f = (o) => {
|
|
35
35
|
o?.createNew && g.name === "request" && d();
|
|
36
|
-
}, v = "2.17.
|
|
36
|
+
}, v = "2.17.1";
|
|
37
37
|
return q(() => a.hotKeys.on(f)), R(() => a.hotKeys.off(f)), (o, e) => (i(), l("div", W, [
|
|
38
38
|
s("div", {
|
|
39
39
|
class: y(["flex h-[calc(100%_-_50px)] flex-col items-center justify-center", {
|
package/package.json
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"rest",
|
|
19
19
|
"testing"
|
|
20
20
|
],
|
|
21
|
-
"version": "2.17.
|
|
21
|
+
"version": "2.17.1",
|
|
22
22
|
"engines": {
|
|
23
23
|
"node": ">=20"
|
|
24
24
|
},
|
|
@@ -321,26 +321,26 @@
|
|
|
321
321
|
"whatwg-mimetype": "^4.0.0",
|
|
322
322
|
"yaml": "^2.8.0",
|
|
323
323
|
"zod": "^4.1.11",
|
|
324
|
+
"@scalar/components": "0.16.12",
|
|
325
|
+
"@scalar/draggable": "0.3.0",
|
|
324
326
|
"@scalar/analytics-client": "1.0.1",
|
|
325
|
-
"@scalar/components": "0.16.11",
|
|
326
327
|
"@scalar/helpers": "0.2.4",
|
|
327
|
-
"@scalar/draggable": "0.3.0",
|
|
328
328
|
"@scalar/icons": "0.5.2",
|
|
329
329
|
"@scalar/import": "0.4.41",
|
|
330
330
|
"@scalar/json-magic": "0.8.8",
|
|
331
331
|
"@scalar/oas-utils": "0.6.11",
|
|
332
|
+
"@scalar/object-utils": "1.2.18",
|
|
332
333
|
"@scalar/openapi-types": "0.5.3",
|
|
333
334
|
"@scalar/openapi-parser": "0.23.9",
|
|
334
|
-
"@scalar/
|
|
335
|
-
"@scalar/
|
|
335
|
+
"@scalar/sidebar": "0.7.2",
|
|
336
|
+
"@scalar/postman-to-openapi": "0.3.52",
|
|
336
337
|
"@scalar/themes": "0.13.26",
|
|
337
338
|
"@scalar/types": "0.5.4",
|
|
338
|
-
"@scalar/use-codemirror": "0.13.
|
|
339
|
-
"@scalar/postman-to-openapi": "0.3.52",
|
|
339
|
+
"@scalar/use-codemirror": "0.13.6",
|
|
340
340
|
"@scalar/snippetz": "0.6.1",
|
|
341
341
|
"@scalar/use-toasts": "0.9.1",
|
|
342
|
-
"@scalar/
|
|
343
|
-
"@scalar/
|
|
342
|
+
"@scalar/workspace-store": "0.24.1",
|
|
343
|
+
"@scalar/use-hooks": "0.3.3"
|
|
344
344
|
},
|
|
345
345
|
"devDependencies": {
|
|
346
346
|
"@tailwindcss/vite": "^4.1.7",
|
|
@@ -355,8 +355,8 @@
|
|
|
355
355
|
"vite": "7.1.11",
|
|
356
356
|
"vite-svg-loader": "5.1.0",
|
|
357
357
|
"vitest": "3.2.4",
|
|
358
|
-
"@scalar/
|
|
359
|
-
"@scalar/
|
|
358
|
+
"@scalar/build-tooling": "0.4.0",
|
|
359
|
+
"@scalar/galaxy": "0.5.12"
|
|
360
360
|
},
|
|
361
361
|
"scripts": {
|
|
362
362
|
"build": "scalar-build-vite",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ItemDecorator.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/app/components/ItemDecorator.vue"],"names":[],"mappings":"AAkLA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AACnD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAEvE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4CAA4C,CAAA;AAIhF,KAAK,WAAW,GAAG;IACjB,4CAA4C;IAC5C,IAAI,EAAE,cAAc,CAAA;IACpB,sCAAsC;IACtC,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,qDAAqD;IACrD,YAAY,EAAE,YAAY,CAAC,cAAc,CAAC,CAAA;IAC1C,sDAAsD;IACtD,MAAM,EAAE,WAAW,CAAA;CACpB,CAAC;;;;;;;;AAsVF,wBAOG"}
|