UNPKG

@scalar/api-client

Version:

the open source API testing client

89 lines (88 loc) 3.29 kB
import { defineComponent as k, onMounted as v, onBeforeUnmount as b, createElementBlock as s, openBlock as a, createElementVNode as o, createCommentVNode as r, normalizeClass as y, createVNode as l, createTextVNode as i, toDisplayString as x, unref as m } from "vue"; import { ScalarHotkey as d } from "@scalar/components"; import R from "../../../../assets/computer.ascii.js"; import g from "../../../../components/EmptyState.vue.js"; import q from "../../../../components/ScalarAsciiArt.vue.js"; const C = { class: "flex-center relative flex flex-1 flex-col gap-6 p-2 capitalize" }, w = { key: 0, class: "scalar-version-number" }, S = { class: "text-c-3 right-4 mt-auto flex w-full flex-col items-end gap-2 text-sm" }, E = /* @__PURE__ */ k({ __name: "ResponseEmpty", props: { layout: {}, totalPerformedRequests: {}, appVersion: {}, events: {} }, emits: ["addRequest", "sendRequest", "openCommandPalette"], setup(u, { emit: c }) { const n = c, p = (t) => { t?.createNew && n("addRequest"); }; return v(() => u.events.hotKeys.on(p)), b(() => u.events.hotKeys.off(p)), (t, e) => (a(), s("div", C, [ o("div", { class: y(["flex h-[calc(100%_-_50px)] flex-col items-center justify-center", { "hidden opacity-0": t.totalPerformedRequests < 1 && t.layout !== "modal" }]) }, [ t.layout !== "modal" ? (a(), s("div", w, [ i(" Scalar App V" + x(t.appVersion) + " Beta ", 1), e[3] || (e[3] = o("div", { class: "mt-2" }, [ o("a", { href: "https://github.com/scalar/scalar/issues/2669", target: "_blank" }, " Roadmap ") ], -1)) ])) : r("", !0), e[4] || (e[4] = o("a", { class: "gitbook-show scalar-version-number", href: "https://www.scalar.com", target: "_blank" }, " Powered By Scalar.com ", -1)), l(q, { art: m(R), class: "text-c-3" }, null, 8, ["art"]) ], 2), t.layout !== "modal" ? (a(), s("div", { key: 0, class: y(["hidden h-[calc(100%_-_50px)] items-center justify-center pb-5", { "!flex opacity-100": t.totalPerformedRequests == 0 }]) }, [ l(g) ], 2)) : r("", !0), o("div", S, [ t.layout !== "modal" ? (a(), s("button", { key: 0, class: "flex items-center gap-1.5", type: "button", onClick: e[0] || (e[0] = (f) => n("openCommandPalette")) }, [ e[5] || (e[5] = i(" Get Started ", -1)), l(m(d), { hotkey: "k" }) ])) : r("", !0), t.layout === "desktop" ? (a(), s("button", { key: 1, class: "flex items-center gap-1.5", type: "button", onClick: e[1] || (e[1] = (f) => n("addRequest")) }, [ e[6] || (e[6] = i(" New Request ", -1)), l(m(d), { hotkey: "N" }) ])) : r("", !0), o("button", { class: "flex items-center gap-1.5", type: "button", onClick: e[2] || (e[2] = (f) => n("sendRequest")) }, [ e[7] || (e[7] = i(" Send Request ", -1)), l(m(d), { hotkey: "↵" }) ]) ]) ])); } }); export { E as default };