@scalar/api-client 2.1.22 → 2.1.24

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 (86) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/README.md +22 -0
  3. package/dist/components/CodeInput/CodeInput.vue.d.ts.map +1 -1
  4. package/dist/components/CodeInput/CodeInput.vue.js +2 -2
  5. package/dist/components/CommandPalette/TheCommandPalette.vue.d.ts.map +1 -1
  6. package/dist/components/CommandPalette/TheCommandPalette.vue.js +2 -2
  7. package/dist/components/CommandPalette/TheCommandPalette.vue2.js +163 -154
  8. package/dist/components/ContextBar.vue.js +2 -2
  9. package/dist/components/ContextBar.vue2.js +1 -1
  10. package/dist/components/DataTable/DataTableCell.vue.d.ts.map +1 -1
  11. package/dist/components/DataTable/DataTableCell.vue.js +5 -5
  12. package/dist/components/DataTable/DataTableText.vue.d.ts +12 -3
  13. package/dist/components/DataTable/DataTableText.vue.d.ts.map +1 -1
  14. package/dist/components/DataTable/DataTableText.vue.js +13 -9
  15. package/dist/components/EnvironmentSelector/EnvironmentSelector.vue.d.ts.map +1 -1
  16. package/dist/components/EnvironmentSelector/EnvironmentSelector.vue.js +9 -9
  17. package/dist/components/ImportCollection/ImportCollectionModal.vue.d.ts.map +1 -1
  18. package/dist/components/ImportCollection/ImportCollectionModal.vue.js +84 -63
  19. package/dist/components/ImportCollection/ImportNowButton.vue.d.ts.map +1 -1
  20. package/dist/components/ImportCollection/ImportNowButton.vue.js +36 -40
  21. package/dist/components/ImportCollection/WorkspaceSelector.vue.d.ts +3 -0
  22. package/dist/components/ImportCollection/WorkspaceSelector.vue.d.ts.map +1 -0
  23. package/dist/components/ImportCollection/WorkspaceSelector.vue.js +125 -0
  24. package/dist/components/ImportCollection/WorkspaceSelector.vue2.js +4 -0
  25. package/dist/components/ImportCurl/ImportCurlModal.vue.d.ts.map +1 -1
  26. package/dist/components/ImportCurl/ImportCurlModal.vue.js +2 -2
  27. package/dist/components/ImportCurl/ImportCurlModal.vue2.js +28 -27
  28. package/dist/components/SideNav/SideHelp.vue.js +1 -1
  29. package/dist/components/SideNav/SideNav.vue.d.ts.map +1 -1
  30. package/dist/components/SideNav/SideNav.vue.js +1 -1
  31. package/dist/components/SideNav/SideNav.vue2.js +8 -8
  32. package/dist/components/SideNav/SideNavLink.vue.js +1 -1
  33. package/dist/components/Sidebar/Sidebar.vue.d.ts.map +1 -1
  34. package/dist/components/Sidebar/Sidebar.vue.js +2 -2
  35. package/dist/components/Sidebar/Sidebar.vue2.js +4 -4
  36. package/dist/components/Sidebar/SidebarList.vue.d.ts.map +1 -1
  37. package/dist/components/Sidebar/SidebarList.vue.js +3 -3
  38. package/dist/components/Sidebar/SidebarToggle.vue.js +1 -1
  39. package/dist/components/TopNav/TopNav.vue.d.ts.map +1 -1
  40. package/dist/components/TopNav/TopNav.vue.js +3 -3
  41. package/dist/data/httpHeaders.d.ts +6 -0
  42. package/dist/data/httpHeaders.d.ts.map +1 -0
  43. package/dist/data/httpHeaders.js +537 -0
  44. package/dist/layouts/App/create-api-client-app.d.ts +8 -8
  45. package/dist/layouts/App/create-api-client-app.d.ts.map +1 -1
  46. package/dist/layouts/Modal/create-api-client-modal.d.ts +16 -16
  47. package/dist/layouts/Modal/create-api-client-modal.d.ts.map +1 -1
  48. package/dist/layouts/Web/create-api-client-web.d.ts +8 -8
  49. package/dist/layouts/Web/create-api-client-web.d.ts.map +1 -1
  50. package/dist/libs/create-client.d.ts +8 -8
  51. package/dist/libs/create-client.d.ts.map +1 -1
  52. package/dist/libs/importers/curl.d.ts +25 -1
  53. package/dist/libs/importers/curl.d.ts.map +1 -1
  54. package/dist/libs/importers/curl.js +40 -38
  55. package/dist/libs/parse-curl.d.ts +3 -4
  56. package/dist/libs/parse-curl.d.ts.map +1 -1
  57. package/dist/libs/parse-curl.js +58 -55
  58. package/dist/store/collections.d.ts.map +1 -1
  59. package/dist/store/import-spec.d.ts.map +1 -1
  60. package/dist/store/request-example.d.ts +4 -4
  61. package/dist/store/requests.d.ts +4 -4
  62. package/dist/store/store.d.ts +16 -16
  63. package/dist/store/store.d.ts.map +1 -1
  64. package/dist/store/tags.d.ts.map +1 -1
  65. package/dist/style.css +1 -1
  66. package/dist/views/Cookies/Cookies.vue.d.ts.map +1 -1
  67. package/dist/views/Cookies/Cookies.vue2.js +21 -21
  68. package/dist/views/Request/Request.vue.js +1 -1
  69. package/dist/views/Request/Request.vue2.js +1 -1
  70. package/dist/views/Request/RequestSection/RequestSection.vue.d.ts.map +1 -1
  71. package/dist/views/Request/RequestSection/RequestSection.vue.js +45 -53
  72. package/dist/views/Request/RequestSidebar.vue.d.ts.map +1 -1
  73. package/dist/views/Request/RequestSidebar.vue.js +3 -3
  74. package/dist/views/Request/RequestSidebar.vue2.js +61 -63
  75. package/dist/views/Request/RequestSidebarItem.vue.js +1 -1
  76. package/dist/views/Request/RequestSidebarItem.vue2.js +43 -43
  77. package/dist/views/Request/RequestSubpageHeader.vue.d.ts.map +1 -1
  78. package/dist/views/Request/RequestSubpageHeader.vue.js +2 -2
  79. package/dist/views/Request/RequestSubpageHeader.vue2.js +15 -13
  80. package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
  81. package/dist/views/Request/ResponseSection/ResponseHeaders.vue.d.ts.map +1 -1
  82. package/dist/views/Request/ResponseSection/ResponseHeaders.vue.js +43 -22
  83. package/dist/views/Request/ResponseSection/ResponseSection.vue.d.ts.map +1 -1
  84. package/dist/views/Request/ResponseSection/ResponseSection.vue.js +44 -51
  85. package/dist/views/Request/components/WorkspaceDropdown.vue.js +2 -2
  86. package/package.json +10 -10
