@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.
- package/CHANGELOG.md +29 -0
- package/dist/style.css +1 -1
- package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts.map +1 -1
- package/dist/v2/blocks/operation-block/OperationBlock.vue.js +56 -59
- package/dist/v2/blocks/operation-block/helpers/build-request-parameters.d.ts.map +1 -1
- package/dist/v2/blocks/operation-block/helpers/build-request-parameters.js +52 -51
- package/dist/v2/blocks/operation-block/helpers/de-serialize-parameter.d.ts +4 -0
- package/dist/v2/blocks/operation-block/helpers/de-serialize-parameter.d.ts.map +1 -0
- package/dist/v2/blocks/operation-block/helpers/de-serialize-parameter.js +23 -0
- package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-parameters.d.ts.map +1 -1
- package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-parameters.js +24 -23
- package/dist/v2/blocks/request-block/helpers/get-default-headers.js +1 -1
- package/dist/v2/blocks/response-block/ResponseBlock.vue.d.ts +2 -8
- package/dist/v2/blocks/response-block/ResponseBlock.vue.d.ts.map +1 -1
- package/dist/v2/blocks/response-block/ResponseBlock.vue.js +2 -2
- package/dist/v2/blocks/response-block/ResponseBlock.vue2.js +57 -60
- package/dist/v2/blocks/response-block/components/ResponseBodyStreaming.vue.d.ts.map +1 -1
- package/dist/v2/blocks/response-block/components/ResponseBodyStreaming.vue.js +61 -41
- package/dist/v2/blocks/response-block/components/ResponseEmpty.vue.d.ts +0 -3
- package/dist/v2/blocks/response-block/components/ResponseEmpty.vue.d.ts.map +1 -1
- package/dist/v2/blocks/response-block/components/ResponseEmpty.vue.js +1 -1
- package/dist/v2/blocks/response-block/components/ResponseEmpty.vue2.js +31 -34
- package/dist/v2/blocks/response-block/components/ResponseLoadingOverlay.vue.d.ts +3 -3
- package/dist/v2/blocks/response-block/components/ResponseLoadingOverlay.vue.d.ts.map +1 -1
- package/dist/v2/blocks/response-block/components/ResponseLoadingOverlay.vue.js +2 -2
- package/dist/v2/blocks/response-block/components/ResponseLoadingOverlay.vue2.js +26 -20
- package/dist/v2/blocks/response-block/components/ResponseMetaInformation.vue.d.ts +4 -2
- package/dist/v2/blocks/response-block/components/ResponseMetaInformation.vue.d.ts.map +1 -1
- package/dist/v2/blocks/response-block/components/ResponseMetaInformation.vue.js +39 -33
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.js +2 -2
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue2.js +64 -64
- package/dist/v2/blocks/scalar-address-bar-block/hooks/use-loading-animation.d.ts +1 -0
- package/dist/v2/blocks/scalar-address-bar-block/hooks/use-loading-animation.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-address-bar-block/hooks/use-loading-animation.js +12 -11
- package/dist/v2/components/code-input/CodeInput.vue.d.ts +152 -95
- package/dist/v2/components/code-input/CodeInput.vue.d.ts.map +1 -1
- package/dist/v2/components/code-input/CodeInput.vue.js +2 -2
- package/dist/v2/components/code-input/CodeInput.vue2.js +87 -99
- package/dist/v2/features/operation/Operation.vue.js +1 -1
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
- package/package.json +12 -12
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import type { ResponseInstance } from '@scalar/oas-utils/entities/spec';
|
|
2
|
-
import type {
|
|
2
|
+
import type { WorkspaceEventBus } from '@scalar/workspace-store/events';
|
|
3
3
|
type __VLS_Props = {
|
|
4
|
+
/** Response */
|
|
4
5
|
response: ResponseInstance;
|
|
5
|
-
|
|
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":"
|
|
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
|
|
2
|
-
import { httpStatusCodes as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import { getContentLength as
|
|
6
|
-
const
|
|
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
|
-
|
|
10
|
+
eventBus: {}
|
|
11
11
|
},
|
|
12
12
|
setup(e) {
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
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 =
|
|
18
|
-
const
|
|
19
|
-
if (
|
|
20
|
-
return
|
|
23
|
+
const t = x(() => {
|
|
24
|
+
const d = e.response?.status;
|
|
25
|
+
if (d)
|
|
26
|
+
return b[d] ?? void 0;
|
|
21
27
|
});
|
|
22
|
-
return (
|
|
23
|
-
|
|
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
|
-
|
|
26
|
-
|
|
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(
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
])) :
|
|
32
|
-
t.value ? (
|
|
33
|
-
|
|
34
|
-
t.value.url ? (
|
|
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:
|
|
40
|
-
|
|
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:
|
|
49
|
+
style: y({ backgroundColor: t.value.color })
|
|
44
50
|
}, null, 4)
|
|
45
51
|
]),
|
|
46
52
|
_: 1
|
|
47
|
-
}, 8, ["href"])) : (
|
|
48
|
-
|
|
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:
|
|
57
|
+
style: y({ backgroundColor: t.value.color })
|
|
52
58
|
}, null, 4)
|
|
53
59
|
]))
|
|
54
|
-
], 64)) :
|
|
60
|
+
], 64)) : k("", !0)
|
|
55
61
|
], 64))
|
|
56
62
|
]));
|
|
57
63
|
}
|
|
58
64
|
});
|
|
59
65
|
export {
|
|
60
|
-
|
|
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":"
|
|
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
|
|
4
|
+
const e = /* @__PURE__ */ r(o, [["__scopeId", "data-v-cf2e36b4"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
e as default
|
|
7
7
|
};
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { ScalarButton as
|
|
3
|
-
import { REQUEST_METHODS as
|
|
4
|
-
import { ScalarIconCopy as
|
|
5
|
-
import { useClipboard as
|
|
6
|
-
import { getResolvedUrl as
|
|
7
|
-
import { useLoadingAnimation as
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
const
|
|
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
|
-
},
|
|
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
|
-
},
|
|
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:
|
|
32
|
-
const d =
|
|
33
|
-
backgroundColor: `color-mix(in srgb, transparent 90%, ${
|
|
34
|
-
transform: `translate3d(-${
|
|
35
|
-
})), i =
|
|
36
|
-
const
|
|
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:
|
|
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) =>
|
|
48
|
+
}, I = (n) => y(n, i.value ?? e.path), A = (n) => {
|
|
49
49
|
const t = n.startsWith("/") ? n : `/${n}`;
|
|
50
|
-
|
|
50
|
+
y(r.value ?? e.method, t, {
|
|
51
51
|
debounceKey: `operation:update:pathMethod-${e.path}-${e.method}`
|
|
52
52
|
});
|
|
53
|
-
},
|
|
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
|
-
|
|
60
|
-
e.eventBus.on("ui:focus:address-bar",
|
|
61
|
-
}),
|
|
62
|
-
e.eventBus.off("ui:focus:address-bar",
|
|
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:
|
|
65
|
-
await
|
|
66
|
-
|
|
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
|
|
69
|
+
return $({
|
|
70
70
|
methodConflict: r,
|
|
71
71
|
pathConflict: i
|
|
72
|
-
}), (n, t) => (h(),
|
|
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:
|
|
78
|
-
"outline-c-danger outline":
|
|
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",
|
|
81
|
+
o("div", ae, [
|
|
82
82
|
o("div", {
|
|
83
83
|
class: "absolute top-0 left-0 z-[1002] h-full w-full",
|
|
84
|
-
style:
|
|
84
|
+
style: K(T.value)
|
|
85
85
|
}, null, 4)
|
|
86
86
|
]),
|
|
87
|
-
o("div",
|
|
88
|
-
a(l(
|
|
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",
|
|
97
|
-
e.servers.length ? (h(),
|
|
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"])) :
|
|
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(
|
|
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":
|
|
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:
|
|
140
|
+
onClick: N
|
|
141
141
|
}, {
|
|
142
|
-
default:
|
|
143
|
-
a(l(
|
|
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(
|
|
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
|
-
|
|
154
|
-
o("div",
|
|
155
|
-
a(l(
|
|
156
|
-
o("div",
|
|
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(
|
|
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
|
-
])) :
|
|
167
|
-
a(l(
|
|
166
|
+
])) : R("", !0),
|
|
167
|
+
a(l(E), {
|
|
168
168
|
ref_key: "sendButtonRef",
|
|
169
|
-
ref:
|
|
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(
|
|
171
|
+
disabled: l(L),
|
|
172
172
|
onClick: t[6] || (t[6] = (s) => d("execute"))
|
|
173
173
|
}, {
|
|
174
|
-
default:
|
|
175
|
-
o("span",
|
|
176
|
-
a(l(
|
|
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",
|
|
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,
|
|
188
|
+
], 8, se));
|
|
189
189
|
}
|
|
190
190
|
});
|
|
191
191
|
export {
|
|
192
|
-
|
|
192
|
+
Se as default
|
|
193
193
|
};
|
|
@@ -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;
|
|
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,
|
|
3
|
-
const e = n(s), o = n(0),
|
|
4
|
-
clearInterval(
|
|
5
|
-
},
|
|
6
|
-
|
|
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 (
|
|
11
|
-
|
|
10
|
+
if (t.value) {
|
|
11
|
+
a.value = !0;
|
|
12
12
|
return;
|
|
13
13
|
}
|
|
14
|
-
|
|
14
|
+
a.value = !0, t.value = setInterval(i, l);
|
|
15
15
|
},
|
|
16
16
|
stopLoading: () => {
|
|
17
|
-
o.value = e.value,
|
|
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
|
-
|
|
24
|
+
g as useLoadingAnimation
|
|
24
25
|
};
|