@scalar/api-client 2.0.37 → 2.0.39

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 (60) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/dist/components/CommandPalette/CommandPaletteCollection.vue.d.ts.map +1 -1
  3. package/dist/components/CommandPalette/CommandPaletteCollection.vue.js +15 -12
  4. package/dist/components/CommandPalette/CommandPaletteExample.vue.d.ts.map +1 -1
  5. package/dist/components/CommandPalette/CommandPaletteExample.vue.js +47 -47
  6. package/dist/components/CommandPalette/CommandPaletteFolder.vue.d.ts.map +1 -1
  7. package/dist/components/CommandPalette/CommandPaletteFolder.vue.js +11 -8
  8. package/dist/components/CommandPalette/CommandPaletteRequest.vue.d.ts.map +1 -1
  9. package/dist/components/CommandPalette/CommandPaletteRequest.vue.js +23 -20
  10. package/dist/components/CommandPalette/CommandPaletteWorkspace.vue.d.ts.map +1 -1
  11. package/dist/components/CommandPalette/CommandPaletteWorkspace.vue.js +7 -4
  12. package/dist/components/CommandPalette/TheCommandPalette.vue.d.ts.map +1 -1
  13. package/dist/components/CommandPalette/TheCommandPalette.vue.js +1 -1
  14. package/dist/components/CommandPalette/TheCommandPalette.vue2.js +84 -80
  15. package/dist/components/DataTable/DataTableInput.vue.d.ts.map +1 -1
  16. package/dist/components/DataTable/DataTableInput.vue.js +2 -2
  17. package/dist/components/DataTable/DataTableInput.vue2.js +1 -1
  18. package/dist/components/DataTable/DataTableInputSelect.vue.d.ts.map +1 -1
  19. package/dist/components/DataTable/DataTableInputSelect.vue.js +1 -1
  20. package/dist/components/Sidebar/Actions/DeleteSidebarListElement.vue.d.ts +2 -0
  21. package/dist/components/Sidebar/Actions/DeleteSidebarListElement.vue.d.ts.map +1 -1
  22. package/dist/components/Sidebar/Actions/DeleteSidebarListElement.vue.js +19 -15
  23. package/dist/components/Sidebar/Actions/SidebarListElementForm.vue.d.ts.map +1 -1
  24. package/dist/components/Sidebar/Actions/SidebarListElementForm.vue.js +5 -40
  25. package/dist/components/Sidebar/Actions/SidebarListElementForm.vue2.js +48 -2
  26. package/dist/components/Sidebar/SidebarListElement.vue.d.ts +2 -0
  27. package/dist/components/Sidebar/SidebarListElement.vue.d.ts.map +1 -1
  28. package/dist/components/Sidebar/SidebarListElement.vue.js +2 -2
  29. package/dist/components/Sidebar/SidebarListElement.vue2.js +24 -22
  30. package/dist/components/Sidebar/SidebarListElementActions.vue.d.ts.map +1 -1
  31. package/dist/components/Sidebar/SidebarListElementActions.vue.js +26 -25
  32. package/dist/components/SubpageHeader.vue.d.ts.map +1 -1
  33. package/dist/components/SubpageHeader.vue.js +5 -29
  34. package/dist/components/SubpageHeader.vue2.js +31 -2
  35. package/dist/layouts/App/create-api-client-app.d.ts +5 -5
  36. package/dist/layouts/Modal/create-api-client-modal.d.ts +10 -10
  37. package/dist/libs/create-client.d.ts +6 -5
  38. package/dist/libs/create-client.d.ts.map +1 -1
  39. package/dist/store/workspace.d.ts +12 -12
  40. package/dist/store/workspace.d.ts.map +1 -1
  41. package/dist/store/workspace.js +185 -181
  42. package/dist/style.css +1 -1
  43. package/dist/views/Cookies/Cookies.vue.d.ts.map +1 -1
  44. package/dist/views/Cookies/Cookies.vue2.js +46 -36
  45. package/dist/views/Environment/Environment.vue2.js +26 -26
  46. package/dist/views/Environment/EnvironmentVariableDropdown.vue.d.ts.map +1 -1
  47. package/dist/views/Environment/EnvironmentVariableDropdown.vue.js +37 -34
  48. package/dist/views/Request/RequestSection/RequestAuth.vue.d.ts.map +1 -1
  49. package/dist/views/Request/RequestSection/RequestAuth.vue.js +5 -311
  50. package/dist/views/Request/RequestSection/RequestAuth.vue2.js +312 -2
  51. package/dist/views/Request/RequestSection/RequestSection.vue.js +19 -19
  52. package/dist/views/Request/RequestSidebarItem.vue.d.ts.map +1 -1
  53. package/dist/views/Request/RequestSidebarItem.vue.js +3 -3
  54. package/dist/views/Request/RequestSidebarItem.vue2.js +122 -103
  55. package/dist/views/Request/RequestSidebarItemMenu.vue.d.ts +8 -2
  56. package/dist/views/Request/RequestSidebarItemMenu.vue.d.ts.map +1 -1
  57. package/dist/views/Request/RequestSidebarItemMenu.vue.js +5 -152
  58. package/dist/views/Request/RequestSidebarItemMenu.vue2.js +166 -2
  59. package/dist/views/Servers/Servers.vue2.js +17 -17
  60. package/package.json +6 -6
