@scalar/api-client 2.0.57 → 2.0.58

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 (57) hide show
  1. package/CHANGELOG.md +18 -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 +61 -58
  5. package/dist/components/CommandPalette/CommandPaletteCollection.vue.d.ts.map +1 -1
  6. package/dist/components/CommandPalette/CommandPaletteCollection.vue.js +31 -25
  7. package/dist/components/CommandPalette/CommandPaletteExample.vue.d.ts.map +1 -1
  8. package/dist/components/CommandPalette/CommandPaletteExample.vue.js +51 -45
  9. package/dist/components/CommandPalette/CommandPaletteFolder.vue.d.ts.map +1 -1
  10. package/dist/components/CommandPalette/CommandPaletteFolder.vue.js +47 -41
  11. package/dist/components/CommandPalette/CommandPaletteImport.vue.d.ts.map +1 -1
  12. package/dist/components/CommandPalette/CommandPaletteImport.vue.js +56 -40
  13. package/dist/components/CommandPalette/CommandPaletteRequest.vue.d.ts.map +1 -1
  14. package/dist/components/CommandPalette/CommandPaletteRequest.vue.js +67 -61
  15. package/dist/components/CommandPalette/TheCommandPalette.vue.js +4 -4
  16. package/dist/components/CommandPalette/TheCommandPalette.vue2.js +30 -30
  17. package/dist/components/TopNav/TopNav.vue.d.ts +20 -1
  18. package/dist/components/TopNav/TopNav.vue.d.ts.map +1 -1
  19. package/dist/components/TopNav/TopNav.vue.js +2 -2
  20. package/dist/components/TopNav/TopNav.vue2.js +64 -49
  21. package/dist/layouts/App/ApiClientApp.vue.d.ts +11 -1
  22. package/dist/layouts/App/ApiClientApp.vue.d.ts.map +1 -1
  23. package/dist/layouts/App/ApiClientApp.vue.js +53 -49
  24. package/dist/libs/event-busses/cancel-request-bus.d.ts +2 -0
  25. package/dist/libs/event-busses/cancel-request-bus.d.ts.map +1 -0
  26. package/dist/libs/event-busses/cancel-request-bus.js +5 -0
  27. package/dist/libs/event-busses/hot-keys-bus.d.ts +3 -1
  28. package/dist/libs/event-busses/hot-keys-bus.d.ts.map +1 -1
  29. package/dist/libs/event-busses/hot-keys-bus.js +1 -0
  30. package/dist/libs/event-busses/index.d.ts +2 -1
  31. package/dist/libs/event-busses/index.d.ts.map +1 -1
  32. package/dist/libs/event-busses/index.js +11 -8
  33. package/dist/libs/index.js +21 -18
  34. package/dist/libs/local-storage.js +1 -1
  35. package/dist/libs/sendRequest.d.ts +2 -2
  36. package/dist/libs/sendRequest.d.ts.map +1 -1
  37. package/dist/libs/sendRequest.js +22 -21
  38. package/dist/store/workspace.d.ts.map +1 -1
  39. package/dist/store/workspace.js +100 -103
  40. package/dist/style.css +1 -1
  41. package/dist/views/Request/Request.vue.d.ts +11 -1
  42. package/dist/views/Request/Request.vue.d.ts.map +1 -1
  43. package/dist/views/Request/Request.vue.js +3 -3
  44. package/dist/views/Request/Request.vue2.js +184 -174
  45. package/dist/views/Request/RequestSidebarItem.vue.d.ts +2 -0
  46. package/dist/views/Request/RequestSidebarItem.vue.d.ts.map +1 -1
  47. package/dist/views/Request/RequestSidebarItem.vue.js +2 -2
  48. package/dist/views/Request/RequestSidebarItem.vue2.js +139 -130
  49. package/dist/views/Request/ResponseSection/ResponseLoadingOverlay.vue.d.ts +3 -0
  50. package/dist/views/Request/ResponseSection/ResponseLoadingOverlay.vue.d.ts.map +1 -0
  51. package/dist/views/Request/ResponseSection/ResponseLoadingOverlay.vue.js +7 -0
  52. package/dist/views/Request/ResponseSection/ResponseLoadingOverlay.vue2.js +39 -0
  53. package/dist/views/Request/ResponseSection/ResponseMetaInformation.vue.d.ts.map +1 -1
  54. package/dist/views/Request/ResponseSection/ResponseMetaInformation.vue.js +37 -30
  55. package/dist/views/Request/ResponseSection/ResponseSection.vue.d.ts.map +1 -1
  56. package/dist/views/Request/ResponseSection/ResponseSection.vue.js +23 -21
  57. package/package.json +7 -7
@@ -10,7 +10,7 @@ import ne from "./CommandPaletteRequest.vue.js";
10
10
  import ae from "./CommandPaletteWorkspace.vue.js";
