@scalar/api-reference
Version:
Generate beautiful API references from OpenAPI documents
44 lines (43 loc) • 2.73 kB
JavaScript
import ApiReferenceToolbarPopover_default from "./ApiReferenceToolbarPopover.vue.js";
import { createBlock, createElementVNode, createTextVNode, createVNode, defineComponent, openBlock, toDisplayString, unref, withCtx } from "vue";
import { ScalarIconButton } from "@scalar/components";
import { useClipboard } from "@scalar/use-hooks/useClipboard";
import { ScalarIconCopy, ScalarIconInfo } from "@scalar/icons";
//#region src/features/developer-tools/components/ApiReferenceToolbarTitle.vue?vue&type=script&setup=true&lang.ts
var _hoisted_1 = {
class: "text-c-2 hover:text-c-1 hover:bg-b-2 ml-auto flex items-center gap-1 rounded px-2 py-2.25 text-base leading-none",
type: "button"
};
var _hoisted_2 = { class: "-m-2 flex flex-col gap-2 leading-relaxed" };
var _hoisted_3 = { class: "bg-b-2 inline-flex items-center gap-0.5 rounded border px-1 py-0.5 text-sm" };
var CONFIG_SETTING = "showDeveloperTools: \"never\"";
var ApiReferenceToolbarTitle_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
__name: "ApiReferenceToolbarTitle",
setup(__props) {
const { copyToClipboard } = useClipboard();
return (_ctx, _cache) => {
return openBlock(), createBlock(ApiReferenceToolbarPopover_default, {
class: "w-120",
placement: "bottom-start"
}, {
button: withCtx(() => [createElementVNode("button", _hoisted_1, [createVNode(unref(ScalarIconInfo)), _cache[1] || (_cache[1] = createTextVNode(" Developer Tools ", -1))])]),
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
});
};
}
});
//#endregion
export { ApiReferenceToolbarTitle_vue_vue_type_script_setup_true_lang_default as default };
//# sourceMappingURL=ApiReferenceToolbarTitle.vue.script.js.map