@scalar/api-client
Version:
the open source API testing client
26 lines (25 loc) • 983 B
JavaScript
import { ref as e, computed as o } from "vue";
const g = 46, u = 155, E = () => {
const n = e(!1), a = e(!1), s = e("json"), i = e(!1), t = e(!1), c = o(() => s.value === "yaml"), r = o(
() => i.value ? u : g
), d = o(
() => t.value ? "fixed inset-0 z-50 h-screen w-screen border bg-b-1 p-3" : ""
);
return {
isAutoSaveEnabled: n,
isDirty: a,
editorLanguage: s,
isDiagnosticsPaneExpanded: i,
isEditorMaximized: t,
isYamlMode: c,
editorBottomPadding: r,
editorRootClass: d,
getLanguageToggleClass: (l) => `rounded-none px-2 py-1 text-[11px] leading-4 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-c-accent/30 focus-visible:ring-offset-1 focus-visible:ring-offset-b-1 first:rounded-md last:rounded-md ${l ? "bg-b-2 text-c-1 hover:bg-b-2" : "text-c-2 hover:bg-b-2/60 hover:text-c-1"}`,
toggleEditorMaximized: () => {
t.value = !t.value;
}
};
};
export {
E as useEditorState
};