@@ -1 +1 @@
1
- {"version":3,"file":"ImportCollectionModal.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ImportCollection/ImportCollectionModal.vue"],"names":[],"mappings":";YAqKU,MAAM,GAAG,IAAI;;;;YAAb,MAAM,GAAG,IAAI;;;;AA0QvB,wBASG"}
1
+ {"version":3,"file":"ImportCollectionModal.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ImportCollection/ImportCollectionModal.vue"],"names":[],"mappings":";YA2LU,MAAM,GAAG,IAAI;;;;YAAb,MAAM,GAAG,IAAI;;;;AAmTvB,wBASG"}
@@ -1,91 +1,112 @@
1
- import { defineComponent as C, computed as d, watch as S, openBlock as l, createBlock as I, unref as o, withCtx as z, createElementVNode as t, toDisplayString as f, createVNode as i, createElementBlock as m, Fragment as B, createCommentVNode as h } from "vue";
2
- import { useUrlPrefetcher as D } from "./hooks/useUrlPrefetcher.js";
1
+ import { defineComponent as S, computed as a, watch as C, openBlock as l, createBlock as z, unref as o, withCtx as D, createElementVNode as e, toDisplayString as h, createElementBlock as d, createVNode as i, Fragment as F, createCommentVNode as x, createTextVNode as I } from "vue";
2
+ import { useUrlPrefetcher as V } from "./hooks/useUrlPrefetcher.js";
3
3
  import { getOpenApiDocumentVersion as _ } from "./utils/getOpenApiDocumentVersion.js";
