@scalar/api-client 2.34.1 → 2.36.0
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 +59 -0
- package/dist/components/ViewLayout/ViewLayoutSection.vue.d.ts.map +1 -1
- package/dist/components/ViewLayout/ViewLayoutSection.vue.js +1 -1
- package/dist/style.css +1 -1
- package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts.map +1 -1
- package/dist/v2/blocks/operation-block/OperationBlock.vue.js +88 -80
- package/dist/v2/blocks/operation-block/helpers/de-serialize-parameter.js +6 -4
- package/dist/v2/blocks/operation-block/helpers/validate-path-parameters.d.ts +16 -0
- package/dist/v2/blocks/operation-block/helpers/validate-path-parameters.d.ts.map +1 -0
- package/dist/v2/blocks/operation-block/helpers/validate-path-parameters.js +17 -0
- package/dist/v2/blocks/operation-code-sample/helpers/get-example-from-schema.d.ts.map +1 -1
- package/dist/v2/blocks/operation-code-sample/helpers/get-example-from-schema.js +90 -84
- package/dist/v2/blocks/request-block/helpers/get-default-headers.js +1 -1
- package/dist/v2/blocks/scalar-address-bar-block/components/EnvironmentSelector.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-address-bar-block/components/EnvironmentSelector.vue.js +76 -50
- package/dist/v2/components/sidebar/Sidebar.vue.d.ts.map +1 -1
- package/dist/v2/components/sidebar/Sidebar.vue.js +25 -23
- package/dist/v2/features/app/App.vue.d.ts.map +1 -1
- package/dist/v2/features/app/App.vue.js +41 -35
- package/dist/v2/features/app/app-events.d.ts +5 -2
- package/dist/v2/features/app/app-events.d.ts.map +1 -1
- package/dist/v2/features/app/app-events.js +58 -44
- package/dist/v2/features/app/app-state.d.ts.map +1 -1
- package/dist/v2/features/app/app-state.js +82 -80
- package/dist/v2/features/app/components/AppSidebar.vue.d.ts.map +1 -1
- package/dist/v2/features/app/components/AppSidebar.vue.js +2 -2
- package/dist/v2/features/app/components/AppSidebar.vue2.js +78 -76
- package/dist/v2/features/app/components/SidebarItemMenu.vue.d.ts.map +1 -1
- package/dist/v2/features/app/components/SidebarItemMenu.vue.js +73 -45
- package/dist/v2/features/collection/DocumentCollection.vue.d.ts.map +1 -1
- package/dist/v2/features/collection/DocumentCollection.vue.js +20 -20
- package/dist/v2/features/collection/OperationCollection.vue.d.ts.map +1 -1
- package/dist/v2/features/collection/OperationCollection.vue.js +7 -7
- package/dist/v2/features/collection/WorkspaceCollection.vue.d.ts.map +1 -1
- package/dist/v2/features/collection/WorkspaceCollection.vue.js +5 -4
- package/dist/v2/features/collection/components/Authentication.vue.d.ts.map +1 -1
- package/dist/v2/features/collection/components/Authentication.vue.js +1 -1
- package/dist/v2/features/collection/components/Authentication.vue2.js +84 -66
- package/dist/v2/features/collection/components/LabelInput.vue.d.ts.map +1 -1
- package/dist/v2/features/collection/components/LabelInput.vue.js +2 -2
- package/dist/v2/features/collection/components/LabelInput.vue2.js +1 -1
- package/dist/v2/features/command-palette/components/CommandPaletteExample.vue.d.ts +5 -0
- package/dist/v2/features/command-palette/components/CommandPaletteExample.vue.d.ts.map +1 -1
- package/dist/v2/features/command-palette/components/CommandPaletteExample.vue.js +131 -96
- package/dist/v2/features/command-palette/hooks/use-command-palette-state.d.ts +25 -0
- package/dist/v2/features/command-palette/hooks/use-command-palette-state.d.ts.map +1 -1
- package/dist/v2/features/command-palette/hooks/use-command-palette-state.js +42 -36
- package/dist/v2/features/operation/Operation.vue.js +1 -1
- package/dist/v2/workspace-events.d.ts.map +1 -1
- package/dist/v2/workspace-events.js +8 -5
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
- package/package.json +18 -18
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useModal as Q, ScalarSidebarItem as
|
|
1
|
+
import { defineComponent as j, mergeModels as C, computed as S, capitalize as F, useModel as W, ref as G, createElementBlock as b, openBlock as d, createVNode as u, createBlock as f, createCommentVNode as c, unref as s, normalizeClass as $, createSlots as H, withCtx as l, createTextVNode as y, createElementVNode as r, withKeys as p, withModifiers as m, toDisplayString as J, renderSlot as U, Fragment as I, nextTick as Y } from "vue";
|
|
2
|
+
import { useModal as Q, ScalarSidebarItem as E, ScalarIconButton as O, ScalarButton as A, ScalarModal as X } from "@scalar/components";
|
|
3
3
|
import { isMacOS as Z } from "@scalar/helpers/general/is-mac-os";
|
|
4
4
|
import { ScalarIconPlus as _, ScalarIconGearSix as ee, ScalarIconDotsThree as te } from "@scalar/icons";
|
|
5
5
|
import { LibraryIcon as ae } from "@scalar/icons/library";
|
|
@@ -7,8 +7,8 @@ import { getParentEntry as g } from "@scalar/workspace-store/navigation";
|
|
|
7
7
|
import oe from "../../../../assets/rabbit.ascii.js";
|
|
8
8
|
import ne from "../../../../assets/rabbitjump.ascii.js";
|
|
9
9
|
import D from "../../../../components/ScalarAsciiArt.vue.js";
|
|
10
|
-
import
|
|
11
|
-
import
|
|
10
|
+
import se from "../../../../components/Sidebar/Actions/DeleteSidebarListElement.vue.js";
|
|
11
|
+
import ie from "./DownloadAppButton.vue.js";
|
|
12
12
|
import re from "./SidebarItemMenu.vue.js";
|
|
13
13
|
import { dragHandleFactory as le } from "../../../helpers/drag-handle-factory.js";
|
|
14
14
|
import de from "../../../components/sidebar/Sidebar.vue.js";
|
|
@@ -18,9 +18,9 @@ const ue = { class: "flex" }, me = { class: "flex items-center gap-0.5" }, ce =
|
|
|
18
18
|
}, pe = {
|
|
19
19
|
key: 0,
|
|
20
20
|
class: "empty-sidebar-item-content overflow-hidden px-2.5 py-2.5"
|
|
21
|
-
}, ve = { class: "rabbit-ascii relative m-auto mt-2 h-[68px] w-[60px]" }, be = { class: "flex flex-col gap-1.5 p-2" }, fe = { class: "text-sidebar-c-2 rounded border px-1.25 py-1 text-xs leading-none font-medium uppercase" },
|
|
21
|
+
}, ve = { class: "rabbit-ascii relative m-auto mt-2 h-[68px] w-[60px]" }, be = { class: "flex flex-col gap-1.5 p-2" }, fe = { class: "text-sidebar-c-2 rounded border px-1.25 py-1 text-xs leading-none font-medium uppercase" }, Oe = /* @__PURE__ */ j({
|
|
22
22
|
__name: "AppSidebar",
|
|
23
|
-
props: /* @__PURE__ */
|
|
23
|
+
props: /* @__PURE__ */ C({
|
|
24
24
|
layout: {},
|
|
25
25
|
sidebarState: {},
|
|
26
26
|
isWorkspaceOpen: { type: Boolean },
|
|
@@ -37,18 +37,18 @@ const ue = { class: "flex" }, me = { class: "flex items-center gap-0.5" }, ce =
|
|
|
37
37
|
},
|
|
38
38
|
sidebarWidthModifiers: {}
|
|
39
39
|
}),
|
|
40
|
-
emits: /* @__PURE__ */
|
|
40
|
+
emits: /* @__PURE__ */ C(["click:workspace", "selectItem", "select:workspace", "create:workspace"], ["update:isSidebarOpen", "update:sidebarWidth"]),
|
|
41
41
|
setup(o, { emit: N }) {
|
|
42
|
-
const k = N, K = S(() =>
|
|
42
|
+
const k = N, K = S(() => F(o.activeWorkspace.label)), T = W(o, "isSidebarOpen"), B = W(o, "sidebarWidth"), x = S(() => o.sidebarState.items.value.length <= 1), M = S(
|
|
43
43
|
() => le({
|
|
44
44
|
store: o.store,
|
|
45
45
|
sidebarState: o.sidebarState
|
|
46
46
|
})
|
|
47
|
-
),
|
|
48
|
-
const a =
|
|
47
|
+
), z = (a, e) => M.value.handleDragEnd(a, e), P = (a, e) => M.value.isDroppable(a, e), i = G(null), w = Q(), q = S(() => {
|
|
48
|
+
const a = i.value?.item;
|
|
49
49
|
return a?.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 ${a?.type ?? "item"}? This action cannot be undone.`;
|
|
50
|
-
}),
|
|
51
|
-
const a =
|
|
50
|
+
}), L = () => {
|
|
51
|
+
const a = i.value?.item;
|
|
52
52
|
if (!a)
|
|
53
53
|
return;
|
|
54
54
|
const e = o.sidebarState.getEntryById(a.id), t = g("document", e), n = g("operation", e);
|
|
@@ -82,18 +82,18 @@ const ue = { class: "flex" }, me = { class: "flex items-center gap-0.5" }, ce =
|
|
|
82
82
|
documentName: t.name
|
|
83
83
|
});
|
|
84
84
|
}
|
|
85
|
-
w.hide(),
|
|
85
|
+
w.hide(), i.value = null;
|
|
86
86
|
}
|
|
87
87
|
}, v = async (a, e) => {
|
|
88
|
-
if (
|
|
88
|
+
if (i.value?.showMenu)
|
|
89
89
|
return;
|
|
90
90
|
const t = a.currentTarget;
|
|
91
|
-
|
|
91
|
+
i.value = { item: e, el: t, showMenu: !0 }, await Y();
|
|
92
92
|
const n = a instanceof MouseEvent ? new MouseEvent(a.type, a) : new KeyboardEvent(a.type, a);
|
|
93
|
-
|
|
94
|
-
},
|
|
95
|
-
|
|
96
|
-
},
|
|
93
|
+
i.value?.el.dispatchEvent(n);
|
|
94
|
+
}, R = () => {
|
|
95
|
+
i.value && (i.value.showMenu = !1);
|
|
96
|
+
}, V = (a) => {
|
|
97
97
|
const e = o.sidebarState.getEntryById(a.id), t = g("document", e), n = g("tag", e);
|
|
98
98
|
o.eventBus.emit("ui:open:command-palette", {
|
|
99
99
|
action: "create-request",
|
|
@@ -102,7 +102,7 @@ const ue = { class: "flex" }, me = { class: "flex items-center gap-0.5" }, ce =
|
|
|
102
102
|
tagId: n?.name
|
|
103
103
|
}
|
|
104
104
|
});
|
|
105
|
-
},
|
|
105
|
+
}, h = (a) => {
|
|
106
106
|
const e = o.sidebarState.getEntryById(a.id), t = g("document", e)?.name;
|
|
107
107
|
o.eventBus.emit("ui:navigate", {
|
|
108
108
|
page: "operation",
|
|
@@ -113,56 +113,58 @@ const ue = { class: "flex" }, me = { class: "flex items-center gap-0.5" }, ce =
|
|
|
113
113
|
});
|
|
114
114
|
};
|
|
115
115
|
return (a, e) => (d(), b("div", ue, [
|
|
116
|
-
u(
|
|
117
|
-
|
|
118
|
-
"onUpdate:
|
|
119
|
-
sidebarWidth: h.value,
|
|
120
|
-
"onUpdate:sidebarWidth": e[4] || (e[4] = (t) => h.value = t),
|
|
116
|
+
u(s(de), {
|
|
117
|
+
sidebarWidth: B.value,
|
|
118
|
+
"onUpdate:sidebarWidth": e[3] || (e[3] = (t) => B.value = t),
|
|
121
119
|
activeWorkspace: o.activeWorkspace,
|
|
120
|
+
class: $([
|
|
121
|
+
"max-md:inset-y-0 max-md:z-2 max-md:w-full!",
|
|
122
|
+
T.value ? "max-md:fixed! max-md:flex!" : "max-md:hidden!"
|
|
123
|
+
]),
|
|
122
124
|
documents: Object.values(o.store.workspace.documents),
|
|
123
125
|
isDroppable: P,
|
|
124
126
|
layout: o.layout,
|
|
125
127
|
sidebarState: o.sidebarState,
|
|
126
128
|
workspaces: o.workspaces,
|
|
127
|
-
"onCreate:workspace": e[
|
|
128
|
-
"onNavigate:to:settings": e[
|
|
129
|
-
onReorder: e[
|
|
130
|
-
"onSelect:workspace": e[
|
|
131
|
-
onSelectItem: e[
|
|
132
|
-
},
|
|
129
|
+
"onCreate:workspace": e[4] || (e[4] = (t) => k("create:workspace")),
|
|
130
|
+
"onNavigate:to:settings": e[5] || (e[5] = (t) => o.eventBus.emit("ui:navigate", { page: "workspace", path: "settings" })),
|
|
131
|
+
onReorder: e[6] || (e[6] = (t, n) => z(t, n)),
|
|
132
|
+
"onSelect:workspace": e[7] || (e[7] = (t) => k("select:workspace", t)),
|
|
133
|
+
onSelectItem: e[8] || (e[8] = (t) => k("selectItem", t))
|
|
134
|
+
}, H({
|
|
133
135
|
sidebarMenuActions: l(() => [
|
|
134
136
|
U(a.$slots, "sidebarMenuActions", {}, void 0, !0)
|
|
135
137
|
]),
|
|
136
138
|
workspaceButton: l(() => [
|
|
137
|
-
u(
|
|
139
|
+
u(s(E), {
|
|
138
140
|
is: "button",
|
|
139
141
|
active: o.isWorkspaceOpen,
|
|
140
142
|
onClick: e[0] || (e[0] = (t) => k("click:workspace"))
|
|
141
143
|
}, {
|
|
142
144
|
default: l(() => [
|
|
143
|
-
y(
|
|
145
|
+
y(J(K.value), 1)
|
|
144
146
|
]),
|
|
145
147
|
_: 1
|
|
146
148
|
}, 8, ["active"])
|
|
147
149
|
]),
|
|
148
150
|
decorator: l(({ item: t }) => [
|
|
149
151
|
r("div", me, [
|
|
150
|
-
t.type === "operation" ? (d(), f(
|
|
152
|
+
t.type === "operation" ? (d(), f(s(O), {
|
|
151
153
|
key: 0,
|
|
152
|
-
icon:
|
|
154
|
+
icon: s(ee),
|
|
153
155
|
label: "Operation settings",
|
|
154
156
|
size: "sm",
|
|
155
157
|
weight: "bold",
|
|
156
|
-
onClick: m((n) =>
|
|
158
|
+
onClick: m((n) => h(t), ["stop"]),
|
|
157
159
|
onKeydown: [
|
|
158
|
-
p(m((n) =>
|
|
159
|
-
p(m((n) =>
|
|
160
|
+
p(m((n) => h(t), ["stop"]), ["enter"]),
|
|
161
|
+
p(m((n) => h(t), ["stop"]), ["space"])
|
|
160
162
|
]
|
|
161
163
|
}, null, 8, ["icon", "onClick", "onKeydown"])) : c("", !0),
|
|
162
|
-
u(
|
|
164
|
+
u(s(O), {
|
|
163
165
|
"aria-expanded": "false",
|
|
164
166
|
"aria-haspopup": "menu",
|
|
165
|
-
icon:
|
|
167
|
+
icon: s(te),
|
|
166
168
|
label: "More options",
|
|
167
169
|
size: "sm",
|
|
168
170
|
weight: "bold",
|
|
@@ -178,22 +180,22 @@ const ue = { class: "flex" }, me = { class: "flex items-center gap-0.5" }, ce =
|
|
|
178
180
|
]),
|
|
179
181
|
icon: l(({ item: t }) => [
|
|
180
182
|
t.type === "document" && o.store.workspace.documents[t.name]?.["x-scalar-is-dirty"] === !0 ? (d(), b("div", ce, [
|
|
181
|
-
u(
|
|
183
|
+
u(s(ae), {
|
|
182
184
|
class: "block",
|
|
183
185
|
src: "icon" in t && t.icon || "interface-content-folder"
|
|
184
186
|
}, null, 8, ["src"]),
|
|
185
|
-
e[
|
|
187
|
+
e[11] || (e[11] = r("div", { class: "bg-orange absolute -top-1.25 -right-1.25 flex h-2.5 w-2.5 items-center justify-center rounded-full text-[9px] font-bold text-white" }, " ! ", -1))
|
|
186
188
|
])) : c("", !0)
|
|
187
189
|
]),
|
|
188
190
|
empty: l(({ item: t }) => [
|
|
189
|
-
u(
|
|
191
|
+
u(s(E), {
|
|
190
192
|
is: "button",
|
|
191
|
-
onClick: (n) =>
|
|
193
|
+
onClick: (n) => V(t)
|
|
192
194
|
}, {
|
|
193
195
|
icon: l(() => [
|
|
194
|
-
u(
|
|
196
|
+
u(s(_))
|
|
195
197
|
]),
|
|
196
|
-
default: l(() => [...e[
|
|
198
|
+
default: l(() => [...e[12] || (e[12] = [
|
|
197
199
|
y("Add operation", -1)
|
|
198
200
|
])]),
|
|
199
201
|
_: 1
|
|
@@ -205,28 +207,28 @@ const ue = { class: "flex" }, me = { class: "flex items-center gap-0.5" }, ce =
|
|
|
205
207
|
name: "footer",
|
|
206
208
|
fn: l(() => [
|
|
207
209
|
r("div", {
|
|
208
|
-
class:
|
|
210
|
+
class: $({
|
|
209
211
|
"empty-sidebar-item border-t": x.value
|
|
210
212
|
})
|
|
211
213
|
}, [
|
|
212
214
|
x.value ? (d(), b("div", pe, [
|
|
213
215
|
r("div", ve, [
|
|
214
216
|
u(D, {
|
|
215
|
-
art:
|
|
217
|
+
art: s(oe),
|
|
216
218
|
class: "rabbitsit font-bold"
|
|
217
219
|
}, null, 8, ["art"]),
|
|
218
220
|
u(D, {
|
|
219
|
-
art:
|
|
221
|
+
art: s(ne),
|
|
220
222
|
class: "rabbitjump absolute top-0 left-0 font-bold"
|
|
221
223
|
}, null, 8, ["art"])
|
|
222
224
|
]),
|
|
223
|
-
e[
|
|
225
|
+
e[13] || (e[13] = r("div", { class: "mt-2 mb-2 text-center text-sm text-balance" }, [
|
|
224
226
|
r("b", { class: "font-medium" }, "Let's Get Started"),
|
|
225
227
|
r("p", { class: "mt-2 leading-5" }, " Create request, folder, collection or import from OpenAPI/Postman ")
|
|
226
228
|
], -1))
|
|
227
229
|
])) : c("", !0),
|
|
228
230
|
r("div", be, [
|
|
229
|
-
x.value ? (d(), f(
|
|
231
|
+
x.value ? (d(), f(s(A), {
|
|
230
232
|
key: 0,
|
|
231
233
|
class: "w-full",
|
|
232
234
|
size: "sm",
|
|
@@ -235,12 +237,12 @@ const ue = { class: "flex" }, me = { class: "flex items-center gap-0.5" }, ce =
|
|
|
235
237
|
payload: void 0
|
|
236
238
|
}))
|
|
237
239
|
}, {
|
|
238
|
-
default: l(() => [...e[
|
|
240
|
+
default: l(() => [...e[14] || (e[14] = [
|
|
239
241
|
y(" Import Collection ", -1)
|
|
240
242
|
])]),
|
|
241
243
|
_: 1
|
|
242
244
|
})) : c("", !0),
|
|
243
|
-
u(
|
|
245
|
+
u(s(A), {
|
|
244
246
|
class: "w-full",
|
|
245
247
|
hotkey: "K",
|
|
246
248
|
size: "sm",
|
|
@@ -248,48 +250,48 @@ const ue = { class: "flex" }, me = { class: "flex items-center gap-0.5" }, ce =
|
|
|
248
250
|
onClick: e[2] || (e[2] = (t) => o.eventBus.emit("ui:open:command-palette"))
|
|
249
251
|
}, {
|
|
250
252
|
default: l(() => [
|
|
251
|
-
e[
|
|
253
|
+
e[20] || (e[20] = y(" Add Item ", -1)),
|
|
252
254
|
r("span", fe, [
|
|
253
|
-
|
|
254
|
-
e[
|
|
255
|
-
e[
|
|
255
|
+
s(Z)() ? (d(), b(I, { key: 0 }, [
|
|
256
|
+
e[15] || (e[15] = r("span", { class: "sr-only" }, "Command", -1)),
|
|
257
|
+
e[16] || (e[16] = r("span", { "aria-hidden": "true" }, "⌘", -1))
|
|
256
258
|
], 64)) : (d(), b(I, { key: 1 }, [
|
|
257
|
-
e[
|
|
258
|
-
e[
|
|
259
|
+
e[17] || (e[17] = r("span", { class: "sr-only" }, "CTRL", -1)),
|
|
260
|
+
e[18] || (e[18] = r("span", { "aria-hidden": "true" }, "⌃", -1))
|
|
259
261
|
], 64)),
|
|
260
|
-
e[
|
|
262
|
+
e[19] || (e[19] = y(" K ", -1))
|
|
261
263
|
])
|
|
262
264
|
]),
|
|
263
265
|
_: 1
|
|
264
266
|
}),
|
|
265
|
-
o.layout === "web" ? (d(), f(
|
|
267
|
+
o.layout === "web" ? (d(), f(ie, { key: 1 })) : c("", !0)
|
|
266
268
|
])
|
|
267
269
|
], 2)
|
|
268
270
|
]),
|
|
269
271
|
key: "0"
|
|
270
272
|
} : void 0
|
|
271
|
-
]), 1032, ["
|
|
272
|
-
|
|
273
|
+
]), 1032, ["sidebarWidth", "activeWorkspace", "class", "documents", "layout", "sidebarState", "workspaces"]),
|
|
274
|
+
i.value?.showMenu ? (d(), f(re, {
|
|
273
275
|
key: 0,
|
|
274
276
|
eventBus: o.eventBus,
|
|
275
|
-
item:
|
|
277
|
+
item: i.value.item,
|
|
276
278
|
sidebarState: o.sidebarState,
|
|
277
|
-
target:
|
|
278
|
-
onCloseMenu:
|
|
279
|
-
onShowDeleteModal: e[
|
|
279
|
+
target: i.value.el,
|
|
280
|
+
onCloseMenu: R,
|
|
281
|
+
onShowDeleteModal: e[9] || (e[9] = (t) => s(w).show())
|
|
280
282
|
}, null, 8, ["eventBus", "item", "sidebarState", "target"])) : c("", !0),
|
|
281
|
-
|
|
283
|
+
i.value ? (d(), f(s(X), {
|
|
282
284
|
key: 1,
|
|
283
285
|
size: "xxs",
|
|
284
|
-
state:
|
|
285
|
-
title: `Delete ${
|
|
286
|
+
state: s(w),
|
|
287
|
+
title: `Delete ${i.value.item.title}`
|
|
286
288
|
}, {
|
|
287
289
|
default: l(() => [
|
|
288
|
-
u(
|
|
289
|
-
variableName:
|
|
290
|
-
warningMessage:
|
|
291
|
-
onClose: e[
|
|
292
|
-
onDelete:
|
|
290
|
+
u(se, {
|
|
291
|
+
variableName: i.value.item.title,
|
|
292
|
+
warningMessage: q.value,
|
|
293
|
+
onClose: e[10] || (e[10] = (t) => s(w).hide()),
|
|
294
|
+
onDelete: L
|
|
293
295
|
}, null, 8, ["variableName", "warningMessage"])
|
|
294
296
|
]),
|
|
295
297
|
_: 1
|
|
@@ -298,5 +300,5 @@ const ue = { class: "flex" }, me = { class: "flex items-center gap-0.5" }, ce =
|
|
|
298
300
|
}
|
|
299
301
|
});
|
|
300
302
|
export {
|
|
301
|
-
|
|
303
|
+
Oe as default
|
|
302
304
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SidebarItemMenu.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/app/components/SidebarItemMenu.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SidebarItemMenu.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/app/components/SidebarItemMenu.vue"],"names":[],"mappings":"AA+OA,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;AAqdF,QAAA,MAAM,YAAY;;;;;;kFAGhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { ScalarDropdown as
|
|
3
|
-
import { ScalarIconPencil as
|
|
4
|
-
import { getParentEntry as
|
|
5
|
-
const
|
|
1
|
+
import { defineComponent as T, ref as b, watch as z, nextTick as $, createBlock as i, openBlock as m, unref as n, withCtx as o, createCommentVNode as l, createElementVNode as c, createVNode as u, createTextVNode as s } from "vue";
|
|
2
|
+
import { ScalarDropdown as M, ScalarDropdownItem as r, ScalarIcon as f, ScalarDropdownDivider as O } from "@scalar/components";
|
|
3
|
+
import { ScalarIconPencil as A } from "@scalar/icons";
|
|
4
|
+
import { getParentEntry as y } from "@scalar/workspace-store/navigation";
|
|
5
|
+
const V = { class: "flex items-center gap-2" }, W = { class: "flex items-center gap-2" }, U = { class: "flex items-center gap-2" }, q = { class: "flex items-center gap-2" }, R = { class: "flex items-center gap-2" }, j = { class: "text-red flex items-center gap-2" }, K = /* @__PURE__ */ T({
|
|
6
6
|
__name: "SidebarItemMenu",
|
|
7
7
|
props: {
|
|
8
8
|
item: {},
|
|
@@ -11,12 +11,12 @@ const $ = { class: "flex items-center gap-2" }, V = { class: "flex items-center
|
|
|
11
11
|
target: {}
|
|
12
12
|
},
|
|
13
13
|
emits: ["closeMenu", "showDeleteModal"],
|
|
14
|
-
setup(e, { emit:
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
!a && t && (await
|
|
14
|
+
setup(e, { emit: I }) {
|
|
15
|
+
const x = I, g = b(!1);
|
|
16
|
+
z(g, async (a, t) => {
|
|
17
|
+
!a && t && (await $(), x("closeMenu"));
|
|
18
18
|
});
|
|
19
|
-
const
|
|
19
|
+
const v = () => e.item.type === "document" || e.item.type === "tag", k = () => e.item.type === "document", S = () => e.item.type === "tag", E = () => e.item.type === "example", p = () => e.item.type === "operation", B = () => e.item.type === "document" && e.item.id !== "drafts" || e.item.type === "tag" || e.item.type === "operation" || e.item.type === "example", N = () => {
|
|
20
20
|
if (e.item.type === "document" && e.eventBus.emit("ui:open:command-palette", {
|
|
21
21
|
action: "create-request",
|
|
22
22
|
payload: {
|
|
@@ -27,19 +27,19 @@ const $ = { class: "flex items-center gap-2" }, V = { class: "flex items-center
|
|
|
27
27
|
e.eventBus.emit("ui:open:command-palette", {
|
|
28
28
|
action: "create-request",
|
|
29
29
|
payload: {
|
|
30
|
-
documentName:
|
|
30
|
+
documentName: y("document", a)?.name,
|
|
31
31
|
tagId: e.item.name
|
|
32
32
|
}
|
|
33
33
|
});
|
|
34
34
|
}
|
|
35
|
-
},
|
|
35
|
+
}, C = () => {
|
|
36
36
|
e.item.type === "document" && e.eventBus.emit("ui:open:command-palette", {
|
|
37
37
|
action: "add-tag",
|
|
38
38
|
payload: {
|
|
39
39
|
documentName: e.item.name
|
|
40
40
|
}
|
|
41
41
|
});
|
|
42
|
-
},
|
|
42
|
+
}, D = () => {
|
|
43
43
|
if (e.item.type === "tag") {
|
|
44
44
|
const a = e.sidebarState.getEntryById(e.item.id);
|
|
45
45
|
e.eventBus.emit(
|
|
@@ -48,7 +48,7 @@ const $ = { class: "flex items-center gap-2" }, V = { class: "flex items-center
|
|
|
48
48
|
action: "edit-tag",
|
|
49
49
|
payload: {
|
|
50
50
|
tag: e.item,
|
|
51
|
-
documentName:
|
|
51
|
+
documentName: y("document", a)?.name ?? ""
|
|
52
52
|
}
|
|
53
53
|
},
|
|
54
54
|
{ skipUnpackProxy: !0 }
|
|
@@ -60,89 +60,117 @@ const $ = { class: "flex items-center gap-2" }, V = { class: "flex items-center
|
|
|
60
60
|
e.eventBus.emit("ui:open:command-palette", {
|
|
61
61
|
action: "add-example",
|
|
62
62
|
payload: {
|
|
63
|
-
documentName:
|
|
63
|
+
documentName: y("document", a)?.name,
|
|
64
64
|
operationId: e.item.id
|
|
65
65
|
}
|
|
66
66
|
});
|
|
67
67
|
}
|
|
68
|
+
}, P = () => {
|
|
69
|
+
if (e.item.type === "example") {
|
|
70
|
+
const a = e.sidebarState.getEntryById(e.item.id), t = y("operation", a);
|
|
71
|
+
e.eventBus.emit(
|
|
72
|
+
"ui:open:command-palette",
|
|
73
|
+
{
|
|
74
|
+
action: "edit-example",
|
|
75
|
+
payload: {
|
|
76
|
+
example: e.item,
|
|
77
|
+
documentName: y("document", a)?.name ?? "",
|
|
78
|
+
operationId: t?.id ?? ""
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
{ skipUnpackProxy: !0 }
|
|
82
|
+
);
|
|
83
|
+
}
|
|
68
84
|
};
|
|
69
|
-
return (a, t) => (
|
|
85
|
+
return (a, t) => (m(), i(n(M), {
|
|
70
86
|
open: g.value,
|
|
71
|
-
"onUpdate:open": t[
|
|
87
|
+
"onUpdate:open": t[6] || (t[6] = (d) => g.value = d),
|
|
72
88
|
placement: "bottom-end",
|
|
73
89
|
target: e.target,
|
|
74
90
|
teleport: ""
|
|
75
91
|
}, {
|
|
76
92
|
items: o(() => [
|
|
77
|
-
|
|
93
|
+
v() ? (m(), i(n(r), {
|
|
78
94
|
key: 0,
|
|
79
|
-
onClick: t[0] || (t[0] = (
|
|
95
|
+
onClick: t[0] || (t[0] = (d) => N())
|
|
80
96
|
}, {
|
|
81
97
|
default: o(() => [
|
|
82
|
-
c("div",
|
|
83
|
-
u(n(
|
|
98
|
+
c("div", V, [
|
|
99
|
+
u(n(f), {
|
|
84
100
|
icon: "Add",
|
|
85
101
|
size: "sm"
|
|
86
102
|
}),
|
|
87
|
-
t[
|
|
103
|
+
t[7] || (t[7] = s(" Add Operation ", -1))
|
|
88
104
|
])
|
|
89
105
|
]),
|
|
90
106
|
_: 1
|
|
91
107
|
})) : l("", !0),
|
|
92
|
-
k() ? (
|
|
108
|
+
k() ? (m(), i(n(r), {
|
|
93
109
|
key: 1,
|
|
94
|
-
onClick: t[1] || (t[1] = (
|
|
110
|
+
onClick: t[1] || (t[1] = (d) => C())
|
|
95
111
|
}, {
|
|
96
112
|
default: o(() => [
|
|
97
|
-
c("div",
|
|
98
|
-
u(n(
|
|
113
|
+
c("div", W, [
|
|
114
|
+
u(n(f), {
|
|
99
115
|
icon: "Add",
|
|
100
116
|
size: "sm"
|
|
101
117
|
}),
|
|
102
|
-
t[
|
|
118
|
+
t[8] || (t[8] = s(" Add Tag ", -1))
|
|
103
119
|
])
|
|
104
120
|
]),
|
|
105
121
|
_: 1
|
|
106
122
|
})) : l("", !0),
|
|
107
|
-
S() ? (
|
|
123
|
+
S() ? (m(), i(n(r), {
|
|
108
124
|
key: 2,
|
|
109
|
-
onClick: t[2] || (t[2] = (
|
|
125
|
+
onClick: t[2] || (t[2] = (d) => D())
|
|
110
126
|
}, {
|
|
111
127
|
default: o(() => [
|
|
112
|
-
c("div",
|
|
113
|
-
u(n(
|
|
114
|
-
t[
|
|
128
|
+
c("div", U, [
|
|
129
|
+
u(n(A), { size: "sm" }),
|
|
130
|
+
t[9] || (t[9] = s(" Rename Tag ", -1))
|
|
115
131
|
])
|
|
116
132
|
]),
|
|
117
133
|
_: 1
|
|
118
134
|
})) : l("", !0),
|
|
119
|
-
|
|
135
|
+
E() ? (m(), i(n(r), {
|
|
120
136
|
key: 3,
|
|
121
|
-
onClick: t[3] || (t[3] = (
|
|
137
|
+
onClick: t[3] || (t[3] = (d) => P())
|
|
122
138
|
}, {
|
|
123
139
|
default: o(() => [
|
|
124
|
-
c("div",
|
|
125
|
-
u(n(
|
|
140
|
+
c("div", q, [
|
|
141
|
+
u(n(A), { size: "sm" }),
|
|
142
|
+
t[10] || (t[10] = s(" Rename Example ", -1))
|
|
143
|
+
])
|
|
144
|
+
]),
|
|
145
|
+
_: 1
|
|
146
|
+
})) : l("", !0),
|
|
147
|
+
p() ? (m(), i(n(r), {
|
|
148
|
+
key: 4,
|
|
149
|
+
onClick: t[4] || (t[4] = (d) => w())
|
|
150
|
+
}, {
|
|
151
|
+
default: o(() => [
|
|
152
|
+
c("div", R, [
|
|
153
|
+
u(n(f), {
|
|
126
154
|
icon: "Add",
|
|
127
155
|
size: "sm"
|
|
128
156
|
}),
|
|
129
|
-
t[
|
|
157
|
+
t[11] || (t[11] = s(" Add Example ", -1))
|
|
130
158
|
])
|
|
131
159
|
]),
|
|
132
160
|
_: 1
|
|
133
161
|
})) : l("", !0),
|
|
134
|
-
(
|
|
135
|
-
B() ? (
|
|
136
|
-
key:
|
|
137
|
-
onClick: t[
|
|
162
|
+
(p() || v() || k() || E()) && B() ? (m(), i(n(O), { key: 5 })) : l("", !0),
|
|
163
|
+
B() ? (m(), i(n(r), {
|
|
164
|
+
key: 6,
|
|
165
|
+
onClick: t[5] || (t[5] = (d) => x("showDeleteModal"))
|
|
138
166
|
}, {
|
|
139
167
|
default: o(() => [
|
|
140
|
-
c("div",
|
|
141
|
-
u(n(
|
|
168
|
+
c("div", j, [
|
|
169
|
+
u(n(f), {
|
|
142
170
|
icon: "Delete",
|
|
143
171
|
size: "sm"
|
|
144
172
|
}),
|
|
145
|
-
t[
|
|
173
|
+
t[12] || (t[12] = s(" Delete ", -1))
|
|
146
174
|
])
|
|
147
175
|
]),
|
|
148
176
|
_: 1
|
|
@@ -153,5 +181,5 @@ const $ = { class: "flex items-center gap-2" }, V = { class: "flex items-center
|
|
|
153
181
|
}
|
|
154
182
|
});
|
|
155
183
|
export {
|
|
156
|
-
|
|
184
|
+
K as default
|
|
157
185
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DocumentCollection.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/collection/DocumentCollection.vue"],"names":[],"mappings":"AAyJA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAA;AAMlE;;;;;;;GAOG;wBACkB,OAAO,YAAY;AAAxC,wBAAyC;AAKzC,QAAA,MAAM,YAAY,
|
|
1
|
+
{"version":3,"file":"DocumentCollection.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/collection/DocumentCollection.vue"],"names":[],"mappings":"AAyJA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAA;AAMlE;;;;;;;GAOG;wBACkB,OAAO,YAAY;AAAxC,wBAAyC;AAKzC,QAAA,MAAM,YAAY,gSA+Vd,CAAC"}
|