@scalar/api-client 2.20.2 → 2.21.0

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 (42) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/dist/style.css +1 -1
  3. package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts.map +1 -1
  4. package/dist/v2/blocks/operation-block/OperationBlock.vue.js +56 -59
  5. package/dist/v2/blocks/operation-block/helpers/build-request-parameters.d.ts.map +1 -1
  6. package/dist/v2/blocks/operation-block/helpers/build-request-parameters.js +52 -51
  7. package/dist/v2/blocks/operation-block/helpers/de-serialize-parameter.d.ts +4 -0
  8. package/dist/v2/blocks/operation-block/helpers/de-serialize-parameter.d.ts.map +1 -0
  9. package/dist/v2/blocks/operation-block/helpers/de-serialize-parameter.js +23 -0
  10. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-parameters.d.ts.map +1 -1
  11. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-parameters.js +24 -23
  12. package/dist/v2/blocks/request-block/helpers/get-default-headers.js +1 -1
  13. package/dist/v2/blocks/response-block/ResponseBlock.vue.d.ts +2 -8
  14. package/dist/v2/blocks/response-block/ResponseBlock.vue.d.ts.map +1 -1
  15. package/dist/v2/blocks/response-block/ResponseBlock.vue.js +2 -2
  16. package/dist/v2/blocks/response-block/ResponseBlock.vue2.js +57 -60
  17. package/dist/v2/blocks/response-block/components/ResponseBodyStreaming.vue.d.ts.map +1 -1
  18. package/dist/v2/blocks/response-block/components/ResponseBodyStreaming.vue.js +61 -41
  19. package/dist/v2/blocks/response-block/components/ResponseEmpty.vue.d.ts +0 -3
  20. package/dist/v2/blocks/response-block/components/ResponseEmpty.vue.d.ts.map +1 -1
  21. package/dist/v2/blocks/response-block/components/ResponseEmpty.vue.js +1 -1
  22. package/dist/v2/blocks/response-block/components/ResponseEmpty.vue2.js +31 -34
  23. package/dist/v2/blocks/response-block/components/ResponseLoadingOverlay.vue.d.ts +3 -3
  24. package/dist/v2/blocks/response-block/components/ResponseLoadingOverlay.vue.d.ts.map +1 -1
  25. package/dist/v2/blocks/response-block/components/ResponseLoadingOverlay.vue.js +2 -2
  26. package/dist/v2/blocks/response-block/components/ResponseLoadingOverlay.vue2.js +26 -20
  27. package/dist/v2/blocks/response-block/components/ResponseMetaInformation.vue.d.ts +4 -2
  28. package/dist/v2/blocks/response-block/components/ResponseMetaInformation.vue.d.ts.map +1 -1
  29. package/dist/v2/blocks/response-block/components/ResponseMetaInformation.vue.js +39 -33
  30. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.d.ts.map +1 -1
  31. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.js +2 -2
  32. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue2.js +64 -64
  33. package/dist/v2/blocks/scalar-address-bar-block/hooks/use-loading-animation.d.ts +1 -0
  34. package/dist/v2/blocks/scalar-address-bar-block/hooks/use-loading-animation.d.ts.map +1 -1
  35. package/dist/v2/blocks/scalar-address-bar-block/hooks/use-loading-animation.js +12 -11
  36. package/dist/v2/components/code-input/CodeInput.vue.d.ts +152 -95
  37. package/dist/v2/components/code-input/CodeInput.vue.d.ts.map +1 -1
  38. package/dist/v2/components/code-input/CodeInput.vue.js +2 -2
  39. package/dist/v2/components/code-input/CodeInput.vue2.js +87 -99
  40. package/dist/v2/features/operation/Operation.vue.js +1 -1
  41. package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
  42. package/package.json +12 -12
@@ -1,20 +1,20 @@
1
- import { defineComponent as S, computed as i, ref as g, useId as I, createBlock as r, openBlock as o, withCtx as u, createElementVNode as c, normalizeClass as B, createElementBlock as p, createVNode as h, Fragment as y, createCommentVNode as d, createTextVNode as A, renderList as E, unref as O, withDirectives as z, resolveDynamicComponent as N, vShow as P } from "vue";
2
- import { ScalarErrorBoundary as D } from "@scalar/components";
3
- import { isDefined as L } from "@scalar/helpers/array/is-defined";
4
- import j from "../../../components/SectionFilter.vue.js";
5
- import w from "../../../components/ViewLayout/ViewLayoutSection.vue.js";
1
+ import { defineComponent as T, computed as i, ref as $, useId as S, createBlock as r, openBlock as o, withCtx as d, createElementVNode as c, normalizeClass as h, createElementBlock as p, createVNode as R, Fragment as y, createCommentVNode as u, createTextVNode as A, renderList as g, unref as I, withDirectives as E, resolveDynamicComponent as O, vShow as z } from "vue";
2
+ import { ScalarErrorBoundary as N } from "@scalar/components";
3
+ import { isDefined as P } from "@scalar/helpers/array/is-defined";
4
+ import D from "../../../components/SectionFilter.vue.js";
5
+ import L from "../../../components/ViewLayout/ViewLayoutSection.vue.js";
6
6
  import V from "./components/Headers.vue.js";
