@scalar/api-client
Version:
the open source API testing client
60 lines (59 loc) • 2.09 kB
JavaScript
import { defineComponent as u, createBlock as t, openBlock as a, unref as r } from "vue";
import { useRouter as i } from "vue-router";
import p from "../../settings/DocumentSettings.vue.js";
import h from "../../settings/CollectionSettings.vue.js";
const y = /* @__PURE__ */ u({
__name: "Settings",
props: {
documentSlug: {},
document: {},
eventBus: {},
layout: {},
path: {},
method: {},
exampleName: {},
environment: {},
workspaceStore: {},
activeWorkspace: {},
collectionType: {}
},
setup(o) {
const c = (e) => {
o.eventBus.emit("document:update:watch-mode", e);
}, n = (e) => {
o.eventBus.emit("workspace:update:theme", e);
}, m = (e) => {
o.eventBus.emit("workspace:update:active-proxy", e);
}, d = (e) => {
o.eventBus.emit("workspace:update:color-mode", e);
}, l = i(), s = () => {
o.workspaceStore.deleteDocument(o.documentSlug), l.push({
name: "workspace.environment",
params: {
workspaceSlug: o.activeWorkspace.id
}
});
};
return (e, k) => e.collectionType === "document" ? (a(), t(r(p), {
key: 0,
documentUrl: e.document?.["x-scalar-original-source-url"],
title: e.document?.info.title ?? "",
watchMode: e.document?.["x-scalar-watch-mode"] ?? !0,
"onDelete:document": s,
"onUpdate:watchMode": c,
isDraftDocument: e.documentSlug === "drafts"
}, null, 8, ["documentUrl", "title", "watchMode", "isDraftDocument"])) : (a(), t(r(h), {
key: 1,
activeProxyUrl: e.workspaceStore.workspace["x-scalar-active-proxy"],
activeThemeId: e.workspaceStore.workspace["x-scalar-theme"] ?? "default",
colorMode: e.workspaceStore.workspace["x-scalar-color-mode"] ?? "system",
customProxyUrl: e.workspaceStore.config["x-scalar-reference-config"].settings.proxyUrl,
"onUpdate:colorMode": d,
"onUpdate:proxyUrl": m,
"onUpdate:themeId": n
}, null, 8, ["activeProxyUrl", "activeThemeId", "colorMode", "customProxyUrl"]));
}
});
export {
y as default
};