@scalar/api-client 2.1.16 → 2.1.18

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 (71) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/dist/components/AddressBar/AddressBar.vue.d.ts.map +1 -1
  3. package/dist/components/AddressBar/AddressBar.vue.js +2 -2
  4. package/dist/components/AddressBar/AddressBar.vue2.js +67 -66
  5. package/dist/components/CommandPalette/CommandActionForm.vue.d.ts +3 -0
  6. package/dist/components/CommandPalette/CommandActionForm.vue.d.ts.map +1 -1
  7. package/dist/components/CommandPalette/CommandActionForm.vue.js +13 -11
  8. package/dist/components/CommandPalette/CommandActionInput.vue.d.ts +0 -2
  9. package/dist/components/CommandPalette/CommandActionInput.vue.d.ts.map +1 -1
  10. package/dist/components/CommandPalette/CommandActionInput.vue.js +36 -38
  11. package/dist/components/CommandPalette/CommandPaletteImport.vue.d.ts.map +1 -1
  12. package/dist/components/CommandPalette/CommandPaletteImport.vue.js +100 -80
  13. package/dist/components/CommandPalette/TheCommandPalette.vue.js +1 -1
  14. package/dist/components/CommandPalette/TheCommandPalette.vue2.js +24 -24
  15. package/dist/components/ContextBar.vue.js +2 -2
  16. package/dist/components/EnvironmentSelector/EnvironmentSelector.vue.js +2 -2
  17. package/dist/components/SideNav/SideNav.vue.js +2 -2
  18. package/dist/components/SideNav/SideNav.vue2.js +1 -1
  19. package/dist/components/TopNav/TopNav.vue.js +2 -2
  20. package/dist/components/TopNav/TopNav.vue2.js +11 -11
  21. package/dist/components/ViewLayout/ViewLayoutCollapse.vue.js +1 -1
  22. package/dist/layouts/App/ApiClientApp.vue.d.ts.map +1 -1
  23. package/dist/layouts/App/ApiClientApp.vue.js +36 -40
  24. package/dist/layouts/App/hotkeys.d.ts +6 -0
  25. package/dist/layouts/App/hotkeys.d.ts.map +1 -0
  26. package/dist/layouts/App/hotkeys.js +21 -0
  27. package/dist/layouts/Web/ApiClientWeb.vue.d.ts +3 -0
  28. package/dist/layouts/Web/ApiClientWeb.vue.d.ts.map +1 -0
  29. package/dist/layouts/Web/ApiClientWeb.vue.js +54 -0
  30. package/dist/layouts/Web/ApiClientWeb.vue3.js +5 -0
  31. package/dist/layouts/Web/create-api-client-web.d.ts +3593 -0
  32. package/dist/layouts/Web/create-api-client-web.d.ts.map +1 -0
  33. package/dist/layouts/Web/create-api-client-web.js +18 -0
  34. package/dist/layouts/Web/index.d.ts +3 -0
  35. package/dist/layouts/Web/index.d.ts.map +1 -0
  36. package/dist/layouts/Web/index.js +7 -0
  37. package/dist/libs/event-busses/hot-keys-bus.d.ts +0 -1
  38. package/dist/libs/event-busses/hot-keys-bus.d.ts.map +1 -1
  39. package/dist/libs/event-busses/hot-keys-bus.js +19 -35
  40. package/dist/libs/extractAttachmentFilename.d.ts +2 -0
  41. package/dist/libs/extractAttachmentFilename.d.ts.map +1 -0
  42. package/dist/libs/extractAttachmentFilename.js +20 -0
  43. package/dist/libs/getOpenApiDocumentDetails.d.ts +10 -0
  44. package/dist/libs/getOpenApiDocumentDetails.d.ts.map +1 -0
  45. package/dist/libs/getOpenApiDocumentDetails.js +40 -0
  46. package/dist/libs/index.d.ts +1 -2
  47. package/dist/libs/index.d.ts.map +1 -1
  48. package/dist/libs/index.js +21 -23
  49. package/dist/libs/isUrl.d.ts +1 -1
  50. package/dist/libs/isUrl.d.ts.map +1 -1
  51. package/dist/libs/isUrl.js +4 -3
  52. package/dist/store/import-spec.d.ts.map +1 -1
  53. package/dist/store/import-spec.js +21 -26
  54. package/dist/style.css +1 -1
  55. package/dist/views/Request/RequestSection/RequestSection.vue.js +1 -1
  56. package/dist/views/Request/RequestSubpageHeader.vue.js +3 -3
  57. package/dist/views/Request/RequestSubpageHeader.vue2.js +2 -2
  58. package/dist/views/Request/ResponseSection/ResponseBody.vue.d.ts.map +1 -1
  59. package/dist/views/Request/ResponseSection/ResponseBody.vue.js +63 -55
  60. package/dist/views/Request/ResponseSection/ResponseBodyDownload.vue.d.ts +2 -0
  61. package/dist/views/Request/ResponseSection/ResponseBodyDownload.vue.d.ts.map +1 -1
  62. package/dist/views/Request/ResponseSection/ResponseBodyDownload.vue.js +14 -14
  63. package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
  64. package/dist/views/Request/components/WorkspaceDropdown.vue.js +2 -2
  65. package/package.json +10 -6
  66. package/dist/libs/getOpenApiDocumentVersion.d.ts +0 -8
  67. package/dist/libs/getOpenApiDocumentVersion.d.ts.map +0 -1
  68. package/dist/libs/getOpenApiDocumentVersion.js +0 -20
  69. package/dist/libs/isDocument.d.ts +0 -3
  70. package/dist/libs/isDocument.d.ts.map +0 -1
  71. package/dist/libs/isDocument.js +0 -7
