@cccsaurora/howler-ui 2.13.0-dev.132 → 2.13.0-dev.133

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.
@@ -26,18 +26,6 @@ const QueryEditor = ({ query, setQuery, onMount, language = 'lucene', fontSize =
26
26
  _monaco.languages.register({ id: 'lucene' });
27
27
  _monaco.languages.register({ id: 'eql' });
28
28
  }, []);
29
- useEffect(() => {
30
- const handleKeyPress = event => {
31
- if (setFzfSearch && event.ctrlKey && event.key == 'r') {
32
- event.preventDefault();
33
- setFzfSearch(!fzfSearch);
34
- }
35
- };
36
- window.addEventListener('keydown', handleKeyPress);
37
- return () => {
38
- window.removeEventListener('keydown', handleKeyPress);
39
- };
40
- }, [fzfSearch, setFzfSearch]);
41
29
  useEffect(() => {
42
30
  if (!monaco) {
43
31
  return;
@@ -90,6 +78,13 @@ const QueryEditor = ({ query, setQuery, onMount, language = 'lucene', fontSize =
90
78
  fontSize,
91
79
  ...editorOptions
92
80
  }), [setQuery, fontSize, editorOptions]);
93
- return (_jsx(Box, { sx: { flex: 1 }, children: _jsx(ThemedEditor, { height: height, width: width, theme: theme.palette.mode === 'light' ? 'howler' : 'howler-dark', value: query, onChange: value => setQuery(value), beforeMount: beforeEditorMount, onMount: onMount, options: options }) }));
81
+ const handleKeyPress = useCallback((event) => {
82
+ if (setFzfSearch && event.ctrlKey && event.key == 'r') {
83
+ event.preventDefault();
84
+ event.stopPropagation();
85
+ setFzfSearch(!fzfSearch);
86
+ }
87
+ }, [fzfSearch, setFzfSearch]);
88
+ return (_jsx(Box, { sx: { flex: 1 }, onKeyDownCapture: handleKeyPress, children: _jsx(ThemedEditor, { height: height, width: width, theme: theme.palette.mode === 'light' ? 'howler' : 'howler-dark', value: query, onChange: value => setQuery(value), beforeMount: beforeEditorMount, onMount: onMount, options: options }) }));
94
89
  };
95
90
  export default memo(QueryEditor);
package/package.json CHANGED
@@ -96,7 +96,7 @@
96
96
  "internal-slot": "1.0.7"
97
97
  },
98
98
  "type": "module",
99
- "version": "2.13.0-dev.132",
99
+ "version": "2.13.0-dev.133",
100
100
  "exports": {
101
101
  "./i18n": "./i18n.js",
102
102
  "./index.css": "./index.css",