@scalar/api-client 2.1.2 → 2.1.5

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.
Files changed (38) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/dist/components/AddressBar/AddressBarServer.vue.d.ts.map +1 -1
  3. package/dist/components/AddressBar/AddressBarServer.vue.js +58 -58
  4. package/dist/layouts/App/create-api-client-app.d.ts.map +1 -1
  5. package/dist/layouts/Modal/create-api-client-modal.d.ts.map +1 -1
  6. package/dist/libs/create-client.d.ts.map +1 -1
  7. package/dist/libs/send-request.d.ts.map +1 -1
  8. package/dist/libs/send-request.js +63 -62
  9. package/dist/store/request-example.d.ts.map +1 -1
  10. package/dist/store/store.d.ts.map +1 -1
  11. package/dist/style.css +1 -1
  12. package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.d.ts.map +1 -1
  13. package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.js +2 -2
  14. package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue2.js +77 -73
  15. package/dist/views/Request/RequestSection/RequestBody.vue.d.ts +0 -4
  16. package/dist/views/Request/RequestSection/RequestBody.vue.d.ts.map +1 -1
  17. package/dist/views/Request/RequestSection/RequestBody.vue.js +214 -162
  18. package/dist/views/Request/RequestSection/RequestPathParams.vue.d.ts.map +1 -1
  19. package/dist/views/Request/RequestSection/RequestPathParams.vue.js +38 -37
  20. package/dist/views/Request/RequestSection/RequestSection.vue.d.ts.map +1 -1
  21. package/dist/views/Request/RequestSection/RequestSection.vue.js +5 -8
  22. package/dist/views/Request/RequestSidebar.vue.d.ts.map +1 -1
  23. package/dist/views/Request/RequestSidebar.vue.js +2 -2
  24. package/dist/views/Request/RequestSidebar.vue2.js +164 -153
  25. package/dist/views/Request/RequestSidebarItem.vue.d.ts +7 -0
  26. package/dist/views/Request/RequestSidebarItem.vue.d.ts.map +1 -1
  27. package/dist/views/Request/RequestSidebarItem.vue.js +1 -1
  28. package/dist/views/Request/RequestSidebarItem.vue2.js +230 -263
  29. package/dist/views/Request/RequestSidebarItemMenu.vue.d.ts +8 -30
  30. package/dist/views/Request/RequestSidebarItemMenu.vue.d.ts.map +1 -1
  31. package/dist/views/Request/RequestSidebarItemMenu.vue.js +1 -1
  32. package/dist/views/Request/RequestSidebarItemMenu.vue2.js +131 -81
  33. package/dist/views/Request/types/index.d.ts +2 -0
  34. package/dist/views/Request/types/index.d.ts.map +1 -0
  35. package/dist/views/Request/types/index.js +1 -0
  36. package/dist/views/Request/types/sidebar-item.d.ts +23 -0
  37. package/dist/views/Request/types/sidebar-item.d.ts.map +1 -0
  38. package/package.json +11 -6