7
- import F from "./components/ResponseBody.vue.js";
8
- import U from "./components/ResponseBodyStreaming.vue.js";
9
- import K from "./components/ResponseBodyVirtual.vue.js";
7
+ import j from "./components/ResponseBody.vue.js";
8
+ import w from "./components/ResponseBodyStreaming.vue.js";
9
+ import F from "./components/ResponseBodyVirtual.vue.js";
10
10
  /* empty css */
11
- import M from "./components/ResponseCookies.vue.js";
12
- import Z from "./components/ResponseEmpty.vue.js";
13
- import G from "./components/ResponseLoadingOverlay.vue.js";
14
- import J from "./components/ResponseMetaInformation.vue.js";
15
- import { textMediaTypes as Q } from "./helpers/media-types.js";
16
- import { parseSetCookie as W } from "./helpers/parse-set-cookie.js";
17
- const X = { class: "flex h-8 flex-1 items-center" }, Y = ["id", "role"], b = 2e5, pe = /* @__PURE__ */ S({
11
+ import U from "./components/ResponseCookies.vue.js";
12
+ import K from "./components/ResponseEmpty.vue.js";
13
+ import M from "./components/ResponseLoadingOverlay.vue.js";
14
+ import Z from "./components/ResponseMetaInformation.vue.js";
15
+ import { textMediaTypes as G } from "./helpers/media-types.js";
16
+ import { parseSetCookie as J } from "./helpers/parse-set-cookie.js";
17
+ const Q = { class: "flex h-8 flex-1 items-center" }, W = ["id", "role"], b = 2e5, ve = /* @__PURE__ */ T({
18
18
  __name: "ResponseBlock",
19
19
  props: {
20
20
  response: {},
@@ -23,29 +23,27 @@ const X = { class: "flex h-8 flex-1 items-center" }, Y = ["id", "role"], b = 2e5
23
23
  totalPerformedRequests: {},
24
24
  appVersion: {},
25
25
  plugins: {},
26
- events: {},
27
26
  eventBus: {}
28
27
  },
29
- emits: ["sendRequest"],
30
- setup(e, { expose: x, emit: C }) {
31
- const H = C, m = i(() => {
28
+ setup(e, { expose: x }) {
29
+ const m = i(() => {
32
30
  const t = e.response?.headers;
33
31
  return t ? Object.keys(t).map((s) => ({
34
32
  name: s,
35
33
  value: t[s] ?? ""
36
34
  })) : [];
37
35
  }), k = i(
38
- () => e.response?.cookieHeaderKeys.map((t) => W(t)).filter(L) ?? []
39
- ), T = ["Cookies", "Headers", "Body"], n = g("All"), v = i(() => ["All", ...T]), a = i(
36
+ () => e.response?.cookieHeaderKeys.map((t) => J(t)).filter(P) ?? []
37
+ ), C = ["Cookies", "Headers", "Body"], n = $("All"), v = i(() => ["All", ...C]), a = i(
40
38
  () => Object.fromEntries(
41
- v.value.map((t) => [t, I()])
39
+ v.value.map((t) => [t, S()])
42
40
  )
43
- ), q = i(() => {
41
+ ), B = i(() => {
44
42
  if (!e.response || !("size" in e.response))
45
43
  return !1;
46
44
  const t = e.response.headers?.["content-type"] || e.response.headers?.["Content-Type"];
47
- return !t || (e.response.size ?? 0) <= b || t.includes("text/html") ? !1 : Q.some((l) => t.includes(l)) && (e.response.size ?? 0) > b;
48
- }), R = i(
45
+ return !t || (e.response.size ?? 0) <= b || t.includes("text/html") ? !1 : G.some((l) => t.includes(l)) && (e.response.size ?? 0) > b;
46
+ }), q = i(
49
47
  () => e.request?.headers ? [...e.request.headers].map((t) => ({
50
48
  name: t[0],
51
49
  value: t[1],
@@ -55,26 +53,26 @@ const X = { class: "flex h-8 flex-1 items-center" }, Y = ["id", "role"], b = 2e5
55
53
  return x({
56
54
  responseHeaders: m,
57
55
  responseCookies: k,
58
- requestHeaders: R,
59
- shouldVirtualize: q,
56
+ requestHeaders: q,
57
+ shouldVirtualize: B,
60
58
  activeFilter: n,
61
59
  filters: v
62
- }), (t, s) => (o(), r(w, { "aria-label": "Response" }, {
63
- title: u(() => [
64
- c("div", X, [
60
+ }), (t, s) => (o(), r(L, { "aria-label": "Response" }, {
61
+ title: d(() => [
62
+ c("div", Q, [
65
63
  c("div", {
66
64
  "aria-live": "polite",
67
- class: B(["flex items-center", { "animate-response-heading": e.response }])
65
+ class: h(["flex items-center", { "animate-response-heading": e.response }])
68
66
  }, [
69
67
  s[4] || (s[4] = c("span", { class: "response-heading pointer-events-none absolute" }, " Response ", -1)),
70
- e.response ? (o(), r(J, {
68
+ e.response ? (o(), r(Z, {
71
69
  key: 0,
72
70
  class: "animate-response-children",
73
- events: e.events,
71
+ eventBus: e.eventBus,
74
72
  response: e.response
75
- }, null, 8, ["events", "response"])) : d("", !0)
73
+ }, null, 8, ["eventBus", "response"])) : u("", !0)
76
74
  ], 2),
77
- h(j, {
75
+ R(D, {
78
76
  modelValue: n.value,
79
77
  "onUpdate:modelValue": s[0] || (s[0] = (l) => n.value = l),
80
78
  filterIds: a.value,
@@ -82,34 +80,34 @@ const X = { class: "flex h-8 flex-1 items-center" }, Y = ["id", "role"], b = 2e5
82
80
  }, null, 8, ["modelValue", "filterIds", "filters"])
83
81
  ])
84
82
  ]),
85
- default: u(() => [
83
+ default: d(() => [
86
84
  c("div", {
87
85
  id: a.value.All,
88
- class: B(["custom-scroll response-section-content relative grid h-full justify-stretch", {
86
+ class: h(["custom-scroll response-section-content relative grid h-full justify-stretch", {
89
87
  "content-start": e.response
90
88
  }]),
91
89
  role: n.value === "All" && e.response ? "tabpanel" : "none"
92
90
  }, [
93
91
  e.response ? (o(), p(y, { key: 1 }, [
94
- f("Cookies") ? (o(), r(M, {
92
+ f("Cookies") ? (o(), r(U, {
95
93
  key: 0,
96
94
  id: a.value.Cookies,
97
95
  class: "response-section-content-cookies",
98
96
  cookies: k.value,
99
97
  role: n.value === "All" ? "none" : "tabpanel"
100
- }, null, 8, ["id", "cookies", "role"])) : d("", !0),
98
+ }, null, 8, ["id", "cookies", "role"])) : u("", !0),
101
99
  f("Headers") ? (o(), r(V, {
102
100
  key: 1,
103
101
  id: a.value.Headers,
104
102
  class: "response-section-content-headers",
105
- headers: R.value,
103
+ headers: q.value,
106
104
  role: n.value === "All" ? "none" : "tabpanel"
107
105
  }, {
108
- title: u(() => [...s[5] || (s[5] = [
106
+ title: d(() => [...s[5] || (s[5] = [
109
107
  A("Request Headers", -1)
110
108
  ])]),
111
109
  _: 1
112
- }, 8, ["id", "headers", "role"])) : d("", !0),
110
+ }, 8, ["id", "headers", "role"])) : u("", !0),
113
111
  f("Headers") ? (o(), r(V, {
114
112
  key: 2,
115
113
  id: a.value.Headers,
@@ -117,37 +115,37 @@ const X = { class: "flex h-8 flex-1 items-center" }, Y = ["id", "role"], b = 2e5
117
115
  headers: m.value,
118
116
  role: n.value === "All" ? "none" : "tabpanel"
119
117
  }, {
120
- title: u(() => [...s[6] || (s[6] = [
118
+ title: d(() => [...s[6] || (s[6] = [
121
119
  A("Response Headers", -1)
122
120
  ])]),
123
121
  _: 1
124
- }, 8, ["id", "headers", "role"])) : d("", !0),
125
- (o(!0), p(y, null, E(e.plugins, (l, $) => (o(), r(O(D), { key: $ }, {
126
- default: u(() => [
127
- l.components?.response && e.request && e.response ? z((o(), r(N(l.components.response), {
122
+ }, 8, ["id", "headers", "role"])) : u("", !0),
123
+ (o(!0), p(y, null, g(e.plugins, (l, H) => (o(), r(I(N), { key: H }, {
124
+ default: d(() => [
125
+ l.components?.response && e.request && e.response ? E((o(), r(O(l.components.response), {
128
126
  key: 0,
129
127
  request: e.request,
130
128
  response: e.response
131
129
  }, null, 8, ["request", "response"])), [
132
- [P, n.value === "All"]
133
- ]) : d("", !0)
130
+ [z, n.value === "All"]
131
+ ]) : u("", !0)
134
132
  ]),
135
133
  _: 2
136
134
  }, 1024))), 128)),
137
135
  n.value === "All" || n.value === "Body" ? (o(), p(y, { key: 3 }, [
138
- "reader" in e.response ? (o(), r(U, {
136
+ "reader" in e.response ? (o(), r(w, {
139
137
  key: 0,
140
138
  id: a.value.Body,
141
139
  class: "response-section-content-body",
142
140
  reader: e.response.reader
143
- }, null, 8, ["id", "reader"])) : q.value && typeof e.response?.data == "string" ? (o(), r(K, {
141
+ }, null, 8, ["id", "reader"])) : B.value && typeof e.response?.data == "string" ? (o(), r(F, {
144
142
  key: 1,
145
143
  id: a.value.Body,
146
144
  content: e.response.data,
147
145
  data: e.response?.data,
148
146
  headers: m.value,
149
147
  role: n.value === "All" ? "none" : "tabpanel"
150
- }, null, 8, ["id", "content", "data", "headers", "role"])) : (o(), r(F, {
148
+ }, null, 8, ["id", "content", "data", "headers", "role"])) : (o(), r(j, {
151
149
  key: 2,
152
150
  id: a.value.Body,
153
151
  active: !0,
@@ -158,11 +156,10 @@ const X = { class: "flex h-8 flex-1 items-center" }, Y = ["id", "role"], b = 2e5
158
156
  role: n.value === "All" ? "none" : "tabpanel",
159
157
  title: "Body"
160
158
  }, null, 8, ["id", "data", "headers", "role"]))
161
- ], 64)) : d("", !0)
162
- ], 64)) : (o(), r(Z, {
159
+ ], 64)) : u("", !0)
160
+ ], 64)) : (o(), r(K, {
163
161
  key: 0,
164
162
  appVersion: e.appVersion,
165
- events: e.events,
166
163
  layout: e.layout,
167
164
  totalPerformedRequests: e.totalPerformedRequests,
168
165
  onAddRequest: s[1] || (s[1] = (l) => e.eventBus.emit("ui:open:command-palette", {
@@ -170,15 +167,15 @@ const X = { class: "flex h-8 flex-1 items-center" }, Y = ["id", "role"], b = 2e5
170
167
  payload: void 0
171
168
  })),
172
169
  onOpenCommandPalette: s[2] || (s[2] = (l) => e.eventBus.emit("ui:open:command-palette")),
173
- onSendRequest: s[3] || (s[3] = (l) => H("sendRequest"))
174
- }, null, 8, ["appVersion", "events", "layout", "totalPerformedRequests"])),
175
- h(G, { events: e.events }, null, 8, ["events"])
176
- ], 10, Y)
170
+ onSendRequest: s[3] || (s[3] = (l) => e.eventBus.emit("operation:send:request:hotkey"))
171
+ }, null, 8, ["appVersion", "layout", "totalPerformedRequests"])),
172
+ R(M, { eventBus: e.eventBus }, null, 8, ["eventBus"])
173
+ ], 10, W)
177
174
  ]),
178
175
  _: 1
179
176
  }));
180
177
  }
181
178
  });
182
179
  export {
183
- pe as default
180
+ ve as default
184
181
  };
@@ -1 +1 @@
1
- {"version":3,"file":"ResponseBodyStreaming.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/response-block/components/ResponseBodyStreaming.vue"],"names":[],"mappings":"AA+GA,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,2BAA2B,CAAC,UAAU,CAAC,CAAA;CAChD,CAAC;;AAkLF,wBAMG"}
1
+ {"version":3,"file":"ResponseBodyStreaming.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/response-block/components/ResponseBodyStreaming.vue"],"names":[],"mappings":"AAuKA,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,2BAA2B,CAAC,UAAU,CAAC,CAAA;CAChD,CAAC;;AAmPF,wBAMG"}
@@ -1,74 +1,94 @@
1
- import { defineComponent as y, ref as c, watch as _, nextTick as w, onMounted as h, onBeforeUnmount as k, createBlock as B, openBlock as l, unref as s, withCtx as v, createElementVNode as i, createElementBlock as d, createCommentVNode as u, toDisplayString as p, createVNode as S } from "vue";
2
- import { useLoadingState as b, ScalarLoading as C } from "@scalar/components";
3
- import L from "../../../components/layout/CollapsibleSection.vue.js";
4
- const T = { class: "flex w-full items-center justify-between" }, E = {
1
+ import { defineComponent as B, ref as i, watch as y, nextTick as C, onBeforeUnmount as b, createBlock as L, openBlock as u, unref as n, createSlots as T, withCtx as d, createElementVNode as v, createElementBlock as m, createCommentVNode as g, toDisplayString as k, createVNode as w, createTextVNode as N } from "vue";
2
+ import { useLoadingState as V, ScalarLoading as E, ScalarButton as z } from "@scalar/components";
3
+ import D from "../../../components/layout/CollapsibleSection.vue.js";
4
+ const j = { class: "flex w-full items-center justify-between" }, H = {
5
5
  key: 0,
6
6
  class: "mr-2 flex items-center gap-2"
7
- }, N = {
7
+ }, U = {
8
8
  key: 0,
9
9
  class: "text-red bg-b-danger sticky top-0 border-b p-2"
10
- }, V = {
10
+ }, $ = {
11
11
  key: 1,
12
12
  class: "p-2"
13
- }, z = /* @__PURE__ */ y({
13
+ }, G = /* @__PURE__ */ B({
14
14
  __name: "ResponseBodyStreaming",
15
15
  props: {
16
16
  reader: {}
17
17
  },
18
18
  setup(f) {
19
- const e = b(), o = c(""), n = c(null), m = new TextDecoder(), a = c(null), g = () => {
20
- a.value && (a.value.scrollTop = a.value.scrollHeight);
19
+ const a = V(), o = i(""), s = i(null), c = i(null), t = i(null), r = i(null), S = () => {
20
+ c.value && (c.value.scrollTop = c.value.scrollHeight);
21
21
  };
22
- _(o, () => {
23
- w(g);
22
+ y(o, async () => {
23
+ await C(S);
24
24
  });
25
- async function x() {
25
+ async function h(l) {
26
26
  try {
27
- for (; e.isLoading; ) {
28
- const { done: r, value: t } = await f.reader.read();
29
- if (r) {
30
- e.clear();
27
+ for (; a.isLoading && t.value === l; ) {
28
+ const { done: e, value: x } = await l.read();
29
+ if (t.value !== l)
30
+ break;
31
+ if (e) {
32
+ a.clear();
31
33
  break;
32
34
  }
33
- t && (o.value += m.decode(t, { stream: !0 }));
35
+ x && r.value && (o.value += r.value.decode(x, { stream: !0 }));
34
36
  }
35
- } catch (r) {
36
- console.error("Error reading stream:", r), e.clear(), n.value = r;
37
+ } catch (e) {
38
+ t.value === l && (console.error("Error reading stream:", e), a.clear(), s.value = e);
37
39
  } finally {
38
- o.value += m.decode();
40
+ t.value === l && r.value && (o.value += r.value.decode());
39
41
  }
40
42
  }
41
- return h(() => {
42
- e.start(), x(), n.value = null;
43
- }), k(() => {
44
- f.reader.cancel(), e.clear();
45
- }), (r, t) => (l(), B(s(L), { class: "max-h-content overflow-y-hidden" }, {
46
- title: v(() => [
47
- i("div", T, [
48
- t[1] || (t[1] = i("div", null, "Body", -1)),
49
- s(e).isLoading ? (l(), d("div", E, [
50
- S(s(C), {
51
- loadingState: s(e),
43
+ const _ = () => {
44
+ t.value && t.value.cancel(), t.value = f.reader, r.value = new TextDecoder(), a.start(), o.value = "", s.value = null, h(f.reader);
45
+ }, p = () => {
46
+ t.value && (t.value.cancel(), t.value = null), a.clear();
47
+ };
48
+ return y(() => f.reader, _, { immediate: !0 }), b(p), (l, e) => (u(), L(n(D), { class: "max-h-content overflow-y-hidden" }, T({
49
+ title: d(() => [
50
+ v("div", j, [
51
+ e[1] || (e[1] = v("div", null, "Body", -1)),
52
+ n(a).isLoading ? (u(), m("div", H, [
53
+ w(n(E), {
54
+ loadingState: n(a),
52
55
  size: "xs"
53
56
  }, null, 8, ["loadingState"]),
54
- t[0] || (t[0] = i("span", { class: "text-c-2" }, " Listening… ", -1))
55
- ])) : u("", !0)
57
+ e[0] || (e[0] = v("span", { class: "text-c-2" }, " Listening… ", -1))
58
+ ])) : g("", !0)
56
59
  ])
57
60
  ]),
58
- default: v(() => [
59
- i("div", {
61
+ default: d(() => [
62
+ v("div", {
60
63
  ref_key: "contentContainer",
61
- ref: a,
64
+ ref: c,
62
65
  class: "text-xxs font-code h-full overflow-auto leading-2 whitespace-pre-wrap"
63
66
  }, [
64
- n.value ? (l(), d("div", N, p(n.value.message), 1)) : u("", !0),
65
- o.value ? (l(), d("div", V, p(o.value), 1)) : u("", !0)
67
+ s.value ? (u(), m("div", U, k(s.value.message), 1)) : g("", !0),
68
+ o.value ? (u(), m("div", $, k(o.value), 1)) : g("", !0)
66
69
  ], 512)
67
70
  ]),
68
- _: 1
69
- }));
71
+ _: 2
72
+ }, [
73
+ n(a).isLoading ? {
74
+ name: "actions",
75
+ fn: d(() => [
76
+ w(n(z), {
77
+ size: "sm",
78
+ variant: "ghost",
79
+ onClick: p
80
+ }, {
81
+ default: d(() => [...e[2] || (e[2] = [
82
+ N(" Cancel ", -1)
83
+ ])]),
84
+ _: 1
85
+ })
86
+ ]),
87
+ key: "0"
88
+ } : void 0
89
+ ]), 1024));
70
90
  }
71
91
  });
72
92
  export {
73
- z as default
93
+ G as default
74
94
  };
@@ -1,5 +1,4 @@
1
1
  import { type ClientLayout } from '../../../../hooks/index.js';
2
- import type { createStoreEvents } from '../../../../store/events.js';
3
2
  type __VLS_Props = {
4
3
  /** Client layout */
5
4
  layout: ClientLayout;
@@ -7,8 +6,6 @@ type __VLS_Props = {
7
6
  totalPerformedRequests: number;
8
7
  /** Application version */
9
8
  appVersion: string;
10
- /** Event bus */
11
- events: ReturnType<typeof createStoreEvents>;
12
9
  };
13
10
  declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
14
11
  sendRequest: () => any;
@@ -1 +1 @@
1
- {"version":3,"file":"ResponseEmpty.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/response-block/components/ResponseEmpty.vue"],"names":[],"mappings":"AAmJA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,SAAS,CAAA;AAE3C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AAEvD,KAAK,WAAW,GAAG;IACjB,oBAAoB;IACpB,MAAM,EAAE,YAAY,CAAA;IACpB,yCAAyC;IACzC,sBAAsB,EAAE,MAAM,CAAA;IAC9B,0BAA0B;IAC1B,UAAU,EAAE,MAAM,CAAA;IAClB,gBAAgB;IAChB,MAAM,EAAE,UAAU,CAAC,OAAO,iBAAiB,CAAC,CAAA;CAC7C,CAAC;;;;;;;;;;AAiNF,wBAOG"}
1
+ {"version":3,"file":"ResponseEmpty.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/response-block/components/ResponseEmpty.vue"],"names":[],"mappings":"AAoIA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,SAAS,CAAA;AAE3C,KAAK,WAAW,GAAG;IACjB,oBAAoB;IACpB,MAAM,EAAE,YAAY,CAAA;IACpB,yCAAyC;IACzC,sBAAsB,EAAE,MAAM,CAAA;IAC9B,0BAA0B;IAC1B,UAAU,EAAE,MAAM,CAAA;CACnB,CAAC;;;;;;;;;;AAwMF,wBAOG"}
@@ -1,7 +1,7 @@
1
1
  import o from "./ResponseEmpty.vue2.js";
2
2
  /* empty css */
3
3
  import t from "../../../../_virtual/_plugin-vue_export-helper.js";
4
- const s = /* @__PURE__ */ t(o, [["__scopeId", "data-v-159bd9b3"]]);
4
+ const s = /* @__PURE__ */ t(o, [["__scopeId", "data-v-651d0186"]]);
5
5
  export {
6
6
  s as default
7
7
  };
@@ -1,32 +1,29 @@
1
- import { defineComponent as x, onMounted as k, onBeforeUnmount as v, createElementBlock as s, openBlock as a, createElementVNode as o, createCommentVNode as r, normalizeClass as y, createVNode as l, createTextVNode as i, toDisplayString as b, unref as m } from "vue";
1
+ import { defineComponent as p, createElementBlock as a, openBlock as s, createElementVNode as o, createCommentVNode as r, normalizeClass as f, createVNode as l, createTextVNode as n, toDisplayString as y, unref as i } from "vue";
2
2
  import { ScalarHotkey as d } from "@scalar/components";
3
- import R from "../../../../assets/computer.ascii.js";
4
- import g from "../../../../components/EmptyState.vue.js";
5
- import q from "../../../../components/ScalarAsciiArt.vue.js";
6
- const C = { class: "flex-center relative flex flex-1 flex-col gap-6 p-2 capitalize" }, S = {
3
+ import x from "../../../../assets/computer.ascii.js";
4
+ import k from "../../../../components/EmptyState.vue.js";
5
+ import b from "../../../../components/ScalarAsciiArt.vue.js";
6
+ const v = { class: "flex-center relative flex flex-1 flex-col gap-6 p-2 capitalize" }, g = {
7
7
  key: 0,
8
8
  class: "scalar-version-number"
9
- }, w = { class: "text-c-3 right-4 mt-auto flex w-full flex-col items-end gap-2 text-sm" }, E = /* @__PURE__ */ x({
9
+ }, R = { class: "text-c-3 right-4 mt-auto flex w-full flex-col items-end gap-2 text-sm" }, P = /* @__PURE__ */ p({
10
10
  __name: "ResponseEmpty",
11
11
  props: {
12
12
  layout: {},
13
13
  totalPerformedRequests: {},
14
- appVersion: {},
15
- events: {}
14
+ appVersion: {}
16
15
  },
17
16
  emits: ["addRequest", "sendRequest", "openCommandPalette"],
18
- setup(t, { emit: p }) {
19
- const n = p, u = (f) => {
20
- f?.createNew && n("addRequest");
21
- };
22
- return k(() => t.events.hotKeys.on(u)), v(() => t.events.hotKeys.off(u)), (f, e) => (a(), s("div", C, [
17
+ setup(t, { emit: c }) {
18
+ const m = c;
19
+ return (q, e) => (s(), a("div", v, [
23
20
  o("div", {
24
- class: y(["flex h-[calc(100%_-_50px)] flex-col items-center justify-center", {
21
+ class: f(["flex h-[calc(100%_-_50px)] flex-col items-center justify-center", {
25
22
  "hidden opacity-0": t.totalPerformedRequests < 1 && t.layout !== "modal"
26
23
  }])
27
24
  }, [
28
- t.layout !== "modal" ? (a(), s("div", S, [
29
- i(" Scalar App V" + b(t.appVersion) + " Beta ", 1),
25
+ t.layout !== "modal" ? (s(), a("div", g, [
26
+ n(" Scalar App V" + y(t.appVersion) + " Beta ", 1),
30
27
  e[3] || (e[3] = o("div", { class: "mt-2" }, [
31
28
  o("a", {
32
29
  href: "https://github.com/scalar/scalar/issues/2669",
@@ -39,53 +36,53 @@ const C = { class: "flex-center relative flex flex-1 flex-col gap-6 p-2 capitali
39
36
  href: "https://www.scalar.com",
40
37
  target: "_blank"
41
38
  }, " Powered By Scalar.com ", -1)),
42
- l(q, {
43
- art: m(R),
39
+ l(b, {
40
+ art: i(x),
44
41
  class: "text-c-3"
45
42
  }, null, 8, ["art"])
46
43
  ], 2),
47
- t.layout !== "modal" ? (a(), s("div", {
44
+ t.layout !== "modal" ? (s(), a("div", {
48
45
  key: 0,
49
- class: y(["hidden h-[calc(100%_-_50px)] items-center justify-center pb-5", {
46
+ class: f(["hidden h-[calc(100%_-_50px)] items-center justify-center pb-5", {
50
47
  "!flex opacity-100": t.totalPerformedRequests == 0
51
48
  }])
52
49
  }, [
53
- l(g)
50
+ l(k)
54
51
  ], 2)) : r("", !0),
55
- o("div", w, [
56
- t.layout !== "modal" ? (a(), s("button", {
52
+ o("div", R, [
53
+ t.layout !== "modal" ? (s(), a("button", {
57
54
  key: 0,
58
55
  class: "flex items-center gap-1.5",
59
56
  type: "button",
60
- onClick: e[0] || (e[0] = (c) => n("openCommandPalette"))
57
+ onClick: e[0] || (e[0] = (u) => m("openCommandPalette"))
61
58
  }, [
62
- e[5] || (e[5] = i(" Get Started ", -1)),
63
- l(m(d), {
59
+ e[5] || (e[5] = n(" Get Started ", -1)),
60
+ l(i(d), {
64
61
  hotkey: "p",
65
62
  modifier: ["default", "Shift"]
66
63
  })
67
64
  ])) : r("", !0),
68
- t.layout === "desktop" ? (a(), s("button", {
65
+ t.layout === "desktop" ? (s(), a("button", {
69
66
  key: 1,
70
67
  class: "flex items-center gap-1.5",
71
68
  type: "button",
72
- onClick: e[1] || (e[1] = (c) => n("addRequest"))
69
+ onClick: e[1] || (e[1] = (u) => m("addRequest"))
73
70
  }, [
74
- e[6] || (e[6] = i(" New Request ", -1)),
75
- l(m(d), { hotkey: "N" })
71
+ e[6] || (e[6] = n(" New Request ", -1)),
72
+ l(i(d), { hotkey: "N" })
76
73
  ])) : r("", !0),
77
74
  o("button", {
78
75
  class: "flex items-center gap-1.5",
79
76
  type: "button",
80
- onClick: e[2] || (e[2] = (c) => n("sendRequest"))
77
+ onClick: e[2] || (e[2] = (u) => m("sendRequest"))
81
78
  }, [
82
- e[7] || (e[7] = i(" Send Request ", -1)),
83
- l(m(d), { hotkey: "↵" })
79
+ e[7] || (e[7] = n(" Send Request ", -1)),
80
+ l(i(d), { hotkey: "↵" })
84
81
  ])
85
82
  ])
86
83
  ]));
87
84
  }
88
85
  });
89
86
  export {
90
- E as default
87
+ P as default
91
88
  };
@@ -1,7 +1,7 @@
1
- import type { createStoreEvents } from '../../../../store/events.js';
1
+ import type { WorkspaceEventBus } from '@scalar/workspace-store/events';
2
2
  type __VLS_Props = {
3
- /** Event bus */
4
- events: ReturnType<typeof createStoreEvents>;
3
+ /** Workspace event bus */
4
+ eventBus: WorkspaceEventBus;
5
5
  };
6
6
  declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
7
7
  export default _default;
@@ -1 +1 @@
1
- {"version":3,"file":"ResponseLoadingOverlay.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/response-block/components/ResponseLoadingOverlay.vue"],"names":[],"mappings":"AAgEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AAEvD,KAAK,WAAW,GAAG;IACjB,gBAAgB;IAChB,MAAM,EAAE,UAAU,CAAC,OAAO,iBAAiB,CAAC,CAAA;CAC7C,CAAC;;AA8GF,wBAMG"}
1
+ {"version":3,"file":"ResponseLoadingOverlay.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/response-block/components/ResponseLoadingOverlay.vue"],"names":[],"mappings":"AAuEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAGvE,KAAK,WAAW,GAAG;IACjB,0BAA0B;IAC1B,QAAQ,EAAE,iBAAiB,CAAA;CAC5B,CAAC;;AAwHF,wBAMG"}
@@ -1,7 +1,7 @@
1
1
  import o from "./ResponseLoadingOverlay.vue2.js";
2
2
  /* empty css */
3
- import a from "../../../../_virtual/_plugin-vue_export-helper.js";
4
- const p = /* @__PURE__ */ a(o, [["__scopeId", "data-v-57ced68a"]]);
3
+ import e from "../../../../_virtual/_plugin-vue_export-helper.js";
4
+ const p = /* @__PURE__ */ e(o, [["__scopeId", "data-v-1f35725e"]]);
5
5
  export {
6
6
  p as default
7
7
  };
@@ -1,40 +1,46 @@
1
- import { defineComponent as c, ref as u, createBlock as d, openBlock as s, Transition as m, withCtx as r, createElementBlock as f, createCommentVNode as v, unref as a, createVNode as i, createTextVNode as p } from "vue";
2
- import { useLoadingState as x, ScalarLoading as g, ScalarButton as k } from "@scalar/components";
3
- const y = {
1
+ import { defineComponent as c, ref as d, onMounted as m, onBeforeUnmount as f, createBlock as v, openBlock as l, Transition as B, withCtx as u, createElementBlock as k, createCommentVNode as g, unref as n, createVNode as i, createTextVNode as x } from "vue";
2
+ import { useLoadingState as p, ScalarLoading as q, ScalarButton as C } from "@scalar/components";
3
+ const L = {
4
4
  key: 0,
5
5
  class: "bg-b-1 z-overlay absolute inset-0 flex flex-col items-center justify-center gap-6"
6
- }, T = /* @__PURE__ */ c({
6
+ }, N = /* @__PURE__ */ c({
7
7
  __name: "ResponseLoadingOverlay",
8
8
  props: {
9
- events: {}
9
+ eventBus: {}
10
10
  },
11
- setup(n) {
12
- const e = x(), o = u();
13
- return n.events.requestStatus.on(async (l) => {
14
- l === "start" ? o.value = setTimeout(() => e.start(), 1e3) : (clearTimeout(o.value), o.value = void 0, await e.clear());
15
- }), (l, t) => (s(), d(m, null, {
16
- default: r(() => [
17
- a(e).isActive ? (s(), f("div", y, [
18
- i(a(g), {
11
+ setup(e) {
12
+ const t = p(), s = d(), r = () => {
13
+ s.value = setTimeout(() => t.start(), 1e3);
14
+ }, a = () => {
15
+ clearTimeout(s.value), s.value = void 0, t.clear();
16
+ };
17
+ return m(() => {
18
+ e.eventBus.on("hooks:on:request:sent", r), e.eventBus.on("hooks:on:request:complete", a);
19
+ }), f(() => {
20
+ e.eventBus.off("hooks:on:request:sent", r), e.eventBus.off("hooks:on:request:complete", a), a();
21
+ }), (h, o) => (l(), v(B, null, {
22
+ default: u(() => [
23
+ n(t).isActive ? (l(), k("div", L, [
24
+ i(n(q), {
19
25
  class: "text-c-3",
20
- loader: a(e),
26
+ loader: n(t),
21
27
  size: "3xl"
22
28
  }, null, 8, ["loader"]),
23
- i(a(k), {
29
+ i(n(C), {
24
30
  variant: "ghost",
25
- onClick: t[0] || (t[0] = (C) => n.events.cancelRequest.emit())
31
+ onClick: o[0] || (o[0] = (y) => e.eventBus.emit("operation:cancel:request"))
26
32
  }, {
27
- default: r(() => [...t[1] || (t[1] = [
28
- p(" Cancel ", -1)
33
+ default: u(() => [...o[1] || (o[1] = [
34
+ x(" Cancel ", -1)
29
35
  ])]),
30
36
  _: 1
31
37
  })
32
- ])) : v("", !0)
38
+ ])) : g("", !0)
33
39
  ]),
34
40
  _: 1
35
41
  }));
36
42
  }
37
43
  });
38
44
  export {
39
- T as default
45
+ N as default
40
46
  };