@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,8 +1,10 @@
1
1
  import type { ResponseInstance } from '@scalar/oas-utils/entities/spec';
2
- import type { createStoreEvents } from '../../../../store/events.js';
2
+ import type { WorkspaceEventBus } from '@scalar/workspace-store/events';
3
3
  type __VLS_Props = {
4
+ /** Response */
4
5
  response: ResponseInstance;
5
- events: ReturnType<typeof createStoreEvents>;
6
+ /** Workspace event bus */
7
+ eventBus: WorkspaceEventBus;
6
8
  };
7
9
  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>;
8
10
  export default _default;
@@ -1 +1 @@
1
- {"version":3,"file":"ResponseMetaInformation.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/response-block/components/ResponseMetaInformation.vue"],"names":[],"mappings":"AA4EA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAA;AAMvE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AAGvD,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,gBAAgB,CAAA;IAC1B,MAAM,EAAE,UAAU,CAAC,OAAO,iBAAiB,CAAC,CAAA;CAC7C,CAAC;;AA0IF,wBAMG"}
1
+ {"version":3,"file":"ResponseMetaInformation.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/response-block/components/ResponseMetaInformation.vue"],"names":[],"mappings":"AAyFA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAA;AAEvE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAOvE,KAAK,WAAW,GAAG;IACjB,eAAe;IACf,QAAQ,EAAE,gBAAgB,CAAA;IAC1B,0BAA0B;IAC1B,QAAQ,EAAE,iBAAiB,CAAA;CAC5B,CAAC;;AAqJF,wBAMG"}
@@ -1,61 +1,67 @@
1
- import { defineComponent as C, ref as d, computed as g, createElementBlock as a, openBlock as s, toDisplayString as n, unref as c, Fragment as p, createElementVNode as l, createCommentVNode as v, createTextVNode as m, createBlock as h, withCtx as x, normalizeStyle as f } from "vue";
2
- import { httpStatusCodes as S } from "@scalar/oas-utils/helpers";
3
- import y from "pretty-ms";
4
- import I from "../../../../components/HelpfulLink.vue.js";
5
- import { getContentLength as k } from "../helpers/get-content-length.js";
6
- const b = { class: "text-c-1 flex gap-1.5" }, w = { key: 0 }, B = { key: 0 }, N = { key: 1 }, R = /* @__PURE__ */ C({
1
+ import { defineComponent as C, ref as v, onMounted as g, onBeforeUnmount as S, computed as x, createElementBlock as a, openBlock as o, toDisplayString as n, unref as c, Fragment as p, createElementVNode as l, createCommentVNode as k, createTextVNode as i, createBlock as w, withCtx as I, normalizeStyle as y } from "vue";
2
+ import { httpStatusCodes as b } from "@scalar/oas-utils/helpers";
3
+ import h from "pretty-ms";
4
+ import q from "../../../../components/HelpfulLink.vue.js";
5
+ import { getContentLength as B } from "../helpers/get-content-length.js";
6
+ const M = { class: "text-c-1 flex gap-1.5" }, N = { key: 0 }, V = { key: 0 }, z = { key: 1 }, T = /* @__PURE__ */ C({
7
7
  __name: "ResponseMetaInformation",
8
8
  props: {
9
9
  response: {},
10
- events: {}
10
+ eventBus: {}
11
11
  },
12
12
  setup(e) {
13
- const u = d(), i = d(0);
14
- e.events.requestStatus.on((r) => {
15
- r === "start" ? u.value = setInterval(() => i.value += 1e3, 1e3) : (clearInterval(u.value), u.value = void 0, i.value = 0);
13
+ const r = v(), u = v(0), m = () => {
14
+ clearInterval(r.value), r.value = void 0, u.value = 0;
15
+ }, f = () => {
16
+ r.value = setInterval(() => u.value += 1e3, 1e3);
17
+ };
18
+ g(() => {
19
+ e.eventBus.on("hooks:on:request:sent", f), e.eventBus.on("hooks:on:request:complete", m);
20
+ }), S(() => {
21
+ e.eventBus.off("hooks:on:request:sent", f), e.eventBus.off("hooks:on:request:complete", m), m();
16
22
  });
17
- const t = g(() => {
18
- const r = e.response.status;
19
- if (r)
20
- return S[r] ?? void 0;
23
+ const t = x(() => {
24
+ const d = e.response?.status;
25
+ if (d)
26
+ return b[d] ?? void 0;
21
27
  });
22
- return (r, o) => (s(), a("div", b, [
23
- u.value && i.value ? (s(), a("span", w, n(c(y)(i.value)), 1)) : (s(), a(p, { key: 1 }, [
28
+ return (d, s) => (o(), a("div", M, [
29
+ r.value && u.value ? (o(), a("span", N, n(c(h)(u.value)), 1)) : (o(), a(p, { key: 1 }, [
24
30
  l("span", null, [
25
- o[0] || (o[0] = l("span", { class: "sr-only" }, "Response Information, Duration:", -1)),
26
- m(" " + n(c(y)(e.response.duration)), 1)
31
+ s[0] || (s[0] = l("span", { class: "sr-only" }, "Response Information, Duration:", -1)),
32
+ i(" " + n(c(h)(e.response.duration)), 1)
27
33
  ]),
28
- c(k)(e.response) ? (s(), a("span", B, [
29
- o[1] || (o[1] = l("span", { class: "sr-only" }, ", Size:", -1)),
30
- m(" " + n(c(k)(e.response)), 1)
31
- ])) : v("", !0),
32
- t.value ? (s(), a(p, { key: 1 }, [
33
- o[2] || (o[2] = l("span", { class: "sr-only" }, ", Status:", -1)),
34
- t.value.url ? (s(), h(I, {
34
+ c(B)(e.response) ? (o(), a("span", V, [
35
+ s[1] || (s[1] = l("span", { class: "sr-only" }, ", Size:", -1)),
36
+ i(" " + n(c(B)(e.response)), 1)
37
+ ])) : k("", !0),
38
+ t.value ? (o(), a(p, { key: 1 }, [
39
+ s[2] || (s[2] = l("span", { class: "sr-only" }, ", Status:", -1)),
40
+ t.value.url ? (o(), w(q, {
35
41
  key: 0,
36
42
  class: "flex items-center gap-1.5",
37
43
  href: t.value.url
38
44
  }, {
39
- default: x(() => [
40
- m(n(e.response.status) + " " + n(t.value.name) + " ", 1),
45
+ default: I(() => [
46
+ i(n(e.response.status) + " " + n(t.value.name) + " ", 1),
41
47
  l("span", {
42
48
  class: "block h-1.5 w-1.5 rounded-full",
43
- style: f({ backgroundColor: t.value.color })
49
+ style: y({ backgroundColor: t.value.color })
44
50
  }, null, 4)
45
51
  ]),
46
52
  _: 1
47
- }, 8, ["href"])) : (s(), a("span", N, [
48
- m(n(e.response.status) + " " + n(t.value.name) + " ", 1),
53
+ }, 8, ["href"])) : (o(), a("span", z, [
54
+ i(n(e.response.status) + " " + n(t.value.name) + " ", 1),
49
55
  l("span", {
50
56
  class: "block h-1.5 w-1.5 rounded-full",
51
- style: f({ backgroundColor: t.value.color })
57
+ style: y({ backgroundColor: t.value.color })
52
58
  }, null, 4)
53
59
  ]))
54
- ], 64)) : v("", !0)
60
+ ], 64)) : k("", !0)
55
61
  ], 64))
56
62
  ]));
57
63
  }
58
64
  });
59
65
  export {
60
- R as default
66
+ T as default
61
67
  };
@@ -1 +1 @@
1
- {"version":3,"file":"AddressBar.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-address-bar-block/components/AddressBar.vue"],"names":[],"mappings":"AAwbA,OAAO,KAAK,EAAE,UAAU,IAAI,cAAc,EAAE,MAAM,mCAAmC,CAAA;AAGrF,OAAO,KAAK,EAEV,iBAAiB,EAClB,MAAM,gCAAgC,CAAA;AACvC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2EAA2E,CAAA;AACnH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAA;AAWhG,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,SAAS,CAAA;AAM3C,OAA0B,EAAE,KAAK,OAAO,EAAE,MAAM,yBAAyB,CAAA;AAEzE,KAAK,WAAW,GAAG;IACjB,2BAA2B;IAC3B,IAAI,EAAE,MAAM,CAAA;IACZ,6BAA6B;IAC7B,MAAM,EAAE,cAAc,CAAA;IACtB,gCAAgC;IAChC,MAAM,EAAE,YAAY,GAAG,IAAI,CAAA;IAC3B,mDAAmD;IACnD,OAAO,EAAE,YAAY,EAAE,CAAA;IACvB,8BAA8B;IAC9B,OAAO,EAAE,OAAO,EAAE,CAAA;IAClB,oBAAoB;IACpB,MAAM,EAAE,YAAY,CAAA;IACpB,gBAAgB;IAChB,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,kBAAkB;IAClB,WAAW,EAAE,kBAAkB,CAAA;CAChC,CAAC;;;;;;;;eAkB6C,MAAM;;;;;;eAAN,MAAM;;;AAglBrD,wBAQG"}
1
+ {"version":3,"file":"AddressBar.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-address-bar-block/components/AddressBar.vue"],"names":[],"mappings":"AAybA,OAAO,KAAK,EAAE,UAAU,IAAI,cAAc,EAAE,MAAM,mCAAmC,CAAA;AAGrF,OAAO,KAAK,EAEV,iBAAiB,EAClB,MAAM,gCAAgC,CAAA;AACvC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2EAA2E,CAAA;AACnH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAA;AAWhG,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,SAAS,CAAA;AAM3C,OAA0B,EAAE,KAAK,OAAO,EAAE,MAAM,yBAAyB,CAAA;AAEzE,KAAK,WAAW,GAAG;IACjB,2BAA2B;IAC3B,IAAI,EAAE,MAAM,CAAA;IACZ,6BAA6B;IAC7B,MAAM,EAAE,cAAc,CAAA;IACtB,gCAAgC;IAChC,MAAM,EAAE,YAAY,GAAG,IAAI,CAAA;IAC3B,mDAAmD;IACnD,OAAO,EAAE,YAAY,EAAE,CAAA;IACvB,8BAA8B;IAC9B,OAAO,EAAE,OAAO,EAAE,CAAA;IAClB,oBAAoB;IACpB,MAAM,EAAE,YAAY,CAAA;IACpB,gBAAgB;IAChB,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,kBAAkB;IAClB,WAAW,EAAE,kBAAkB,CAAA;CAChC,CAAC;;;;;;;;eAkB6C,MAAM;;;;;;eAAN,MAAM;;;AAilBrD,wBAQG"}
@@ -1,7 +1,7 @@
1
1
  import o from "./AddressBar.vue2.js";
2
2
  /* empty css */
3
3
  import r from "../../../../_virtual/_plugin-vue_export-helper.js";
4
- const a = /* @__PURE__ */ r(o, [["__scopeId", "data-v-80d05ddf"]]);
4
+ const e = /* @__PURE__ */ r(o, [["__scopeId", "data-v-cf2e36b4"]]);
5
5
  export {
6
- a as default
6
+ e as default
7
7
  };
@@ -1,21 +1,21 @@
1
- import { defineComponent as D, useId as F, computed as w, ref as S, useTemplateRef as U, onMounted as H, onBeforeUnmount as W, createElementBlock as R, openBlock as h, unref as l, createElementVNode as o, normalizeClass as O, createVNode as a, createCommentVNode as z, normalizeStyle as P, createBlock as K, withCtx as E, createTextVNode as x, toDisplayString as c } from "vue";
2
- import { ScalarButton as $, ScalarWrappingText as Q, ScalarIcon as j } from "@scalar/components";
3
- import { REQUEST_METHODS as G } from "@scalar/helpers/http/http-info";
4
- import { ScalarIconCopy as J, ScalarIconWarningCircle as X } from "@scalar/icons";
5
- import { useClipboard as Y } from "@scalar/use-hooks/useClipboard";
6
- import { getResolvedUrl as Z } from "../../operation-block/helpers/get-resolved-url.js";
7
- import { useLoadingAnimation as _ } from "../hooks/use-loading-animation.js";
8
- import ee from "./AddressBarHistory.vue.js";
9
- import te from "../../../../components/HttpMethod/HttpMethod.vue.js";
10
- import ne from "../../../components/server/ServerDropdown.vue.js";
11
- import oe from "../../../components/code-input/CodeInput.vue.js";
12
- const le = ["id"], se = { class: "pointer-events-none absolute top-0 left-0 block h-full w-full overflow-hidden rounded-lg border" }, ae = { class: "z-context-plus flex gap-1" }, re = { class: "scroll-timeline-x scroll-timeline-x-hidden z-context-plus relative flex w-full bg-blend-normal" }, ie = {
1
+ import { defineComponent as F, useId as H, computed as k, ref as w, useTemplateRef as S, onMounted as W, onBeforeUnmount as O, createElementBlock as U, openBlock as h, unref as l, createElementVNode as o, normalizeClass as P, createVNode as a, createCommentVNode as R, normalizeStyle as K, createBlock as Q, withCtx as z, createTextVNode as x, toDisplayString as c } from "vue";
2
+ import { ScalarButton as E, ScalarWrappingText as j, ScalarIcon as G } from "@scalar/components";
3
+ import { REQUEST_METHODS as J } from "@scalar/helpers/http/http-info";
4
+ import { ScalarIconCopy as X, ScalarIconWarningCircle as Y } from "@scalar/icons";
5
+ import { useClipboard as Z } from "@scalar/use-hooks/useClipboard";
6
+ import { getResolvedUrl as _ } from "../../operation-block/helpers/get-resolved-url.js";
7
+ import { useLoadingAnimation as ee } from "../hooks/use-loading-animation.js";
8
+ import te from "./AddressBarHistory.vue.js";
9
+ import ne from "../../../../components/HttpMethod/HttpMethod.vue.js";
10
+ import oe from "../../../components/server/ServerDropdown.vue.js";
11
+ import le from "../../../components/code-input/CodeInput.vue.js";
12
+ const se = ["id"], ae = { class: "pointer-events-none absolute top-0 left-0 block h-full w-full overflow-hidden rounded-lg border" }, re = { class: "z-context-plus flex gap-1" }, ie = { class: "scroll-timeline-x scroll-timeline-x-hidden z-context-plus relative flex w-full bg-blend-normal" }, de = {
13
13
  key: 0,
14
14
  class: "z-context absolute inset-x-0 top-[calc(100%+4px)] flex flex-col items-center rounded px-6"
15
- }, de = { class: "text-c-danger bg-b-danger border-c-danger flex items-center gap-1 rounded border p-1" }, ue = { class: "min-w-0 flex-1" }, me = {
15
+ }, ue = { class: "text-c-danger bg-b-danger border-c-danger flex items-center gap-1 rounded border p-1" }, me = { class: "min-w-0 flex-1" }, ce = {
16
16
  "aria-hidden": "true",
17
17
  class: "inline-flex items-center gap-1"
18
- }, ce = { class: "sr-only" }, we = /* @__PURE__ */ D({
18
+ }, fe = { class: "sr-only" }, Se = /* @__PURE__ */ F({
19
19
  __name: "AddressBar",
20
20
  props: {
21
21
  path: {},
@@ -28,64 +28,64 @@ const le = ["id"], se = { class: "pointer-events-none absolute top-0 left-0 bloc
28
28
  environment: {}
29
29
  },
30
30
  emits: ["execute", "update:servers", "select:history:item"],
31
- setup(e, { expose: V, emit: q }) {
32
- const d = q, f = F(), { percentage: b, startLoading: g, stopLoading: v } = _(), T = w(() => ({
33
- backgroundColor: `color-mix(in srgb, transparent 90%, ${G[e.method].colorVar})`,
34
- transform: `translate3d(-${b.value}%,0,0)`
35
- })), i = S(null), r = S(null), y = w(() => r.value || i.value), B = (n, t, s) => {
36
- const N = u.value?.cursorPosition();
31
+ setup(e, { expose: $, emit: V }) {
32
+ const d = V, f = H(), { percentage: q, startLoading: b, stopLoading: v, isLoading: L } = ee(), T = k(() => ({
33
+ backgroundColor: `color-mix(in srgb, transparent 90%, ${J[e.method].colorVar})`,
34
+ transform: `translate3d(-${q.value}%,0,0)`
35
+ })), i = w(null), r = w(null), g = k(() => r.value || i.value), y = (n, t, s) => {
36
+ const D = u.value?.cursorPosition();
37
37
  e.eventBus.emit(
38
38
  "operation:update:pathMethod",
39
39
  {
40
40
  meta: { method: e.method, path: e.path },
41
41
  payload: { method: n, path: t },
42
42
  callback: (m) => {
43
- (m === "success" || m === "no-change") && (r.value = null, i.value = null), m === "success" ? e.eventBus.emit("ui:focus:address-bar", { position: N }) : m === "conflict" && (n !== e.method && (r.value = n), t !== e.path && (i.value = t));
43
+ (m === "success" || m === "no-change") && (r.value = null, i.value = null), m === "success" ? e.eventBus.emit("ui:focus:address-bar", { position: D }) : m === "conflict" && (n !== e.method && (r.value = n), t !== e.path && (i.value = t));
44
44
  }
45
45
  },
46
46
  s
47
47
  );
48
- }, I = (n) => B(n, i.value ?? e.path), L = (n) => {
48
+ }, I = (n) => y(n, i.value ?? e.path), A = (n) => {
49
49
  const t = n.startsWith("/") ? n : `/${n}`;
50
- B(r.value ?? e.method, t, {
50
+ y(r.value ?? e.method, t, {
51
51
  debounceKey: `operation:update:pathMethod-${e.path}-${e.method}`
52
52
  });
53
- }, C = U("sendButtonRef"), u = U("addressBarRef"), p = () => C.value?.$el?.focus(), k = (n) => {
53
+ }, B = S("sendButtonRef"), u = S("addressBarRef"), C = () => B.value?.$el?.focus(), p = (n) => {
54
54
  if (u.value?.isFocused && e.layout !== "desktop")
55
55
  return;
56
56
  const t = n && "position" in n ? n.position : "end";
57
57
  u.value?.focus(t), n && "event" in n && n.event.preventDefault();
58
58
  };
59
- H(() => {
60
- e.eventBus.on("ui:focus:address-bar", k), e.eventBus.on("ui:focus:send-button", p), e.eventBus.on("hooks:on:request:sent", g), e.eventBus.on("hooks:on:request:complete", v);
61
- }), W(() => {
62
- e.eventBus.off("ui:focus:address-bar", k), e.eventBus.off("ui:focus:send-button", p), e.eventBus.off("hooks:on:request:sent", g), e.eventBus.off("hooks:on:request:complete", v), v();
59
+ W(() => {
60
+ e.eventBus.on("ui:focus:address-bar", p), e.eventBus.on("ui:focus:send-button", C), e.eventBus.on("hooks:on:request:sent", b), e.eventBus.on("hooks:on:request:complete", v);
61
+ }), O(() => {
62
+ e.eventBus.off("ui:focus:address-bar", p), e.eventBus.off("ui:focus:send-button", C), e.eventBus.off("hooks:on:request:sent", b), e.eventBus.off("hooks:on:request:complete", v), v();
63
63
  });
64
- const { copyToClipboard: A } = Y(), M = async () => {
65
- await A(
66
- Z({ environment: e.environment, server: e.server, path: e.path, pathVariables: {} })
64
+ const { copyToClipboard: M } = Z(), N = async () => {
65
+ await M(
66
+ _({ environment: e.environment, server: e.server, path: e.path, pathVariables: {} })
67
67
  );
68
68
  };
69
- return V({
69
+ return $({
70
70
  methodConflict: r,
71
71
  pathConflict: i
72
- }), (n, t) => (h(), R("div", {
72
+ }), (n, t) => (h(), U("div", {
73
73
  id: l(f),
74
74
  class: "scalar-address-bar order-last flex h-(--scalar-address-bar-height) w-full [--scalar-address-bar-height:32px] lg:order-none lg:w-auto"
75
75
  }, [
76
76
  o("div", {
77
- class: O(["address-bar-bg-states text-xxs group relative order-last flex w-full max-w-[calc(100dvw-24px)] flex-1 flex-row items-stretch rounded-lg p-0.75 lg:order-none lg:max-w-[580px] lg:min-w-[580px] xl:max-w-[720px] xl:min-w-[720px]", {
78
- "outline-c-danger outline": y.value
77
+ class: P(["address-bar-bg-states text-xxs group relative order-last flex w-full max-w-[calc(100dvw-24px)] flex-1 flex-row items-stretch rounded-lg p-0.75 lg:order-none lg:max-w-[580px] lg:min-w-[580px] xl:max-w-[720px] xl:min-w-[720px]", {
78
+ "outline-c-danger outline": g.value
79
79
  }])
80
80
  }, [
81
- o("div", se, [
81
+ o("div", ae, [
82
82
  o("div", {
83
83
  class: "absolute top-0 left-0 z-[1002] h-full w-full",
84
- style: P(T.value)
84
+ style: K(T.value)
85
85
  }, null, 4)
86
86
  ]),
87
- o("div", ae, [
88
- a(l(te), {
87
+ o("div", re, [
88
+ a(l(ne), {
89
89
  isEditable: e.layout !== "modal",
90
90
  isSquare: "",
91
91
  method: r.value ?? e.method,
@@ -93,8 +93,8 @@ const le = ["id"], se = { class: "pointer-events-none absolute top-0 left-0 bloc
93
93
  onChange: I
94
94
  }, null, 8, ["isEditable", "method"])
95
95
  ]),
96
- o("div", re, [
97
- e.servers.length ? (h(), K(l(ne), {
96
+ o("div", ie, [
97
+ e.servers.length ? (h(), Q(l(oe), {
98
98
  key: 0,
99
99
  layout: e.layout,
100
100
  server: e.server,
@@ -103,9 +103,9 @@ const le = ["id"], se = { class: "pointer-events-none absolute top-0 left-0 bloc
103
103
  "onUpdate:selectedServer": t[0] || (t[0] = (s) => e.eventBus.emit("server:update:selected", s)),
104
104
  "onUpdate:servers": t[1] || (t[1] = (s) => d("update:servers")),
105
105
  "onUpdate:variable": t[2] || (t[2] = (s) => e.eventBus.emit("server:update:variables", s))
106
- }, null, 8, ["layout", "server", "servers", "target"])) : z("", !0),
106
+ }, null, 8, ["layout", "server", "servers", "target"])) : R("", !0),
107
107
  t[7] || (t[7] = o("div", { class: "fade-left" }, null, -1)),
108
- a(l(oe), {
108
+ a(l(le), {
109
109
  ref_key: "addressBarRef",
110
110
  ref: u,
111
111
  alwaysEmitChange: "",
@@ -129,65 +129,65 @@ const le = ["id"], se = { class: "pointer-events-none absolute top-0 left-0 bloc
129
129
  }
130
130
  })),
131
131
  onSubmit: t[4] || (t[4] = (s) => d("execute")),
132
- "onUpdate:modelValue": L
132
+ "onUpdate:modelValue": A
133
133
  }, null, 8, ["disabled", "environment", "layout", "modelValue", "placeholder"]),
134
134
  t[8] || (t[8] = o("div", { class: "fade-right" }, null, -1))
135
135
  ]),
136
- a(l($), {
136
+ a(l(E), {
137
137
  class: "hover:bg-b-3 mx-1",
138
138
  size: "xs",
139
139
  variant: "ghost",
140
- onClick: M
140
+ onClick: N
141
141
  }, {
142
- default: E(() => [
143
- a(l(J)),
142
+ default: z(() => [
143
+ a(l(X)),
144
144
  t[9] || (t[9] = o("span", { class: "sr-only" }, "Copy URL", -1))
145
145
  ]),
146
146
  _: 1
147
147
  }),
148
- a(ee, {
148
+ a(te, {
149
149
  history: e.history,
150
150
  target: l(f),
151
151
  "onSelect:history:item": t[5] || (t[5] = (s) => d("select:history:item", s))
152
152
  }, null, 8, ["history", "target"]),
153
- y.value ? (h(), R("div", ie, [
154
- o("div", de, [
155
- a(l(X), { size: "sm" }),
156
- o("div", ue, [
153
+ g.value ? (h(), U("div", de, [
154
+ o("div", ue, [
155
+ a(l(Y), { size: "sm" }),
156
+ o("div", me, [
157
157
  t[10] || (t[10] = x(" A ", -1)),
158
158
  o("em", null, c(r.value?.toUpperCase() ?? e.method.toUpperCase()), 1),
159
159
  t[11] || (t[11] = x(" request to ", -1)),
160
- a(l(Q), {
160
+ a(l(j), {
161
161
  text: i.value ?? e.path
162
162
  }, null, 8, ["text"]),
163
163
  t[12] || (t[12] = x(" already exists in this document ", -1))
164
164
  ])
165
165
  ])
166
- ])) : z("", !0),
167
- a(l($), {
166
+ ])) : R("", !0),
167
+ a(l(E), {
168
168
  ref_key: "sendButtonRef",
169
- ref: C,
169
+ ref: B,
170
170
  class: "z-context-plus relative h-auto shrink-0 overflow-hidden py-1 pr-2.5 pl-2 font-bold",
171
- disabled: l(b) < 100,
171
+ disabled: l(L),
172
172
  onClick: t[6] || (t[6] = (s) => d("execute"))
173
173
  }, {
174
- default: E(() => [
175
- o("span", me, [
176
- a(l(j), {
174
+ default: z(() => [
175
+ o("span", ce, [
176
+ a(l(G), {
177
177
  class: "relative shrink-0 fill-current",
178
178
  icon: "Play",
179
179
  size: "xs"
180
180
  }),
181
181
  t[13] || (t[13] = o("span", { class: "text-xxs hidden lg:flex" }, "Send", -1))
182
182
  ]),
183
- o("span", ce, " Send " + c(e.method) + " request to " + c(e.server?.url ?? "") + c(e.path), 1)
183
+ o("span", fe, " Send " + c(e.method) + " request to " + c(e.server?.url ?? "") + c(e.path), 1)
184
184
  ]),
185
185
  _: 1
186
186
  }, 8, ["disabled"])
187
187
  ], 2)
188
- ], 8, le));
188
+ ], 8, se));
189
189
  }
190
190
  });
191
191
  export {
192
- we as default
192
+ Se as default
193
193
  };
@@ -15,5 +15,6 @@ export declare const useLoadingAnimation: () => {
15
15
  startLoading: () => void;
16
16
  stopLoading: () => void;
17
17
  percentage: Ref<number>;
18
+ isLoading: Ref<boolean>;
18
19
  };
19
20
  //# sourceMappingURL=use-loading-animation.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"use-loading-animation.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-address-bar-block/hooks/use-loading-animation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAe9B;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,mBAAmB,QAAO;IACrC,YAAY,EAAE,MAAM,IAAI,CAAA;IACxB,WAAW,EAAE,MAAM,IAAI,CAAA;IACvB,UAAU,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;CAwExB,CAAA"}
1
+ {"version":3,"file":"use-loading-animation.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-address-bar-block/hooks/use-loading-animation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAe9B;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,mBAAmB,QAAO;IACrC,YAAY,EAAE,MAAM,IAAI,CAAA;IACxB,WAAW,EAAE,MAAM,IAAI,CAAA;IACvB,UAAU,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IACvB,SAAS,EAAE,GAAG,CAAC,OAAO,CAAC,CAAA;CAyExB,CAAA"}
@@ -1,24 +1,25 @@
1
1
  import { ref as n } from "vue";
2
- const l = 20, s = 100, I = 0, i = 15, r = 60, c = 400, A = c / l, M = () => {
3
- const e = n(s), o = n(0), t = n(!1), a = n(), u = () => {
4
- clearInterval(a.value), a.value = void 0, e.value = s, t.value = !1;
5
- }, v = () => {
6
- t.value ? e.value -= (e.value - i) / r : e.value -= o.value / A, e.value <= I && u();
2
+ const l = 20, s = 100, v = 0, I = 15, r = 60, c = 400, A = c / l, g = () => {
3
+ const e = n(s), o = n(0), a = n(!1), t = n(), u = () => {
4
+ clearInterval(t.value), t.value = void 0, e.value = s, a.value = !1;
5
+ }, i = () => {
6
+ a.value ? e.value -= (e.value - I) / r : e.value -= o.value / A, e.value <= v && u();
7
7
  };
8
8
  return {
9
9
  startLoading: () => {
10
- if (a.value) {
11
- t.value = !0;
10
+ if (t.value) {
11
+ a.value = !0;
12
12
  return;
13
13
  }
14
- t.value = !0, a.value = setInterval(v, l);
14
+ a.value = !0, t.value = setInterval(i, l);
15
15
  },
16
16
  stopLoading: () => {
17
- o.value = e.value, t.value = !1;
17
+ o.value = e.value, a.value = !1;
18
18
  },
19
- percentage: e
19
+ percentage: e,
20
+ isLoading: a
20
21
  };
21
22
  };
22
23
  export {
23
- M as useLoadingAnimation
24
+ g as useLoadingAnimation
24
25
  };