@scalar/api-client 2.0.25 → 2.0.27

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 (39) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/dist/components/AddressBar/AddressBarHistory.vue.d.ts.map +1 -1
  3. package/dist/components/AddressBar/AddressBarHistory.vue.js +38 -38
  4. package/dist/components/CodeInput/CodeInput.vue.d.ts.map +1 -1
  5. package/dist/components/CodeInput/CodeInput.vue.js +2 -2
  6. package/dist/components/CodeInput/CodeInput.vue2.js +11 -11
  7. package/dist/components/CodeInput/codeVariableWidget.d.ts.map +1 -1
  8. package/dist/components/CodeInput/codeVariableWidget.js +48 -46
  9. package/dist/components/HttpMethod/HttpMethod.vue.d.ts.map +1 -1
  10. package/dist/components/HttpMethod/HttpMethod.vue.js +23 -30
  11. package/dist/components/Sidebar/SidebarToggle.vue.d.ts +20 -0
  12. package/dist/components/Sidebar/SidebarToggle.vue.d.ts.map +1 -0
  13. package/dist/components/Sidebar/SidebarToggle.vue.js +48 -0
  14. package/dist/components/Sidebar/SidebarToggle.vue2.js +4 -0
  15. package/dist/index.d.ts +1 -0
  16. package/dist/index.d.ts.map +1 -1
  17. package/dist/index.js +13 -10
  18. package/dist/layouts/Modal/api-client-modal.d.ts +1 -1
  19. package/dist/layouts/Modal/api-client-modal.d.ts.map +1 -1
  20. package/dist/layouts/Modal/api-client-modal.js +41 -41
  21. package/dist/store/workspace.d.ts +36 -12
  22. package/dist/store/workspace.d.ts.map +1 -1
  23. package/dist/store/workspace.js +163 -149
  24. package/dist/style.css +1 -1
  25. package/dist/views/Cookies/Cookies.vue2.js +22 -22
  26. package/dist/views/Environment/EnvironmentVariableDropdown.vue.d.ts.map +1 -1
  27. package/dist/views/Environment/EnvironmentVariableDropdown.vue.js +32 -30
  28. package/dist/views/Request/Request.vue.d.ts.map +1 -1
  29. package/dist/views/Request/Request.vue.js +1 -1
  30. package/dist/views/Request/Request.vue2.js +97 -98
  31. package/dist/views/Request/RequestSection/RequestBody.vue.d.ts.map +1 -1
  32. package/dist/views/Request/RequestSection/RequestBody.vue.js +155 -125
  33. package/dist/views/Request/RequestSidebarItemMenu.vue.d.ts.map +1 -1
  34. package/dist/views/Request/RequestSidebarItemMenu.vue.js +44 -46
  35. package/dist/views/Request/ResponseSection/ResponseBody.vue.d.ts +0 -5
  36. package/dist/views/Request/ResponseSection/ResponseBody.vue.d.ts.map +1 -1
  37. package/dist/views/Request/ResponseSection/ResponseBody.vue.js +2 -2
  38. package/dist/views/Request/ResponseSection/ResponseBody.vue2.js +24 -113
  39. package/package.json +4 -4
@@ -1,36 +1,36 @@
1
- import { defineComponent as G, ref as T, computed as _, watch as N, openBlock as r, createBlock as f, withCtx as u, createTextVNode as V, toDisplayString as k, createElementBlock as v, Fragment as j, createVNode as d, unref as i, createElementVNode as y, nextTick as H } from "vue";
2
- import K from "../../../components/CodeInput/CodeInput.vue.js";
3
- import Q from "../../../components/DataTable/DataTable.vue.js";
4
- import Z from "../../../components/DataTable/DataTableHeader.vue.js";
5
- import D from "../../../components/DataTable/DataTableRow.vue.js";
6
- import I from "../../../components/ViewLayout/ViewLayoutCollapse.vue.js";
7
- import { useWorkspace as ee } from "../../../store/workspace.js";
8
- import { ScalarListbox as te, ScalarButton as F, ScalarIcon as q } from "@scalar/components";
1
+ import { defineComponent as Q, ref as L, computed as _, watch as N, openBlock as i, createBlock as v, withCtx as d, createTextVNode as V, toDisplayString as k, createElementBlock as y, Fragment as j, createVNode as m, unref as c, createElementVNode as b, nextTick as Z } from "vue";
2
+ import I from "../../../components/CodeInput/CodeInput.vue.js";
3
+ import ee from "../../../components/DataTable/DataTable.vue.js";
4
+ import te from "../../../components/DataTable/DataTableHeader.vue.js";
5
+ import F from "../../../components/DataTable/DataTableRow.vue.js";
6
+ import ae from "../../../components/ViewLayout/ViewLayoutCollapse.vue.js";
7
+ import { useWorkspace as oe } from "../../../store/workspace.js";
8
+ import { ScalarListbox as ne, ScalarButton as D, ScalarIcon as q } from "@scalar/components";
9
9
  import { createRequestExampleParameter as S } from "@scalar/oas-utils/entities/workspace/spec";
