UNPKG

@scalar/api-reference

Version:

Generate beautiful API references from OpenAPI documents

58 lines (57 loc) 2.71 kB
import { defineComponent, createBlock, openBlock, withCtx, createElementVNode, createTextVNode, createVNode, toDisplayString, unref } from "vue"; import { ScalarIconButton } from "@scalar/components"; import { ScalarIconCopy, ScalarIconInfo } from "@scalar/icons"; import { useClipboard } from "@scalar/use-hooks/useClipboard"; import _sfc_main$1 from "./ApiReferenceToolbarPopover.vue.js"; const _hoisted_1 = { 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" }; const _hoisted_2 = { class: "-m-2 flex flex-col gap-2 leading-relaxed" }; const _hoisted_3 = { class: "bg-b-2 inline-flex items-center gap-0.5 rounded border px-1 py-0.5 text-sm" }; const CONFIG_SETTING = 'showDeveloperTools: "never"'; const _sfc_main = /* @__PURE__ */ defineComponent({ __name: "ApiReferenceToolbarTitle", setup(__props) { const { copyToClipboard } = useClipboard(); return (_ctx, _cache) => { return openBlock(), createBlock(_sfc_main$1, { class: "w-120", placement: "bottom-start" }, { button: withCtx(() => [ createElementVNode("button", _hoisted_1, [ _cache[1] || (_cache[1] = createTextVNode(" Developer Tools ", -1)), createVNode(unref(ScalarIconInfo)) ]) ]), info: withCtx(() => [..._cache[5] || (_cache[5] = [ createTextVNode(" The developer tools will only appear when running on localhost. ", -1) ])]), default: withCtx(() => [ createElementVNode("div", _hoisted_2, [ _cache[4] || (_cache[4] = createElementVNode("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)), createElementVNode("div", null, [ _cache[2] || (_cache[2] = createTextVNode(" To disable the toolbar, set ", -1)), createElementVNode("div", _hoisted_3, [ createElementVNode("code", { class: "font-code" }, toDisplayString(CONFIG_SETTING)), createVNode(unref(ScalarIconButton), { class: "-m-1 p-1.25", icon: unref(ScalarIconCopy), label: "Copy link to clipboard", size: "sm", onClick: _cache[0] || (_cache[0] = ($event) => unref(copyToClipboard)(CONFIG_SETTING)) }, null, 8, ["icon"]) ]), _cache[3] || (_cache[3] = createTextVNode(" in your configuration. ", -1)) ]) ]) ]), _: 1 }); }; } }); export { _sfc_main as default };