UNPKG

@scalar/api-reference

Version:

Generate beautiful API references from OpenAPI documents

44 lines (43 loc) 1.8 kB
import { defineComponent as d, mergeModels as m, useModel as u, computed as p, createElementBlock as n, createCommentVNode as s, openBlock as a, createElementVNode as c, createVNode as o, Fragment as w } from "vue"; import { isLocalUrl as v } from "@scalar/helpers/url/is-local-url"; import k from "./ApiReferenceToolbarConfig.vue.js"; import b from "./ApiReferenceToolbarSdks.vue.js"; import h from "./ApiReferenceToolbarShare.vue.js"; import _ from "./ApiReferenceToolbarTitle.vue.js"; const g = { key: 0, "aria-label": "Developer Tools", class: "api-reference-toolbar h-header bg-b-1 sticky top-0 z-10 flex justify-center border-b px-15" }, x = { class: "-mx-2 flex max-w-(--refs-content-max-width) flex-1 items-center" }, y = { class: "flex flex-1 items-center" }, C = /* @__PURE__ */ d({ __name: "ApiReferenceToolbar", props: /* @__PURE__ */ m({ workspace: {}, configuration: {} }, { overrides: {}, overridesModifiers: {} }), emits: ["update:overrides"], setup(r) { const t = u(r, "overrides"), l = p(() => r.configuration?.showToolbar === "always" ? !0 : r.configuration?.showToolbar === "never" || typeof window > "u" ? !1 : v(window.location.href)); return (e, i) => l.value ? (a(), n("header", g, [ c("div", x, [ c("div", y, [ o(_) ]), e.workspace ? (a(), n(w, { key: 0 }, [ o(h, { workspace: e.workspace }, null, 8, ["workspace"]), o(b, { workspace: e.workspace }, null, 8, ["workspace"]) ], 64)) : s("", !0), o(k, { overrides: t.value, "onUpdate:overrides": i[0] || (i[0] = (f) => t.value = f), configuration: e.configuration }, null, 8, ["overrides", "configuration"]) ]) ])) : s("", !0); } }); export { C as default };