@fc-components/monaco-editor 0.1.25 → 0.1.26

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.
@@ -2130,7 +2130,9 @@ function PromQLEditor(props) {
2130
2130
  onChange = props.onChange,
2131
2131
  onEnter = props.onEnter,
2132
2132
  onBlur = props.onBlur,
2133
- editorDidMount = props.editorDidMount;
2133
+ editorDidMount = props.editorDidMount,
2134
+ _props$debugEscKey = props.debugEscKey,
2135
+ debugEscKey = _props$debugEscKey === void 0 ? false : _props$debugEscKey;
2134
2136
  var autocompleteDisposeFun = useRef(null);
2135
2137
  var containerRef = useRef(null);
2136
2138
  var dataProviderRef = useRef(null);
@@ -2220,6 +2222,18 @@ function PromQLEditor(props) {
2220
2222
  editor$1.addCommand(KeyCode.Enter, function () {
2221
2223
  onEnter == null || onEnter(editor$1.getValue());
2222
2224
  }, '!suggestWidgetVisible && isEditorFocused' + id);
2225
+ editor$1.addCommand(KeyCode.Escape, function () {
2226
+ if (debugEscKey) {
2227
+ var _editor$_contextKeySe;
2228
+ var suggestWidgetVisible = editor$1 == null || (_editor$_contextKeySe = editor$1._contextKeyService) == null || _editor$_contextKeySe.getContextKeyValue == null ? void 0 : _editor$_contextKeySe.getContextKeyValue('suggestWidgetVisible');
2229
+ // eslint-disable-next-line no-console
2230
+ console.log('[PromQLEditor][ESC]', {
2231
+ suggestWidgetVisible: suggestWidgetVisible,
2232
+ valueLength: editor$1.getValue().length
2233
+ });
2234
+ }
2235
+ editor$1.trigger('keyboard', 'hideSuggestWidget', {});
2236
+ }, 'suggestWidgetVisible && isEditorFocused' + id);
2223
2237
  // Initialize previous content tracking
2224
2238
  previousContentRef.current = editor$1.getValue();
2225
2239
  lastDeletionTriggerTimeRef.current = 0;