4
- import { isDocument as E } from "./utils/isDocument.js";
5
- import { isUrl as F } from "./utils/isUrl.js";
6
- import { useModal as U, ScalarModal as V, ScalarIcon as x, ScalarCodeBlock as A } from "@scalar/components";
7
- import { normalize as M } from "@scalar/openapi-parser";
8
- import N from "./ImportNowButton.vue.js";
9
- import $ from "../../views/Request/components/WorkspaceDropdown.vue.js";
10
- import { useWorkspace as O } from "../../store/store.js";
11
- const P = { class: "flex gap-5 flex-col my-24" }, W = { class: "text-center text-xl font-medium" }, j = { class: "flex justify-center" }, K = { class: "inline-block bg-b-2 py-1 px-4 rounded" }, R = {
4
+ import { isDocument as j } from "./utils/isDocument.js";
5
+ import { isUrl as A } from "./utils/isUrl.js";
6
+ import { useModal as B, ScalarModal as E, ScalarIcon as m, ScalarCodeBlock as N } from "@scalar/components";
7
+ import { normalize as O } from "@scalar/openapi-parser";
8
+ import U from "./ImportNowButton.vue.js";
9
+ import M from "./WorkspaceSelector.vue.js";
10
+ import { useWorkspace as $ } from "../../store/store.js";
11
+ const P = { class: "flex flex-col h-screen justify-center overflow-hidden relative" }, T = { class: "flex items-center flex-col m-auto" }, W = { class: "text-center text-[50px] tracking-[-3px] leading-tight font-medium text-pretty" }, K = {
12
12
  key: 0,
13
- class: "flex gap-2 items-center p-3 font-code text-sm border rounded break-words"
14
- }, T = { class: "break-all" }, q = { class: "flex gap-2 items-center p-3 font-code text-sm border rounded" }, G = { class: "bg-b-2 h-48 border rounded custom-scroll" }, H = {
13
+ class: "flex gap-2 items-center p-3 font-code text-sm border rounded break-words my-4"
14
+ }, L = { class: "break-all" }, R = { class: "flex gap-2 items-center p-3 font-code text-sm border rounded" }, q = { class: "bg-b-2 h-48 border rounded custom-scroll" }, G = {
15
15
  key: 2,
16
16
  class: "inline-flex flex-col gap-2 items-center mt-2"
17
- }, se = /* @__PURE__ */ C({
17
+ }, H = { class: "flex justify-center" }, J = { class: "inline-block py-1 px-4" }, Q = { class: "flex flex-col justify-center items-center pb-4" }, X = { class: "text-center flex items-center flex-col" }, Y = { class: "mb-2 w-10 h-10 border rounded-[10px] flex items-center justify-center" }, ae = /* @__PURE__ */ S({
18
18
  __name: "ImportCollectionModal",
19
19
  props: {
20
20
  source: {}
21
21
  },
22
22
  emits: ["importFinished"],
23
23
  setup(v) {
24
- const c = v, { activeWorkspace: k, events: g } = O(), { prefetchResult: s, prefetchUrl: b } = D(), n = U();
24
+ const c = v, { activeWorkspace: k, events: g } = $(), { prefetchResult: r, prefetchUrl: y } = V(), n = B();
25
25
  g.hotKeys.on(() => n.hide());
26
- const y = d(() => {
26
+ const b = a(() => {
27
27
  try {
28
- return M(
29
- s.content || c.source || ""
28
+ return O(
29
+ r.content || c.source || ""
30
30
  );
31
31
  } catch {
32
32
  return;
33
33
  }
34
- }), w = d(() => {
35
- var e, r;
36
- return (r = (e = y.value) == null ? void 0 : e.info) == null ? void 0 : r.title;
37
- }), a = d(
38
- () => _(s.content || c.source || "")
34
+ }), w = a(() => {
35
+ var t, s;
36
+ return (s = (t = b.value) == null ? void 0 : t.info) == null ? void 0 : s.title;
37
+ }), p = a(
38
+ () => _(r.content || c.source || "")
39
39
  );
40
- return S(
40
+ return C(
41
41
  () => c.source,
42
- (e) => {
43
- b(e, k.value.proxyUrl), e && (F(e) || E(e) && _(e)) ? n.show() : n.hide();
42
+ (t) => {
43
+ y(t, k.value.proxyUrl), t && (A(t) || j(t) && _(t)) ? n.show() : n.hide();
44
44
  }
45
- ), (e, r) => (l(), I(o(V), {
46
- size: "md",
45
+ ), (t, s) => (l(), z(o(E), {
46
+ size: "full",
47
47
  state: o(n)
48
48
  }, {
49
- default: z(() => {
50
- var p, u;
49
+ default: D(() => {
50
+ var f, u;
51
51
  return [
52
- t("div", P, [
53
- t("div", W, f(w.value ?? "Import Collection"), 1),
54
- t("div", j, [
55
- t("div", K, [
56
- i(o($))
57
- ])
58
- ]),
59
- o(s).state !== "loading" && o(s).error ? (l(), m("div", R, [
60
- i(o(x), {
61
- class: "text-red flex-shrink-0",
62
- icon: "Error",
63
- size: "sm"
64
- }),
65
- t("div", T, f(o(s).error), 1)
66
- ])) : a.value ? h("", !0) : (l(), m(B, { key: 1 }, [
67
- t("div", q, [
68
- i(o(x), {
69
- class: "text-red",
52
+ e("div", P, [
53
+ e("div", T, [
54
+ e("div", W, h(w.value ?? "Import Collection"), 1),
55
+ o(r).state !== "loading" && o(r).error ? (l(), d("div", K, [
56
+ i(o(m), {
57
+ class: "text-red flex-shrink-0",
70
58
  icon: "Error",
71
59
  size: "sm"
72
60
  }),
73
- r[1] || (r[1] = t("div", null, "This doesn’t look like a valid OpenAPI/Swagger document.", -1))
74
- ]),
75
- t("div", G, [
76
- i(o(A), {
77
- content: ((p = o(s).content) == null ? void 0 : p.trim()) || ((u = c.source) == null ? void 0 : u.trim()) || "",
78
- copy: !1
79
- }, null, 8, ["content"])
61
+ e("div", L, h(o(r).error), 1)
62
+ ])) : p.value ? x("", !0) : (l(), d(F, { key: 1 }, [
63
+ e("div", R, [
64
+ i(o(m), {
65
+ class: "text-red",
66
+ icon: "Error",
67
+ size: "sm"
68
+ }),
69
+ s[1] || (s[1] = e("div", null, "This doesn’t look like a valid OpenAPI/Swagger document.", -1))
70
+ ]),
71
+ e("div", q, [
72
+ i(o(N), {
73
+ content: ((f = o(r).content) == null ? void 0 : f.trim()) || ((u = c.source) == null ? void 0 : u.trim()) || "",
74
+ copy: !1
75
+ }, null, 8, ["content"])
76
+ ])
77
+ ], 64)),
78
+ p.value ? (l(), d("div", G, [
79
+ i(U, {
80
+ source: t.source,
81
+ variant: "button",
82
+ onImportFinished: s[0] || (s[0] = () => t.$emit("importFinished"))
83
+ }, null, 8, ["source"])
84
+ ])) : x("", !0),
85
+ e("div", H, [
86
+ e("div", J, [
87
+ i(M)
88
+ ])
89
+ ])
90
+ ]),
91
+ e("div", Q, [
92
+ e("div", X, [
93
+ e("div", Y, [
94
+ i(o(m), {
95
+ icon: "Logo",
96
+ size: "xl"
97
+ })
98
+ ]),
99
+ s[2] || (s[2] = e("span", { class: "text-c-2" }, [
100
+ e("a", {
101
+ class: "hover:text-c-1",
102
+ href: "https://scalar.com/download",
103
+ target: "_blank"
104
+ }, " Download Scalar App "),
105
+ e("br"),
106
+ I(" Offline First - Open Source ")
107
+ ], -1))
80
108
  ])
81
- ], 64)),
82
- a.value ? (l(), m("div", H, [
83
- i(N, {
84
- source: e.source,
85
- variant: "button",
86
- onImportFinished: r[0] || (r[0] = () => e.$emit("importFinished"))
87
- }, null, 8, ["source"])
88
- ])) : h("", !0)
109
+ ])
89
110
  ])
90
111
  ];
91
112
  }),
@@ -94,5 +115,5 @@ const P = { class: "flex gap-5 flex-col my-24" }, W = { class: "text-center text
94
115
  }
95
116
  });
96
117
  export {
97
- se as default
118
+ ae as default
98
119
  };
@@ -1 +1 @@
1
- {"version":3,"file":"ImportNowButton.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ImportCollection/ImportNowButton.vue"],"names":[],"mappings":";aAgHW,MAAM,GAAG,IAAI;cACZ,QAAQ,GAAG,MAAM;;;;aADlB,MAAM,GAAG,IAAI;cACZ,QAAQ,GAAG,MAAM;;;;AAsL7B,wBASG"}
1
+ {"version":3,"file":"ImportNowButton.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ImportCollection/ImportNowButton.vue"],"names":[],"mappings":";aA6GW,MAAM,GAAG,IAAI;cACZ,QAAQ,GAAG,MAAM;;;;aADlB,MAAM,GAAG,IAAI;cACZ,QAAQ,GAAG,MAAM;;;;AAkL7B,wBASG"}
@@ -1,10 +1,10 @@
1
- import { defineComponent as w, openBlock as s, createElementBlock as I, Fragment as g, createBlock as u, unref as i, withCtx as c, createVNode as F, createTextVNode as p, createCommentVNode as x } from "vue";
2
- import { isUrl as B } from "./utils/isUrl.js";
3
- import { ScalarButton as l, ScalarIcon as b } from "@scalar/components";
4
- import { useToasts as h } from "@scalar/use-toasts";
5
- import { useRouter as q } from "vue-router";
6
- import { useWorkspace as N } from "../../store/store.js";
7
- const W = /* @__PURE__ */ w({
1
+ import { defineComponent as x, openBlock as s, createElementBlock as b, Fragment as w, createBlock as m, unref as a, withCtx as p, createTextVNode as c, createCommentVNode as g } from "vue";
2
+ import { isUrl as h } from "./utils/isUrl.js";
3
+ import { ScalarButton as l } from "@scalar/components";
4
+ import { useToasts as F } from "@scalar/use-toasts";
5
+ import { useRouter as B } from "vue-router";
6
+ import { useWorkspace as I } from "../../store/store.js";
7
+ const R = /* @__PURE__ */ x({
8
8
  __name: "ImportNowButton",
9
9
  props: {
10
10
  source: {},
@@ -12,74 +12,70 @@ const W = /* @__PURE__ */ w({
12
12
  },
13
13
  emits: ["importFinished"],
14
14
  setup(f, { emit: d }) {
15
- const o = f, k = d, v = q(), { importSpecFromUrl: C, importSpecFile: y, activeWorkspace: r } = N(), { toast: n } = h();
16
- async function a() {
15
+ const o = f, k = d, y = B(), { importSpecFromUrl: v, importSpecFile: C, activeWorkspace: r } = I(), { toast: i } = F();
16
+ async function n() {
17
17
  try {
18
18
  if (o.source) {
19
- if (B(o.source)) {
20
- const e = await C(
19
+ if (h(o.source)) {
20
+ const t = await v(
21
21
  o.source,
22
22
  void 0,
23
23
  void 0,
24
24
  r.value.uid
25
25
  );
26
- m(e);
26
+ u(t);
27
27
  } else {
28
- const e = await y(
28
+ const t = await C(
29
29
  o.source,
30
30
  r.value.uid
31
31
  );
32
- m(e);
32
+ u(t);
33
33
  }
34
- n("Import successful", "info"), k("importFinished");
34
+ i("Import successful", "info"), k("importFinished");
35
35
  }
36
- } catch (e) {
37
- console.error("[importCollection]", e);
38
- const t = (e == null ? void 0 : e.message) || "Unknown error";
39
- n(`Import failed: ${t}`, "error");
36
+ } catch (t) {
37
+ console.error("[importCollection]", t);
38
+ const e = (t == null ? void 0 : t.message) || "Unknown error";
39
+ i(`Import failed: ${e}`, "error");
40
40
  }
41
41
  }
42
- function m(e) {
43
- e && v.push({
42
+ function u(t) {
43
+ t && y.push({
44
44
  name: "request",
45
45
  params: {
46
46
  workspace: r.value.uid,
47
- request: e == null ? void 0 : e.requests[0]
47
+ request: t == null ? void 0 : t.requests[0]
48
48
  }
49
49
  });
50
50
  }
51
- return (e, t) => e.source ? (s(), I(g, { key: 0 }, [
52
- e.variant === "button" ? (s(), u(i(l), {
51
+ return (t, e) => t.source ? (s(), b(w, { key: 0 }, [
52
+ t.variant === "button" ? (s(), m(a(l), {
53
53
  key: 0,
54
- class: "px-6 gap-2",
54
+ class: "text-[21px] py-2.5 px-6 rounded-lg font-bold h-fit mt-3 mb-1.5",
55
55
  size: "md",
56
56
  type: "button",
57
- onClick: a
57
+ onClick: n
58
58
  }, {
59
- default: c(() => [
60
- F(i(b), {
61
- icon: "Import",
62
- size: "md"
63
- }),
64
- t[0] || (t[0] = p(" Import Collection "))
65
- ]),
59
+ default: p(() => e[0] || (e[0] = [
60
+ c(" Import Collection ")
61
+ ])),
66
62
  _: 1
67
- })) : (s(), u(i(l), {
63
+ })) : (s(), m(a(l), {
68
64
  key: 1,
69
- class: "px-6 gap-2 text-c-1",
65
+ class: "text-[21px] py-2.5 px-6 rounded-lg font-bold h-fit",
70
66
  size: "md",
71
67
  type: "button",
72
68
  variant: "ghost",
73
- onClick: a
69
+ onClick: n
74
70
  }, {
75
- default: c(() => t[1] || (t[1] = [
76
- p(" Try it in the browser ")
71
+ default: p(() => e[1] || (e[1] = [
72
+ c(" Try it in the browser ")
77
73
  ])),
78
74
  _: 1
79
75
  }))
80
- ], 64)) : x("", !0);
76
+ ], 64)) : g("", !0);
81
77
  }
82
78
  });
83
79
  export {
84
- W as default
80
+ R as default
85
81
  };
@@ -0,0 +1,3 @@
1
+ declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
+ export default _default;
3
+ //# sourceMappingURL=WorkspaceSelector.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WorkspaceSelector.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ImportCollection/WorkspaceSelector.vue"],"names":[],"mappings":";AAieA,wBAKG"}
@@ -0,0 +1,125 @@
1
+ import { defineComponent as y, ref as D, openBlock as d, createElementBlock as x, Fragment as w, createElementVNode as t, createVNode as s, unref as e, withCtx as r, renderList as W, createBlock as N, withModifiers as h, normalizeClass as M, toDisplayString as k, withDirectives as $, vModelText as z, createTextVNode as B } from "vue";
2
+ import { useModal as V, ScalarDropdown as j, ScalarDropdownItem as v, ScalarIcon as u, ScalarDropdownDivider as T, ScalarButton as _, ScalarModal as E } from "@scalar/components";
3
+ import { useToasts as I } from "@scalar/use-toasts";
4
+ import { useRouter as A } from "vue-router";
5
+ import { useWorkspace as F } from "../../store/store.js";
6
+ const L = { class: "flex items-center text-sm w-[inherit]" }, P = { class: "font-medium m-0 text-sm flex gap-1.5 items-center" }, R = { class: "line-clamp-1 text-left w-[calc(100%-10px)]" }, U = { class: "text-ellipsis overflow-hidden" }, q = { class: "flex items-center justify-center h-4 w-4" }, Y = /* @__PURE__ */ y({
7
+ __name: "WorkspaceSelector",
8
+ setup(G) {
9
+ const { activeWorkspace: i, workspaces: b, workspaceMutators: g } = F(), { push: m } = A(), c = V(), { toast: f } = I(), a = D(""), C = (l) => {
10
+ l !== i.value.uid && m(`/workspace/${l}`);
11
+ }, S = () => {
12
+ if (!a.value.trim()) {
13
+ f("Please enter a name before creating a workspace.", "error");
14
+ return;
15
+ }
16
+ const l = g.add({
17
+ name: a.value
18
+ });
19
+ m(`/workspace/${l.uid}`), f(`Created new workspace '${a.value}'`), a.value = "", c.hide();
20
+ };
21
+ return (l, o) => (d(), x(w, null, [
22
+ t("div", L, [
23
+ s(e(j), null, {
24
+ items: r(() => [
25
+ (d(!0), x(w, null, W(e(b), (n, p) => (d(), N(e(v), {
26
+ key: p,
27
+ class: "flex gap-1.5 group/item items-center whitespace-nowrap text-ellipsis overflow-hidden w-full",
28
+ onClick: h((H) => C(p), ["stop"])
29
+ }, {
30
+ default: r(() => [
31
+ t("div", {
32
+ class: M([
33
+ "flex items-center justify-center rounded-full p-[3px] w-4 h-4 group-hover/item:shadow-border",
34
+ e(i).uid === p ? "bg-blue text-b-1" : "text-transparent"
35
+ ])
36
+ }, [
37
+ s(e(u), {
38
+ class: "size-2.5",
39
+ icon: "Checkmark",
40
+ thickness: "3.5"
41
+ })
42
+ ], 2),
43
+ t("span", U, k(n.name), 1)
44
+ ]),
45
+ _: 2
46
+ }, 1032, ["onClick"]))), 128)),
47
+ s(e(T)),
48
+ s(e(v), {
49
+ class: "flex items-center gap-1.5",
50
+ onClick: o[0] || (o[0] = (n) => e(c).show())
51
+ }, {
52
+ default: r(() => [
53
+ t("div", q, [
54
+ s(e(u), {
55
+ class: "h-2.5",
56
+ icon: "Add",
57
+ thickness: "3"
58
+ })
59
+ ]),
60
+ o[2] || (o[2] = t("span", null, "New Workspace", -1))
61
+ ]),
62
+ _: 1
63
+ })
64
+ ]),
65
+ default: r(() => [
66
+ s(e(_), {
67
+ class: "font-normal h-full justify-start line-clamp-1 py-1.5 px-1.5 text-c-1 hover:bg-b-2 w-fit",
68
+ fullWidth: "",
69
+ variant: "ghost"
70
+ }, {
71
+ default: r(() => [
72
+ t("div", P, [
73
+ t("h2", R, k(e(i).name), 1),
74
+ s(e(u), {
75
+ class: "size-3",
76
+ icon: "ChevronDown",
77
+ thickness: "3"
78
+ })
79
+ ])
80
+ ]),
81
+ _: 1
82
+ })
83
+ ]),
84
+ _: 1
85
+ })
86
+ ]),
87
+ s(e(E), {
88
+ bodyClass: "!m-0 !p-1",
89
+ size: "xxs",
90
+ state: e(c),
91
+ variant: "form"
92
+ }, {
93
+ default: r(() => [
94
+ t("form", {
95
+ class: "flex gap-1 rounded",
96
+ onSubmit: h(S, ["prevent"])
97
+ }, [
98
+ $(t("input", {
99
+ "onUpdate:modelValue": o[1] || (o[1] = (n) => a.value = n),
100
+ class: "border-none outline-none flex-1 w-full text-sm min-h-8 p-1.5",
101
+ placeholder: "New Workspace",
102
+ type: "text"
103
+ }, null, 512), [
104
+ [z, a.value]
105
+ ]),
106
+ s(e(_), {
107
+ class: "max-h-8 text-xs p-0 px-3",
108
+ disabled: !a.value.trim(),
109
+ type: "submit"
110
+ }, {
111
+ default: r(() => o[3] || (o[3] = [
112
+ B(" Continue ")
113
+ ])),
114
+ _: 1
115
+ }, 8, ["disabled"])
116
+ ], 32)
117
+ ]),
118
+ _: 1
119
+ }, 8, ["state"])
120
+ ], 64));
121
+ }
122
+ });
123
+ export {
124
+ Y as default
125
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./WorkspaceSelector.vue.js";
2
+ export {
3
+ f as default
4
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"ImportCurlModal.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ImportCurl/ImportCurlModal.vue"],"names":[],"mappings":"AA6GA,OAAO,KAAK,EAEV,cAAc,EACf,MAAM,iCAAiC,CAAA;;gBAO1B,cAAc,GAAG,IAAI;WAC1B;QAAE,IAAI,EAAE,OAAO,CAAC;QAAC,IAAI,EAAE,MAAM,IAAI,CAAC;QAAC,IAAI,EAAE,MAAM,IAAI,CAAA;KAAE;;;oBAsPnC,cAAc;qBAAe,MAAM;;;;gBAvPhD,cAAc,GAAG,IAAI;WAC1B;QAAE,IAAI,EAAE,OAAO,CAAC;QAAC,IAAI,EAAE,MAAM,IAAI,CAAC;QAAC,IAAI,EAAE,MAAM,IAAI,CAAA;KAAE;;;oBAsPnC,cAAc;qBAAe,MAAM;;;;AAT9D,wBAaG"}
1
+ {"version":3,"file":"ImportCurlModal.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ImportCurl/ImportCurlModal.vue"],"names":[],"mappings":"AA8GA,OAAO,KAAK,EAEV,cAAc,EACf,MAAM,iCAAiC,CAAA;;gBAO1B,cAAc,GAAG,IAAI;WAC1B;QAAE,IAAI,EAAE,OAAO,CAAC;QAAC,IAAI,EAAE,MAAM,IAAI,CAAC;QAAC,IAAI,EAAE,MAAM,IAAI,CAAA;KAAE;;;oBAoQnC,cAAc;qBAAe,MAAM;;;;gBArQhD,cAAc,GAAG,IAAI;WAC1B;QAAE,IAAI,EAAE,OAAO,CAAC;QAAC,IAAI,EAAE,MAAM,IAAI,CAAC;QAAC,IAAI,EAAE,MAAM,IAAI,CAAA;KAAE;;;oBAoQnC,cAAc;qBAAe,MAAM;;;;AAT9D,wBAaG"}
@@ -1,7 +1,7 @@
1
1
  import o from "./ImportCurlModal.vue2.js";
2
2
  /* empty css */
3
3
  import r from "../../_virtual/_plugin-vue_export-helper.js";
4
- const a = /* @__PURE__ */ r(o, [["__scopeId", "data-v-6103022c"]]);
4
+ const p = /* @__PURE__ */ r(o, [["__scopeId", "data-v-50c10cc9"]]);
5
5
  export {
6
- a as default
6
+ p as default
7
7
  };
@@ -1,24 +1,24 @@
1
- import { defineComponent as g, ref as y, computed as N, watch as V, openBlock as k, createBlock as R, unref as s, withCtx as n, createVNode as r, createElementVNode as l, toDisplayString as C, createTextVNode as x } from "vue";
2
- import S from "../HttpMethod/HttpMethod.vue.js";
3
- import { ScalarModal as I, ScalarTextField as B, ScalarButton as h } from "@scalar/components";
4
- import { useToasts as E } from "@scalar/use-toasts";
5
- const M = { class: "border flex flex-row gap-2 h-10 items-center my-4 p-[3px] rounded text-sm" }, T = { class: "flex h-full" }, U = { class: "scroll-timeline-x whitespace-nowrap" }, j = { class: "flex gap-10 justify-between" }, L = /* @__PURE__ */ g({
1
+ import { defineComponent as _, ref as g, computed as N, watch as V, openBlock as k, createBlock as R, unref as s, withCtx as n, createVNode as r, withKeys as S, createElementVNode as l, toDisplayString as x, createTextVNode as h } from "vue";
2
+ import I from "../HttpMethod/HttpMethod.vue.js";
3
+ import { ScalarModal as B, ScalarTextField as E, ScalarButton as v } from "@scalar/components";
4
+ import { useToasts as M } from "@scalar/use-toasts";
5
+ const T = { class: "border flex flex-row gap-2 h-10 items-center my-4 p-[3px] rounded text-sm" }, K = { class: "flex h-full" }, U = { class: "scroll-timeline-x whitespace-nowrap" }, j = { class: "flex gap-10 justify-between" }, L = /* @__PURE__ */ _({
6
6
  __name: "ImportCurlModal",
7
7
  props: {
8
8
  parsedCurl: {},
9
9
  state: {}
10
10
  },
11
11
  emits: ["importCurl", "close"],
12
- setup(v, { emit: q }) {
13
- const t = v, u = q, { toast: b } = E(), o = y(""), i = N(() => !o.value.trim());
14
- function w() {
12
+ setup(q, { emit: w }) {
13
+ const t = q, u = w, { toast: y } = M(), o = g(""), i = N(() => !o.value.trim());
14
+ function p() {
15
15
  if (i.value) {
16
- b("Please enter a name before importing your request.", "error");
16
+ y("Please enter a name before importing your request.", "error");
17
17
  return;
18
18
  }
19
- _();
19
+ b();
20
20
  }
21
- function _() {
21
+ function b() {
22
22
  t.parsedCurl && u("importCurl", {
23
23
  parsedCurl: t.parsedCurl,
24
24
  requestName: o.value
@@ -29,50 +29,51 @@ const M = { class: "border flex flex-row gap-2 h-10 items-center my-4 p-[3px] ro
29
29
  (a) => {
30
30
  a && (o.value = "");
31
31
  }
32
- ), (a, e) => (k(), R(s(I), {
32
+ ), (a, e) => (k(), R(s(B), {
33
33
  size: "xs",
34
34
  state: a.state,
35
35
  title: "Import cURL request"
36
36
  }, {
37
37
  default: n(() => {
38
- var p, d, m, c;
38
+ var d, m, c, f;
39
39
  return [
40
- r(s(B), {
40
+ r(s(E), {
41
41
  modelValue: o.value,
42
- "onUpdate:modelValue": e[0] || (e[0] = (f) => o.value = f),
42
+ "onUpdate:modelValue": e[0] || (e[0] = (C) => o.value = C),
43
43
  autofocus: "",
44
- placeholder: "Request Name"
44
+ placeholder: "Request Name",
45
+ onKeyup: S(p, ["enter"])
45
46
  }, null, 8, ["modelValue"]),
46
- l("div", M, [
47
- l("div", T, [
48
- r(S, {
47
+ l("div", T, [
48
+ l("div", K, [
49
+ r(I, {
49
50
  isEditable: !1,
50
51
  isSquare: "",
51
- method: ((p = t.parsedCurl) == null ? void 0 : p.method) || "get"
52
+ method: ((d = t.parsedCurl) == null ? void 0 : d.method) || "get"
52
53
  }, null, 8, ["method"])
53
54
  ]),
54
- l("span", U, C(((m = (d = t.parsedCurl) == null ? void 0 : d.servers) == null ? void 0 : m[0]) || "") + C(((c = t.parsedCurl) == null ? void 0 : c.path) || ""), 1)
55
+ l("span", U, x(((c = (m = t.parsedCurl) == null ? void 0 : m.servers) == null ? void 0 : c[0]) || "") + x(((f = t.parsedCurl) == null ? void 0 : f.path) || ""), 1)
55
56
  ]),
56
57
  l("div", j, [
57
- r(s(h), {
58
+ r(s(v), {
58
59
  class: "gap-1.5 px-2.5 h-8 shadow-none focus:outline-none flex items-center cursor-pointer",
59
60
  type: "button",
60
61
  variant: "outlined",
61
- onClick: e[1] || (e[1] = (f) => u("close"))
62
+ onClick: e[1] || (e[1] = (C) => u("close"))
62
63
  }, {
63
64
  default: n(() => e[2] || (e[2] = [
64
- x(" Cancel ")
65
+ h(" Cancel ")
65
66
  ])),
66
67
  _: 1
67
68
  }),
68
- r(s(h), {
69
+ r(s(v), {
69
70
  class: "gap-1.5 font-medium px-2.5 h-8 shadow-none focus:outline-none",
70
71
  disabled: i.value,
71
72
  type: "submit",
72
- onClick: w
73
+ onClick: p
73
74
  }, {
74
75
  default: n(() => e[3] || (e[3] = [
75
- x(" Import Request ")
76
+ h(" Import Request ")
76
77
  ])),
77
78
  _: 1
78
79
  }, 8, ["disabled"])
@@ -1,7 +1,7 @@
1
1
  import { defineComponent as i, openBlock as c, createBlock as r, unref as t, withCtx as l, createElementVNode as e, createVNode as n } from "vue";
2
2
  import { ScalarDropdown as d, ScalarDropdownItem as o, ScalarIcon as a } from "@scalar/components";
3
3
  const p = {
4
- class: "min-w-[37px] max-w-[37px] hover:bg-b-3 flex items-center justify-center rounded-lg p-[7px] text-c-3 focus:text-c-1 scalar-app-nav-padding",
4
+ class: "min-w-[37px] max-w-[37px] hover:bg-b-2 flex items-center justify-center rounded-lg p-[8px] text-c-3 focus:text-c-1 scalar-app-nav-padding",
5
5
  type: "button"
6
6
  }, u = {
7
7
  class: "no-underline block",
@@ -1 +1 @@
1
- {"version":3,"file":"SideNav.vue.d.ts","sourceRoot":"","sources":["../../../src/components/SideNav/SideNav.vue"],"names":[],"mappings":";AAkLA,wBAKG"}
1
+ {"version":3,"file":"SideNav.vue.d.ts","sourceRoot":"","sources":["../../../src/components/SideNav/SideNav.vue"],"names":[],"mappings":";AAmLA,wBAKG"}
@@ -1,7 +1,7 @@
1
1
  import o from "./SideNav.vue2.js";
2
2
  /* empty css */
3
3
  import t from "../../_virtual/_plugin-vue_export-helper.js";
4
- const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-a00979e0"]]);
4
+ const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-26a2bed3"]]);
5
5
  export {
6
6
  m as default
7
7
  };