UNPKG

@scalar/api-client

Version:

the open source API testing client

59 lines (58 loc) 2.04 kB
import { defineComponent as d, createBlock as a, openBlock as n, unref as o } from "vue"; import { getActiveProxyUrl as i } from "../../../helpers/get-active-proxy-url.js"; import s from "../../settings/DocumentSettings.vue.js"; import h from "../../settings/CollectionSettings.vue.js"; const f = /* @__PURE__ */ d({ __name: "Settings", props: { documentSlug: {}, document: {}, eventBus: {}, layout: {}, path: {}, method: {}, exampleName: {}, environment: {}, securitySchemes: {}, workspaceStore: {}, activeWorkspace: {}, plugins: {}, customThemes: {}, collectionType: {} }, setup(e) { const m = (t) => { e.eventBus.emit("document:update:watch-mode", t); }, l = (t) => { e.eventBus.emit("workspace:update:theme", t); }, u = (t) => { e.eventBus.emit("workspace:update:active-proxy", t); }, r = (t) => { e.eventBus.emit("workspace:update:color-mode", t); }; return (t, c) => e.collectionType === "document" ? (n(), a(o(s), { key: 0, documentUrl: e.document?.["x-scalar-original-source-url"], isDraftDocument: e.documentSlug === "drafts", title: e.document?.info.title ?? "", watchMode: e.document?.["x-scalar-watch-mode"], "onDelete:document": c[0] || (c[0] = (v) => e.eventBus.emit("document:delete:document", { name: e.documentSlug })), "onUpdate:watchMode": m }, null, 8, ["documentUrl", "isDraftDocument", "title", "watchMode"])) : (n(), a(o(h), { key: 1, activeProxyUrl: o(i)( e.workspaceStore.workspace["x-scalar-active-proxy"], e.layout ), activeThemeSlug: e.workspaceStore.workspace["x-scalar-theme"] ?? "none", colorMode: e.workspaceStore.workspace["x-scalar-color-mode"] ?? "system", customThemes: e.customThemes, "onUpdate:colorMode": r, "onUpdate:proxyUrl": u, "onUpdate:themeSlug": l }, null, 8, ["activeProxyUrl", "activeThemeSlug", "colorMode", "customThemes"])); } }); export { f as default };