10
- import L from "./RequestTable.vue.js";
11
- import { useFileDialog as W } from "../../../hooks/useFileDialog.js";
12
- const ae = {
10
+ import W from "./RequestTable.vue.js";
11
+ import { useFileDialog as A } from "../../../hooks/useFileDialog.js";
12
+ const le = {
13
13
  key: 0,
14
14
  class: "text-c-3 flex min-h-14 w-full items-center justify-center rounded border border-dashed text-center text-base"
15
- }, oe = /* @__PURE__ */ y("span", null, "No Body", -1), le = [
16
- oe
17
- ], ne = {
15
+ }, re = /* @__PURE__ */ b("span", null, "No Body", -1), ue = [
16
+ re
17
+ ], se = {
18
18
  key: 0,
19
19
  class: "text-c-3 flex min-h-10 w-full items-center justify-center p-2 text-sm"
20
- }, re = /* @__PURE__ */ y("span", null, "No Body", -1), ue = [
21
- re
22
- ], ie = {
20
+ }, ie = /* @__PURE__ */ b("span", null, "No Body", -1), de = [
21
+ ie
22
+ ], ce = {
23
23
  key: 1,
24
24
  class: "flex items-center justify-center p-1.5 overflow-hidden"
25
- }, se = { class: "text-c-2 text-xs w-full border rounded p-1 max-w-full overflow-hidden whitespace-nowrap" }, de = /* @__PURE__ */ y("span", null, "Upload File", -1), De = /* @__PURE__ */ G({
25
+ }, me = { class: "text-c-2 text-xs w-full border rounded p-1 max-w-full overflow-hidden whitespace-nowrap" }, pe = /* @__PURE__ */ b("span", null, "Upload File", -1), Re = /* @__PURE__ */ Q({
26
26
  __name: "RequestBody",
27
27
  props: {
28
28
  title: {},
29
29
  body: {},
30
30
  formData: {}
31
31
  },
32
- setup(ce) {
33
- const A = {
32
+ setup(fe) {
33
+ const M = {
34
34
  multipartForm: "Multipart Form",
35
35
  formUrlEncoded: "Form URL Encoded",
36
36
  binaryFile: "Binary File",
@@ -40,86 +40,116 @@ const ae = {
40
40
  edn: "EDN",
41
41
  other: "Other",
42
42
  none: "None"
43
- }, { activeRequest: m, activeExample: t, requestExampleMutators: s } = ee(), n = T("none"), b = T(null), M = {
43
+ }, { activeRequest: p, activeExample: t, requestExampleMutators: r } = oe(), u = L("none"), h = L(null), O = {
44
44
  json: "json",
45
45
  xml: "xml",
46
46
  yaml: "yaml",
47
47
  edn: "edn",
48
48
  other: "html"
49
- }, O = _(() => {
50
- const e = n.value;
51
- return M[e] ?? "plaintext";
49
+ }, z = _(() => {
50
+ const e = u.value;
51
+ return O[e] ?? "plaintext";
52
52
  });
53
53
  function R() {
54
54
  console.log("deleteRow");
55
55
  }
56
- const U = (e, a, o) => {
57
- if (!m.value || !t.value) return;
58
- const c = p.value;
59
- if (c.length > e) {
60
- const l = [...c];
61
- l[e] = { ...l[e], [a]: o }, (l[e].key !== "" || l[e].value !== "") && (l[e].enabled = !0), l[e].key === "" && l[e].value === "" && l.splice(e, 1), s.edit(
56
+ const C = (e, a, o) => {
57
+ if (!p.value || !t.value) return;
58
+ const s = f.value;
59
+ if (s.length > e) {
60
+ const n = [...s];
61
+ n[e] = { ...n[e], [a]: o }, (n[e].key !== "" || n[e].value !== "") && (n[e].enabled = !0), n[e].key === "" && n[e].value === "" && n.splice(e, 1), r.edit(
62
62
  t.value.uid,
63
63
  "body.formData.value",
64
- l
64
+ n
65
65
  );
66
66
  } else {
67
- const l = [S({ [a]: o })];
68
- s.edit(
67
+ const n = [S({ [a]: o })];
68
+ r.edit(
69
69
  t.value.uid,
70
70
  "body.formData.value",
71
- l
72
- ), H(() => {
73
- var C;
74
- if (!b.value) return;
75
- (C = b.value.querySelectorAll("input")[a === "key" ? 0 : 1]) == null || C.focus();
71
+ n
72
+ ), Z(() => {
73
+ var P;
74
+ if (!h.value) return;
75
+ (P = h.value.querySelectorAll("input")[a === "key" ? 0 : 1]) == null || P.focus();
76
76
  });
77
77
  }
78
- }, p = _(
78
+ }, f = _(
79
79
  () => {
80
80
  var e;
81
81
  return ((e = t.value) == null ? void 0 : e.body.formData.value) ?? [];
82
82
  }
83
83
  );
84
- function z() {
85
- p.value.length === 0 && x();
84
+ function $() {
85
+ f.value.length === 0 && x();
86
86
  }
87
87
  const x = () => {
88
- if (!m.value || !t.value) return;
88
+ if (!p.value || !t.value) return;
89
89
  const e = S({
90
90
  enabled: !1
91
- }), a = [...p.value, e];
92
- s.edit(
91
+ }), a = [...f.value, e];
92
+ r.edit(
93
93
  t.value.uid,
94
94
  "body.formData.value",
95
95
  a
96
96
  );
97
- }, $ = (e) => {
98
- !m.value || !t.value || s.edit(
97
+ }, H = (e) => {
98
+ !p.value || !t.value || r.edit(
99
99
  t.value.uid,
100
100
  "body.raw.value",
101
101
  e
102
102
  );
103
- }, J = (e) => {
104
- let a = "raw";
105
- e === "multipartForm" || e === "formUrlEncoded" ? a = "formData" : e === "binaryFile" ? a = "binary" : a = "raw", s.edit(
103
+ }, J = (e) => e === "multipartForm" ? "multipart/form-data" : e === "formUrlEncoded" ? "application/x-www-form-urlencoded" : e === "binaryFile" ? "application/octet-stream" : e !== "none" ? `application/${e}` : "", X = (e) => e === "multipartForm" || e === "formUrlEncoded" ? "formData" : e === "binaryFile" ? "binary" : "raw", Y = (e) => {
104
+ const a = J(e), o = X(e);
105
+ r.edit(
106
106
  t.value.uid,
107
107
  "body.activeBody",
108
- a
108
+ o
109
109
  );
110
- }, B = async (e) => {
111
- const { open: a } = W({
110
+ const s = [
111
+ ...t.value.parameters.headers
112
+ ].findIndex(
113
+ (l) => l.key.toLowerCase() === "Content-Type".toLowerCase()
114
+ ), n = [...t.value.parameters.headers][s];
115
+ if ((n == null ? void 0 : n.value) !== a) {
116
+ if (n && a) {
117
+ const l = [...t.value.parameters.headers];
118
+ l[s].value = a, r.edit(
119
+ t.value.uid,
120
+ "parameters.headers",
121
+ l
122
+ );
123
+ } else if (a) {
124
+ const l = [
125
+ ...t.value.parameters.headers.filter(
126
+ (E) => E.key.toLowerCase() !== "Content-Type".toLowerCase()
127
+ )
128
+ ];
129
+ l.push({
130
+ key: "Content-Type",
131
+ value: a,
132
+ enabled: !0
133
+ }), r.edit(
134
+ t.value.uid,
135
+ "parameters.headers",
136
+ l
137
+ );
138
+ }
139
+ }
140
+ }, T = async (e) => {
141
+ const { open: a } = A({
112
142
  onChange: async (o) => {
113
- const c = o == null ? void 0 : o[0];
114
- if (c && m.value && t.value) {
115
- const h = [...p.value];
116
- h[e] = {
117
- ...h[e],
118
- file: c
119
- }, s.edit(
143
+ const s = o == null ? void 0 : o[0];
144
+ if (s && p.value && t.value) {
145
+ const l = [...f.value];
146
+ l[e] = {
147
+ ...l[e],
148
+ file: s
149
+ }, r.edit(
120
150
  t.value.uid,
121
151
  "body.formData.value",
122
- h
152
+ l
123
153
  );
124
154
  }
125
155
  },
@@ -128,26 +158,26 @@ const ae = {
128
158
  });
129
159
  a();
130
160
  };
131
- function X() {
132
- !m.value || !t.value || s.edit(t.value.uid, "body.binary", void 0);
161
+ function G() {
162
+ !p.value || !t.value || r.edit(t.value.uid, "body.binary", void 0);
133
163
  }
134
- function E(e) {
135
- if (!m.value || !t.value) return;
136
- const o = [...p.value];
164
+ function U(e) {
165
+ if (!p.value || !t.value) return;
166
+ const o = [...f.value];
137
167
  o[e] = {
138
168
  ...o[e],
139
169
  file: void 0
140
- }, s.edit(
170
+ }, r.edit(
141
171
  t.value.uid,
142
172
  "body.formData.value",
143
173
  o
144
174
  );
145
175
  }
146
- function Y() {
147
- const { open: e } = W({
176
+ function K() {
177
+ const { open: e } = A({
148
178
  onChange: async (a) => {
149
179
  const o = a == null ? void 0 : a[0];
150
- o && m.value && t.value && s.edit(
180
+ o && p.value && t.value && r.edit(
151
181
  t.value.uid,
152
182
  "body.binary",
153
183
  o
@@ -158,63 +188,63 @@ const ae = {
158
188
  });
159
189
  e();
160
190
  }
161
- const P = Object.entries(A).map(
191
+ const B = Object.entries(M).map(
162
192
  ([e, a]) => ({
163
193
  id: e,
164
194
  label: a,
165
195
  value: e
166
196
  })
167
197
  ), g = _({
168
- get: () => P.find((e) => e.id === n.value),
198
+ get: () => B.find((e) => e.id === u.value),
169
199
  set: (e) => {
170
- e != null && e.id && (n.value = e.id);
200
+ e != null && e.id && (u.value = e.id);
171
201
  }
172
- }), w = _(() => t.value ? t.value.body.formData && t.value.body.formData.value.length > 0 ? "multipartForm" : t.value.body.raw && t.value.body.raw.value.trim() !== "" ? t.value.body.raw.encoding : n.value : "none");
173
- return w.value !== "none" && (n.value = w.value), N(
202
+ }), w = _(() => t.value ? t.value.body.activeBody === "formData" && t.value.body.formData && t.value.body.formData.value.length > 0 ? "multipartForm" : t.value.body.activeBody === "raw" ? t.value.body.raw.encoding : u.value : "none");
203
+ return w.value !== "none" && (u.value = w.value), N(
174
204
  w,
175
205
  (e) => {
176
- e && (n.value = e);
206
+ e && (u.value = e);
177
207
  },
178
208
  { immediate: !0 }
179
209
  ), N(
180
- n,
210
+ u,
181
211
  (e) => {
182
- (e === "multipartForm" || e === "formUrlEncoded") && z(), J(e);
212
+ (e === "multipartForm" || e === "formUrlEncoded") && $(), Y(e);
183
213
  },
184
214
  { immediate: !0 }
185
- ), (e, a) => (r(), f(I, null, {
186
- title: u(() => [
215
+ ), (e, a) => (i(), v(ae, null, {
216
+ title: d(() => [
187
217
  V(k(e.title), 1)
188
218
  ]),
189
- default: u(() => [
190
- e.body && e.body.length === 0 && e.formData && e.formData.length === 0 ? (r(), v("div", ae, le)) : e.formData && e.formData.length > 0 ? (r(), v(j, { key: 1 }, [], 64)) : (r(), f(Q, {
219
+ default: d(() => [
220
+ e.body && e.body.length === 0 && e.formData && e.formData.length === 0 ? (i(), y("div", le, ue)) : e.formData && e.formData.length > 0 ? (i(), y(j, { key: 1 }, [], 64)) : (i(), v(ee, {
191
221
  key: 2,
192
222
  columns: [""]
193
223
  }, {
194
- default: u(() => [
195
- d(D, null, {
196
- default: u(() => [
197
- d(Z, { class: "relative col-span-full flex h-8 cursor-pointer items-center px-[2.25px] py-[2.25px]" }, {
198
- default: u(() => [
199
- d(i(te), {
224
+ default: d(() => [
225
+ m(F, null, {
226
+ default: d(() => [
227
+ m(te, { class: "relative col-span-full flex h-8 cursor-pointer items-center px-[2.25px] py-[2.25px]" }, {
228
+ default: d(() => [
229
+ m(c(ne), {
200
230
  modelValue: g.value,
201
231
  "onUpdate:modelValue": a[0] || (a[0] = (o) => g.value = o),
202
232
  class: "text-xxs w-full",
203
233
  fullWidth: "",
204
- options: i(P),
234
+ options: c(B),
205
235
  teleport: ""
206
236
  }, {
207
- default: u(() => [
208
- d(i(F), {
237
+ default: d(() => [
238
+ m(c(D), {
209
239
  class: "flex gap-1.5 h-auto px-1.5 text-c-2 font-normal hover:text-c-1",
210
240
  fullWidth: "",
211
241
  variant: "ghost"
212
242
  }, {
213
- default: u(() => {
243
+ default: d(() => {
214
244
  var o;
215
245
  return [
216
- y("span", null, k((o = g.value) == null ? void 0 : o.label), 1),
217
- d(i(q), {
246
+ b("span", null, k((o = g.value) == null ? void 0 : o.label), 1),
247
+ m(c(q), {
218
248
  icon: "ChevronDown",
219
249
  size: "xs",
220
250
  thickness: "2.5"
@@ -232,34 +262,34 @@ const ae = {
232
262
  ]),
233
263
  _: 1
234
264
  }),
235
- d(D, null, {
236
- default: u(() => {
237
- var o, c, l;
265
+ m(F, null, {
266
+ default: d(() => {
267
+ var o, s, n;
238
268
  return [
239
- n.value === "none" ? (r(), v("div", ne, ue)) : n.value === "binaryFile" ? (r(), v("div", ie, [
240
- (o = i(t)) != null && o.body.binary ? (r(), v(j, { key: 0 }, [
241
- y("span", se, k((c = i(t)) == null ? void 0 : c.body.binary.name), 1),
242
- d(i(F), {
269
+ u.value === "none" ? (i(), y("div", se, de)) : u.value === "binaryFile" ? (i(), y("div", ce, [
270
+ (o = c(t)) != null && o.body.binary ? (i(), y(j, { key: 0 }, [
271
+ b("span", me, k((s = c(t)) == null ? void 0 : s.body.binary.name), 1),
272
+ m(c(D), {
243
273
  class: "bg-b-2 hover:bg-b-3 border-0 text-c-2 ml-1",
244
274
  size: "sm",
245
275
  variant: "outlined",
246
- onClick: X
276
+ onClick: G
247
277
  }, {
248
- default: u(() => [
278
+ default: d(() => [
249
279
  V(" Delete ")
250
280
  ]),
251
281
  _: 1
252
282
  })
253
- ], 64)) : (r(), f(i(F), {
283
+ ], 64)) : (i(), v(c(D), {
254
284
  key: 1,
255
285
  class: "bg-b-2 hover:bg-b-3 border-0 text-c-2",
256
286
  size: "sm",
257
287
  variant: "outlined",
258
- onClick: Y
288
+ onClick: K
259
289
  }, {
260
- default: u(() => [
261
- de,
262
- d(i(q), {
290
+ default: d(() => [
291
+ pe,
292
+ m(c(q), {
263
293
  class: "ml-1",
264
294
  icon: "UploadSimple",
265
295
  size: "xs",
@@ -268,46 +298,46 @@ const ae = {
268
298
  ]),
269
299
  _: 1
270
300
  }))
271
- ])) : n.value == "multipartForm" ? (r(), f(L, {
301
+ ])) : u.value == "multipartForm" ? (i(), v(W, {
272
302
  key: 2,
273
303
  ref_key: "tableWrapperRef",
274
- ref: b,
304
+ ref: h,
275
305
  class: "!m-0 rounded-t-none shadow-none border-l-0 border-r-0 border-t-0 border-b-0",
276
306
  columns: ["32px", "", "", "61px"],
277
- items: p.value,
307
+ items: f.value,
278
308
  showUploadButton: "",
279
309
  onAddRow: x,
280
310
  onDeleteRow: R,
281
- onRemoveFile: E,
282
- onUpdateRow: U,
283
- onUploadFile: B
284
- }, null, 8, ["items"])) : n.value == "formUrlEncoded" ? (r(), f(L, {
311
+ onRemoveFile: U,
312
+ onUpdateRow: C,
313
+ onUploadFile: T
314
+ }, null, 8, ["items"])) : u.value == "formUrlEncoded" ? (i(), v(W, {
285
315
  key: 3,
286
316
  ref_key: "tableWrapperRef",
287
- ref: b,
317
+ ref: h,
288
318
  class: "!m-0 rounded-t-none border-t-0 shadow-none border-l-0 border-r-0 border-t-0 border-b-0",
289
319
  columns: ["32px", "", "", "61px"],
290
- items: p.value,
320
+ items: f.value,
291
321
  showUploadButton: "",
292
322
  onAddRow: x,
293
323
  onDeleteRow: R,
294
- onRemoveFile: E,
295
- onUpdateRow: U,
296
- onUploadFile: B
297
- }, null, 8, ["items"])) : (r(), f(K, {
324
+ onRemoveFile: U,
325
+ onUpdateRow: C,
326
+ onUploadFile: T
327
+ }, null, 8, ["items"])) : (i(), v(I, {
298
328
  key: 4,
299
329
  content: "",
300
- language: O.value,
330
+ language: z.value,
301
331
  lineNumbers: "",
302
332
  lint: "",
303
- modelValue: ((l = i(t)) == null ? void 0 : l.body.raw.value) ?? "",
304
- "onUpdate:modelValue": $
333
+ modelValue: ((n = c(t)) == null ? void 0 : n.body.raw.value) ?? "",
334
+ "onUpdate:modelValue": H
305
335
  }, null, 8, ["language", "modelValue"]))
306
336
  ];
307
337
  }),
308
338
  _: 1
309
339
  }),
310
- d(D)
340
+ m(F)
311
341
  ]),
312
342
  _: 1
313
343
  }))
@@ -317,5 +347,5 @@ const ae = {
317
347
  }
318
348
  });
319
349
  export {
320
- De as default
350
+ Re as default
321
351
  };
@@ -1 +1 @@
1
- {"version":3,"file":"RequestSidebarItemMenu.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Request/RequestSidebarItemMenu.vue"],"names":[],"mappings":"AA0IA,OAAO,KAAK,EACV,OAAO,EACP,cAAc,EACf,MAAM,2CAA2C,CAAA;;UAO1C,OAAO,GAAG,cAAc;;UAAxB,OAAO,GAAG,cAAc;;AA8VhC,wBAMG;AAOH,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AAC5D,KAAK,uBAAuB,CAAC,CAAC,IAAI;KAChC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GACpC;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAC9D;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CACzD,CAAC"}
1
+ {"version":3,"file":"RequestSidebarItemMenu.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Request/RequestSidebarItemMenu.vue"],"names":[],"mappings":"AAyIA,OAAO,KAAK,EACV,OAAO,EACP,cAAc,EACf,MAAM,2CAA2C,CAAA;;UAO1C,OAAO,GAAG,cAAc;;UAAxB,OAAO,GAAG,cAAc;;AAiVhC,wBAMG;AAOH,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AAC5D,KAAK,uBAAuB,CAAC,CAAC,IAAI;KAChC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GACpC;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAC9D;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CACzD,CAAC"}
@@ -1,102 +1,100 @@
1
- import { defineComponent as C, computed as E, openBlock as u, createBlock as d, unref as e, withCtx as s, createVNode as t, createCommentVNode as R, withModifiers as w, createElementVNode as i } from "vue";
1
+ import { defineComponent as q, computed as E, openBlock as m, createBlock as u, unref as e, withCtx as l, createVNode as t, createCommentVNode as R, createElementVNode as n } from "vue";
2
2
  import { commandPaletteBus as z } from "../../libs/eventBusses/command-palette.js";
3
- import { activeRouterParams as p, PathId as f } from "../../router.js";
4
- import { useWorkspace as I, findRequestFolders as S } from "../../store/workspace.js";
5
- import { ScalarDropdown as b, ScalarDropdownItem as o, ScalarIcon as a, ScalarDropdownDivider as A, ScalarButton as B } from "@scalar/components";
6
- import { useRouter as M } from "vue-router";
7
- const N = /* @__PURE__ */ i("span", null, "Add Example", -1), P = /* @__PURE__ */ i("span", null, "Rename", -1), V = /* @__PURE__ */ i("span", null, "Duplicate", -1), y = /* @__PURE__ */ i("span", null, "Delete", -1), G = /* @__PURE__ */ C({
3
+ import { activeRouterParams as d, PathId as p } from "../../router.js";
4
+ import { useWorkspace as C, findRequestFolders as I } from "../../store/workspace.js";
5
+ import { ScalarDropdown as w, ScalarDropdownItem as o, ScalarIcon as s, ScalarDropdownDivider as S, ScalarButton as b } from "@scalar/components";
6
+ import { useRouter as A } from "vue-router";
7
+ const B = /* @__PURE__ */ n("span", null, "Add Example", -1), N = /* @__PURE__ */ n("span", null, "Rename", -1), M = /* @__PURE__ */ n("span", null, "Duplicate", -1), P = /* @__PURE__ */ n("span", null, "Delete", -1), j = /* @__PURE__ */ q({
8
8
  __name: "RequestSidebarItemMenu",
9
9
  props: {
10
10
  item: {}
11
11
  },
12
- setup(x) {
13
- const l = x, { activeWorkspace: r, requestMutators: _, requestExampleMutators: h } = I(), { replace: c } = M(), k = () => z.emit({
12
+ setup(f) {
13
+ const a = f, { activeWorkspace: c, requestMutators: _, requestExampleMutators: x } = C(), { replace: r } = A(), h = () => z.emit({
14
14
  commandName: "Add Example",
15
- metaData: l.item.uid
16
- }), v = () => {
15
+ metaData: a.item.uid
16
+ }), k = () => {
17
17
  console.log("rename");
18
- }, g = () => {
18
+ }, v = () => {
19
19
  console.log("duplicate");
20
- }, D = () => {
21
- if ("requestUid" in l.item)
22
- h.delete(l.item), p.value[f.Examples] === l.item.uid && c(`/workspace/${r.value}/request/default`);
20
+ }, g = () => {
21
+ if ("requestUid" in a.item)
22
+ x.delete(a.item), d.value[p.Examples] === a.item.uid && r(`/workspace/${c.value}/request/default`);
23
23
  else {
24
- const n = S(l.item.uid);
25
- if (!n.length) return;
26
- _.delete(l.item, n[0]), p.value[f.Request] === l.item.uid && c(`/workspace/${r.value.uid}/request/default`);
24
+ const i = I(a.item.uid);
25
+ if (!i.length) return;
26
+ _.delete(a.item, i[0]), d.value[p.Request] === a.item.uid && r(`/workspace/${c.value.uid}/request/default`);
27
27
  }
28
- }, q = E(() => "summary" in l.item);
29
- return (n, m) => (u(), d(e(b), { teleport: "#scalar-client" }, {
30
- items: s(() => [
31
- q.value ? (u(), d(e(o), {
28
+ }, D = E(() => "summary" in a.item);
29
+ return (i, V) => (m(), u(e(w), { teleport: "#scalar-client" }, {
30
+ items: l(() => [
31
+ D.value ? (m(), u(e(o), {
32
32
  key: 0,
33
33
  class: "flex !gap-2",
34
- onClick: k
34
+ onClick: h
35
35
  }, {
36
- default: s(() => [
37
- t(e(a), {
36
+ default: l(() => [
37
+ t(e(s), {
38
38
  class: "inline-flex",
39
39
  icon: "Add",
40
40
  size: "sm"
41
41
  }),
42
- N
42
+ B
43
43
  ]),
44
44
  _: 1
45
45
  })) : R("", !0),
46
46
  t(e(o), {
47
47
  class: "flex !gap-2",
48
- onClick: v
48
+ onClick: k
49
49
  }, {
50
- default: s(() => [
51
- t(e(a), {
50
+ default: l(() => [
51
+ t(e(s), {
52
52
  class: "inline-flex",
53
53
  icon: "Edit",
54
54
  size: "sm"
55
55
  }),
56
- P
56
+ N
57
57
  ]),
58
58
  _: 1
59
59
  }),
60
60
  t(e(o), {
61
61
  class: "flex !gap-2",
62
- onClick: g
62
+ onClick: v
63
63
  }, {
64
- default: s(() => [
65
- t(e(a), {
64
+ default: l(() => [
65
+ t(e(s), {
66
66
  class: "inline-flex",
67
67
  icon: "Duplicate",
68
68
  size: "sm"
69
69
  }),
70
- V
70
+ M
71
71
  ]),
72
72
  _: 1
73
73
  }),
74
- t(e(A)),
74
+ t(e(S)),
75
75
  t(e(o), {
76
76
  class: "flex !gap-2",
77
- onClick: D
77
+ onClick: g
78
78
  }, {
79
- default: s(() => [
80
- t(e(a), {
79
+ default: l(() => [
80
+ t(e(s), {
81
81
  class: "inline-flex",
82
82
  icon: "Trash",
83
83
  size: "sm"
84
84
  }),
85
- y
85
+ P
86
86
  ]),
87
87
  _: 1
88
88
  })
89
89
  ]),
90
- default: s(() => [
91
- t(e(B), {
90
+ default: l(() => [
91
+ t(e(b), {
92
92
  class: "z-10 hover:bg-b-3 transition-none p-1 group-hover:flex ui-open:flex absolute left-0 hidden -translate-x-full -ml-1",
93
93
  size: "sm",
94
- variant: "ghost",
95
- onClick: m[0] || (m[0] = w(() => {
96
- }, ["stop"]))
94
+ variant: "ghost"
97
95
  }, {
98
- default: s(() => [
99
- t(e(a), {
96
+ default: l(() => [
97
+ t(e(s), {
100
98
  icon: "Ellipses",
101
99
  size: "sm"
102
100
  })
@@ -109,5 +107,5 @@ const N = /* @__PURE__ */ i("span", null, "Add Example", -1), P = /* @__PURE__ *
109
107
  }
110
108
  });
111
109
  export {
112
- G as default
110
+ j as default
113
111
  };
@@ -1,6 +1,5 @@
1
1
  declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<{
2
2
  title: string;
3
- active: boolean;
4
3
  data: any;
5
4
  headers: {
6
5
  name: string;
@@ -8,11 +7,9 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
8
7
  required: boolean;
9
8
  }[];
10
9
  }>, {
11
- active: boolean;
12
10
  data: null;
13
11
  }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<{
14
12
  title: string;
15
- active: boolean;
16
13
  data: any;
17
14
  headers: {
18
15
  name: string;
@@ -20,11 +17,9 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
20
17
  required: boolean;
21
18
  }[];
22
19
  }>, {
23
- active: boolean;
24
20
  data: null;
25
21
  }>>>, {
26
22
  data: any;
27
- active: boolean;
28
23
  }, {}>;
29
24
  export default _default;
30
25
  type __VLS_WithDefaults<P, D> = {