@@ -1,22 +1,22 @@
1
- import { defineComponent as S, computed as f, ref as A, watch as k, openBlock as q, createBlock as R, withCtx as h, createVNode as l, unref as o, createElementVNode as u, createTextVNode as B, toDisplayString as C, withDirectives as i, vShow as a } from "vue";
1
+ import { defineComponent as A, computed as f, ref as S, watch as q, openBlock as k, createBlock as R, withCtx as h, createVNode as l, unref as o, createElementVNode as u, createTextVNode as B, toDisplayString as C, withDirectives as i, vShow as a } from "vue";
2
2
  import E from "../../../components/ContextBar.vue.js";
3
3
  import O from "../../../components/ViewLayout/ViewLayoutSection.vue.js";
4
- import { useWorkspace as $ } from "../../../store/workspace.js";
5
- import g from "./RequestAuth.vue.js";
6
- import H from "./RequestBody.vue.js";
4
+ import { useWorkspace as g } from "../../../store/workspace.js";
5
+ import H from "./RequestAuth.vue.js";
6
+ import P from "./RequestBody.vue.js";
7
7
  import r from "./RequestParams.vue.js";
8
- import P from "./RequestPathParams.vue.js";
9
- import { ScalarIcon as T } from "@scalar/components";
10
- const w = { class: "flex-1" }, K = { class: "text-c-3 pl-1" }, N = { class: "request-section-content custom-scroll flex flex-1 flex-col px-2 xl:px-5 py-2.5" }, W = /* @__PURE__ */ S({
8
+ import T from "./RequestPathParams.vue.js";
9
+ import { ScalarIcon as $ } from "@scalar/components";
10
+ const w = { class: "flex-1" }, K = { class: "text-c-3 pl-1" }, N = { class: "request-section-content custom-scroll flex flex-1 flex-col px-2 xl:px-5 py-2.5" }, W = /* @__PURE__ */ A({
11
11
  __name: "RequestSection",
12
12
  setup(V) {
13
13
  const {
14
14
  activeRequest: s,
15
- activeSecuritySchemes: _,
15
+ activeSecuritySchemes: y,
16
16
  activeExample: m,
17
17
  activeSecurityRequirements: d,
18
- isReadOnly: y
19
- } = $(), n = ["POST", "PUT", "PATCH", "DELETE"], x = f(() => {
18
+ isReadOnly: _
19
+ } = g(), n = ["POST", "PUT", "PATCH", "DELETE"], x = f(() => {
20
20
  const t = [
21
21
  "All",
22
22
  "Auth",
@@ -28,15 +28,15 @@ const w = { class: "flex-1" }, K = { class: "text-c-3 pl-1" }, N = { class: "req
28
28
  ];
29
29
  return m.value.parameters.path.length || t.splice(t.indexOf("Request"), 1), n.includes(s.value.method) || t.splice(t.indexOf("Body"), 1), p.value && t.splice(t.indexOf("Auth"), 1), t;
30
30
  }), p = f(
31
- () => y.value && (d.value.length === 0 || JSON.stringify(d.value) === "[{}]")
32
- ), e = A("All");
33
- return k(s, (t) => {
31
+ () => _.value && (d.value.length === 0 || JSON.stringify(d.value) === "[{}]")
32
+ ), e = S("All");
33
+ return q(s, (t) => {
34
34
  e.value === "Body" && !n.includes(t.method) && (e.value = "All");
35
- }), (t, v) => (q(), R(O, null, {
35
+ }), (t, v) => (k(), R(O, null, {
36
36
  title: h(() => {
37
37
  var c;
38
38
  return [
39
- l(o(T), {
39
+ l(o($), {
40
40
  class: "text-c-3 mr-2",
41
41
  icon: "ExternalLink",
42
42
  size: "sm",
@@ -55,9 +55,9 @@ const w = { class: "flex-1" }, K = { class: "text-c-3 pl-1" }, N = { class: "req
55
55
  sections: x.value,
56
56
  onSetActiveSection: v[0] || (v[0] = (c) => e.value = c)
57
57
  }, null, 8, ["activeSection", "sections"]),
58
- i(l(g, {
58
+ i(l(H, {
59
59
  index: 0,
60
- securityScheme: o(_)[0],
60
+ securityScheme: o(y)[0],
61
61
  title: "Authentication"
62
62
  }, null, 8, ["securityScheme"]), [
63
63
  [
@@ -65,7 +65,7 @@ const w = { class: "flex-1" }, K = { class: "text-c-3 pl-1" }, N = { class: "req
65
65
  !p.value && (e.value === "All" || e.value === "Auth")
66
66
  ]
67
67
  ]),
68
- i(l(P, {
68
+ i(l(T, {
69
69
  paramKey: "path",
70
70
  title: "Path Variables"
71
71
  }, null, 512), [
@@ -92,7 +92,7 @@ const w = { class: "flex-1" }, K = { class: "text-c-3 pl-1" }, N = { class: "req
92
92
  }, null, 512), [
93
93
  [a, e.value === "All" || e.value === "Query"]
94
94
  ]),
95
- i(l(H, {
95
+ i(l(P, {
96
96
  body: "foo",
97
97
  title: "Body"
98
98
  }, null, 512), [
@@ -1 +1 @@
1
- {"version":3,"file":"RequestSidebarItem.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Request/RequestSidebarItem.vue"],"names":[],"mappings":"AA2PA,OAAO,EAEL,KAAK,YAAY,EACjB,KAAK,WAAW,EACjB,MAAM,mBAAmB,CAAA;AAC1B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iDAAiD,CAAA;AACjF,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,6CAA6C,CAAA;AACzE,OAAO,KAAK,EACV,OAAO,EACP,cAAc,EACf,MAAM,2CAA2C,CAAA;AA0HlD,iBAAS,cAAc;gBAvFT,IAAI;;gBAAJ,IAAI;EAmXjB;AACD,QAAA,MAAM,eAAe;IA9YjB;;;;OAIG;kBACW,OAAO;IACrB;;;;OAIG;kBACW,OAAO;IACrB,qEAAqE;gBACzD,MAAM,EAAE;UACd,UAAU,GAAG,MAAM,GAAG,OAAO,GAAG,cAAc;;;;;;;;IAdpD;;;;OAIG;kBACW,OAAO;IACrB;;;;OAIG;kBACW,OAAO;IACrB,qEAAqE;gBACzD,MAAM,EAAE;UACd,UAAU,GAAG,MAAM,GAAG,OAAO,GAAG,cAAc;;;;;;;;iBATtC,OAAO;iBAMP,OAAO;MA0YvB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAAvG,wBAAwG;AAOxG,KAAK,kBAAkB,CAAC,CAAC,EAAE,CAAC,IAAI;KAC1B,CAAC,IAAI,MAAM,IAAI,CAAC,CAAC,EAAE,MAA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AAC,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,8 +1,8 @@
1
1
  import t from "./RequestSidebarItem.vue2.js";
2
2
  /* empty css */
3
3
  /* empty css */
4
- import o from "../../_virtual/_plugin-vue_export-helper.js";
5
- const p = /* @__PURE__ */ o(t, [["__scopeId", "data-v-f2df081d"]]);
4
+ import e from "../../_virtual/_plugin-vue_export-helper.js";
5
+ const a = /* @__PURE__ */ e(t, [["__scopeId", "data-v-ec2878eb"]]);
6
6
  export {
7
- p as default
7
+ a as default
8
8
  };
@@ -1,13 +1,13 @@
1
- import { defineComponent as j, useCssVars as F, computed as o, resolveComponent as L, openBlock as a, createElementBlock as d, normalizeClass as u, unref as i, createVNode as m, withCtx as D, createBlock as p, createElementVNode as n, toDisplayString as y, createCommentVNode as f, createTextVNode as k, renderSlot as P, withDirectives as T, Fragment as W, renderList as A, vShow as _ } from "vue";
2
- import { PathId as G } from "../../router.js";
3
- import { useWorkspace as H } from "../../store/workspace.js";
4
- import { ScalarIcon as J } from "@scalar/components";
5
- import { Draggable as K } from "@scalar/draggable";
6
- import { RouterLink as M } from "vue-router";
7
- import Q from "./RequestSidebarItemMenu.vue.js";
8
- import X from "../../components/HttpMethod/HttpMethod.vue.js";
9
- import { useSidebar as Y } from "../../hooks/useSidebar.js";
10
- const Z = { class: "z-10 font-medium w-full editable-sidebar-hover-item pl-2" }, ee = { class: "relative" }, te = { class: "flex" }, ie = { class: "z-10 flex h-fit items-center justify-center max-w-[14px]" }, se = { class: "z-10 font-medium" }, re = { key: 2 }, q = "hover:bg-sidebar-active-b indent-padding-left", be = /* @__PURE__ */ j({
1
+ import { defineComponent as P, useCssVars as T, computed as o, resolveComponent as W, openBlock as a, createElementBlock as p, normalizeClass as d, unref as i, createVNode as b, withCtx as k, createBlock as m, createElementVNode as l, toDisplayString as y, createCommentVNode as f, createTextVNode as q, renderSlot as A, withDirectives as M, Fragment as G, renderList as H, vShow as J } from "vue";
2
+ import { PathId as K } from "../../router.js";
3
+ import { useWorkspace as Q } from "../../store/workspace.js";
4
+ import { ScalarIcon as X } from "@scalar/components";
5
+ import { Draggable as Y } from "@scalar/draggable";
6
+ import { RouterLink as Z } from "vue-router";
7
+ import x from "./RequestSidebarItemMenu.vue.js";
8
+ import _ from "../../components/HttpMethod/HttpMethod.vue.js";
9
+ import { useSidebar as ee } from "../../hooks/useSidebar.js";
10
+ const te = { class: "flex flex-row gap-1" }, ie = { class: "flex" }, re = { class: "z-10 flex h-fit items-center justify-center max-w-[14px]" }, se = { class: "flex flex-1 flex-row justify-between sidebar-folderitem editable-sidebar-hover" }, ae = { key: 2 }, $ = "hover:bg-sidebar-active-b indent-padding-left", ge = /* @__PURE__ */ P({
11
11
  __name: "RequestSidebarItem",
12
12
  props: {
13
13
  isDraggable: { type: Boolean, default: !1 },
@@ -16,116 +16,135 @@ const Z = { class: "z-10 font-medium w-full editable-sidebar-hover-item pl-2" },
16
16
  item: {}
17
17
  },
18
18
  emits: ["onDragEnd"],
19
- setup($) {
20
- F((e) => ({
21
- "1fe07419": R.value,
22
- "096d41f6": E.value
19
+ setup(C) {
20
+ T((e) => ({
21
+ "2b445812": z.value,
22
+ "78a7cc6c": B.value
23
23
  }));
24
- const t = $, {
25
- activeRequest: b,
26
- activeRouterParams: w,
24
+ const t = C, {
25
+ activeRequest: g,
26
+ activeRouterParams: S,
27
27
  activeWorkspace: c,
28
- folders: x,
29
- isReadOnly: l,
30
- requests: g,
31
- requestExamples: C
32
- } = H(), { collapsedSidebarFolders: h, toggleSidebarFolder: S } = Y(), v = o(() => "childUids" in t.item), R = o(() => t.parentUids.length ? l.value ? `${(t.parentUids.length - 1) * 12}px` : `${t.parentUids.length * 12}px` : "12px"), E = o(() => t.parentUids.length ? l.value ? `${(t.parentUids.length - 1) * 12}px` : `${t.parentUids.length * 12}px` : "0px"), U = (e) => {
28
+ folders: R,
29
+ isReadOnly: r,
30
+ requests: h,
31
+ requestExamples: I
32
+ } = Q(), { collapsedSidebarFolders: v, toggleSidebarFolder: E } = ee(), U = o(() => "childUids" in t.item), z = o(() => t.parentUids.length ? r.value ? `${(t.parentUids.length - 1) * 12}px` : `${t.parentUids.length * 12}px` : "12px"), B = o(() => t.parentUids.length ? r.value ? `${(t.parentUids.length - 1) * 12}px` : `${t.parentUids.length * 12}px` : "0px"), D = (e) => {
33
33
  var s;
34
34
  return "spec" in e ? (s = e.spec.info) == null ? void 0 : s.title : "summary" in e ? e.summary || e.path : "name" in e ? e.name : "";
35
- }, I = o(() => ("requestUid" in t.item ? g[t.item.requestUid] : t.item).method), z = o(
35
+ }, O = o(() => ("requestUid" in t.item ? h[t.item.requestUid] : t.item).method), V = o(
36
36
  () => {
37
37
  var e;
38
- return h[t.item.uid] || ((e = b.value) == null ? void 0 : e.uid) === t.item.uid && t.item.childUids.length > 1;
38
+ return v[t.item.uid] || ((e = g.value) == null ? void 0 : e.uid) === t.item.uid && t.item.childUids.length > 1;
39
39
  }
40
- ), B = () => "requestUid" in t.item ? `/workspace/${c.value.uid}/request/${t.item.requestUid}/examples/${t.item.uid}` : `/workspace/${c.value.uid}/request/${t.item.uid}`, O = o(
41
- () => w.value[G.Request] === "default" && b.value.uid === t.item.uid
40
+ ), j = () => "requestUid" in t.item ? `/workspace/${c.value.uid}/request/${t.item.requestUid}/examples/${t.item.uid}` : `/workspace/${c.value.uid}/request/${t.item.uid}`, N = o(
41
+ () => S.value[K.Request] === "default" && g.value.uid === t.item.uid
42
42
  );
43
43
  return (e, s) => {
44
- const V = L("RequestSidebarItem", !0);
45
- return a(), d("div", {
46
- class: u(["relative flex flex-row", [
47
- i(l) && e.parentUids.length > 1 || !i(l) && 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-px mb-[.5px] last:mb-0 indent-border-line-offset" : ""
44
+ const F = W("RequestSidebarItem", !0);
45
+ return a(), p("div", {
46
+ class: d(["relative flex flex-row", [
47
+ i(r) && e.parentUids.length > 1 || !i(r) && 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-px mb-[.5px] last:mb-0 indent-border-line-offset" : ""
48
48
  ]])
49
49
  }, [
50
- m(i(K), {
50
+ b(i(Y), {
51
51
  id: e.item.uid,
52
- ceiling: v.value ? 0.8 : 0.5,
53
- class: "flex flex-1 flex-col gap-[.5px] text-sm",
54
- floor: v.value ? 0.2 : 0.5,
52
+ ceiling: U.value ? 0.8 : 0.5,
53
+ class: "flex flex-1 flex-col gap-[.5px] text-sm max-w-full",
54
+ floor: U.value ? 0.2 : 0.5,
55
55
  isDraggable: e.parentUids.length > 0 && e.isDraggable,
56
56
  isDroppable: e.isDroppable,
57
57
  parentIds: e.parentUids,
58
- onOnDragEnd: s[2] || (s[2] = (...r) => e.$emit("onDragEnd", ...r))
58
+ onOnDragEnd: s[2] || (s[2] = (...u) => e.$emit("onDragEnd", ...u))
59
59
  }, {
60
- default: D(() => [
61
- "summary" in e.item || "requestUid" in e.item ? (a(), p(i(M), {
62
- key: 0,
63
- class: "no-underline",
64
- to: B()
65
- }, {
66
- default: D(({ isExactActive: r }) => [
67
- n("div", {
68
- class: u(["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", [
69
- q,
70
- r || O.value ? "bg-sidebar-active-b text-sidebar-active-c transition-none" : "text-sidebar-c-2"
71
- ]]),
72
- tabindex: "0"
73
- }, [
74
- n("span", Z, y(U(e.item)), 1),
75
- n("div", ee, [
76
- i(l) ? f("", !0) : (a(), p(Q, {
77
- key: 0,
78
- item: e.item
79
- }, null, 8, ["item"])),
80
- n("span", te, [
81
- k("   "),
82
- m(i(X), {
83
- class: "font-bold",
84
- method: I.value
85
- }, null, 8, ["method"])
86
- ])
87
- ])
88
- ], 2)
89
- ]),
90
- _: 1
91
- }, 8, ["to"])) : !i(l) || e.parentUids.length ? (a(), d("button", {
92
- key: 1,
93
- class: u(["hover:bg-b-2 group relative flex w-full flex-row justify-start gap-1.5 rounded p-1.5 z-[1]", q]),
94
- type: "button",
95
- onClick: s[0] || (s[0] = (r) => i(S)(e.item.uid))
96
- }, [
97
- n("span", ie, [
98
- P(e.$slots, "leftIcon", {}, () => [
99
- n("div", {
100
- class: u({
101
- "rotate-90": i(h)[e.item.uid]
102
- })
60
+ default: k(() => {
61
+ var u, w;
62
+ return [
63
+ "summary" in e.item || "requestUid" in e.item ? (a(), m(i(Z), {
64
+ key: 0,
65
+ class: "no-underline",
66
+ to: j()
67
+ }, {
68
+ default: k(({ isExactActive: n }) => [
69
+ l("div", {
70
+ class: d(["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", [
71
+ $,
72
+ n || N.value ? "bg-sidebar-active-b text-sidebar-active-c transition-none" : "text-sidebar-c-2"
73
+ ]]),
74
+ tabindex: "0"
103
75
  }, [
104
- m(i(J), {
105
- class: "text-c-3 text-sm",
106
- icon: "ChevronRight",
107
- size: "sm",
108
- thickness: "2.5"
109
- })
76
+ l("span", {
77
+ class: d(["z-10 font-medium w-full pl-2 word-break-break-word", {
78
+ "editable-sidebar-hover-item": !i(r)
79
+ }])
80
+ }, y(D(e.item)), 3),
81
+ l("div", te, [
82
+ i(r) ? f("", !0) : (a(), m(x, {
83
+ key: 0,
84
+ item: e.item,
85
+ parentUids: e.parentUids
86
+ }, null, 8, ["item", "parentUids"])),
87
+ l("span", ie, [
88
+ q("   "),
89
+ b(i(_), {
90
+ class: "font-bold",
91
+ method: O.value
92
+ }, null, 8, ["method"])
93
+ ])
94
+ ])
110
95
  ], 2)
111
- ], !0),
112
- k("   ")
113
- ]),
114
- n("span", se, y(U(e.item)), 1)
115
- ])) : f("", !0),
116
- "childUids" in e.item ? T((a(), d("div", re, [
117
- (a(!0), d(W, null, A("summary" in e.item ? e.item.childUids.slice(1) : e.item.childUids, (r) => (a(), p(V, {
118
- key: r,
119
- isDraggable: e.isDraggable,
120
- isDroppable: e.isDroppable,
121
- item: i(x)[r] || i(g)[r] || i(C)[r],
122
- parentUids: [...e.parentUids, e.item.uid],
123
- onOnDragEnd: s[1] || (s[1] = (...N) => e.$emit("onDragEnd", ...N))
124
- }, null, 8, ["isDraggable", "isDroppable", "item", "parentUids"]))), 128))
125
- ], 512)), [
126
- [_, z.value]
127
- ]) : f("", !0)
128
- ]),
96
+ ]),
97
+ _: 1
98
+ }, 8, ["to"])) : !i(r) || e.parentUids.length ? (a(), p("button", {
99
+ key: 1,
100
+ class: d(["hover:bg-b-2 group relative flex w-full flex-row justify-start gap-1.5 rounded p-1.5 z-[1]", $]),
101
+ type: "button",
102
+ onClick: s[0] || (s[0] = (n) => i(E)(e.item.uid))
103
+ }, [
104
+ l("span", re, [
105
+ A(e.$slots, "leftIcon", {}, () => [
106
+ l("div", {
107
+ class: d({
108
+ "rotate-90": i(v)[e.item.uid]
109
+ })
110
+ }, [
111
+ b(i(X), {
112
+ class: "text-c-3 text-sm",
113
+ icon: "ChevronRight",
114
+ size: "sm",
115
+ thickness: "2.5"
116
+ })
117
+ ], 2)
118
+ ], !0),
119
+ q("   ")
120
+ ]),
121
+ l("div", se, [
122
+ l("span", {
123
+ class: d(["z-10 font-medium w-full word-break-break-word text-left", {
124
+ "editable-sidebar-hover-item": !i(r)
125
+ }])
126
+ }, y(D(e.item)), 3),
127
+ !i(r) && ((w = (u = e.item.spec) == null ? void 0 : u.info) == null ? void 0 : w.title) !== "Drafts" ? (a(), m(x, {
128
+ key: 0,
129
+ item: e.item,
130
+ parentUids: e.parentUids
131
+ }, null, 8, ["item", "parentUids"])) : f("", !0)
132
+ ])
133
+ ])) : f("", !0),
134
+ "childUids" in e.item ? M((a(), p("div", ae, [
135
+ (a(!0), p(G, null, H("summary" in e.item ? e.item.childUids.slice(1) : e.item.childUids, (n) => (a(), m(F, {
136
+ key: n,
137
+ isDraggable: e.isDraggable,
138
+ isDroppable: e.isDroppable,
139
+ item: i(R)[n] || i(h)[n] || i(I)[n],
140
+ parentUids: [...e.parentUids, e.item.uid],
141
+ onOnDragEnd: s[1] || (s[1] = (...L) => e.$emit("onDragEnd", ...L))
142
+ }, null, 8, ["isDraggable", "isDroppable", "item", "parentUids"]))), 128))
143
+ ], 512)), [
144
+ [J, V.value]
145
+ ]) : f("", !0)
146
+ ];
147
+ }),
129
148
  _: 3
130
149
  }, 8, ["id", "ceiling", "floor", "isDraggable", "isDroppable", "parentIds"])
131
150
  ], 2);
@@ -133,5 +152,5 @@ const Z = { class: "z-10 font-medium w-full editable-sidebar-hover-item pl-2" },
133
152
  }
134
153
  });
135
154
  export {
136
- be as default
155
+ ge as default
137
156
  };
@@ -1,8 +1,14 @@
1
+ import type { Collection } from '@scalar/oas-utils/entities/workspace/collection';
2
+ import type { Folder } from '@scalar/oas-utils/entities/workspace/folder';
1
3
  import type { Request, RequestExample } from '@scalar/oas-utils/entities/workspace/spec';
2
4
  declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<{
3
- item: Request | RequestExample;
5
+ /** Both inidicate the level and provide a way to traverse upwards */
6
+ parentUids: string[];
7
+ item: Collection | Folder | Request | RequestExample;
4
8
  }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<{
5
- item: Request | RequestExample;
9
+ /** Both inidicate the level and provide a way to traverse upwards */
10
+ parentUids: string[];
11
+ item: Collection | Folder | Request | RequestExample;
6
12
  }>>>, {}, {}>;
7
13
  export default _default;
8
14
  type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
@@ -1 +1 @@
1
- {"version":3,"file":"RequestSidebarItemMenu.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Request/RequestSidebarItemMenu.vue"],"names":[],"mappings":"AA0MA,OAAO,KAAK,EACV,OAAO,EACP,cAAc,EACf,MAAM,2CAA2C,CAAA;;UAO1C,OAAO,GAAG,cAAc;;UAAxB,OAAO,GAAG,cAAc;;AAkdhC,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":"AA4PA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iDAAiD,CAAA;AACjF,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,6CAA6C,CAAA;AACzE,OAAO,KAAK,EACV,OAAO,EACP,cAAc,EACf,MAAM,2CAA2C,CAAA;;IAOhD,qEAAqE;gBACzD,MAAM,EAAE;UACd,UAAU,GAAG,MAAM,GAAG,OAAO,GAAG,cAAc;;IAFpD,qEAAqE;gBACzD,MAAM,EAAE;UACd,UAAU,GAAG,MAAM,GAAG,OAAO,GAAG,cAAc;;AAshBtD,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,154 +1,7 @@
1
- import { defineComponent as V, computed as q, ref as I, openBlock as E, createElementBlock as $, Fragment as B, createVNode as a, unref as e, withCtx as l, createBlock as A, createCommentVNode as F, createElementVNode as r, createTextVNode as C } from "vue";
2
- import P from "../../components/Sidebar/Actions/DeleteSidebarListElement.vue.js";
3
- import { commandPaletteBus as T } from "../../libs/eventBusses/command-palette.js";
4
- import { PathId as b } from "../../router.js";
5
- import { useWorkspace as U } from "../../store/workspace.js";
6
- import { useModal as g, ScalarDropdown as W, ScalarDropdownItem as p, ScalarIcon as u, ScalarButton as f, ScalarModal as N, ScalarTextField as j } from "@scalar/components";
7
- import { useRouter as G } from "vue-router";
8
- const H = /* @__PURE__ */ r("span", null, "Add Example", -1), J = /* @__PURE__ */ r("span", null, "Rename", -1), K = /* @__PURE__ */ r("span", null, "Delete", -1), L = { class: "flex gap-3" }, ae = /* @__PURE__ */ V({
9
- __name: "RequestSidebarItemMenu",
10
- props: {
11
- item: {}
12
- },
13
- setup(y) {
14
- const t = y, {
15
- activeWorkspace: v,
16
- activeRouterParams: x,
17
- findRequestFolders: D,
18
- requestMutators: _,
19
- requestExampleMutators: R
20
- } = U(), { replace: h } = G(), M = () => T.emit({
21
- commandName: "Add Example",
22
- metaData: t.item.uid
23
- }), S = () => {
24
- if ("requestUid" in t.item)
25
- R.delete(t.item), x.value[b.Examples] === t.item.uid && h(`/workspace/${v.value}/request/default`);
26
- else {
27
- const c = D(t.item.uid);
28
- if (!c.length) return;
29
- _.delete(t.item, c[0]), x.value[b.Request] === t.item.uid && h(`/workspace/${v.value.uid}/request/default`);
30
- }
31
- }, n = q(() => "summary" in t.item), k = q(() => "summary" in t.item ? t.item.summary || "" : "name" in t.item && t.item.name || ""), i = I(""), w = () => {
32
- "summary" in t.item ? _.edit(t.item.uid, "summary", i.value) : "summary" in t.item || R.edit(t.item.uid, "name", i.value), i.value = "", o.hide();
33
- }, o = g(), d = g(), z = () => {
34
- i.value = k.value, o.show();
35
- };
36
- return (c, s) => (E(), $(B, null, [
37
- a(e(W), { teleport: "#scalar-client" }, {
38
- items: l(() => [
39
- n.value ? (E(), A(e(p), {
40
- key: 0,
41
- class: "flex !gap-2",
42
- onClick: M
43
- }, {
44
- default: l(() => [
45
- a(e(u), {
46
- class: "inline-flex",
47
- icon: "Add",
48
- size: "sm"
49
- }),
50
- H
51
- ]),
52
- _: 1
53
- })) : F("", !0),
54
- a(e(p), {
55
- class: "flex !gap-2",
56
- onClick: z
57
- }, {
58
- default: l(() => [
59
- a(e(u), {
60
- class: "inline-flex",
61
- icon: "Edit",
62
- size: "sm"
63
- }),
64
- J
65
- ]),
66
- _: 1
67
- }),
68
- a(e(p), {
69
- class: "flex !gap-2",
70
- onClick: s[0] || (s[0] = (m) => e(d).show())
71
- }, {
72
- default: l(() => [
73
- a(e(u), {
74
- class: "inline-flex",
75
- icon: "Trash",
76
- size: "sm"
77
- }),
78
- K
79
- ]),
80
- _: 1
81
- })
82
- ]),
83
- default: l(() => [
84
- a(e(f), {
85
- 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",
86
- size: "sm",
87
- variant: "ghost"
88
- }, {
89
- default: l(() => [
90
- a(e(u), {
91
- icon: "Ellipses",
92
- size: "sm"
93
- })
94
- ]),
95
- _: 1
96
- })
97
- ]),
98
- _: 1
99
- }),
100
- a(e(N), {
101
- size: "sm",
102
- state: e(d),
103
- title: n.value ? "Delete Request" : "Delete Example"
104
- }, {
105
- default: l(() => [
106
- a(P, {
107
- variableName: k.value,
108
- onClose: s[1] || (s[1] = (m) => e(d).hide()),
109
- onDelete: S
110
- }, null, 8, ["variableName"])
111
- ]),
112
- _: 1
113
- }, 8, ["state", "title"]),
114
- a(e(N), {
115
- state: e(o),
116
- title: n.value ? "Rename Request" : "Rename Example"
117
- }, {
118
- default: l(() => [
119
- a(e(j), {
120
- modelValue: i.value,
121
- "onUpdate:modelValue": s[2] || (s[2] = (m) => i.value = m),
122
- label: n.value ? "Request" : "Example"
123
- }, null, 8, ["modelValue", "label"]),
124
- r("div", L, [
125
- a(e(f), {
126
- class: "flex-1",
127
- variant: "outlined",
128
- onClick: s[3] || (s[3] = (m) => e(o).hide())
129
- }, {
130
- default: l(() => [
131
- C(" Cancel ")
132
- ]),
133
- _: 1
134
- }),
135
- a(e(f), {
136
- class: "flex-1",
137
- type: "submit",
138
- onClick: w
139
- }, {
140
- default: l(() => [
141
- C(" Save ")
142
- ]),
143
- _: 1
144
- })
145
- ])
146
- ]),
147
- _: 1
148
- }, 8, ["state", "title"])
149
- ], 64));
150
- }
151
- });
1
+ import t from "./RequestSidebarItemMenu.vue2.js";
2
+ /* empty css */
3
+ import e from "../../_virtual/_plugin-vue_export-helper.js";
4
+ const a = /* @__PURE__ */ e(t, [["__scopeId", "data-v-b4744bc5"]]);
152
5
  export {
153
- ae as default
6
+ a as default
154
7
  };