@nethru/ui 1.0.57 → 1.0.59

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.
package/dist/Editor.js CHANGED
@@ -19,6 +19,7 @@ export default function Editor({
19
19
  jsonFormat = false,
20
20
  keyword,
21
21
  isRegExp = false,
22
+ autoScrollToBottom = false,
22
23
  onUpdate,
23
24
  style,
24
25
  ...props
@@ -85,12 +86,19 @@ export default function Editor({
85
86
  });
86
87
  }
87
88
  }, [view, highlight, keyword, isRegExp]);
89
+ const scrollToBottom = useCallback(() => {
90
+ if (!view || !autoScrollToBottom) return;
91
+ view.dispatch({
92
+ effects: EditorView.scrollIntoView(view.state.doc.length)
93
+ });
94
+ }, [view, autoScrollToBottom]);
88
95
  useEffect(() => {
89
96
  setTimeout(() => {
90
97
  setContent(value);
91
98
  highlightKeyword();
99
+ scrollToBottom();
92
100
  }, 100);
93
- }, [value, view, highlightKeyword]);
101
+ }, [value, view, highlightKeyword, scrollToBottom]);
94
102
  return /*#__PURE__*/_jsxs(Box, {
95
103
  ref: ref,
96
104
  children: [/*#__PURE__*/_jsx(CodeMirror, {
package/dist/Select.js CHANGED
@@ -23,7 +23,7 @@ export default function Select({
23
23
  fontSize: fontSize ? fontSize : 15
24
24
  }
25
25
  },
26
- children: [/*#__PURE__*/_jsx(InputLabel, {
26
+ children: [label && /*#__PURE__*/_jsx(InputLabel, {
27
27
  children: label
28
28
  }), /*#__PURE__*/_jsx(MuiSelect, {
29
29
  inputProps: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nethru/ui",
3
- "version": "1.0.57",
3
+ "version": "1.0.59",
4
4
  "main": "dist/index.js",
5
5
  "files": [
6
6
  "/dist"