@scalar/api-reference
Version:
Generate beautiful API references from OpenAPI documents
52 lines (51 loc) • 2.11 kB
JavaScript
import { defineComponent as a, createBlock as p, openBlock as d, withCtx as l, createElementVNode as e, createTextVNode as t, createVNode as r, toDisplayString as c, unref as n } from "vue";
import { ScalarIconButton as u } from "@scalar/components";
import { ScalarIconCopy as m, ScalarIconInfo as f } from "@scalar/icons";
import { useClipboard as b } from "@scalar/use-hooks/useClipboard";
import x from "./ApiReferenceToolbarPopover.vue.js";
const y = {
class: "text-c-2 hover:text-c-1 hover:bg-b-2 flex items-center gap-1 rounded px-2 py-2.25 text-base leading-none",
type: "button"
}, g = { class: "-m-2 flex flex-col gap-2 leading-relaxed" }, v = { class: "bg-b-2 inline-flex items-center gap-0.5 rounded border px-1 py-0.5 text-sm" }, i = 'showToolbar: "never"', k = /* @__PURE__ */ a({
__name: "ApiReferenceToolbarTitle",
setup(T) {
const { copyToClipboard: s } = b();
return (C, o) => (d(), p(x, {
class: "w-120",
placement: "bottom-start"
}, {
button: l(() => [
e("button", y, [
o[1] || (o[1] = t(" Developer Tools ")),
r(n(f))
])
]),
info: l(() => o[5] || (o[5] = [
t(" The developer tools will only appear when running on localhost. ")
])),
default: l(() => [
e("div", g, [
o[4] || (o[4] = e("div", null, " The developer tools allow you to customize the appearance and behavior of your documentation. You can also share your documentation using the Scalar Registry. ", -1)),
e("div", null, [
o[2] || (o[2] = t(" To disable the toolbar, set ")),
e("div", v, [
e("code", { class: "font-code" }, c(i)),
r(n(u), {
class: "-m-1 p-1.25",
icon: n(m),
label: "Copy link to clipboard",
size: "sm",
onClick: o[0] || (o[0] = (w) => n(s)(i))
}, null, 8, ["icon"])
]),
o[3] || (o[3] = t(" in your configuration. "))
])
])
]),
_: 1
}));
}
});
export {
k as default
};