@@ -1,328 +1,295 @@
1
- import { defineComponent as pe, useCssVars as me, computed as c, ref as F, resolveComponent as fe, openBlock as d, createElementBlock as A, Fragment as Y, createElementVNode as s, normalizeClass as v, unref as i, createVNode as m, withCtx as p, createBlock as f, withModifiers as ce, toDisplayString as L, createCommentVNode as w, createTextVNode as M, renderSlot as ve, withDirectives as be, renderList as ge, vShow as he, pushScopeId as we, popScopeId as xe } from "vue";
2
- import ye from "../../components/Sidebar/Actions/DeleteSidebarListElement.vue.js";
3
- import ke from "../../components/Sidebar/Actions/RenameSidebarListElement.vue.js";
4
- import { PathId as S } from "../../router.js";
5
- import { useModal as W, ScalarContextMenu as H, ScalarIcon as G, ScalarButton as Ue, ScalarModal as J } from "@scalar/components";
6
- import { Draggable as De } from "@scalar/draggable";
7
- import { useRouter as Re, RouterLink as Te } from "vue-router";
8
- import D from "./RequestSidebarItemMenu.vue.js";
9
- import $e from "../../components/HttpMethod/HttpMethod.vue.js";
10
- import { useSidebar as qe } from "../../hooks/useSidebar.js";
11
- import { getModifiers as Ce } from "../../libs/event-busses/hot-keys-bus.js";
12
- import { useWorkspace as Me } from "../../store/store.js";
13
- import { commandPaletteBus as Se } from "../../libs/event-busses/command-palette-bus.js";
14
- const Q = (x) => (we("data-v-1e316c86"), x = x(), xe(), x), Ie = { class: "flex flex-row gap-1 items-center" }, Ee = { class: "relative" }, Ne = { class: "flex items-start" }, ze = { class: "z-10 flex h-5 items-center justify-center max-w-[14px]" }, Be = { class: "flex flex-1 flex-row justify-between editable-sidebar-hover" }, Oe = { class: "relative flex h-fit" }, je = /* @__PURE__ */ Q(() => /* @__PURE__ */ s("span", null, " ", -1)), Pe = /* @__PURE__ */ Q(() => /* @__PURE__ */ s("span", null, "Add Request", -1)), K = "hover:bg-sidebar-active-b indent-padding-left", _e = /* @__PURE__ */ pe({
1
+ import { defineComponent as te, useCssVars as ie, computed as c, ref as ne, resolveComponent as re, openBlock as f, createElementBlock as k, normalizeClass as m, unref as n, createVNode as h, withCtx as y, createBlock as b, withModifiers as C, createElementVNode as d, toDisplayString as O, createCommentVNode as g, createTextVNode as B, renderSlot as le, Fragment as se, renderList as ae, pushScopeId as oe, popScopeId as de } from "vue";
2
+ import { PathId as ue } from "../../router.js";
3
+ import { ScalarButton as I, ScalarIcon as w } from "@scalar/components";
4
+ import { Draggable as pe } from "@scalar/draggable";
5
+ import { RouterLink as fe } from "vue-router";
6
+ import me from "../../components/HttpMethod/HttpMethod.vue.js";
7
+ import { useSidebar as ce } from "../../hooks/useSidebar.js";
8
+ import { getModifiers as be } from "../../libs/event-busses/hot-keys-bus.js";
9
+ import { useWorkspace as ge } from "../../store/store.js";
10
+ import { commandPaletteBus as ve } from "../../libs/event-busses/command-palette-bus.js";
11
+ const P = (v) => (oe("data-v-49b059d4"), v = v(), de(), v), he = { class: "flex flex-row gap-1 items-center" }, ye = { class: "relative" }, xe = { class: "flex items-start" }, ke = ["disabled"], we = { class: "z-10 flex h-5 items-center justify-center max-w-[14px]" }, Ue = { class: "flex flex-1 flex-row justify-between editable-sidebar-hover" }, qe = { class: "relative flex h-fit" }, De = /* @__PURE__ */ P(() => /* @__PURE__ */ d("span", null, " ", -1)), Ce = { key: 2 }, Ie = /* @__PURE__ */ P(() => /* @__PURE__ */ d("span", null, "Add Request", -1)), j = "hover:bg-sidebar-active-b indent-padding-left", je = /* @__PURE__ */ te({
15
12
  __name: "RequestSidebarItem",
16
13
  props: {
17
14
  isDraggable: { type: Boolean, default: !1 },
18
15
  isDroppable: { type: [Boolean, Function], default: !1 },
19
16
  parentUids: {},
20
- uid: {}
17
+ uid: {},
18
+ menuItem: {}
21
19
  },
22
- emits: ["onDragEnd", "newTab"],
23
- setup(x, { emit: X }) {
24
- me((e) => ({
25
- efb8c1e6: le.value,
26
- "1bacdf91": ie.value
20
+ emits: ["onDragEnd", "newTab", "openMenu"],
21
+ setup(v, { emit: V }) {
22
+ ie((e) => ({
23
+ "2df59af7": G.value,
24
+ "6a813932": J.value
27
25
  }));
28
- const n = x, Z = X, {
29
- activeRequest: I,
30
- activeRouterParams: R,
31
- activeWorkspace: b,
32
- collections: T,
33
- tags: _,
34
- isReadOnly: o,
35
- requests: E,
36
- requestExamples: $,
37
- collectionMutators: N,
38
- tagMutators: z,
39
- requestMutators: B,
40
- requestExampleMutators: O,
41
- router: ee
42
- } = Me(), { replace: j } = Re(), { collapsedSidebarFolders: P, toggleSidebarFolder: te } = qe(), l = c(() => {
43
- var u, U;
44
- const e = T[n.uid], t = _[n.uid], r = E[n.uid], a = $[n.uid];
26
+ const r = v, F = V, {
27
+ activeRequest: R,
28
+ activeRouterParams: A,
29
+ activeWorkspace: x,
30
+ collections: U,
31
+ tags: Y,
32
+ isReadOnly: p,
33
+ requests: $,
34
+ requestExamples: q,
35
+ collectionMutators: T,
36
+ tagMutators: M,
37
+ requestMutators: z,
38
+ requestExampleMutators: E,
39
+ router: L
40
+ } = ge(), { collapsedSidebarFolders: S, toggleSidebarFolder: W } = ce(), i = c(() => {
41
+ var s, u;
42
+ const e = U[r.uid], t = Y[r.uid], l = $[r.uid], a = q[r.uid];
45
43
  return e ? {
46
- title: ((u = e.info) == null ? void 0 : u.title) ?? "Unknown title",
44
+ title: ((s = e.info) == null ? void 0 : s.title) ?? "Unknown title",
47
45
  entity: e,
48
46
  resourceTitle: "Collection",
49
47
  children: e.children,
50
48
  warning: "This cannot be undone. You’re about to delete the collection and all folders andrequests inside it.",
51
- rename: () => N.edit(e.uid, "info.title", g.value),
52
- delete: () => N.delete(e, b.value)
49
+ rename: (o) => T.edit(e.uid, "info.title", o),
50
+ delete: () => T.delete(e, x.value)
53
51
  } : t ? {
54
52
  title: t.name,
55
53
  entity: t,
56
54
  resourceTitle: "Tag",
57
55
  children: t.children,
58
56
  warning: "This cannot be undone. You’re about to delete the tag and all requests inside it",
59
- rename: () => z.edit(t.uid, "name", g.value),
60
- delete: () => z.delete(t, n.parentUids[0])
61
- } : r ? {
62
- title: r.summary ?? [r.method, r.path].join(" - "),
63
- link: `/workspace/${b.value.uid}/request/${r.uid}`,
64
- method: r.method,
65
- entity: r,
57
+ rename: (o) => M.edit(t.uid, "name", o),
58
+ delete: () => M.delete(t, r.parentUids[0])
59
+ } : l ? {
60
+ title: l.summary ?? [l.method, l.path].join(" - "),
61
+ link: `/workspace/${x.value.uid}/request/${l.uid}`,
62
+ method: l.method,
63
+ entity: l,
66
64
  resourceTitle: "Request",
67
65
  warning: "This cannot be undone. You’re about to delete the request.",
68
- children: r.examples,
69
- rename: () => B.edit(r.uid, "summary", g.value),
70
- delete: () => B.delete(r, n.parentUids[0])
66
+ children: l.examples,
67
+ rename: (o) => z.edit(l.uid, "summary", o),
68
+ delete: () => z.delete(l, r.parentUids[0])
71
69
  } : {
72
70
  title: a.name,
73
- link: `/workspace/${b.value.uid}/request/${a.requestUid}/examples/${a.uid}`,
74
- method: (U = E[a.requestUid]) == null ? void 0 : U.method,
71
+ link: `/workspace/${x.value.uid}/request/${a.requestUid}/examples/${a.uid}`,
72
+ method: (u = $[a.requestUid]) == null ? void 0 : u.method,
75
73
  entity: a,
76
74
  resourceTitle: "Example",
77
75
  children: [],
78
- rename: () => O.edit(a.uid, "name", g.value),
79
- delete: () => O.delete(a)
76
+ rename: (o) => E.edit(a.uid, "name", o),
77
+ delete: () => E.delete(a)
80
78
  };
81
- }), q = c(
82
- () => l.value.entity.type === "collection" && l.value.title === "Drafts"
83
- ), le = c(() => n.parentUids.length ? o.value ? `${(n.parentUids.length - 1) * 12}px` : `${n.parentUids.length * 12}px` : "12px"), ie = c(() => n.parentUids.length ? o.value ? `${(n.parentUids.length - 1) * 12}px` : `${n.parentUids.length * 12}px` : "0px"), ae = c(
79
+ }), H = c(
80
+ () => i.value.entity.type === "collection" && i.value.title === "Drafts"
81
+ ), G = c(() => r.parentUids.length ? p.value ? `${(r.parentUids.length - 1) * 12}px` : `${r.parentUids.length * 12}px` : "12px"), J = c(() => r.parentUids.length ? p.value ? `${(r.parentUids.length - 1) * 12}px` : `${r.parentUids.length * 12}px` : "0px"), K = c(
84
82
  () => {
85
83
  var e;
86
- return P[n.uid] || ((e = I.value) == null ? void 0 : e.uid) === n.uid && l.value.entity.examples.length > 1;
84
+ return S[r.uid] || ((e = R.value) == null ? void 0 : e.uid) === r.uid && i.value.entity.examples.length > 1;
87
85
  }
88
- ), ne = c(
86
+ ), Q = c(
89
87
  () => {
90
88
  var e;
91
- return R.value[S.Request] === "default" && ((e = I.value) == null ? void 0 : e.uid) === n.uid;
89
+ return A.value[ue.Request] === "default" && ((e = R.value) == null ? void 0 : e.uid) === r.uid;
92
90
  }
93
- ), C = F(null), V = c(() => {
91
+ ), D = ne(null), N = c(() => {
94
92
  let e = 0.5, t = 0.5;
95
- if (!C.value) return { ceiling: e, floor: t };
96
- const { draggingItem: r } = C.value;
97
- return !T[r == null ? void 0 : r.id] && l.value.entity.type === "collection" ? (e = 1, t = 0) : l.value.entity.type === "tag" && (e = 0.8, t = 0.2), { ceiling: e, floor: t };
98
- }), re = (e, t) => !(b.value.isReadOnly || $[t.id] || T[e.id]), g = F(""), y = W(), h = W(), se = (e) => {
99
- g.value = e, l.value.rename(), y.hide();
100
- }, k = () => {
101
- g.value = l.value.title || "", y.show();
102
- }, oe = () => {
103
- l.value.delete(), R.value[S.Request] === n.uid && j(`/workspace/${b.value.uid}/request/default`), R.value[S.Examples] === n.uid && j(`/workspace/${b.value}/request/default`);
104
- }, ue = (e, t) => {
105
- e && (Ce(["default"]).some((u) => e[u]) ? Z("newTab", t.title || "", t.entity.uid) : t.link && ee.push(t.link));
93
+ if (!D.value) return { ceiling: e, floor: t };
94
+ const { draggingItem: l } = D.value;
95
+ 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 };
96
+ }), X = (e, t) => !(x.value.isReadOnly || q[t.id] || U[e.id]), Z = (e, t) => {
97
+ e && (be(["default"]).some((s) => e[s]) ? F("newTab", t.title || "", t.entity.uid) : t.link && L.push(t.link));
106
98
  };
107
- function de() {
108
- Se.emit({
99
+ function _() {
100
+ ve.emit({
109
101
  commandName: "Create Request",
110
102
  metaData: {
111
- itemUid: n.uid,
112
- parentUid: n.parentUids[0]
103
+ itemUid: r.uid,
104
+ parentUid: r.parentUids[0]
113
105
  }
114
106
  });
115
107
  }
116
108
  return (e, t) => {
117
- const r = fe("RequestSidebarItem", !0);
118
- return d(), A(Y, null, [
119
- s("div", {
120
- class: v(["relative flex flex-row", [
121
- i(o) && e.parentUids.length > 1 || !i(o) && e.parentUids.length ? "before:bg-b-3 before:absolute before:left-[calc(.75rem_+_.5px)] before:top-0 before:z-10 before:h-[calc(100%_+_.5px)] last:before:h-full before:w-[.5px] mb-[.5px] last:mb-0 indent-border-line-offset" : ""
122
- ]])
123
- }, [
124
- m(i(De), {
125
- id: l.value.entity.uid,
126
- ref_key: "draggableRef",
127
- ref: C,
128
- ceiling: V.value.ceiling,
129
- class: "flex flex-1 flex-col gap-[.5px] text-sm",
130
- floor: V.value.floor,
131
- isDraggable: e.isDraggable,
132
- isDroppable: e.isDroppable,
133
- parentIds: e.parentUids,
134
- onOnDragEnd: t[9] || (t[9] = (...a) => e.$emit("onDragEnd", ...a))
135
- }, {
136
- default: p(() => [
137
- l.value.link ? (d(), f(i(Te), {
109
+ const l = re("RequestSidebarItem", !0);
110
+ return f(), k("div", {
111
+ class: m(["relative flex flex-row", [
112
+ n(p) && e.parentUids.length > 1 || !n(p) && e.parentUids.length ? "before:bg-b-3 before:absolute before:left-[calc(.75rem_+_.5px)] before:top-0 before:z-10 before:h-[calc(100%_+_.5px)] last:before:h-full before:w-[.5px] mb-[.5px] last:mb-0 indent-border-line-offset" : ""
113
+ ]])
114
+ }, [
115
+ h(n(pe), {
116
+ id: i.value.entity.uid,
117
+ ref_key: "draggableRef",
118
+ ref: D,
119
+ ceiling: N.value.ceiling,
120
+ class: "flex flex-1 flex-col gap-[.5px] text-sm",
121
+ floor: N.value.floor,
122
+ isDraggable: e.isDraggable,
123
+ isDroppable: e.isDroppable,
124
+ parentIds: e.parentUids,
125
+ onOnDragEnd: t[8] || (t[8] = (...a) => e.$emit("onDragEnd", ...a))
126
+ }, {
127
+ default: y(() => {
128
+ var a;
129
+ return [
130
+ i.value.link ? (f(), b(n(fe), {
138
131
  key: 0,
139
132
  class: "no-underline",
140
- to: l.value.link,
141
- onClick: t[2] || (t[2] = ce(
142
- (a) => ue(a, l.value),
133
+ to: i.value.link,
134
+ onClick: t[1] || (t[1] = C(
135
+ (s) => Z(s, i.value),
143
136
  ["prevent"]
144
137
  ))
145
138
  }, {
146
- default: p(({ isExactActive: a }) => [
147
- m(i(H), { disabled: i(o) }, {
148
- trigger: p(() => [
149
- s("div", {
150
- class: v(["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", [
151
- K,
152
- a || ne.value ? "bg-sidebar-active-b text-sidebar-active-c transition-none" : "text-sidebar-c-2"
153
- ]]),
154
- tabindex: "0"
155
- }, [
156
- s("span", {
157
- class: v(["line-clamp-3 z-10 font-medium w-full pl-2 word-break-break-word", {
158
- "editable-sidebar-hover-item": !i(o)
159
- }])
160
- }, L(l.value.title), 3),
161
- s("div", Ie, [
162
- s("div", Ee, [
163
- i(o) ? w("", !0) : (d(), f(D, {
164
- key: 0,
165
- item: l.value.entity,
166
- parentUids: e.parentUids,
167
- resourceTitle: l.value.resourceTitle,
168
- onDelete: t[0] || (t[0] = (u) => i(h).show()),
169
- onRename: k
170
- }, null, 8, ["item", "parentUids", "resourceTitle"]))
171
- ]),
172
- s("span", Ne, [
173
- M("   "),
174
- l.value.method ? (d(), f(i($e), {
175
- key: 0,
176
- class: "font-bold",
177
- method: l.value.method
178
- }, null, 8, ["method"])) : w("", !0)
179
- ])
139
+ default: y(({ isExactActive: s }) => {
140
+ var u, o;
141
+ return [
142
+ d("div", {
143
+ class: m(["group relative flex min-h-8 cursor-pointer flex-row items-start justify-between gap-2 py-1.5 pr-2 rounded editable-sidebar-hover w-full", [
144
+ j,
145
+ s || Q.value ? "bg-sidebar-active-b text-sidebar-active-c transition-none" : "text-sidebar-c-2"
146
+ ]]),
147
+ tabindex: "0"
148
+ }, [
149
+ d("span", {
150
+ class: m(["line-clamp-3 z-10 font-medium w-full pl-2 word-break-break-word", {
151
+ "editable-sidebar-hover-item": !n(p)
152
+ }])
153
+ }, O(i.value.title), 3),
154
+ d("div", he, [
155
+ d("div", ye, [
156
+ n(p) ? g("", !0) : (f(), b(n(I), {
157
+ key: 0,
158
+ class: m(["px-0.5 py-0 z-10 hover:bg-b-3 hidden group-hover:flex absolute -translate-y-1/2 right-0 aspect-square inset-y-2/4 h-fit", {
159
+ flex: ((o = (u = e.menuItem) == null ? void 0 : u.item) == null ? void 0 : o.entity.uid) === i.value.entity.uid && e.menuItem.open
160
+ }]),
161
+ size: "sm",
162
+ type: "button",
163
+ variant: "ghost",
164
+ onClick: t[0] || (t[0] = C(
165
+ (ee) => e.$emit("openMenu", {
166
+ item: i.value,
167
+ parentUids: e.parentUids,
168
+ targetRef: ee.currentTarget.parentNode,
169
+ open: !0
170
+ }),
171
+ ["stop", "prevent"]
172
+ ))
173
+ }, {
174
+ default: y(() => [
175
+ h(n(w), {
176
+ icon: "Ellipses",
177
+ size: "sm"
178
+ })
179
+ ]),
180
+ _: 1
181
+ }, 8, ["class"]))
182
+ ]),
183
+ d("span", xe, [
184
+ B("   "),
185
+ i.value.method ? (f(), b(n(me), {
186
+ key: 0,
187
+ class: "font-bold",
188
+ method: i.value.method
189
+ }, null, 8, ["method"])) : g("", !0)
180
190
  ])
181
- ], 2)
182
- ]),
183
- content: p(() => [
184
- m(D, {
185
- item: l.value.entity,
186
- parentUids: e.parentUids,
187
- resourceTitle: l.value.resourceTitle,
188
- static: "",
189
- onDelete: t[1] || (t[1] = (u) => i(h).show()),
190
- onRename: k
191
- }, null, 8, ["item", "parentUids", "resourceTitle"])
192
- ]),
193
- _: 2
194
- }, 1032, ["disabled"])
195
- ]),
191
+ ])
192
+ ], 2)
193
+ ];
194
+ }),
196
195
  _: 1
197
- }, 8, ["to"])) : !i(o) || e.parentUids.length ? (d(), f(i(H), {
196
+ }, 8, ["to"])) : !n(p) || e.parentUids.length ? (f(), k("button", {
198
197
  key: 1,
199
- disabled: i(o) || q.value
200
- }, {
201
- trigger: p(() => [
202
- s("button", {
203
- class: v(["hover:bg-b-2 group relative flex w-full flex-row justify-start gap-1.5 rounded p-1.5 z-[1]", K]),
204
- type: "button",
205
- onClick: t[4] || (t[4] = (a) => i(te)(l.value.entity.uid))
206
- }, [
207
- s("span", ze, [
208
- ve(e.$slots, "leftIcon", {}, () => [
209
- s("div", {
210
- class: v({
211
- "rotate-90": i(P)[l.value.entity.uid]
212
- })
213
- }, [
214
- m(i(G), {
215
- class: "text-c-3 text-sm",
216
- icon: "ChevronRight",
217
- size: "sm",
218
- thickness: "2.5"
219
- })
220
- ], 2)
221
- ], !0),
222
- M("")
223
- ]),
224
- s("div", Be, [
225
- s("span", {
226
- class: v(["line-clamp-3 z-10 font-medium text-left w-full word-break-break-word", {
227
- "editable-sidebar-hover-item": !i(o)
228
- }])
229
- }, L(l.value.title), 3),
230
- s("div", Oe, [
231
- !i(o) && !q.value ? (d(), f(D, {
232
- key: 0,
233
- item: l.value.entity,
198
+ class: m(["hover:bg-b-2 group relative flex w-full flex-row justify-start gap-1.5 rounded p-1.5 z-[1]", j]),
199
+ disabled: n(p),
200
+ type: "button",
201
+ onClick: t[3] || (t[3] = (s) => n(W)(i.value.entity.uid))
202
+ }, [
203
+ d("span", we, [
204
+ le(e.$slots, "leftIcon", {}, () => [
205
+ d("div", {
206
+ class: m({
207
+ "rotate-90": n(S)[i.value.entity.uid]
208
+ })
209
+ }, [
210
+ h(n(w), {
211
+ class: "text-c-3 text-sm",
212
+ icon: "ChevronRight",
213
+ size: "sm",
214
+ thickness: "2.5"
215
+ })
216
+ ], 2)
217
+ ], !0),
218
+ B("   ")
219
+ ]),
220
+ d("div", Ue, [
221
+ d("span", {
222
+ class: m(["line-clamp-3 z-10 font-medium text-left w-full word-break-break-word", {
223
+ "editable-sidebar-hover-item": !n(p)
224
+ }])
225
+ }, O(i.value.title), 3),
226
+ d("div", qe, [
227
+ !n(p) && !H.value ? (f(), b(n(I), {
228
+ key: 0,
229
+ class: m(["px-0.5 py-0 z-10 hover:bg-b-3 hidden group-hover:flex absolute -translate-y-1/2 right-0 aspect-square inset-y-2/4 h-fit", {
230
+ flex: ((a = e.menuItem.item) == null ? void 0 : a.entity.uid) === i.value.entity.uid && e.menuItem.open
231
+ }]),
232
+ size: "sm",
233
+ variant: "ghost",
234
+ onClick: t[2] || (t[2] = C(
235
+ (s) => e.$emit("openMenu", {
236
+ item: i.value,
234
237
  parentUids: e.parentUids,
235
- resourceTitle: l.value.resourceTitle,
236
- onDelete: t[3] || (t[3] = (a) => i(h).show()),
237
- onRename: k
238
- }, null, 8, ["item", "parentUids", "resourceTitle"])) : w("", !0),
239
- je
240
- ])
241
- ])
238
+ targetRef: s.currentTarget.parentNode,
239
+ open: !0
240
+ }),
241
+ ["stop", "prevent"]
242
+ ))
243
+ }, {
244
+ default: y(() => [
245
+ h(n(w), {
246
+ icon: "Ellipses",
247
+ size: "sm"
248
+ })
249
+ ]),
250
+ _: 1
251
+ }, 8, ["class"])) : g("", !0),
252
+ De
242
253
  ])
243
- ]),
244
- content: p(() => [
245
- !i(o) && !q.value ? (d(), f(D, {
246
- key: 0,
247
- item: l.value.entity,
248
- parentUids: e.parentUids,
249
- resourceTitle: l.value.resourceTitle,
250
- static: "",
251
- onDelete: t[5] || (t[5] = (a) => i(h).show()),
252
- onRename: k
253
- }, null, 8, ["item", "parentUids", "resourceTitle"])) : w("", !0)
254
- ]),
255
- default: p(() => [
256
- M(" > ")
257
- ]),
258
- _: 3
259
- }, 8, ["disabled"])) : w("", !0),
260
- be(s("div", null, [
261
- (d(!0), A(Y, null, ge(l.value.children, (a) => (d(), f(r, {
262
- key: a,
263
- isDraggable: !i($)[a],
264
- isDroppable: re,
254
+ ])
255
+ ], 8, ke)) : g("", !0),
256
+ K.value ? (f(), k("div", Ce, [
257
+ (f(!0), k(se, null, ae(i.value.children, (s) => (f(), b(l, {
258
+ key: s,
259
+ isDraggable: !n(q)[s],
260
+ isDroppable: X,
261
+ menuItem: e.menuItem,
265
262
  parentUids: [...e.parentUids, e.uid],
266
- uid: a,
267
- onNewTab: t[6] || (t[6] = (u, U) => e.$emit("newTab", u, U)),
268
- onOnDragEnd: t[7] || (t[7] = (...u) => e.$emit("onDragEnd", ...u))
269
- }, null, 8, ["isDraggable", "parentUids", "uid"]))), 128)),
270
- l.value.children.length === 0 ? (d(), f(i(Ue), {
263
+ uid: s,
264
+ onNewTab: t[4] || (t[4] = (u, o) => e.$emit("newTab", u, o)),
265
+ onOnDragEnd: t[5] || (t[5] = (...u) => e.$emit("onDragEnd", ...u)),
266
+ onOpenMenu: t[6] || (t[6] = (u) => e.$emit("openMenu", u))
267
+ }, null, 8, ["isDraggable", "menuItem", "parentUids", "uid"]))), 128)),
268
+ i.value.children.length === 0 ? (f(), b(n(I), {
271
269
  key: 0,
272
- class: v(["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" : ""]),
270
+ class: m(["mb-[.5px] flex gap-1.5 h-8 text-c-1 py-0 justify-start text-xs w-full hover:bg-b-2", e.parentUids.length ? "pl-9" : ""]),
273
271
  variant: "ghost",
274
- onClick: t[8] || (t[8] = (a) => de())
272
+ onClick: t[7] || (t[7] = (s) => _())
275
273
  }, {
276
- default: p(() => [
277
- m(i(G), {
274
+ default: y(() => [
275
+ h(n(w), {
278
276
  class: "ml-0.5 h-2.5 w-2.5",
279
277
  icon: "Add",
280
278
  thickness: "3"
281
279
  }),
282
- Pe
280
+ Ie
283
281
  ]),
284
282
  _: 1
285
- }, 8, ["class"])) : w("", !0)
286
- ], 512), [
287
- [he, ae.value]
288
- ])
289
- ]),
290
- _: 3
291
- }, 8, ["id", "ceiling", "floor", "isDraggable", "isDroppable", "parentIds"])
292
- ], 2),
293
- m(i(J), {
294
- size: "xxs",
295
- state: i(h),
296
- title: `Delete ${l.value.resourceTitle}`
297
- }, {
298
- default: p(() => [
299
- m(ye, {
300
- variableName: l.value.title,
301
- warningMessage: l.value.warning,
302
- onClose: t[10] || (t[10] = (a) => i(h).hide()),
303
- onDelete: oe
304
- }, null, 8, ["variableName", "warningMessage"])
305
- ]),
306
- _: 1
307
- }, 8, ["state", "title"]),
308
- m(i(J), {
309
- size: "xxs",
310
- state: i(y),
311
- title: `Rename ${l.value.resourceTitle}`
312
- }, {
313
- default: p(() => [
314
- m(ke, {
315
- name: l.value.title,
316
- onClose: t[11] || (t[11] = (a) => i(y).hide()),
317
- onRename: se
318
- }, null, 8, ["name"])
319
- ]),
320
- _: 1
321
- }, 8, ["state", "title"])
322
- ], 64);
283
+ }, 8, ["class"])) : g("", !0)
284
+ ])) : g("", !0)
285
+ ];
286
+ }),
287
+ _: 3
288
+ }, 8, ["id", "ceiling", "floor", "isDraggable", "isDroppable", "parentIds"])
289
+ ], 2);
323
290
  };
324
291
  }
325
292
  });
326
293
  export {
327
- _e as default
294
+ je as default
328
295
  };
@@ -1,36 +1,14 @@
1
- import type { Collection, Request, RequestExample, Tag } from '@scalar/oas-utils/entities/spec';
2
- declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<{
3
- /** Both inidicate the level and provide a way to traverse upwards */
4
- item: Collection | Tag | Request | RequestExample;
5
- resourceTitle: string;
6
- static?: boolean;
7
- }>, {
8
- static: boolean;
1
+ import type { SidebarMenuItem } from '../../views/Request/types/index.js';
2
+ declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<{
3
+ menuItem: SidebarMenuItem;
9
4
  }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
10
- delete: () => void;
11
- rename: () => void;
12
- }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<{
13
- /** Both inidicate the level and provide a way to traverse upwards */
14
- item: Collection | Tag | Request | RequestExample;
15
- resourceTitle: string;
16
- static?: boolean;
17
- }>, {
18
- static: boolean;
5
+ closeMenu: () => void;
6
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<{
7
+ menuItem: SidebarMenuItem;
19
8
  }>>> & {
20
- onDelete?: (() => any) | undefined;
21
- onRename?: (() => any) | undefined;
22
- }, {
23
- static: boolean;
24
- }, {}>;
9
+ onCloseMenu?: (() => any) | undefined;
10
+ }, {}, {}>;
25
11
  export default _default;
26
- type __VLS_WithDefaults<P, D> = {
27
- [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
28
- default: D[K];
29
- }> : P[K];
30
- };
31
- type __VLS_Prettify<T> = {
32
- [K in keyof T]: T[K];
33
- } & {};
34
12
  type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
35
13
  type __VLS_TypePropsToOption<T> = {
36
14
  [K in keyof T]-?: {} extends Pick<T, K> ? {
@@ -1 +1 @@
1
- {"version":3,"file":"RequestSidebarItemMenu.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Request/RequestSidebarItemMenu.vue"],"names":[],"mappings":"AAoIA,OAAO,KAAK,EACV,UAAU,EACV,OAAO,EACP,cAAc,EACd,GAAG,EACJ,MAAM,iCAAiC,CAAA;;IAMpC,qEAAqE;UAC/D,UAAU,GAAG,GAAG,GAAG,OAAO,GAAG,cAAc;mBAClC,MAAM;aACZ,OAAO;;;;;;;IAHhB,qEAAqE;UAC/D,UAAU,GAAG,GAAG,GAAG,OAAO,GAAG,cAAc;mBAClC,MAAM;aACZ,OAAO;;;;;;;YAAP,OAAO;;AAsSpB,wBAOG;AAOH,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,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
+ {"version":3,"file":"RequestSidebarItemMenu.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Request/RequestSidebarItemMenu.vue"],"names":[],"mappings":"AA4KA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;;cAa1B,eAAe;;;;cAAf,eAAe;;;;AA+YjD,wBAOG;AAOH,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AAC5D,KAAK,uBAAuB,CAAC,CAAC,IAAI;KAChC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GACpC;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAC9D;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CACzD,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import t from "./RequestSidebarItemMenu.vue2.js";
2
2
  /* empty css */
3
3
  import e from "../../_virtual/_plugin-vue_export-helper.js";
4
- const m = /* @__PURE__ */ e(t, [["__scopeId", "data-v-d6fc1c6f"]]);
4
+ const m = /* @__PURE__ */ e(t, [["__scopeId", "data-v-59cf3dad"]]);
5
5
  export {
6
6
  m as default
7
7
  };