UNPKG

@scalar/api-client

Version:

the open source API testing client

94 lines (93 loc) 3.44 kB
import { defineComponent as f, computed as d, createElementBlock as r, openBlock as n, createElementVNode as e, createVNode as o, withCtx as c, unref as m, createBlock as x, resolveDynamicComponent as v, mergeProps as _ } from "vue"; import { ScalarButton as h } from "@scalar/components"; import { LibraryIcon as b } from "@scalar/icons/library"; import { RouterView as y } from "vue-router"; import w from "../../../components/IconSelector.vue.js"; import g from "./components/LabelInput.vue.js"; import k from "./components/Tabs.vue.js"; const V = { class: "custom-scroll h-full" }, B = { key: 0, class: "w-full md:mx-auto md:max-w-[720px]" }, C = ["aria-label"], D = { class: "flex flex-row items-center gap-2" }, N = { class: "group relative ml-1.25" }, I = { class: "px-1.5 py-8" }, S = { key: 1, class: "flex w-full flex-1 items-center justify-center" }, U = { name: "DocumentCollection" }, P = /* @__PURE__ */ f({ ...U, props: { documentSlug: {}, document: {}, eventBus: {}, layout: {}, path: {}, method: {}, exampleName: {}, environment: {}, workspaceStore: {}, activeWorkspace: {} }, setup(p) { const s = p, u = d(() => s.document?.info?.title || "Untitled Document"), i = d( () => s.document?.["x-scalar-icon"] || "interface-content-folder" ); return (a, t) => (n(), r("div", V, [ a.document ? (n(), r("div", B, [ e("div", { "aria-label": `title: ${u.value}`, class: "mx-auto flex h-fit w-full flex-col gap-2 pt-6 pb-3 md:mx-auto md:max-w-[720px]" }, [ e("div", D, [ o(w, { modelValue: i.value, placement: "bottom-start", "onUpdate:modelValue": t[0] || (t[0] = (l) => a.eventBus.emit("document:update:icon", l)) }, { default: c(() => [ o(m(h), { class: "hover:bg-b-2 aspect-square h-7 w-7 cursor-pointer rounded border border-transparent p-0 hover:border-inherit", variant: "ghost" }, { default: c(() => [ o(m(b), { class: "text-c-2 size-5", src: i.value, "stroke-width": "2" }, null, 8, ["src"]) ]), _: 1 }) ]), _: 1 }, 8, ["modelValue"]) ]), e("div", N, [ o(g, { class: "text-xl font-bold", inputId: "documentName", modelValue: u.value, "onUpdate:modelValue": t[1] || (t[1] = (l) => a.eventBus.emit("document:update:info", { title: l })) }, null, 8, ["modelValue"]) ]) ], 8, C), o(k, { type: "document" }), e("div", I, [ o(m(y), null, { default: c(({ Component: l }) => [ (n(), x(v(l), _(s, { collectionType: "document" }), null, 16)) ]), _: 1 }) ]) ])) : (n(), r("div", S, [...t[2] || (t[2] = [ e("div", { class: "flex h-full flex-col items-center justify-center" }, [ e("h1", { class: "text-2xl font-bold" }, "Document not found"), e("p", { class: "text-gray-500" }, " The document you are looking for does not exist. ") ], -1) ])])) ])); } }); export { P as default };