@@ -1,76 +1,83 @@
1
- import { defineComponent as V, ref as _, openBlock as s, createBlock as u, withCtx as l, createVNode as p, unref as r, createTextVNode as d, createElementBlock as h, Fragment as A, createCommentVNode as O } from "vue";
2
- import { ScalarButton as x, ScalarIcon as P, ScalarCodeBlock as B } from "@scalar/components";
3
- import { useToasts as $ } from "@scalar/use-toasts";
4
- import N from "./CommandActionForm.vue.js";
5
- import T from "./CommandActionInput.vue.js";
6
- import { useFileDialog as L } from "../../hooks/useFileDialog.js";
7
- import { getOpenApiDocumentVersion as f } from "../../libs/getOpenApiDocumentVersion.js";
8
- import { isUrl as v } from "../../libs/isUrl.js";
9
- import { isDocument as M } from "../../libs/isDocument.js";
10
- import { useWorkspace as R } from "../../store/store.js";
11
- const X = /* @__PURE__ */ V({
1
+ import { defineComponent as O, ref as P, computed as v, openBlock as l, createBlock as k, unref as n, withCtx as p, createVNode as y, createTextVNode as s, createElementBlock as c, Fragment as u, toDisplayString as _, createElementVNode as w, createCommentVNode as $ } from "vue";
2
+ import { useLoadingState as R, ScalarButton as h, ScalarIcon as T, ScalarCodeBlock as j } from "@scalar/components";
3
+ import { useToasts as M } from "@scalar/use-toasts";
4
+ import z from "./CommandActionForm.vue.js";
5
+ import E from "./CommandActionInput.vue.js";
6
+ import { getOpenApiDocumentDetails as W } from "../../libs/getOpenApiDocumentDetails.js";
7
+ import { isUrl as x } from "../../libs/isUrl.js";
8
+ import { useFileDialog as J } from "../../hooks/useFileDialog.js";
9
+ import { useWorkspace as Y } from "../../store/store.js";
10
+ const q = { class: "flex justify-between" }, G = /* @__PURE__ */ w("div", { class: "pl-8 text-xs min-h-8 py-2 text-c-2" }, "Preview", -1), ne = /* @__PURE__ */ O({
12
11
  __name: "CommandPaletteImport",
13
12
  emits: ["close", "back"],
14
- setup(j, { emit: b }) {
15
- const m = b, { activeWorkspace: c, importSpecFile: g, importSpecFromUrl: C } = R(), { toast: n } = $(), e = _(""), { open: y } = L({
13
+ setup(H, { emit: U }) {
14
+ const f = U, { activeWorkspace: g, importSpecFile: b, importSpecFromUrl: D } = Y(), { toast: m } = M(), i = R(), e = P(""), o = v(
15
+ () => W(e.value)
16
+ ), C = v(
17
+ () => o.value ? o.value.type : "json"
18
+ ), S = v(() => x(e.value)), F = v(() => !!o.value), { open: L } = J({
16
19
  onChange: async (a) => {
17
- const o = a == null ? void 0 : a[0];
18
- if (o) {
19
- const t = new FileReader();
20
- t.onload = async (w) => {
21
- var k;
22
- const F = (k = w.target) == null ? void 0 : k.result;
20
+ const t = a == null ? void 0 : a[0];
21
+ if (t) {
22
+ const r = new FileReader();
23
+ r.onload = async (A) => {
24
+ var I;
25
+ const B = (I = A.target) == null ? void 0 : I.result;
23
26
  try {
24
- await g(F, c.value.uid), n("Import successful", "info"), m("close");
25
- } catch (i) {
26
- console.error(i);
27
- const U = (i == null ? void 0 : i.message) || "Unknown error";
28
- n(`Import failed: ${U}`, "error");
27
+ await b(B, g.value.uid), m("Import successful", "info"), f("close");
28
+ } catch (d) {
29
+ console.error(d);
30
+ const N = (d == null ? void 0 : d.message) || "Unknown error";
31
+ m(`Import failed: ${N}`, "error");
29
32
  }
30
- }, t.readAsText(o);
33
+ }, r.readAsText(t);
31
34
  }
32
35
  },
33
36
  multiple: !1,
34
37
  accept: ".json,.yaml,.yml"
35
38
  });
36
- async function I() {
37
- try {
38
- e.value && (v(e.value) ? await C(
39
- e.value,
40
- void 0,
41
- void 0,
42
- c.value.uid
43
- ) : M(e.value) ? await g(
44
- String(e.value),
45
- c.value.uid
46
- ) : n("Import failed: Invalid URL or OpenAPI document", "error")), m("close"), n("Import successful", "info");
47
- } catch (a) {
48
- console.error("[importCollection]", a);
49
- const o = (a == null ? void 0 : a.message) || "Unknown error";
50
- n(`Import failed: ${o}`, "error");
39
+ async function V() {
40
+ if (!(!e.value || i.isLoading)) {
41
+ i.startLoading();
42
+ try {
43
+ if (S.value)
44
+ await D(
45
+ e.value,
46
+ void 0,
47
+ void 0,
48
+ g.value.uid
49
+ );
50
+ else if (F.value)
51
+ await b(
52
+ String(e.value),
53
+ g.value.uid
54
+ );
55
+ else {
56
+ m("Import failed: Invalid URL or OpenAPI document", "error"), i.invalidate(2e3, !0);
57
+ return;
58
+ }
59
+ i.clear(), f("close"), m("Import successful", "info");
60
+ } catch (a) {
61
+ console.error("[importCollection]", a);
62
+ const t = (a == null ? void 0 : a.message) || "Unknown error";
63
+ i.invalidate(2e3, !0), m(`Import failed: ${t}`, "error");
64
+ }
51
65
  }
52
66
  }
53
- function S() {
54
- return (f(e.value) || {}).type ?? "json";
55
- }
56
- function D(a) {
57
- var t;
58
- const o = (t = a.clipboardData) == null ? void 0 : t.getData("text");
59
- o && (e.value = o);
60
- }
61
- return (a, o) => (s(), u(N, {
67
+ return (a, t) => (l(), k(z, {
62
68
  disabled: !e.value.trim(),
63
- onSubmit: I
69
+ loading: n(i),
70
+ onSubmit: V
64
71
  }, {
65
- options: l(() => [
66
- p(r(x), {
72
+ options: p(() => [
73
+ y(n(h), {
67
74
  class: "p-2 max-h-8 gap-1.5 text-xs hover:bg-b-2 relative",
68
75
  variant: "outlined",
69
- onClick: r(y)
76
+ onClick: n(L)
70
77
  }, {
71
- default: l(() => [
72
- d(" JSON, or YAML File "),
73
- p(r(P), {
78
+ default: p(() => [
79
+ s(" JSON, or YAML File "),
80
+ y(n(T), {
74
81
  class: "text-c-3",
75
82
  icon: "UploadSimple",
76
83
  size: "md"
@@ -79,41 +86,54 @@ const X = /* @__PURE__ */ V({
79
86
  _: 1
80
87
  }, 8, ["onClick"])
81
88
  ]),
82
- submit: l(() => [
83
- d("Import Collection")
89
+ submit: p(() => [
90
+ s(" Import "),
91
+ S.value ? (l(), c(u, { key: 0 }, [
92
+ s(" from URL ")
93
+ ], 64)) : o.value && C.value ? (l(), c(u, { key: 1 }, [
94
+ o.value.title ? (l(), c(u, { key: 0 }, [
95
+ s(' "' + _(o.value.title) + '" ', 1)
96
+ ], 64)) : (l(), c(u, { key: 1 }, [
97
+ s(_(o.value.version) + " Spec", 1)
98
+ ], 64))
99
+ ], 64)) : (l(), c(u, { key: 2 }, [
100
+ s("Collection")
101
+ ], 64))
84
102
  ]),
85
- default: l(() => [
86
- !r(f)(e.value) || r(v)(e.value) ? (s(), u(T, {
103
+ default: p(() => [
104
+ !o.value || n(x)(e.value) ? (l(), k(E, {
87
105
  key: 0,
88
106
  modelValue: e.value,
89
- "onUpdate:modelValue": o[0] || (o[0] = (t) => e.value = t),
107
+ "onUpdate:modelValue": t[0] || (t[0] = (r) => e.value = r),
90
108
  placeholder: "Paste Swagger/OpenAPI File URL or content",
91
- onOnDelete: o[1] || (o[1] = (t) => m("back", t)),
92
- onPaste: o[2] || (o[2] = (t) => D(t))
93
- }, null, 8, ["modelValue"])) : (s(), h(A, { key: 1 }, [
94
- p(r(x), {
95
- class: "ml-auto p-2 max-h-8 gap-1.5 text-xs hover:bg-b-2 relative",
96
- variant: "ghost",
97
- onClick: o[3] || (o[3] = (t) => e.value = "")
98
- }, {
99
- default: l(() => [
100
- d(" Clear ")
101
- ]),
102
- _: 1
103
- }),
104
- r(f)(e.value) && !r(v)(e.value) ? (s(), u(r(B), {
109
+ onOnDelete: t[1] || (t[1] = (r) => f("back", r))
110
+ }, null, 8, ["modelValue"])) : (l(), c(u, { key: 1 }, [
111
+ w("div", q, [
112
+ G,
113
+ y(n(h), {
114
+ class: "ml-auto p-2 max-h-8 gap-1.5 text-xs hover:bg-b-2 relative",
115
+ variant: "ghost",
116
+ onClick: t[2] || (t[2] = (r) => e.value = "")
117
+ }, {
118
+ default: p(() => [
119
+ s(" Clear ")
120
+ ]),
121
+ _: 1
122
+ })
123
+ ]),
124
+ o.value && !n(x)(e.value) ? (l(), k(n(j), {
105
125
  key: 0,
106
- class: "bg-backdropdark border max-h-[25dvh] mt-2 rounded",
126
+ class: "border max-h-[40dvh] mt-1 bg-b-2 rounded [--scalar-small:--scalar-font-size-4]",
107
127
  content: e.value,
108
128
  copy: !1,
109
- lang: S()
110
- }, null, 8, ["content", "lang"])) : O("", !0)
129
+ lang: C.value
130
+ }, null, 8, ["content", "lang"])) : $("", !0)
111
131
  ], 64))
112
132
  ]),
113
133
  _: 1
114
- }, 8, ["disabled"]));
134
+ }, 8, ["disabled", "loading"]));
115
135
  }
116
136
  });
117
137
  export {
118
- X as default
138
+ ne as default
119
139
  };
@@ -2,7 +2,7 @@ import o from "./TheCommandPalette.vue2.js";
2
2
  import { PaletteComponents as s } from "./TheCommandPalette.vue2.js";
3
3
  /* empty css */
4
4
  import t from "../../_virtual/_plugin-vue_export-helper.js";
5
- const a = /* @__PURE__ */ t(o, [["__scopeId", "data-v-c08d90be"]]);
5
+ const a = /* @__PURE__ */ t(o, [["__scopeId", "data-v-272ef6cf"]]);
6
6
  export {
7
7
  s as PaletteComponents,
8
8
  a as default
@@ -1,5 +1,5 @@
1
- import { defineComponent as F, ref as u, computed as P, watch as U, onMounted as G, onBeforeUnmount as Q, openBlock as a, createElementBlock as r, Fragment as d, withDirectives as h, createElementVNode as m, vShow as w, unref as f, createVNode as y, withKeys as g, withModifiers as S, vModelText as j, renderList as K, toDisplayString as M, normalizeClass as J, createTextVNode as O, createCommentVNode as X, createBlock as Y, resolveDynamicComponent as Z, mergeProps as ee, nextTick as T } from "vue";
2
- import { useModal as oe, ScalarIcon as $ } from "@scalar/components";
1
+ import { defineComponent as F, ref as u, computed as P, watch as U, onMounted as G, onBeforeUnmount as Q, openBlock as a, createElementBlock as r, Fragment as d, withDirectives as h, createElementVNode as m, vShow as w, unref as f, createVNode as y, withKeys as g, withModifiers as $, vModelText as j, renderList as K, toDisplayString as M, normalizeClass as J, createTextVNode as O, createCommentVNode as X, createBlock as Y, resolveDynamicComponent as Z, mergeProps as ee, nextTick as T } from "vue";
2
+ import { useModal as oe, ScalarIcon as S } from "@scalar/components";
3
3
  import { useRouter as te } from "vue-router";
4
4
  import ne from "./CommandPaletteCollection.vue.js";
5
5
  import ae from "./CommandPaletteExample.vue.js";
@@ -29,7 +29,7 @@ const ue = { class: "commandmenu custom-scroll" }, de = { class: "bg-b-2 flex it
29
29
  setup(be) {
30
30
  const A = [
31
31
  {
32
- label: "Add to Request Sidebar",
32
+ label: "",
33
33
  commands: [
34
34
  {
35
35
  name: "Create Request",
@@ -76,7 +76,7 @@ const ue = { class: "commandmenu custom-scroll" }, de = { class: "bg-b-2 flex it
76
76
  }
77
77
  ]
78
78
  }
79
- ], c = oe(), { push: z } = te(), { activeWorkspace: N } = ie(), k = u(), l = u(""), s = u(null), i = u(-1), R = u([]), p = P(
79
+ ], c = oe(), { push: z } = te(), { activeWorkspace: N } = ie(), k = u(), l = u(""), s = u(null), i = u(-1), D = u([]), p = P(
80
80
  () => A.reduce((e, o) => {
81
81
  const t = o.commands.filter(
82
82
  (n) => n.name.toLowerCase().includes(l.value.toLowerCase())
@@ -85,14 +85,14 @@ const ue = { class: "commandmenu custom-scroll" }, de = { class: "bg-b-2 flex it
85
85
  }, [])
86
86
  ), v = () => {
87
87
  c.hide(), l.value = "", s.value = null, i.value = -1;
88
- }, q = (e) => {
88
+ }, H = (e) => {
89
89
  l.value !== "" && (e == null || e.preventDefault()), s.value = null, T(() => {
90
90
  var o;
91
91
  return (o = b.value) == null ? void 0 : o.focus();
92
92
  });
93
- }, D = (e) => {
93
+ }, L = (e) => {
94
94
  "path" in e ? (z(`/workspace/${N.value.uid}${e.path}`), v()) : s.value = e.name;
95
- }, b = u(), L = ({
95
+ }, b = u(), R = ({
96
96
  commandName: e,
97
97
  metaData: o
98
98
  } = {}) => {
@@ -109,21 +109,21 @@ const ue = { class: "commandmenu custom-scroll" }, de = { class: "bg-b-2 flex it
109
109
  if (!c.open) return;
110
110
  o.preventDefault();
111
111
  const t = e === "up" ? -1 : 1, n = p.value.length;
112
- i.value = (i.value + t + n) % n, (C = R.value[i.value]) == null || C.scrollIntoView({
112
+ i.value = (i.value + t + n) % n, (C = D.value[i.value]) == null || C.scrollIntoView({
113
113
  behavior: "smooth",
114
114
  block: "nearest"
115
115
  });
116
116
  }, x = P(
117
117
  () => p.value[i.value]
118
- ), H = (e) => {
119
- !x.value || s.value || (e.preventDefault(), e.stopPropagation(), D(x.value));
118
+ ), q = (e) => {
119
+ !x.value || s.value || (e.preventDefault(), e.stopPropagation(), L(x.value));
120
120
  }, E = (e) => {
121
121
  c.open && e.closeModal && v();
122
122
  };
123
123
  return G(() => {
124
- V.on(L), W.on(E);
124
+ V.on(R), W.on(E);
125
125
  }), Q(() => {
126
- V.off(L), W.off(E);
126
+ V.off(R), W.off(E);
127
127
  }), (e, o) => (a(), r(d, null, [
128
128
  h(m("div", {
129
129
  class: "commandmenu-clickout",
@@ -138,23 +138,23 @@ const ue = { class: "commandmenu custom-scroll" }, de = { class: "bg-b-2 flex it
138
138
  type: "button",
139
139
  onClick: o[4] || (o[4] = (t) => s.value = null)
140
140
  }, [
141
- y(f($), {
141
+ y(f(S), {
142
142
  icon: "ChevronLeft",
143
143
  size: "md",
144
144
  thickness: "1.5"
145
145
  })
146
146
  ]),
147
147
  (a(), Y(Z(ke[s.value]), ee(k.value ? { metaData: k.value } : {}, {
148
- onBack: o[5] || (o[5] = (t) => q(t)),
148
+ onBack: o[5] || (o[5] = (t) => H(t)),
149
149
  onClose: v
150
150
  }), null, 16))
151
151
  ], 64)) : (a(), r(d, { key: 0 }, [
152
152
  m("div", de, [
153
153
  m("label", fe, [
154
- y(f($), {
155
- class: "text-c-1 mr-2.5",
154
+ y(f(S), {
155
+ class: "text-c-2 mr-2.5",
156
156
  icon: "Search",
157
- size: "sm",
157
+ size: "md",
158
158
  thickness: "1.5"
159
159
  })
160
160
  ]),
@@ -169,9 +169,9 @@ const ue = { class: "commandmenu custom-scroll" }, de = { class: "bg-b-2 flex it
169
169
  placeholder: "Search commands...",
170
170
  type: "text",
171
171
  onKeydown: [
172
- o[2] || (o[2] = g(S((t) => B("down", t), ["stop"]), ["down"])),
173
- g(S(H, ["stop"]), ["enter"]),
174
- o[3] || (o[3] = g(S((t) => B("up", t), ["stop"]), ["up"]))
172
+ o[2] || (o[2] = g($((t) => B("down", t), ["stop"]), ["down"])),
173
+ g($(q, ["stop"]), ["enter"]),
174
+ o[3] || (o[3] = g($((t) => B("up", t), ["stop"]), ["up"]))
175
175
  ]
176
176
  }, null, 40, pe), [
177
177
  [j, l.value]
@@ -196,15 +196,15 @@ const ue = { class: "commandmenu custom-scroll" }, de = { class: "bg-b-2 flex it
196
196
  key: n.name,
197
197
  ref_for: !0,
198
198
  ref: (_) => {
199
- _ && (R.value[C] = _);
199
+ _ && (D.value[C] = _);
200
200
  },
201
201
  class: J(["commandmenu-item text-sm flex items-center py-1.5 px-2 rounded hover:bg-b-2 cursor-pointer", {
202
202
  "bg-b-2": n.name === ((I = x.value) == null ? void 0 : I.name)
203
203
  }]),
204
- onClick: (_) => D(n)
204
+ onClick: (_) => L(n)
205
205
  }, [
206
- y(f($), {
207
- class: "text-c-1 mr-2.5",
206
+ y(f(S), {
207
+ class: "text-c-2 mr-2.5",
208
208
  icon: n.icon,
209
209
  size: "md",
210
210
  thickness: "1.5"
@@ -1,7 +1,7 @@
1
1
  import o from "./ContextBar.vue2.js";
2
2
  /* empty css */
3
3
  import t from "../_virtual/_plugin-vue_export-helper.js";
4
- const p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-59badb72"]]);
4
+ const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-ba672e06"]]);
5
5
  export {
6
- p as default
6
+ m as default
7
7
  };
@@ -94,9 +94,9 @@ const W = { class: "font-medium m-0 text-sm flex gap-1.5 items-center" }, $ = {
94
94
  r("h2", W, [
95
95
  l(k(((t = e(_)) == null ? void 0 : t.name) ?? "No Environment") + " ", 1),
96
96
  n(e(c), {
97
- class: "size-2.5",
97
+ class: "size-3",
98
98
  icon: "ChevronDown",
99
- thickness: "3.5"
99
+ thickness: "3"
100
100
  })
101
101
  ])
102
102
  ];
@@ -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 p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-34c56294"]]);
4
+ const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-985878af"]]);
5
5
  export {
6
- p as default
6
+ m as default
7
7
  };
@@ -8,7 +8,7 @@ const b = {
8
8
  "aria-label": "Side Navigation",
9
9
  class: "text-c-2 w-15 flex flex-col items-center px-2 py-2 scalar-sidenav relative drag-region bg-b-1 border-t-1/2",
10
10
  role: "navigation"
11
- }, S = { class: "flex flex-col gap-1.5" }, k = { class: "mt-auto flex flex-col py-1.5" }, E = { class: "flex items-center no-drag-region" }, R = { class: "flex items-center no-drag-region" }, O = /* @__PURE__ */ _({
11
+ }, S = { class: "flex flex-col gap-1.5" }, k = { class: "mt-auto flex flex-col py-0.5" }, E = { class: "flex items-center no-drag-region" }, R = { class: "flex items-center no-drag-region" }, O = /* @__PURE__ */ _({
12
12
  __name: "SideNav",
13
13
  setup(V) {
14
14
  const { currentRoute: s } = v();
@@ -1,7 +1,7 @@
1
1
  import o from "./TopNav.vue2.js";
2
2
  /* empty css */
3
3
  import t from "../../_virtual/_plugin-vue_export-helper.js";
4
- const f = /* @__PURE__ */ t(o, [["__scopeId", "data-v-df123a3c"]]);
4
+ const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-9a66e94b"]]);
5
5
  export {
6
- f as default
6
+ m as default
7
7
  };
@@ -1,13 +1,13 @@
1
- import { defineComponent as z, reactive as A, ref as B, computed as M, watch as y, onMounted as j, onBeforeUnmount as E, openBlock as d, createElementBlock as g, createElementVNode as h, createVNode as n, unref as l, withCtx as u, toDisplayString as O, createTextVNode as C, Fragment as V, renderList as D, createBlock as q, pushScopeId as K, popScopeId as F } from "vue";
1
+ import { defineComponent as z, reactive as A, ref as B, computed as M, watch as y, onMounted as j, onBeforeUnmount as E, openBlock as d, createElementBlock as g, createElementVNode as f, createVNode as n, unref as l, withCtx as u, toDisplayString as O, createTextVNode as C, Fragment as V, renderList as D, createBlock as q, pushScopeId as K, popScopeId as F } from "vue";
2
2
  import H from "../ScalarHotkey.vue.js";
3
3
  import { ROUTES as W } from "../../constants.js";
4
4
  import { useClipboard as G } from "../../hooks/useClipboard.js";
5
- import { ScalarContextMenu as J, ScalarIcon as f, ScalarDropdown as P, ScalarDropdownItem as x } from "@scalar/components";
5
+ import { ScalarContextMenu as J, ScalarIcon as h, ScalarDropdown as P, ScalarDropdownItem as x } from "@scalar/components";
6
6
  import { capitalize as Q } from "@scalar/oas-utils/helpers";
7
7
  import X from "./TopNavItem.vue.js";
8
8
  import { useWorkspace as Y } from "../../store/store.js";
9
9
  import { hotKeyBus as I } from "../../libs/event-busses/hot-keys-bus.js";
10
- const Z = (s) => (K("data-v-df123a3c"), s = s(), F(), s), ee = { class: "flex h-10 t-app__top-nav" }, te = /* @__PURE__ */ Z(() => /* @__PURE__ */ h("div", { class: "t-app__top-nav-draggable" }, null, -1)), oe = { class: "flex h-10 flex-1 items-center gap-1.5 text-sm font-medium pr-1 relative overflow-hidden" }, ae = {
10
+ const Z = (s) => (K("data-v-9a66e94b"), s = s(), F(), s), ee = { class: "flex h-10 t-app__top-nav" }, te = /* @__PURE__ */ Z(() => /* @__PURE__ */ f("div", { class: "t-app__top-nav-draggable" }, null, -1)), oe = { class: "flex h-10 flex-1 items-center gap-1.5 text-sm font-medium pr-1 relative overflow-hidden" }, ae = {
11
11
  key: 0,
12
12
  class: "h-full w-full overflow-hidden"
13
13
  }, de = /* @__PURE__ */ z({
@@ -78,16 +78,16 @@ const Z = (s) => (K("data-v-df123a3c"), s = s(), F(), s), ee = { class: "flex h-
78
78
  { immediate: !0 }
79
79
  ), j(() => I.on(w)), E(() => I.off(w)), (e, a) => (d(), g("nav", ee, [
80
80
  te,
81
- h("div", oe, [
81
+ f("div", oe, [
82
82
  t.length === 1 ? (d(), g("div", ae, [
83
83
  n(l(J), { triggerClass: "flex custom-scroll gap-1.5 h-full items-center justify-center w-full whitespace-nowrap" }, {
84
84
  trigger: u(() => [
85
- n(l(f), {
85
+ n(l(h), {
86
86
  icon: t[0].icon,
87
87
  size: "xs",
88
88
  thickness: "2.5"
89
89
  }, null, 8, ["icon"]),
90
- h("span", null, O(t[0].label), 1)
90
+ f("span", null, O(t[0].label), 1)
91
91
  ]),
92
92
  content: u(() => [
93
93
  n(l(P), {
@@ -100,7 +100,7 @@ const Z = (s) => (K("data-v-df123a3c"), s = s(), F(), s), ee = { class: "flex h-
100
100
  onClick: m
101
101
  }, {
102
102
  default: u(() => [
103
- n(l(f), {
103
+ n(l(h), {
104
104
  icon: "AddTab",
105
105
  size: "sm",
106
106
  thickness: "1.5"
@@ -118,7 +118,7 @@ const Z = (s) => (K("data-v-df123a3c"), s = s(), F(), s), ee = { class: "flex h-
118
118
  onClick: a[0] || (a[0] = (p) => N(T.value))
119
119
  }, {
120
120
  default: u(() => [
121
- n(l(f), {
121
+ n(l(h), {
122
122
  icon: "Link",
123
123
  size: "sm",
124
124
  thickness: "1.5"
@@ -145,12 +145,12 @@ const Z = (s) => (K("data-v-df123a3c"), s = s(), F(), s), ee = { class: "flex h-
145
145
  onCopyUrl: (b) => N(c),
146
146
  onNewTab: m
147
147
  }, null, 8, ["active", "hotkey", "icon", "label", "onClick", "onClose", "onCloseOtherTabs", "onCopyUrl"]))), 128)),
148
- h("button", {
149
- class: "text-c-3 hover:bg-b-3 p-1.5 rounded-lg webkit-app-no-drag",
148
+ f("button", {
149
+ class: "text-c-3 hover:bg-b-3 p-1.5 rounded webkit-app-no-drag",
150
150
  type: "button",
151
151
  onClick: m
152
152
  }, [
153
- n(l(f), {
153
+ n(l(h), {
154
154
  icon: "Add",
155
155
  size: "xs",
156
156
  thickness: "2.5"
@@ -20,7 +20,7 @@ const x = { class: "flex flex-1 items-center gap-1.5 text-c-1" }, g = {
20
20
  defaultOpen: e.defaultOpen
21
21
  }, {
22
22
  default: n(({ open: t }) => [
23
- i(o(m), { class: "hover:text-c-1 group flex w-full items-center gap-1.5 overflow-hidden py-1.5 text-sm font-medium px-1.5" }, {
23
+ i(o(m), { class: "hover:text-c-1 group flex w-full items-center gap-2.5 overflow-hidden py-1.5 text-sm font-medium px-1.5" }, {
24
24
  default: n(() => [
25
25
  i(o(b), {
26
26
  class: "text-c-3 group-hover:text-c-1 ui-open:rotate-90 ui-not-open:rotate-0",
@@ -1 +1 @@
1
- {"version":3,"file":"ApiClientApp.vue.d.ts","sourceRoot":"","sources":["../../../src/layouts/App/ApiClientApp.vue"],"names":[],"mappings":";;cAyI8B,MAAM;aAAO,MAAM;;;;cAAnB,MAAM;aAAO,MAAM;;;AAuMjD,wBAMG"}
1
+ {"version":3,"file":"ApiClientApp.vue.d.ts","sourceRoot":"","sources":["../../../src/layouts/App/ApiClientApp.vue"],"names":[],"mappings":";;cA0I8B,MAAM;aAAO,MAAM;;;;cAAnB,MAAM;aAAO,MAAM;;;AAoMjD,wBAMG"}
@@ -1,65 +1,61 @@
1
- import { defineComponent as w, ref as _, onMounted as c, watchEffect as h, onBeforeMount as k, onBeforeUnmount as T, computed as y, openBlock as t, createElementBlock as i, Fragment as b, createElementVNode as d, createVNode as e, unref as n, withCtx as N, createBlock as p, KeepAlive as g, resolveDynamicComponent as x, createCommentVNode as C } from "vue";
2
- import S from "../../components/SideNav/SideNav.vue.js";
1
+ import { defineComponent as T, ref as _, onMounted as c, watchEffect as h, onBeforeMount as k, onBeforeUnmount as y, computed as b, openBlock as t, createElementBlock as i, Fragment as N, createElementVNode as d, createVNode as e, unref as n, withCtx as S, createBlock as p, KeepAlive as g, resolveDynamicComponent as x, createCommentVNode as E } from "vue";
2
+ import C from "../../components/SideNav/SideNav.vue.js";
3
3
  import L from "../../components/TopNav/TopNav.vue.js";
4
- import { addScalarClassesToHeadless as B } from "@scalar/components";
5
- import { getThemeStyles as D } from "@scalar/themes";
6
- import { ScalarToasts as E } from "@scalar/use-toasts";
7
- import { RouterView as M } from "vue-router";
8
- import H from "../../components/CommandPalette/TheCommandPalette.vue.js";
9
- import { useDarkModeState as V } from "../../hooks/useDarkModeState.js";
10
- import { useWorkspace as W } from "../../store/store.js";
11
- import { handleHotKeyDown as A } from "../../libs/event-busses/hot-keys-bus.js";
12
- const K = ["innerHTML"], z = {
4
+ import { addScalarClassesToHeadless as D } from "@scalar/components";
5
+ import { getThemeStyles as H } from "@scalar/themes";
6
+ import { ScalarToasts as K } from "@scalar/use-toasts";
7
+ import { RouterView as A } from "vue-router";
8
+ import { APP_HOTKEYS as B } from "./hotkeys.js";
9
+ import M from "../../components/CommandPalette/TheCommandPalette.vue.js";
10
+ import { DEFAULT_HOTKEYS as V, handleHotKeyDown as W } from "../../libs/event-busses/hot-keys-bus.js";
11
+ import { useDarkModeState as P } from "../../hooks/useDarkModeState.js";
12
+ import { useWorkspace as F } from "../../store/store.js";
13
+ const O = ["innerHTML"], U = {
13
14
  key: 0,
14
15
  class: "flex min-h-0 flex-1 z-0"
15
- }, F = { class: "flex flex-1 flex-col min-w-0 border-l-1/2 border-t-1/2" }, Z = /* @__PURE__ */ w({
16
+ }, Y = { class: "flex flex-1 flex-col min-w-0 border-l-1/2 border-t-1/2" }, ne = /* @__PURE__ */ T({
16
17
  __name: "ApiClientApp",
17
18
  emits: ["newTab"],
18
- setup(I) {
19
- const r = _(null), u = (o) => {
20
- r.value = o;
19
+ setup(z) {
20
+ const u = { ...V, ...B }, a = _(null), f = (o) => {
21
+ a.value = o;
21
22
  };
22
23
  c(() => {
23
24
  h(() => {
24
25
  document.body.classList.toggle("dark-mode", l.value), document.body.classList.toggle("light-mode", !l.value);
25
26
  });
26
27
  });
27
- const { isDark: l } = V(), a = W();
28
- k(async () => {
29
- B();
30
- });
31
- const s = (o) => A(o);
32
- c(() => window.addEventListener("keydown", s)), T(() => window.removeEventListener("keydown", s));
33
- const f = y(
34
- () => a.activeWorkspace.value && `<style>
35
- ${D(a.activeWorkspace.value.themeId, {
36
- fonts: !0
37
- })}</style>`
28
+ const { isDark: l } = P(), r = F();
29
+ k(() => D());
30
+ const s = (o) => W(o, { hotKeys: u });
31
+ c(() => window.addEventListener("keydown", s)), y(() => window.removeEventListener("keydown", s));
32
+ const v = b(
33
+ () => r.activeWorkspace.value && `<style>${H(r.activeWorkspace.value.themeId)}</style>`
38
34
  );
39
- return (o, P) => {
35
+ return (o, I) => {
40
36
  var m;
41
- return t(), i(b, null, [
42
- d("div", { innerHTML: f.value }, null, 8, K),
43
- e(L, { openNewTab: r.value }, null, 8, ["openNewTab"]),
44
- (m = n(a).activeWorkspace.value) != null && m.uid ? (t(), i("main", z, [
45
- e(S),
46
- e(n(H)),
47
- d("div", F, [
48
- e(n(M), { onNewTab: u }, {
49
- default: N(({ Component: v }) => [
37
+ return t(), i(N, null, [
38
+ d("div", { innerHTML: v.value }, null, 8, O),
39
+ e(L, { openNewTab: a.value }, null, 8, ["openNewTab"]),
40
+ (m = n(r).activeWorkspace.value) != null && m.uid ? (t(), i("main", U, [
41
+ e(C),
42
+ e(n(M)),
43
+ d("div", Y, [
44
+ e(n(A), { onNewTab: f }, {
45
+ default: S(({ Component: w }) => [
50
46
  (t(), p(g, null, [
51
- (t(), p(x(v)))
47
+ (t(), p(x(w)))
52
48
  ], 1024))
53
49
  ]),
54
50
  _: 1
55
51
  })
56
52
  ])
57
- ])) : C("", !0),
58
- e(n(E))
53
+ ])) : E("", !0),
54
+ e(n(K))
59
55
  ], 64);
60
56
  };
61
57
  }
62
58
  });
63
59
  export {
64
- Z as default
60
+ ne as default
65
61
  };
@@ -0,0 +1,6 @@
1
+ import type { HotKeyConfig } from '@scalar/oas-utils/entities/workspace';
2
+ /**
3
+ * Default set of keybindings for the client app
4
+ */
5
+ export declare const APP_HOTKEYS: HotKeyConfig;
6
+ //# sourceMappingURL=hotkeys.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hotkeys.d.ts","sourceRoot":"","sources":["../../../src/layouts/App/hotkeys.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sCAAsC,CAAA;AAExE;;GAEG;AACH,eAAO,MAAM,WAAW,EAAE,YAiBzB,CAAA"}