swagger-editor
Version:
- [Anonymized analytics](#anonymized-analytics) - [Getting started](#getting-started) - [Prerequisites](#prerequisites) - [Installation](#installation) - [Usage](#usage) - [Development](#development) - [Prerequisites](#prerequisites) - [Setting
31 lines (30 loc) • 1.17 kB
JavaScript
import { n as e } from "../../fn-CSHJFKWj.js";
//#region src/plugins/editor-content-from-file/extensions/top-bar/wrap-actions.js
var t = e((e, t) => async ({ definition: e }) => {
let { editorActions: n, fn: r, EditorContentOrigin: i } = t;
if (r.isValidJSONObject(e) || r.isValidJSONArray(e)) {
let t = await n.convertContentToYAML(e);
t.error || n.setContent(t.payload, i.ImportUrl);
}
}), n = e((e, t) => async ({ content: e }) => {
let { editorActions: n, fn: r, EditorContentOrigin: i } = t;
if (r.isValidJSONObject(e) || r.isValidJSONArray(e)) {
let t = await n.convertContentToYAML(e);
t.error || n.setContent(t.payload, i.ImportFile);
}
}), r = e((e, t) => async ({ content: e }) => {
let { editorActions: n, fn: r, EditorContentOrigin: i } = t;
if (r.isValidJSONObject(e) || r.isValidJSONArray(e)) {
let t = await n.convertContentToYAML(e);
t.error || n.setContent(t.payload, i.FileDrop);
}
}), i = () => ({ statePlugins: {
editor: { wrapActions: {
importUrlSuccess: t,
uploadFileSuccess: n
} },
editorDropzone: { wrapActions: { dropFileSuccess: r } }
} });
//#endregion
export { i as default };
//# sourceMappingURL=index.js.map