@fc-components/monaco-editor 0.1.18 → 0.1.19

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.
@@ -11,6 +11,7 @@ interface SqlEditorProps {
11
11
  onChange?: (value: string) => void;
12
12
  onEnter?: (value: string) => void;
13
13
  onBlur?: (value: string) => void;
14
+ onFocus?: (value: string) => void;
14
15
  editorDidMount?: (editor: monacoTypes.editor.IStandaloneCodeEditor) => void;
15
16
  }
16
17
  export default function SqlEditor(props: SqlEditorProps): React.JSX.Element;
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "0.1.18",
6
+ "version": "0.1.19",
7
7
  "license": "MIT",
8
8
  "main": "dist/index.js",
9
9
  "module": "dist/monaco-editor.esm.js",
package/src/sql/index.tsx CHANGED
@@ -20,6 +20,7 @@ interface SqlEditorProps {
20
20
  onChange?: (value: string) => void;
21
21
  onEnter?: (value: string) => void;
22
22
  onBlur?: (value: string) => void;
23
+ onFocus?: (value: string) => void;
23
24
  editorDidMount?: (editor: monacoTypes.editor.IStandaloneCodeEditor) => void;
24
25
  }
25
26
 
@@ -80,6 +81,7 @@ export default function SqlEditor(props: SqlEditorProps) {
80
81
  onChange,
81
82
  onEnter,
82
83
  onBlur,
84
+ onFocus,
83
85
  editorDidMount,
84
86
  } = props;
85
87
 
@@ -147,6 +149,7 @@ export default function SqlEditor(props: SqlEditorProps) {
147
149
 
148
150
  editor.onDidFocusEditorText(() => {
149
151
  isEditorFocused.set(true);
152
+ onFocus?.(editor.getValue());
150
153
  });
151
154
 
152
155
  // set the height of the editor container