@nethru/ui 2.1.8 → 2.1.9
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/base/editor/Editor.js +4 -5
- package/package.json +1 -1
package/base/editor/Editor.js
CHANGED
|
@@ -3,11 +3,9 @@ import { Box, FormHelperText } from "@mui/material";
|
|
|
3
3
|
import CodeMirror from '@uiw/react-codemirror';
|
|
4
4
|
import { javascript } from '@codemirror/lang-javascript';
|
|
5
5
|
import { json } from '@codemirror/lang-json';
|
|
6
|
-
import {
|
|
7
|
-
import { Decoration, EditorView } from "@codemirror/view";
|
|
6
|
+
import { Decoration, EditorView, keymap as keyMapper } from "@codemirror/view";
|
|
8
7
|
import { RegExpCursor, SearchCursor } from '@codemirror/search';
|
|
9
8
|
import { StateEffect, StateField } from "@codemirror/state";
|
|
10
|
-
import { keymap as keyMapper } from '@codemirror/view';
|
|
11
9
|
import { defaultKeymap } from '@codemirror/commands';
|
|
12
10
|
import borderRadius from "../styles/borderRadius";
|
|
13
11
|
import { blue, grey, red, yellow } from "../colors";
|
|
@@ -135,7 +133,7 @@ export default function Editor({
|
|
|
135
133
|
case 'json':
|
|
136
134
|
return json();
|
|
137
135
|
case 'nscript':
|
|
138
|
-
return
|
|
136
|
+
return undefined;
|
|
139
137
|
default:
|
|
140
138
|
return javascript({
|
|
141
139
|
jsx: true
|
|
@@ -146,7 +144,8 @@ export default function Editor({
|
|
|
146
144
|
return [keyMapper.of(keymap), keyMapper.of(defaultKeymap)];
|
|
147
145
|
}, [keymap]);
|
|
148
146
|
const extensionList = useMemo(() => {
|
|
149
|
-
const result = [
|
|
147
|
+
const result = [EditorView.lineWrapping, highlight.extension, ...keymapExtension];
|
|
148
|
+
if (languageExtension) result.push(languageExtension);
|
|
150
149
|
if (onScroll) {
|
|
151
150
|
result.push(EditorView.domEventHandlers({
|
|
152
151
|
scroll(event, view) {
|