11
11
  import { commandPaletteBus as W } from "../../libs/event-busses/command-palette-bus.js";
12
12
  import { hotKeyBus as z } from "../../libs/event-busses/hot-keys-bus.js";
13
- const le = { class: "commandmenu" }, se = { class: "bg-b-2 flex items-center rounded mb-2 pl-2 focus-within:bg-b-1 focus-within:shadow-border" }, re = { for: "commandmenu" }, ce = ["onClick"], me = {
13
+ const le = { class: "commandmenu" }, se = { class: "bg-b-2 flex items-center rounded mb-2 pl-2 focus-within:bg-b-1 focus-within:shadow-border" }, ce = { for: "commandmenu" }, re = ["onClick"], me = {
14
14
  key: 0,
15
15
  class: "text-c-3 text-center text-sm p-2 pt-3"
16
16
  }, ie = {
@@ -22,7 +22,7 @@ const le = { class: "commandmenu" }, se = { class: "bg-b-2 flex items-center rou
22
22
  "Add Folder": oe,
23
23
  "Create Collection": Z,
24
24
  "Add Example": ee
25
- }, Re = /* @__PURE__ */ F({
25
+ }, Se = /* @__PURE__ */ F({
26
26
  ...ie,
27
27
  setup(de) {
28
28
  const y = [
@@ -58,14 +58,14 @@ const le = { class: "commandmenu" }, se = { class: "bg-b-2 flex items-center rou
58
58
  name: "Create Workspace",
59
59
  icon: "Workspace"
60
60
  },
61
- {
62
- name: "Add Server",
63
- icon: "Brackets",
64
- path: "/servers"
65
- },
61
+ // {
62
+ // name: 'Add Server',
63
+ // icon: 'Server',
64
+ // path: '/servers',
65
+ // },
66
66
  {
67
67
  name: "Add Environment",
68
- icon: "Server",
68
+ icon: "Brackets",
69
69
  path: "/environment"
70
70
  },
71
71
  {
@@ -75,31 +75,31 @@ const le = { class: "commandmenu" }, se = { class: "bg-b-2 flex items-center rou
75
75
  }
76
76
  ]
77
77
  }
78
- ], r = O(), { push: M } = X(), { activeWorkspace: N } = Y(), S = i(), c = i(""), m = i(null), d = i(-1), R = i([]), C = E(
78
+ ], c = O(), { push: M } = X(), { activeWorkspace: N } = Y(), R = i(), r = i(""), m = i(null), d = i(-1), S = i([]), C = E(
79
79
  () => y.reduce((e, n) => {
80
80
  const o = n.commands.filter(
81
- (t) => t.name.toLowerCase().includes(c.value.toLowerCase())
81
+ (t) => t.name.toLowerCase().includes(r.value.toLowerCase())
82
82
  );
83
83
  return [...e, ...o];
84
84
  }, [])
85
85
  ), p = () => {
86
- r.hide(), c.value = "", m.value = null, d.value = -1;
86
+ c.hide(), r.value = "", m.value = null, d.value = -1;
87
87
  }, g = (e) => {
88
88
  "path" in e ? (M(`/workspace/${N.value.uid}${e.path}`), p()) : m.value = e.name;
89
- }, $ = i(), A = ({
89
+ }, $ = i(), D = ({
90
90
  commandName: e,
91
91
  metaData: n
92
92
  } = {}) => {
93
- m.value = e ?? null, S.value = n, r.show(), J(() => {
93
+ m.value = e ?? null, R.value = n, c.show(), J(() => {
94
94
  var o;
95
95
  return (o = $.value) == null ? void 0 : o.focus();
96
96
  });
97
- }, D = (e, n) => {
97
+ }, A = (e, n) => {
98
98
  var v;
99
- if (!r.open) return;
99
+ if (!c.open) return;
100
100
  n.preventDefault();
101
101
  const o = e === "up" ? -1 : 1, t = C.value.length;
102
- d.value = (d.value + o + t) % t, (v = R.value[d.value]) == null || v.scrollIntoView({
102
+ d.value = (d.value + o + t) % t, (v = S.value[d.value]) == null || v.scrollIntoView({
103
103
  behavior: "smooth",
104
104
  block: "center"
105
105
  });
@@ -108,18 +108,18 @@ const le = { class: "commandmenu" }, se = { class: "bg-b-2 flex items-center rou
108
108
  ), P = () => {
109
109
  k.value && g(k.value);
110
110
  }, L = (e) => {
111
- r.open && (e.closeModal && p(), e.navigateSearchResultsUp && D("up", e.navigateSearchResultsUp), e.navigateSearchResultsDown && D("down", e.navigateSearchResultsDown), e.selectSearchResult && P());
111
+ c.open && (e.closeModal && p(), e.navigateSearchResultsUp && A("up", e.navigateSearchResultsUp), e.navigateSearchResultsDown && A("down", e.navigateSearchResultsDown), e.selectSearchResult && P());
112
112
  };
113
113
  return T(() => {
114
- W.on(A), z.on(L);
114
+ W.on(D), z.on(L);
115
115
  }), U(() => {
116
- W.off(A), z.off(L);
116
+ W.off(D), z.off(L);
117
117
  }), (e, n) => (a(), l(u, null, [
118
118
  h(s("div", {
119
119
  class: "commandmenu-clickout",
120
120
  onClick: n[0] || (n[0] = (o) => p())
121
121
  }, null, 512), [
122
- [b, f(r).open]
122
+ [b, f(c).open]
123
123
  ]),
124
124
  h(s("div", le, [
125
125
  m.value ? (a(), l(u, { key: 1 }, [
@@ -135,12 +135,12 @@ const le = { class: "commandmenu" }, se = { class: "bg-b-2 flex items-center rou
135
135
  })
136
136
  ]),
137
137
  (a(), Q(j(ue[m.value]), {
138
- metaData: S.value,
138
+ metaData: R.value,
139
139
  onClose: p
140
140
  }, null, 40, ["metaData"]))
141
141
  ], 64)) : (a(), l(u, { key: 0 }, [
142
142
  s("div", se, [
143
- s("label", re, [
143
+ s("label", ce, [
144
144
  x(f(w), {
145
145
  class: "text-c-1 mr-2.5",
146
146
  icon: "Search",
@@ -152,14 +152,14 @@ const le = { class: "commandmenu" }, se = { class: "bg-b-2 flex items-center rou
152
152
  id: "commandmenu",
153
153
  ref_key: "commandInputRef",
154
154
  ref: $,
155
- "onUpdate:modelValue": n[1] || (n[1] = (o) => c.value = o),
155
+ "onUpdate:modelValue": n[1] || (n[1] = (o) => r.value = o),
156
156
  autocomplete: "off",
157
157
  autofocus: "",
158
158
  class: "w-full rounded bg-none border-none py-1.5 text-sm focus:outline-none",
159
159
  placeholder: "Search commands...",
160
160
  type: "text"
161
161
  }, null, 512), [
162
- [q, c.value]
162
+ [q, r.value]
163
163
  ])
164
164
  ]),
165
165
  (a(), l(u, null, I(y, (o) => (a(), l(u, {
@@ -169,19 +169,19 @@ const le = { class: "commandmenu" }, se = { class: "bg-b-2 flex items-center rou
169
169
  [
170
170
  b,
171
171
  o.commands.filter(
172
- (t) => t.name.toLowerCase().includes(c.value.toLowerCase())
172
+ (t) => t.name.toLowerCase().includes(r.value.toLowerCase())
173
173
  ).length > 0
174
174
  ]
175
175
  ]),
176
176
  (a(!0), l(u, null, I(o.commands.filter(
177
- (t) => t.name.toLowerCase().includes(c.value.toLowerCase())
177
+ (t) => t.name.toLowerCase().includes(r.value.toLowerCase())
178
178
  ), (t, v) => {
179
179
  var B;
180
180
  return a(), l("div", {
181
181
  key: t.name,
182
182
  ref_for: !0,
183
183
  ref: (_) => {
184
- _ && (R.value[v] = _);
184
+ _ && (S.value[v] = _);
185
185
  },
186
186
  class: K(["commandmenu-item text-sm flex items-center py-1.5 px-2 rounded hover:bg-b-2 cursor-pointer", {
187
187
  "bg-b-2": t.name === ((B = k.value) == null ? void 0 : B.name)
@@ -195,18 +195,18 @@ const le = { class: "commandmenu" }, se = { class: "bg-b-2 flex items-center rou
195
195
  thickness: "1.5"
196
196
  }, null, 8, ["icon"]),
197
197
  H(" " + V(t.name), 1)
198
- ], 10, ce);
198
+ ], 10, re);
199
199
  }), 128))
200
200
  ], 64))), 64)),
201
201
  C.value.length ? G("", !0) : (a(), l("div", me, " No commands found "))
202
202
  ], 64))
203
203
  ], 512), [
204
- [b, f(r).open]
204
+ [b, f(c).open]
205
205
  ])
206
206
  ], 64));
207
207
  }
208
208
  });
209
209
  export {
210
210
  ue as PaletteComponents,
211
- Re as default
211
+ Se as default
212
212
  };
@@ -1,3 +1,22 @@
1
- declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>;
1
+ declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<{
2
+ openNewTab: {
3
+ name: string;
4
+ uid: string;
5
+ } | null;
6
+ }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<{
7
+ openNewTab: {
8
+ name: string;
9
+ uid: string;
10
+ } | null;
11
+ }>>>, {}, {}>;
2
12
  export default _default;
13
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
14
+ type __VLS_TypePropsToOption<T> = {
15
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
16
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
17
+ } : {
18
+ type: import('vue').PropType<T[K]>;
19
+ required: true;
20
+ };
21
+ };
3
22
  //# sourceMappingURL=TopNav.vue.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"TopNav.vue.d.ts","sourceRoot":"","sources":["../../../src/components/TopNav/TopNav.vue"],"names":[],"mappings":";AAkfA,wBAKG"}
1
+ {"version":3,"file":"TopNav.vue.d.ts","sourceRoot":"","sources":["../../../src/components/TopNav/TopNav.vue"],"names":[],"mappings":";gBAoNc;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI;;gBAApC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI;;AAwUlD,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,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-dca235f9"]]);
4
+ const e = /* @__PURE__ */ t(o, [["__scopeId", "data-v-ec38eda3"]]);
5
5
  export {
6
- f as default
6
+ e as default
7
7
  };
@@ -1,44 +1,47 @@
1
- import { defineComponent as w, reactive as S, ref as U, watch as R, computed as j, onMounted as B, onBeforeUnmount as L, openBlock as s, createElementBlock as v, createElementVNode as u, createVNode as _, unref as g, toDisplayString as A, Fragment as M, renderList as O, createBlock as $, pushScopeId as z, popScopeId as E } from "vue";
2
- import { ROUTES as V } from "../../constants.js";
3
- import { useClipboard as q } from "../../hooks/useClipboard.js";
4
- import { ScalarIcon as T } from "@scalar/components";
5
- import { capitalize as K } from "@scalar/oas-utils/helpers";
6
- import D from "./TopNavItem.vue.js";
7
- import { useWorkspace as F } from "../../store/workspace.js";
8
- import { hotKeyBus as y } from "../../libs/event-busses/hot-keys-bus.js";
9
- const H = (i) => (z("data-v-dca235f9"), i = i(), E(), i), W = { class: "flex h-10 t-app__top-nav" }, G = /* @__PURE__ */ H(() => /* @__PURE__ */ u("div", { class: "t-app__top-nav-draggable" }, null, -1)), J = { class: "flex h-10 flex-1 items-center justify-center gap-1.5 text-sm font-medium relative" }, P = {
1
+ import { defineComponent as L, reactive as R, ref as j, computed as B, watch as T, onMounted as A, onBeforeUnmount as E, openBlock as s, createElementBlock as h, createElementVNode as p, createVNode as g, unref as N, toDisplayString as M, Fragment as O, renderList as $, createBlock as z, pushScopeId as V, popScopeId as q } from "vue";
2
+ import { ROUTES as K } from "../../constants.js";
3
+ import { useClipboard as D } from "../../hooks/useClipboard.js";
4
+ import { ScalarIcon as _ } from "@scalar/components";
5
+ import { capitalize as F } from "@scalar/oas-utils/helpers";
6
+ import H from "./TopNavItem.vue.js";
7
+ import { useWorkspace as W } from "../../store/workspace.js";
8
+ import { hotKeyBus as k } from "../../libs/event-busses/hot-keys-bus.js";
9
+ const G = (l) => (V("data-v-ec38eda3"), l = l(), q(), l), J = { class: "flex h-10 t-app__top-nav" }, P = /* @__PURE__ */ G(() => /* @__PURE__ */ p("div", { class: "t-app__top-nav-draggable" }, null, -1)), Q = { class: "flex h-10 flex-1 items-center justify-center gap-1.5 text-sm font-medium relative" }, X = {
10
10
  key: 0,
11
11
  class: "flex items-center gap-1 w-full justify-center"
12
- }, ne = /* @__PURE__ */ w({
12
+ }, ce = /* @__PURE__ */ L({
13
13
  __name: "TopNav",
14
- setup(i) {
15
- const { activeRequest: N, router: l } = F(), { copyToClipboard: k } = q(), t = S([{ label: "", path: "", icon: "Add" }]), o = U(0);
16
- function d() {
14
+ props: {
15
+ openNewTab: {}
16
+ },
17
+ setup(l) {
18
+ const y = l, { activeRequest: I, router: c } = W(), { copyToClipboard: C } = D(), t = R([{ label: "", path: "", icon: "Add" }]), o = j(0), x = B(() => o.value);
19
+ function v() {
17
20
  var a;
18
- const e = V.find((r) => l.currentRoute.value.name == r.name);
21
+ const e = K.find((r) => c.currentRoute.value.name == r.name);
19
22
  e && ((e == null ? void 0 : e.name) === "request" ? t[o.value] = {
20
- label: ((a = N.value) == null ? void 0 : a.summary) || "",
21
- path: l.currentRoute.value.path,
23
+ label: ((a = I.value) == null ? void 0 : a.summary) || "",
24
+ path: c.currentRoute.value.path,
22
25
  icon: e.icon
23
26
  } : t[o.value] = {
24
- label: K(e == null ? void 0 : e.name) || "",
25
- path: l.currentRoute.value.path,
27
+ label: F(e == null ? void 0 : e.name) || "",
28
+ path: c.currentRoute.value.path,
26
29
  icon: e.icon
27
30
  });
28
31
  }
29
- function p() {
30
- l.push(t[o.value].path);
32
+ function u() {
33
+ c.push(t[o.value].path);
31
34
  }
32
35
  function m() {
33
- t.push({ label: "", path: "", icon: "Add" }), o.value = t.length - 1, d();
36
+ t.push({ label: "", path: "", icon: "Add" }), o.value = t.length - 1, v();
34
37
  }
35
- function c(e) {
36
- o.value = e, p();
38
+ function i(e) {
39
+ o.value = e, u();
37
40
  }
38
- R(
39
- () => l.currentRoute.value.path,
41
+ T(
42
+ () => c.currentRoute.value.path,
40
43
  () => {
41
- d();
44
+ v();
42
45
  },
43
46
  { immediate: !0 }
44
47
  );
@@ -46,48 +49,60 @@ const H = (i) => (z("data-v-dca235f9"), i = i(), E(), i), W = { class: "flex h-1
46
49
  t.splice(e, 1), o.value = Math.min(
47
50
  o.value,
48
51
  t.length - 1
49
- ), p();
52
+ ), u();
50
53
  }
51
- const I = (e) => {
54
+ const w = (e) => {
52
55
  const a = new URL(window.location.href);
53
- a.pathname = t[e].path, k(a.toString());
54
- }, C = (e) => {
55
- t.splice(0, e), t.splice(1), o.value = 0, p();
56
- }, x = j(() => o.value), b = (e) => {
57
- if (e.addTopNav && m(), e.closeTopNav && f(o.value), e.navigateTopNavLeft && c(Math.max(o.value - 1, 0)), e.navigateTopNavRight && c(Math.min(o.value + 1, t.length - 1)), e.jumpToTab) {
56
+ a.pathname = t[e].path, C(a.toString());
57
+ }, S = (e) => {
58
+ t.splice(0, e), t.splice(1), o.value = 0, u();
59
+ }, b = (e) => {
60
+ if (e.addTopNav && m(), e.closeTopNav && f(o.value), e.navigateTopNavLeft && i(Math.max(o.value - 1, 0)), e.navigateTopNavRight && i(Math.min(o.value + 1, t.length - 1)), e.jumpToTab) {
58
61
  const a = Number(e.jumpToTab.key) - 1;
59
- a >= 0 && a < t.length && c(a);
62
+ a >= 0 && a < t.length && i(a);
60
63
  }
61
- e.jumpToLastTab && c(t.length - 1);
64
+ e.jumpToLastTab && i(t.length - 1);
65
+ }, U = (e) => {
66
+ t.push({
67
+ label: e.name,
68
+ path: e.uid,
69
+ icon: "ExternalLink"
70
+ });
62
71
  };
63
- return B(() => y.on(b)), L(() => y.off(b)), (e, a) => (s(), v("nav", W, [
64
- G,
65
- u("div", J, [
66
- t.length === 1 ? (s(), v("div", P, [
67
- _(g(T), {
72
+ return T(
73
+ () => y.openNewTab,
74
+ (e) => {
75
+ e && U(e);
76
+ },
77
+ { immediate: !0 }
78
+ ), A(() => k.on(b)), E(() => k.off(b)), (e, a) => (s(), h("nav", J, [
79
+ P,
80
+ p("div", Q, [
81
+ t.length === 1 ? (s(), h("div", X, [
82
+ g(N(_), {
68
83
  icon: t[0].icon,
69
84
  size: "xs",
70
85
  thickness: "2.5"
71
86
  }, null, 8, ["icon"]),
72
- u("div", null, A(t[0].label), 1)
73
- ])) : (s(!0), v(M, { key: 1 }, O(t, (r, n) => (s(), $(D, {
87
+ p("div", null, M(t[0].label), 1)
88
+ ])) : (s(!0), h(O, { key: 1 }, $(t, (r, n) => (s(), z(H, {
74
89
  key: n,
75
90
  active: n === x.value,
76
91
  hotkey: (n + 1).toString(),
77
92
  icon: r.icon,
78
93
  label: r.label,
79
- onClick: (h) => c(n),
80
- onClose: (h) => f(n),
81
- onCloseOtherTabs: (h) => C(n),
82
- onCopyUrl: (h) => I(n),
94
+ onClick: (d) => i(n),
95
+ onClose: (d) => f(n),
96
+ onCloseOtherTabs: (d) => S(n),
97
+ onCopyUrl: (d) => w(n),
83
98
  onNewTab: m
84
99
  }, null, 8, ["active", "hotkey", "icon", "label", "onClick", "onClose", "onCloseOtherTabs", "onCopyUrl"]))), 128)),
85
- u("button", {
100
+ p("button", {
86
101
  class: "text-c-3 hover:bg-b-3 p-1.5 rounded-lg webkit-app-no-drag",
87
102
  type: "button",
88
103
  onClick: m
89
104
  }, [
90
- _(g(T), {
105
+ g(N(_), {
91
106
  icon: "Add",
92
107
  size: "xs",
93
108
  thickness: "2.5"
@@ -98,5 +113,5 @@ const H = (i) => (z("data-v-dca235f9"), i = i(), E(), i), W = { class: "flex h-1
98
113
  }
99
114
  });
100
115
  export {
101
- ne as default
116
+ ce as default
102
117
  };
@@ -1,3 +1,13 @@
1
- declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>;
1
+ declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
2
+ newTab: (item: {
3
+ name: string;
4
+ uid: string;
5
+ }) => void;
6
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{}>> & {
7
+ onNewTab?: ((item: {
8
+ name: string;
9
+ uid: string;
10
+ }) => any) | undefined;
11
+ }, {}, {}>;
2
12
  export default _default;
3
13
  //# sourceMappingURL=ApiClientApp.vue.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ApiClientApp.vue.d.ts","sourceRoot":"","sources":["../../../src/layouts/App/ApiClientApp.vue"],"names":[],"mappings":";AAkVA,wBAKG"}
1
+ {"version":3,"file":"ApiClientApp.vue.d.ts","sourceRoot":"","sources":["../../../src/layouts/App/ApiClientApp.vue"],"names":[],"mappings":";;cA+J8B,MAAM;aAAO,MAAM;;;;cAAnB,MAAM;aAAO,MAAM;;;AAiOjD,wBAMG"}
@@ -1,75 +1,79 @@
1
- import { defineComponent as _, onMounted as i, watchEffect as v, onBeforeMount as y, onBeforeUnmount as h, computed as k, openBlock as l, createElementBlock as d, Fragment as g, createElementVNode as p, createVNode as a, unref as n, withCtx as w, createBlock as f, KeepAlive as S, resolveDynamicComponent as x, createCommentVNode as T } from "vue";
2
- import C from "../../components/SideNav/SideNav.vue.js";
3
- import L from "../../components/TopNav/TopNav.vue.js";
4
- import { useWorkspace as B } from "../../store/workspace.js";
5
- import { addScalarClassesToHeadless as E } from "@scalar/components";
6
- import { LS_KEYS as K } from "@scalar/object-utils/mutator-record";
7
- import { getThemeStyles as M } from "@scalar/themes";
8
- import { ScalarToasts as W } from "@scalar/use-toasts";
9
- import { RouterView as A } from "vue-router";
10
- import { loadAllResources as D } from "../../libs/local-storage.js";
11
- import N from "../../components/CommandPalette/TheCommandPalette.vue.js";
12
- import { useDarkModeState as b } from "../../hooks/useDarkModeState.js";
13
- import { handleHotKeyDown as H } from "../../libs/event-busses/hot-keys-bus.js";
14
- const V = ["innerHTML"], F = {
1
+ import { defineComponent as _, ref as h, onMounted as d, watchEffect as y, onBeforeMount as k, onBeforeUnmount as T, computed as g, openBlock as n, createElementBlock as p, Fragment as S, createElementVNode as u, createVNode as l, unref as r, withCtx as x, createBlock as f, KeepAlive as b, resolveDynamicComponent as N, createCommentVNode as C } from "vue";
2
+ import L from "../../components/SideNav/SideNav.vue.js";
3
+ import B from "../../components/TopNav/TopNav.vue.js";
4
+ import { useWorkspace as E } from "../../store/workspace.js";
5
+ import { addScalarClassesToHeadless as K } from "@scalar/components";
6
+ import { LS_KEYS as M } from "@scalar/object-utils/mutator-record";
7
+ import { getThemeStyles as W } from "@scalar/themes";
8
+ import { ScalarToasts as A } from "@scalar/use-toasts";
9
+ import { RouterView as D } from "vue-router";
10
+ import { loadAllResources as H } from "../../libs/local-storage.js";
11
+ import V from "../../components/CommandPalette/TheCommandPalette.vue.js";
12
+ import { useDarkModeState as F } from "../../hooks/useDarkModeState.js";
13
+ import { handleHotKeyDown as O } from "../../libs/event-busses/hot-keys-bus.js";
14
+ const P = ["innerHTML"], R = {
15
15
  key: 0,
16
16
  class: "flex min-h-0 flex-1 z-0"
17
- }, O = { class: "flex flex-1 flex-col min-w-0" }, ee = /* @__PURE__ */ _({
17
+ }, z = { class: "flex flex-1 flex-col min-w-0" }, ae = /* @__PURE__ */ _({
18
18
  __name: "ApiClientApp",
19
- setup(P) {
20
- i(() => {
21
- v(() => {
22
- document.body.classList.toggle("dark-mode", c.value), document.body.classList.toggle("light-mode", !c.value);
19
+ emits: ["newTab"],
20
+ setup(I) {
21
+ const c = h(null), w = (e) => {
22
+ c.value = e;
23
+ };
24
+ d(() => {
25
+ y(() => {
26
+ document.body.classList.toggle("dark-mode", m.value), document.body.classList.toggle("light-mode", !m.value);
23
27
  });
24
28
  });
25
- const { isDark: c } = b(), r = B();
26
- y(async () => {
27
- if (localStorage.getItem(K.WORKSPACE)) {
28
- const o = {};
29
- let s = 0, t = 0, e = "";
30
- for (e in localStorage)
31
- Object.prototype.hasOwnProperty.call(localStorage, e) && (t = (localStorage[e].length + e.length) * 2, s += t, o[e] = (t / 1024).toFixed(2) + " KB");
32
- o.Total = (s / 1024).toFixed(2) + " KB", console.table(o), D(r);
29
+ const { isDark: m } = F(), a = E();
30
+ k(async () => {
31
+ if (localStorage.getItem(M.WORKSPACE)) {
32
+ const e = {};
33
+ let s = 0, t = 0, o = "";
34
+ for (o in localStorage)
35
+ Object.prototype.hasOwnProperty.call(localStorage, o) && (t = (localStorage[o].length + o.length) * 2, s += t, e[o] = (t / 1024).toFixed(2) + " KB");
36
+ e.Total = (s / 1024).toFixed(2) + " KB", console.table(e), H(a);
33
37
  } else
34
- r.workspaceMutators.add({
38
+ a.workspaceMutators.add({
35
39
  uid: "default",
36
40
  name: "Workspace",
37
41
  proxyUrl: "https://proxy.scalar.com"
38
42
  });
39
- E();
43
+ K();
40
44
  });
41
- const m = (o) => H(o);
42
- i(() => window.addEventListener("keydown", m)), h(() => window.removeEventListener("keydown", m));
43
- const u = k(
44
- () => r.activeWorkspace.value && `<style>
45
- ${M(r.activeWorkspace.value.themeId, {
45
+ const i = (e) => O(e);
46
+ d(() => window.addEventListener("keydown", i)), T(() => window.removeEventListener("keydown", i));
47
+ const v = g(
48
+ () => a.activeWorkspace.value && `<style>
49
+ ${W(a.activeWorkspace.value.themeId, {
46
50
  fonts: !0
47
51
  })}</style>`
48
52
  );
49
- return (o, s) => {
53
+ return (e, s) => {
50
54
  var t;
51
- return l(), d(g, null, [
52
- p("div", { innerHTML: u.value }, null, 8, V),
53
- a(L),
54
- (t = n(r).activeWorkspace.value) != null && t.uid ? (l(), d("main", F, [
55
- a(C),
56
- a(n(N)),
57
- p("div", O, [
58
- a(n(A), null, {
59
- default: w(({ Component: e }) => [
60
- (l(), f(S, null, [
61
- (l(), f(x(e)))
55
+ return n(), p(S, null, [
56
+ u("div", { innerHTML: v.value }, null, 8, P),
57
+ l(B, { openNewTab: c.value }, null, 8, ["openNewTab"]),
58
+ (t = r(a).activeWorkspace.value) != null && t.uid ? (n(), p("main", R, [
59
+ l(L),
60
+ l(r(V)),
61
+ u("div", z, [
62
+ l(r(D), { onNewTab: w }, {
63
+ default: x(({ Component: o }) => [
64
+ (n(), f(b, null, [
65
+ (n(), f(N(o)))
62
66
  ], 1024))
63
67
  ]),
64
68
  _: 1
65
69
  })
66
70
  ])
67
- ])) : T("", !0),
68
- a(n(W))
71
+ ])) : C("", !0),
72
+ l(r(A))
69
73
  ], 64);
70
74
  };
71
75
  }
72
76
  });
73
77
  export {
74
- ee as default
78
+ ae as default
75
79
  };
@@ -0,0 +1,2 @@
1
+ export declare const cancelRequestBus: import("@vueuse/core").UseEventBusReturn<void, any>;
2
+ //# sourceMappingURL=cancel-request-bus.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cancel-request-bus.d.ts","sourceRoot":"","sources":["../../../src/libs/event-busses/cancel-request-bus.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,gBAAgB,qDAAmC,CAAA"}
@@ -0,0 +1,5 @@
1
+ import { useEventBus as e } from "@vueuse/core";
2
+ const s = Symbol(), c = e(s);
3
+ export {
4
+ c as cancelRequestBus
5
+ };
@@ -1,4 +1,4 @@
1
- import type { HotKeyConfig } from '@scalar/oas-utils/entities/workspace';
1
+ import type { HotKeyConfig, HotKeyModifiers } from '@scalar/oas-utils/entities/workspace';
2
2
  import type { HotkeyEventName } from '@scalar/oas-utils/entities/workspace/consts';
3
3
  export type HotKeyEvents = Partial<Record<HotkeyEventName, KeyboardEvent>>;
4
4
  /** Event bus for hot keys */
@@ -18,6 +18,8 @@ export declare const hotKeyBus: import("@vueuse/core").UseEventBusReturn<Partial
18
18
  * - if you explicitly set it, the event must match ex: modifier false will not trigger if the modifier was pressed
19
19
  */
20
20
  export declare const DEFAULT_HOTKEYS: HotKeyConfig;
21
+ /** Converts our modifier config to the eventKey */
22
+ export declare const getModifiers: (modifiers: HotKeyModifiers) => ("altKey" | "ctrlKey" | "shiftKey" | "metaKey")[];
21
23
  /**
22
24
  * Global keydown handler for hotkeys
23
25
  *
@@ -1 +1 @@
1
- {"version":3,"file":"hot-keys-bus.d.ts","sourceRoot":"","sources":["../../../src/libs/event-busses/hot-keys-bus.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EAEb,MAAM,sCAAsC,CAAA;AAC7C,OAAO,KAAK,EACV,eAAe,EAEhB,MAAM,6CAA6C,CAAA;AAIpD,MAAM,MAAM,YAAY,GAAG,OAAO,CAAC,MAAM,CAAC,eAAe,EAAE,aAAa,CAAC,CAAC,CAAA;AAG1E,6BAA6B;AAC7B,eAAO,MAAM,SAAS,+WAA4B,CAAA;AAyBlD;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,eAAe,EAAE,YAsB7B,CAAA;AAiCD;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,OACvB,aAAa;;;;;;UA2BlB,CAAA"}
1
+ {"version":3,"file":"hot-keys-bus.d.ts","sourceRoot":"","sources":["../../../src/libs/event-busses/hot-keys-bus.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,eAAe,EAChB,MAAM,sCAAsC,CAAA;AAC7C,OAAO,KAAK,EACV,eAAe,EAEhB,MAAM,6CAA6C,CAAA;AAIpD,MAAM,MAAM,YAAY,GAAG,OAAO,CAAC,MAAM,CAAC,eAAe,EAAE,aAAa,CAAC,CAAC,CAAA;AAG1E,6BAA6B;AAC7B,eAAO,MAAM,SAAS,+WAA4B,CAAA;AAyBlD;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,eAAe,EAAE,YAsB7B,CAAA;AAsBD,mDAAmD;AACnD,eAAO,MAAM,YAAY,cAAe,eAAe,sDAQtD,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,OACvB,aAAa;;;;;;UA2BlB,CAAA"}
@@ -59,6 +59,7 @@ const u = Symbol(), i = d(u), l = [
59
59
  };
60
60
  export {
61
61
  m as DEFAULT_HOTKEYS,
62
+ T as getModifiers,
62
63
  b as handleHotKeyDown,
63
64
  i as hotKeyBus
64
65
  };
@@ -1,5 +1,6 @@
1
1
  export * from './command-palette-bus.js';
2
- export * from './execute-request-bus.js';
3
2
  export * from './hot-keys-bus.js';
3
+ export * from './execute-request-bus.js';
4
+ export * from './cancel-request-bus.js';
4
5
  export * from './request-status-bus.js';
5
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/libs/event-busses/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAA;AACrC,cAAc,uBAAuB,CAAA;AACrC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,sBAAsB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/libs/event-busses/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAA;AACrC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,uBAAuB,CAAA;AACrC,cAAc,sBAAsB,CAAA;AACpC,cAAc,sBAAsB,CAAA"}
@@ -1,12 +1,15 @@
1
1
  import { commandPaletteBus as o } from "./command-palette-bus.js";
2
- import { executeRequestBus as u } from "./execute-request-bus.js";
3
- import { DEFAULT_HOTKEYS as m, handleHotKeyDown as x, hotKeyBus as a } from "./hot-keys-bus.js";
4
- import { requestStatusBus as p } from "./request-status-bus.js";
2
+ import { DEFAULT_HOTKEYS as s, getModifiers as u, handleHotKeyDown as m, hotKeyBus as f } from "./hot-keys-bus.js";
3
+ import { executeRequestBus as a } from "./execute-request-bus.js";
4
+ import { cancelRequestBus as B } from "./cancel-request-bus.js";
5
+ import { requestStatusBus as n } from "./request-status-bus.js";
5
6
  export {
6
- m as DEFAULT_HOTKEYS,
7
+ s as DEFAULT_HOTKEYS,
8
+ B as cancelRequestBus,
7
9
  o as commandPaletteBus,
8
- u as executeRequestBus,
9
- x as handleHotKeyDown,
10
- a as hotKeyBus,
11
- p as requestStatusBus
10
+ a as executeRequestBus,
11
+ u as getModifiers,
12
+ m as handleHotKeyDown,
13
+ f as hotKeyBus,
14
+ n as requestStatusBus
12
15
  };