@fc-components/monaco-editor 0.1.10 → 0.1.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -229,6 +229,9 @@ function _setPrototypeOf(t, e) {
229
229
  return t.__proto__ = e, t;
230
230
  }, _setPrototypeOf(t, e);
231
231
  }
232
+ function _taggedTemplateLiteralLoose(e, t) {
233
+ return t || (t = e.slice(0)), e.raw = t, e;
234
+ }
232
235
  function _toPrimitive(t, r) {
233
236
  if ("object" != typeof t || !t) return t;
234
237
  var e = t[Symbol.toPrimitive];
@@ -1952,6 +1955,7 @@ function isErrorBoundary(boundary) {
1952
1955
  }
1953
1956
 
1954
1957
  var _excluded = ["error"];
1958
+ var _templateObject, _templateObject2;
1955
1959
  var PROMQL_LANG_ID = promLanguageDefinition.id;
1956
1960
  var SIZE_MAP = {
1957
1961
  small: {
@@ -1971,9 +1975,11 @@ var SIZE_MAP = {
1971
1975
  }
1972
1976
  };
1973
1977
  var themeMap = {
1974
- light: 'light',
1978
+ light: 'n9e-light',
1975
1979
  dark: 'n9e-dark'
1976
1980
  };
1981
+ var containerDisabledClassName = /*#__PURE__*/css(_templateObject || (_templateObject = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n .monaco-editor {\n user-select: none;\n pointer-events: none;\n }\n"])));
1982
+ var containerReadOnlyClassName = /*#__PURE__*/css(_templateObject2 || (_templateObject2 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n .monaco-editor .cursors-layer > .cursor {\n opacity: 0 !important; /* \u5B8C\u5168\u900F\u660E */\n }\n"])));
1977
1983
  var getStyles = function getStyles(placeholder) {
1978
1984
  return {
1979
1985
  placeholder: css({
@@ -1997,6 +2003,8 @@ function PromQLEditor(props) {
1997
2003
  enableAutocomplete = _props$enableAutocomp === void 0 ? true : _props$enableAutocomp,
1998
2004
  _props$readOnly = props.readOnly,
1999
2005
  readOnly = _props$readOnly === void 0 ? false : _props$readOnly,
2006
+ _props$disabled = props.disabled,
2007
+ disabled = _props$disabled === void 0 ? false : _props$disabled,
2000
2008
  onChange = props.onChange,
2001
2009
  onShiftEnter = props.onShiftEnter,
2002
2010
  onBlur = props.onBlur,
@@ -2008,6 +2016,15 @@ function PromQLEditor(props) {
2008
2016
  var styles = getStyles(placeholder);
2009
2017
  var handleEditorDidMount = function handleEditorDidMount(editor$1) {
2010
2018
  editorRef.current = editor$1;
2019
+ editor.defineTheme('n9e-light', {
2020
+ base: 'vs',
2021
+ inherit: true,
2022
+ rules: [],
2023
+ colors: {
2024
+ 'editor.background': '#00000000',
2025
+ focusBorder: '#00000000'
2026
+ }
2027
+ });
2011
2028
  editor.defineTheme('n9e-dark', {
2012
2029
  base: 'vs-dark',
2013
2030
  inherit: true,
@@ -2163,7 +2180,7 @@ function PromQLEditor(props) {
2163
2180
  }
2164
2181
  }, [enableAutocomplete, props.url, props.lookbackInterval, JSON.stringify(props.variablesNames), props.durationVariablesCompletion, props.httpMethod, props.apiPrefix, placeholder]);
2165
2182
  return React.createElement("div", {
2166
- className: 'ant-input' + (size ? " " + SIZE_MAP[size].className : '')
2183
+ className: 'ant-input' + (size ? " " + SIZE_MAP[size].className : '') + (disabled ? " ant-input-disabled " + containerDisabledClassName : '') + (readOnly ? " " + containerReadOnlyClassName : '')
2167
2184
  }, React.createElement("div", {
2168
2185
  ref: containerRef
2169
2186
  }, React.createElement(MonacoEditor, {