@grafana/ui
Version:
Grafana Components Library
40 lines (35 loc) • 1.33 kB
JavaScript
;
Object.defineProperty(exports, '__esModule', { value: true });
var jsxRuntime = require('react/jsx-runtime');
var React = require('react');
var i18n = require('@grafana/i18n');
var ErrorBoundary = require('../ErrorBoundary/ErrorBoundary.cjs');
var LoadingPlaceholder = require('../LoadingPlaceholder/LoadingPlaceholder.cjs');
;
const CodeEditor = React.lazy(
() => Promise.resolve().then(function () { return require(
/* webpackChunkName: "react-codemirror-editor" */
'./CodeEditor.cjs'
); }).then((module) => ({
default: module.CodeEditor
}))
);
function CodeMirrorEditor(props) {
return /* @__PURE__ */ jsxRuntime.jsx(
ErrorBoundary.ErrorBoundaryAlert,
{
boundaryName: "CodeMirrorEditorLazy",
title: i18n.t("grafana-ui.code-mirror.error-label", "CodeMirror editor failed to load"),
style: "page",
children: /* @__PURE__ */ jsxRuntime.jsx(
React.Suspense,
{
fallback: /* @__PURE__ */ jsxRuntime.jsx(LoadingPlaceholder.LoadingPlaceholder, { text: i18n.t("grafana-ui.code-mirror.loading-placeholder", "Loading editor") }),
children: /* @__PURE__ */ jsxRuntime.jsx(CodeEditor, { ...props })
}
)
}
);
}
exports.CodeMirrorEditor = CodeMirrorEditor;
//# sourceMappingURL=CodeEditorLazy.cjs.map