@eccenca/gui-elements 24.0.1 → 24.1.0-rc.0
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/CHANGELOG.md +7 -5
- package/dist/cjs/cmem/react-flow/StickyNoteModal/StickyNoteModal.js +3 -3
- package/dist/cjs/cmem/react-flow/StickyNoteModal/StickyNoteModal.js.map +1 -1
- package/dist/cjs/components/AutoSuggestion/ExtendedCodeEditor.js +3 -3
- package/dist/cjs/components/AutoSuggestion/ExtendedCodeEditor.js.map +1 -1
- package/dist/cjs/extensions/codemirror/CodeMirror.js +58 -6
- package/dist/cjs/extensions/codemirror/CodeMirror.js.map +1 -1
- package/dist/cjs/extensions/codemirror/debouncedLinter.js +18 -0
- package/dist/cjs/extensions/codemirror/debouncedLinter.js.map +1 -0
- package/dist/cjs/extensions/codemirror/hooks/useCodemirrorModeExtension.hooks.js +9 -18
- package/dist/cjs/extensions/codemirror/hooks/useCodemirrorModeExtension.hooks.js.map +1 -1
- package/dist/cjs/extensions/codemirror/linters/jsLinter.js +36 -0
- package/dist/cjs/extensions/codemirror/linters/jsLinter.js.map +1 -0
- package/dist/cjs/extensions/codemirror/linters/turtleLinter.js +81 -0
- package/dist/cjs/extensions/codemirror/linters/turtleLinter.js.map +1 -0
- package/dist/cjs/extensions/codemirror/types.js +3 -0
- package/dist/cjs/extensions/codemirror/types.js.map +1 -0
- package/dist/esm/cmem/react-flow/StickyNoteModal/StickyNoteModal.js +4 -4
- package/dist/esm/cmem/react-flow/StickyNoteModal/StickyNoteModal.js.map +1 -1
- package/dist/esm/components/AutoSuggestion/ExtendedCodeEditor.js +14 -3
- package/dist/esm/components/AutoSuggestion/ExtendedCodeEditor.js.map +1 -1
- package/dist/esm/extensions/codemirror/CodeMirror.js +58 -7
- package/dist/esm/extensions/codemirror/CodeMirror.js.map +1 -1
- package/dist/esm/extensions/codemirror/debouncedLinter.js +15 -0
- package/dist/esm/extensions/codemirror/debouncedLinter.js.map +1 -0
- package/dist/esm/extensions/codemirror/hooks/useCodemirrorModeExtension.hooks.js +6 -15
- package/dist/esm/extensions/codemirror/hooks/useCodemirrorModeExtension.hooks.js.map +1 -1
- package/dist/esm/extensions/codemirror/linters/jsLinter.js +32 -0
- package/dist/esm/extensions/codemirror/linters/jsLinter.js.map +1 -0
- package/dist/esm/extensions/codemirror/linters/turtleLinter.js +77 -0
- package/dist/esm/extensions/codemirror/linters/turtleLinter.js.map +1 -0
- package/dist/esm/extensions/codemirror/types.js +2 -0
- package/dist/esm/extensions/codemirror/types.js.map +1 -0
- package/dist/types/cmem/react-flow/StickyNoteModal/StickyNoteModal.d.ts +5 -1
- package/dist/types/components/AutoSuggestion/ExtendedCodeEditor.d.ts +11 -6
- package/dist/types/extensions/codemirror/CodeMirror.d.ts +23 -5
- package/dist/types/extensions/codemirror/debouncedLinter.d.ts +4 -0
- package/dist/types/extensions/codemirror/hooks/useCodemirrorModeExtension.hooks.d.ts +3 -5
- package/dist/types/extensions/codemirror/linters/jsLinter.d.ts +5 -0
- package/dist/types/extensions/codemirror/linters/turtleLinter.d.ts +5 -0
- package/dist/types/extensions/codemirror/types.d.ts +5 -0
- package/package.json +6 -5
- package/src/cmem/react-flow/StickyNoteModal/StickyNoteModal.tsx +16 -2
- package/src/components/AutoSuggestion/ExtendedCodeEditor.tsx +29 -6
- package/src/components/TextField/stories/TextField.stories.tsx +2 -1
- package/src/extensions/codemirror/CodeMirror.stories.tsx +30 -0
- package/src/extensions/codemirror/CodeMirror.tsx +86 -9
- package/src/extensions/codemirror/_codemirror.scss +96 -0
- package/src/extensions/codemirror/debouncedLinter.ts +26 -0
- package/src/extensions/codemirror/hooks/useCodemirrorModeExtension.hooks.ts +6 -16
- package/src/extensions/codemirror/linters/jsLinter.ts +38 -0
- package/src/extensions/codemirror/linters/turtleLinter.ts +102 -0
- package/src/extensions/codemirror/types.ts +7 -0
|
@@ -9,6 +9,17 @@ var __assign = (this && this.__assign) || function () {
|
|
|
9
9
|
};
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
+
var t = {};
|
|
14
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
+
t[p] = s[p];
|
|
16
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
+
t[p[i]] = s[p[i]];
|
|
20
|
+
}
|
|
21
|
+
return t;
|
|
22
|
+
};
|
|
12
23
|
var __read = (this && this.__read) || function (o, n) {
|
|
13
24
|
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
14
25
|
if (!m) return o;
|
|
@@ -34,9 +45,10 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
34
45
|
}
|
|
35
46
|
return to.concat(ar || Array.prototype.slice.call(from));
|
|
36
47
|
};
|
|
37
|
-
import React, { useRef } from "react";
|
|
48
|
+
import React, { useMemo, useRef } from "react";
|
|
38
49
|
import { defaultKeymap, indentWithTab } from "@codemirror/commands";
|
|
39
50
|
import { foldKeymap } from "@codemirror/language";
|
|
51
|
+
import { lintGutter } from "@codemirror/lint";
|
|
40
52
|
import { EditorState } from "@codemirror/state";
|
|
41
53
|
import { EditorView, keymap } from "@codemirror/view";
|
|
42
54
|
import { minimalSetup } from "codemirror";
|
|
@@ -44,6 +56,8 @@ import { markField } from "../../components/AutoSuggestion/extensions/markText.j
|
|
|
44
56
|
import { CLASSPREFIX as eccgui } from "../../configuration/constants.js";
|
|
45
57
|
//hooks
|
|
46
58
|
import { supportedCodeEditorModes, useCodeMirrorModeExtension, } from "./hooks/useCodemirrorModeExtension.hooks.js";
|
|
59
|
+
import { jsLinter } from "./linters/jsLinter.js";
|
|
60
|
+
import { turtleLinter } from "./linters/turtleLinter.js";
|
|
47
61
|
//adaptations
|
|
48
62
|
import { adaptedCodeFolding, AdaptedEditorView, AdaptedEditorViewDomEventHandlers, adaptedFoldGutter, adaptedHighlightActiveLine, adaptedHighlightSpecialChars, adaptedLineNumbers, adaptedPlaceholder, } from "./tests/codemirrorTestHelper.js";
|
|
49
63
|
var addExtensionsFor = function (flag) {
|
|
@@ -64,12 +78,27 @@ var addHandlersFor = function (flag, handlerName, handler) {
|
|
|
64
78
|
var _a;
|
|
65
79
|
return flag ? (_a = {}, _a[handlerName] = handler, _a) : {};
|
|
66
80
|
};
|
|
81
|
+
var ModeLinterMap = new Map([
|
|
82
|
+
["turtle", [turtleLinter]],
|
|
83
|
+
["javascript", [jsLinter]],
|
|
84
|
+
]);
|
|
67
85
|
/**
|
|
68
86
|
* Includes a code editor, currently we use CodeMirror library as base.
|
|
69
87
|
*/
|
|
70
88
|
export var CodeEditor = function (_a) {
|
|
71
|
-
var onChange = _a.onChange, onSelection = _a.onSelection, onMouseDown = _a.onMouseDown, onFocusChange = _a.onFocusChange, onKeyDown = _a.onKeyDown, onCursorChange = _a.onCursorChange, name = _a.name, id = _a.id, mode = _a.mode, _b = _a.preventLineNumbers, preventLineNumbers = _b === void 0 ? false : _b, _c = _a.defaultValue, defaultValue = _c === void 0 ? "" : _c, _d = _a.readOnly, readOnly = _d === void 0 ? false : _d, _e = _a.shouldHaveMinimalSetup, shouldHaveMinimalSetup = _e === void 0 ? true : _e, _f = _a.wrapLines, wrapLines = _f === void 0 ? false : _f, onScroll = _a.onScroll, setEditorView = _a.setEditorView, _g = _a.supportCodeFolding, supportCodeFolding = _g === void 0 ? false : _g, _h = _a.shouldHighlightActiveLine, shouldHighlightActiveLine = _h === void 0 ? false : _h, outerDivAttributes = _a.outerDivAttributes, _j = _a.tabIntentSize, tabIntentSize = _j === void 0 ? 2 : _j, _k = _a.tabIntentStyle, tabIntentStyle = _k === void 0 ? "tab" : _k, placeholder = _a.placeholder, _l = _a.additionalExtensions, additionalExtensions = _l === void 0 ? [] : _l, _m = _a.tabForceSpaceForModes, tabForceSpaceForModes = _m === void 0 ? ["python", "yaml"] : _m, _o = _a.enableTab, enableTab = _o === void 0 ? false : _o, height = _a.height;
|
|
89
|
+
var onChange = _a.onChange, onSelection = _a.onSelection, onMouseDown = _a.onMouseDown, onFocusChange = _a.onFocusChange, onKeyDown = _a.onKeyDown, onCursorChange = _a.onCursorChange, name = _a.name, id = _a.id, mode = _a.mode, _b = _a.preventLineNumbers, preventLineNumbers = _b === void 0 ? false : _b, _c = _a.defaultValue, defaultValue = _c === void 0 ? "" : _c, _d = _a.readOnly, readOnly = _d === void 0 ? false : _d, _e = _a.shouldHaveMinimalSetup, shouldHaveMinimalSetup = _e === void 0 ? true : _e, _f = _a.wrapLines, wrapLines = _f === void 0 ? false : _f, onScroll = _a.onScroll, setEditorView = _a.setEditorView, _g = _a.supportCodeFolding, supportCodeFolding = _g === void 0 ? false : _g, _h = _a.shouldHighlightActiveLine, shouldHighlightActiveLine = _h === void 0 ? false : _h, outerDivAttributes = _a.outerDivAttributes, _j = _a.tabIntentSize, tabIntentSize = _j === void 0 ? 2 : _j, _k = _a.tabIntentStyle, tabIntentStyle = _k === void 0 ? "tab" : _k, placeholder = _a.placeholder, _l = _a.additionalExtensions, additionalExtensions = _l === void 0 ? [] : _l, _m = _a.tabForceSpaceForModes, tabForceSpaceForModes = _m === void 0 ? ["python", "yaml"] : _m, _o = _a.enableTab, enableTab = _o === void 0 ? false : _o, height = _a.height, _p = _a.useLinting, useLinting = _p === void 0 ? false : _p, dataTestId = _a["data-test-id"], _q = _a.autoFocus, autoFocus = _q === void 0 ? false : _q, _r = _a.disabled, disabled = _r === void 0 ? false : _r, intent = _a.intent, otherCodeEditorProps = __rest(_a, ["onChange", "onSelection", "onMouseDown", "onFocusChange", "onKeyDown", "onCursorChange", "name", "id", "mode", "preventLineNumbers", "defaultValue", "readOnly", "shouldHaveMinimalSetup", "wrapLines", "onScroll", "setEditorView", "supportCodeFolding", "shouldHighlightActiveLine", "outerDivAttributes", "tabIntentSize", "tabIntentStyle", "placeholder", "additionalExtensions", "tabForceSpaceForModes", "enableTab", "height", "useLinting", "data-test-id", "autoFocus", "disabled", "intent"]);
|
|
72
90
|
var parent = useRef(undefined);
|
|
91
|
+
var linters = useMemo(function () {
|
|
92
|
+
if (!mode) {
|
|
93
|
+
return [];
|
|
94
|
+
}
|
|
95
|
+
var values = [lintGutter()];
|
|
96
|
+
var linters = ModeLinterMap.get(mode);
|
|
97
|
+
if (linters) {
|
|
98
|
+
values.push.apply(values, __spreadArray([], __read(linters.map(function (linter) { return linter(); })), false));
|
|
99
|
+
}
|
|
100
|
+
return values;
|
|
101
|
+
}, [mode]);
|
|
73
102
|
var onKeyDownHandler = function (event, view) {
|
|
74
103
|
if (onKeyDown && !onKeyDown(event)) {
|
|
75
104
|
if (event.key === "Enter") {
|
|
@@ -102,15 +131,23 @@ export var CodeEditor = function (_a) {
|
|
|
102
131
|
keymap === null || keymap === void 0 ? void 0 : keymap.of(keyMapConfigs),
|
|
103
132
|
EditorState === null || EditorState === void 0 ? void 0 : EditorState.tabSize.of(tabIntentSize),
|
|
104
133
|
EditorState === null || EditorState === void 0 ? void 0 : EditorState.readOnly.of(readOnly),
|
|
134
|
+
EditorView === null || EditorView === void 0 ? void 0 : EditorView.editable.of(!disabled),
|
|
105
135
|
AdaptedEditorViewDomEventHandlers(domEventHandlers),
|
|
106
136
|
EditorView === null || EditorView === void 0 ? void 0 : EditorView.updateListener.of(function (v) {
|
|
107
137
|
var _a;
|
|
108
|
-
|
|
138
|
+
if (disabled)
|
|
139
|
+
return;
|
|
140
|
+
if (onChange) {
|
|
141
|
+
onChange(v.state.doc.toString());
|
|
142
|
+
}
|
|
109
143
|
if (onSelection)
|
|
110
144
|
onSelection(v.state.selection.ranges.filter(function (r) { return !r.empty; }).map(function (_a) {
|
|
111
145
|
var from = _a.from, to = _a.to;
|
|
112
146
|
return ({ from: from, to: to });
|
|
113
147
|
}));
|
|
148
|
+
if (onFocusChange) {
|
|
149
|
+
v.view.dom.className += " ".concat(eccgui, "-intent--").concat(intent);
|
|
150
|
+
}
|
|
114
151
|
if (onCursorChange) {
|
|
115
152
|
var cursorPosition = (_a = v.state.selection.main.head) !== null && _a !== void 0 ? _a : 0;
|
|
116
153
|
var editorRect = v.view.dom.getBoundingClientRect();
|
|
@@ -128,6 +165,7 @@ export var CodeEditor = function (_a) {
|
|
|
128
165
|
addExtensionsFor(shouldHighlightActiveLine, adaptedHighlightActiveLine()),
|
|
129
166
|
addExtensionsFor(wrapLines, EditorView === null || EditorView === void 0 ? void 0 : EditorView.lineWrapping),
|
|
130
167
|
addExtensionsFor(supportCodeFolding, adaptedFoldGutter(), adaptedCodeFolding()),
|
|
168
|
+
addExtensionsFor.apply(void 0, __spreadArray([useLinting], __read(linters), false)),
|
|
131
169
|
additionalExtensions,
|
|
132
170
|
];
|
|
133
171
|
var view = new AdaptedEditorView({
|
|
@@ -140,16 +178,29 @@ export var CodeEditor = function (_a) {
|
|
|
140
178
|
if (height) {
|
|
141
179
|
view.dom.style.height = typeof height === "string" ? height : "".concat(height, "px");
|
|
142
180
|
}
|
|
143
|
-
|
|
181
|
+
if (disabled) {
|
|
182
|
+
view.dom.className += " ".concat(eccgui, "-disabled");
|
|
183
|
+
}
|
|
184
|
+
if (intent) {
|
|
185
|
+
view.dom.className += " ".concat(eccgui, "-intent--").concat(intent);
|
|
186
|
+
}
|
|
187
|
+
if (autoFocus) {
|
|
188
|
+
view.focus();
|
|
189
|
+
}
|
|
190
|
+
if (setEditorView) {
|
|
191
|
+
setEditorView(view);
|
|
192
|
+
}
|
|
144
193
|
return function () {
|
|
145
194
|
view.destroy();
|
|
146
|
-
|
|
195
|
+
if (setEditorView) {
|
|
196
|
+
setEditorView(undefined);
|
|
197
|
+
}
|
|
147
198
|
};
|
|
148
199
|
}, [parent.current, mode, preventLineNumbers]);
|
|
149
200
|
return (React.createElement("div", __assign({}, outerDivAttributes, {
|
|
150
201
|
// overwrite/extend some attributes
|
|
151
|
-
id: id ? id : name ? "codemirror-".concat(name) : undefined, ref: parent, "data-test-id": "codemirror-wrapper", className: "".concat(eccgui, "-codeeditor ").concat(eccgui, "-codeeditor--mode-").concat(mode) +
|
|
152
|
-
((outerDivAttributes === null || outerDivAttributes === void 0 ? void 0 : outerDivAttributes.className) ? " ".concat(outerDivAttributes === null || outerDivAttributes === void 0 ? void 0 : outerDivAttributes.className) : "") })));
|
|
202
|
+
id: id ? id : name ? "codemirror-".concat(name) : undefined, ref: parent, "data-test-id": dataTestId ? dataTestId : "codemirror-wrapper", className: "".concat(eccgui, "-codeeditor ").concat(eccgui, "-codeeditor--mode-").concat(mode) +
|
|
203
|
+
((outerDivAttributes === null || outerDivAttributes === void 0 ? void 0 : outerDivAttributes.className) ? " ".concat(outerDivAttributes === null || outerDivAttributes === void 0 ? void 0 : outerDivAttributes.className) : "") }, otherCodeEditorProps)));
|
|
153
204
|
};
|
|
154
205
|
CodeEditor.supportedModes = supportedCodeEditorModes;
|
|
155
206
|
//# sourceMappingURL=CodeMirror.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CodeMirror.js","sourceRoot":"","sources":["../../../../src/extensions/codemirror/CodeMirror.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CodeMirror.js","sourceRoot":"","sources":["../../../../src/extensions/codemirror/CodeMirror.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAa,MAAM,mBA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|
1
|
+
import { debounce } from "lodash";
|
|
2
|
+
var DEBOUNCE_TIME = 500;
|
|
3
|
+
export var debouncedLinter = function (lintFunction, time) {
|
|
4
|
+
if (time === void 0) { time = DEBOUNCE_TIME; }
|
|
5
|
+
var debouncedFn = debounce(function (view, resolve) {
|
|
6
|
+
var diagnostics = lintFunction(view);
|
|
7
|
+
resolve(diagnostics);
|
|
8
|
+
}, time);
|
|
9
|
+
return function (view) {
|
|
10
|
+
return new Promise(function (resolve) {
|
|
11
|
+
debouncedFn(view, resolve);
|
|
12
|
+
});
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=debouncedLinter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"debouncedLinter.js","sourceRoot":"","sources":["../../../../src/extensions/codemirror/debouncedLinter.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAIlC,IAAM,aAAa,GAAG,GAAG,CAAC;AAE1B,MAAM,CAAC,IAAM,eAAe,GAAG,UAAC,YAAoB,EAAE,IAAoB;IAApB,qBAAA,EAAA,oBAAoB;IACtE,IAAM,WAAW,GAAG,QAAQ,CACxB,UACI,IAAgB,EAChB,OAA8F;QAE9F,IAAM,WAAW,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC;QACvC,OAAO,CAAC,WAAW,CAAC,CAAC;IACzB,CAAC,EACD,IAAI,CACP,CAAC;IAEF,OAAO,UAAC,IAAgB;QACpB,OAAO,IAAI,OAAO,CAA4B,UAAC,OAAO;YAClD,WAAW,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QAC/B,CAAC,CAAC,CAAC;IACP,CAAC,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -1,18 +1,17 @@
|
|
|
1
|
-
//adapted v6 modes imports
|
|
2
|
-
import { javascript } from "@codemirror/lang-javascript";
|
|
3
1
|
import { json } from "@codemirror/lang-json";
|
|
2
|
+
//modes imports
|
|
4
3
|
import { markdown } from "@codemirror/lang-markdown";
|
|
5
|
-
import { sql } from "@codemirror/lang-sql";
|
|
6
4
|
import { xml } from "@codemirror/lang-xml";
|
|
7
|
-
import { yaml } from "@codemirror/lang-yaml";
|
|
8
5
|
import { defaultHighlightStyle, StreamLanguage } from "@codemirror/language";
|
|
9
|
-
|
|
6
|
+
import { javascript } from "@codemirror/legacy-modes/mode/javascript.js";
|
|
10
7
|
import { jinja2 } from "@codemirror/legacy-modes/mode/jinja2.js";
|
|
11
8
|
import { mathematica } from "@codemirror/legacy-modes/mode/mathematica.js";
|
|
12
9
|
import { ntriples } from "@codemirror/legacy-modes/mode/ntriples.js";
|
|
13
10
|
import { python } from "@codemirror/legacy-modes/mode/python.js";
|
|
14
11
|
import { sparql } from "@codemirror/legacy-modes/mode/sparql.js";
|
|
12
|
+
import { sql } from "@codemirror/legacy-modes/mode/sql.js";
|
|
15
13
|
import { turtle } from "@codemirror/legacy-modes/mode/turtle.js";
|
|
14
|
+
import { yaml } from "@codemirror/legacy-modes/mode/yaml.js";
|
|
16
15
|
//adaptations
|
|
17
16
|
import { adaptedSyntaxHighlighting } from "../tests/codemirrorTestHelper.js";
|
|
18
17
|
var supportedModes = {
|
|
@@ -30,19 +29,11 @@ var supportedModes = {
|
|
|
30
29
|
javascript: javascript,
|
|
31
30
|
};
|
|
32
31
|
export var supportedCodeEditorModes = Object.keys(supportedModes);
|
|
33
|
-
var v6AdaptedModes = new Map([
|
|
34
|
-
["json", true],
|
|
35
|
-
["markdown", true],
|
|
36
|
-
["xml", true],
|
|
37
|
-
["sql", true],
|
|
38
|
-
["yaml", true],
|
|
39
|
-
["javascript", true],
|
|
40
|
-
]);
|
|
41
32
|
export var useCodeMirrorModeExtension = function (mode) {
|
|
42
33
|
return !mode
|
|
43
34
|
? adaptedSyntaxHighlighting(defaultHighlightStyle)
|
|
44
|
-
:
|
|
45
|
-
? (typeof supportedModes[mode] === "function" ? supportedModes[mode] : function () { })()
|
|
35
|
+
: ["json", "markdown", "xml"].includes(mode)
|
|
36
|
+
? (typeof supportedModes[mode] === "function" ? supportedModes[mode] : function () { return null; })()
|
|
46
37
|
: StreamLanguage === null || StreamLanguage === void 0 ? void 0 : StreamLanguage.define(supportedModes[mode]);
|
|
47
38
|
};
|
|
48
39
|
//# sourceMappingURL=useCodemirrorModeExtension.hooks.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCodemirrorModeExtension.hooks.js","sourceRoot":"","sources":["../../../../../src/extensions/codemirror/hooks/useCodemirrorModeExtension.hooks.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"useCodemirrorModeExtension.hooks.js","sourceRoot":"","sources":["../../../../../src/extensions/codemirror/hooks/useCodemirrorModeExtension.hooks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAC7C,eAAe;AACf,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AACrD,OAAO,EAAE,GAAG,EAAE,MAAM,sBAAsB,CAAC;AAC3C,OAAO,EAAE,qBAAqB,EAAmB,cAAc,EAAgB,MAAM,sBAAsB,CAAC;AAC5G,OAAO,EAAE,UAAU,EAAE,MAAM,0CAA0C,CAAC;AACtE,OAAO,EAAE,MAAM,EAAE,MAAM,sCAAsC,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,2CAA2C,CAAC;AACxE,OAAO,EAAE,QAAQ,EAAE,MAAM,wCAAwC,CAAC;AAClE,OAAO,EAAE,MAAM,EAAE,MAAM,sCAAsC,CAAC;AAC9D,OAAO,EAAE,MAAM,EAAE,MAAM,sCAAsC,CAAC;AAC9D,OAAO,EAAE,GAAG,EAAE,MAAM,mCAAmC,CAAC;AACxD,OAAO,EAAE,MAAM,EAAE,MAAM,sCAAsC,CAAC;AAC9D,OAAO,EAAE,IAAI,EAAE,MAAM,oCAAoC,CAAC;AAE1D,aAAa;AACb,OAAO,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AAE1E,IAAM,cAAc,GAAG;IACnB,QAAQ,UAAA;IACR,MAAM,QAAA;IACN,MAAM,QAAA;IACN,MAAM,QAAA;IACN,GAAG,KAAA;IACH,IAAI,MAAA;IACJ,MAAM,QAAA;IACN,IAAI,MAAA;IACJ,QAAQ,UAAA;IACR,WAAW,aAAA;IACX,GAAG,KAAA;IACH,UAAU,YAAA;CACJ,CAAC;AAEX,MAAM,CAAC,IAAM,wBAAwB,GAAG,MAAM,CAAC,IAAI,CAAC,cAAc,CAAuC,CAAC;AAG1G,MAAM,CAAC,IAAM,0BAA0B,GAAG,UAAC,IAA+B;IACtE,OAAO,CAAC,IAAI;QACR,CAAC,CAAC,yBAAyB,CAAC,qBAAqB,CAAC;QAClD,CAAC,CAAC,CAAC,MAAM,EAAE,UAAU,EAAE,KAAK,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC;YAC5C,CAAC,CAAE,CAAC,OAAO,cAAc,CAAC,IAAI,CAAC,KAAK,UAAU,CAAC,CAAC,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,cAAM,OAAA,IAAI,EAAJ,CAAI,CAA2B,EAAE;YAC/G,CAAC,CAAC,cAAc,aAAd,cAAc,uBAAd,cAAc,CAAE,MAAM,CAAC,cAAc,CAAC,IAAI,CAA0B,CAAC,CAAC;AAChF,CAAC,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { linter } from "@codemirror/lint";
|
|
2
|
+
import { JSHINT as jshint } from "jshint";
|
|
3
|
+
var lintOptions = {
|
|
4
|
+
esversion: 11,
|
|
5
|
+
browser: true,
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Sets up the javascript linter. Documentation: https://codemirror.net/examples/lint/
|
|
9
|
+
*/
|
|
10
|
+
export var jsLinter = function () {
|
|
11
|
+
return linter(function (view) {
|
|
12
|
+
var _a;
|
|
13
|
+
var diagnostics = [];
|
|
14
|
+
var codeText = view.state.doc.toJSON();
|
|
15
|
+
jshint(codeText, lintOptions);
|
|
16
|
+
var errors = (_a = jshint === null || jshint === void 0 ? void 0 : jshint.data()) === null || _a === void 0 ? void 0 : _a.errors;
|
|
17
|
+
if (errors && errors.length > 0) {
|
|
18
|
+
errors.forEach(function (error) {
|
|
19
|
+
var selectedLine = view.state.doc.line(error.line);
|
|
20
|
+
var diagnostic = {
|
|
21
|
+
from: selectedLine.from,
|
|
22
|
+
to: selectedLine.to,
|
|
23
|
+
severity: "error",
|
|
24
|
+
message: error.reason,
|
|
25
|
+
};
|
|
26
|
+
diagnostics.push(diagnostic);
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
return diagnostics;
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=jsLinter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jsLinter.js","sourceRoot":"","sources":["../../../../../src/extensions/codemirror/linters/jsLinter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,MAAM,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,MAAM,IAAI,MAAM,EAAE,MAAM,QAAQ,CAAC;AAI1C,IAAM,WAAW,GAAG;IAChB,SAAS,EAAE,EAAE;IACb,OAAO,EAAE,IAAI;CAChB,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,IAAM,QAAQ,GAAqB;IACtC,OAAO,MAAM,CAAC,UAAC,IAAI;;QACf,IAAM,WAAW,GAAsB,EAAE,CAAC;QAC1C,IAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC;QACzC,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;QAC9B,IAAM,MAAM,GAAG,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,IAAI,EAAE,0CAAE,MAAM,CAAC;QAEtC,IAAI,MAAM,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC9B,MAAM,CAAC,OAAO,CAAC,UAAC,KAAK;gBACjB,IAAM,YAAY,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;gBAErD,IAAM,UAAU,GAAe;oBAC3B,IAAI,EAAE,YAAY,CAAC,IAAI;oBACvB,EAAE,EAAE,YAAY,CAAC,EAAE;oBACnB,QAAQ,EAAE,OAAO;oBACjB,OAAO,EAAE,KAAK,CAAC,MAAM;iBACxB,CAAC;gBAEF,WAAW,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;YACjC,CAAC,CAAC,CAAC;QACP,CAAC;QAED,OAAO,WAAW,CAAC;IACvB,CAAC,CAAC,CAAC;AACP,CAAC,CAAC"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { linter } from "@codemirror/lint";
|
|
2
|
+
import { Parser } from "n3";
|
|
3
|
+
import { debouncedLinter } from "../debouncedLinter.js";
|
|
4
|
+
var parser = new Parser();
|
|
5
|
+
var EMPTY_RESOURCE = "<>";
|
|
6
|
+
var getError = function (message, view) {
|
|
7
|
+
var lineMatch = message.match(/(?<=line )\d{1,}/);
|
|
8
|
+
var valueMatch = message.match(/"([^"]*)"/);
|
|
9
|
+
var lineNumber = lineMatch ? Number(lineMatch[0]) : 1;
|
|
10
|
+
// the [1] index is used to get the caputre group
|
|
11
|
+
var errorContent = valueMatch && valueMatch[1];
|
|
12
|
+
var line = view.state.doc.line(lineNumber);
|
|
13
|
+
var position = line.text.search(errorContent !== null && errorContent !== void 0 ? errorContent : /\S/);
|
|
14
|
+
var from = line.from + position;
|
|
15
|
+
var errorLength = errorContent === null || errorContent === void 0 ? void 0 : errorContent.length;
|
|
16
|
+
return { from: from, to: errorLength ? from + errorLength : line.to };
|
|
17
|
+
};
|
|
18
|
+
var getQuadError = function (view) {
|
|
19
|
+
var lines = view.state.doc.toJSON();
|
|
20
|
+
for (var i = 0; i < lines.length; i += 1) {
|
|
21
|
+
var input = lines[i].trim();
|
|
22
|
+
if (!input) {
|
|
23
|
+
continue;
|
|
24
|
+
}
|
|
25
|
+
if (input.includes(EMPTY_RESOURCE)) {
|
|
26
|
+
// i + 1 is used here because the codemirror uses 1-indexes
|
|
27
|
+
var line = view.state.doc.line(i + 1);
|
|
28
|
+
var position = line.text.search(EMPTY_RESOURCE);
|
|
29
|
+
var from = line.from + position;
|
|
30
|
+
return {
|
|
31
|
+
from: from,
|
|
32
|
+
to: from + EMPTY_RESOURCE.length,
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
return { from: 0, to: view.state.doc.length };
|
|
37
|
+
};
|
|
38
|
+
var n3Linter = function (view) {
|
|
39
|
+
var diagnostics = [];
|
|
40
|
+
var value = view.state.doc.toString();
|
|
41
|
+
try {
|
|
42
|
+
var quads = parser.parse(value);
|
|
43
|
+
quads.forEach(function (quad) {
|
|
44
|
+
if (!quad.subject || !quad.predicate || !quad.object) {
|
|
45
|
+
var _a = getQuadError(view), from = _a.from, to = _a.to;
|
|
46
|
+
view.dispatch({
|
|
47
|
+
scrollIntoView: true,
|
|
48
|
+
});
|
|
49
|
+
diagnostics.push({
|
|
50
|
+
from: from,
|
|
51
|
+
to: to,
|
|
52
|
+
severity: "error",
|
|
53
|
+
message: "Invalid RDF quad:\n\nsubject: ".concat(quad.subject, "\npredicate: ").concat(quad.predicate, "\nobject: ").concat(quad.object),
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
catch (error) {
|
|
59
|
+
var message = error.message;
|
|
60
|
+
var _a = getError(message, view), from = _a.from, to = _a.to;
|
|
61
|
+
view.dispatch({
|
|
62
|
+
scrollIntoView: true,
|
|
63
|
+
});
|
|
64
|
+
diagnostics.push({
|
|
65
|
+
from: from,
|
|
66
|
+
to: to,
|
|
67
|
+
severity: "error",
|
|
68
|
+
message: error.message,
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
return diagnostics;
|
|
72
|
+
};
|
|
73
|
+
/**
|
|
74
|
+
* Sets up the turtle linter. Documentation: https://codemirror.net/examples/lint/
|
|
75
|
+
*/
|
|
76
|
+
export var turtleLinter = function () { return linter(debouncedLinter(n3Linter)); };
|
|
77
|
+
//# sourceMappingURL=turtleLinter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"turtleLinter.js","sourceRoot":"","sources":["../../../../../src/extensions/codemirror/linters/turtleLinter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAEtD,OAAO,EAAE,MAAM,EAAE,MAAM,IAAI,CAAC;AAE5B,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAGrD,IAAM,MAAM,GAAG,IAAI,MAAM,EAAE,CAAC;AAE5B,IAAM,cAAc,GAAG,IAAI,CAAC;AAE5B,IAAM,QAAQ,GAAG,UAAC,OAAe,EAAE,IAAgB;IAC/C,IAAM,SAAS,GAAG,OAAO,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAAC;IACpD,IAAM,UAAU,GAAG,OAAO,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;IAE9C,IAAM,UAAU,GAAG,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACxD,iDAAiD;IACjD,IAAM,YAAY,GAAG,UAAU,IAAI,UAAU,CAAC,CAAC,CAAC,CAAC;IAEjD,IAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IAC7C,IAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,YAAY,aAAZ,YAAY,cAAZ,YAAY,GAAI,IAAI,CAAC,CAAC;IAExD,IAAM,IAAI,GAAG,IAAI,CAAC,IAAI,GAAG,QAAQ,CAAC;IAClC,IA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AC,eAAe,CAAC,QAAQ,CAAC,CAAC,EAAjC,CAAiC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/extensions/codemirror/types.ts"],"names":[],"mappings":""}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { SimpleDialogProps } from "./../../../index";
|
|
2
|
+
import { CodeEditorProps, SimpleDialogProps } from "./../../../index";
|
|
3
3
|
export type StickyNoteModalTranslationKeys = "modalTitle" | "noteLabel" | "colorLabel" | "saveButton" | "cancelButton";
|
|
4
4
|
export type StickyNoteMetadataType = {
|
|
5
5
|
note: string;
|
|
@@ -27,5 +27,9 @@ export interface StickyNoteModalProps {
|
|
|
27
27
|
* Forward other properties to the `SimpleModal` element that is used for this dialog.
|
|
28
28
|
*/
|
|
29
29
|
simpleDialogProps?: Omit<SimpleDialogProps, "size" | "title" | "hasBorder" | "isOpen" | "onClose" | "actions">;
|
|
30
|
+
/**
|
|
31
|
+
* Code editor props
|
|
32
|
+
*/
|
|
33
|
+
codeEditorProps?: Omit<CodeEditorProps, "defaultValue" | "onChange" | "preventLinuNumbers" | "id" | "name">;
|
|
30
34
|
}
|
|
31
35
|
export declare const StickyNoteModal: React.FC<StickyNoteModalProps>;
|
|
@@ -1,28 +1,33 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { EditorView, Rect } from "@codemirror/view";
|
|
3
|
+
import { CodeEditorProps } from "../../extensions/codemirror/CodeMirror";
|
|
3
4
|
import { SupportedCodeEditorModes } from "../../extensions/codemirror/hooks/useCodemirrorModeExtension.hooks";
|
|
4
5
|
export interface IRange {
|
|
5
6
|
from: number;
|
|
6
7
|
to: number;
|
|
7
8
|
}
|
|
8
9
|
export interface ExtendedCodeEditorProps {
|
|
9
|
-
setCM: (editor: EditorView | undefined) =>
|
|
10
|
-
onChange: (value: string) =>
|
|
11
|
-
onCursorChange: (pos: number, coords: Rect, scrollinfo: HTMLElement, cm: EditorView) =>
|
|
10
|
+
setCM: (editor: EditorView | undefined) => void;
|
|
11
|
+
onChange: (value: string) => void;
|
|
12
|
+
onCursorChange: (pos: number, coords: Rect, scrollinfo: HTMLElement, cm: EditorView) => void;
|
|
12
13
|
mode?: SupportedCodeEditorModes;
|
|
13
14
|
initialValue: string;
|
|
14
|
-
onFocusChange: (focused: boolean) =>
|
|
15
|
+
onFocusChange: (focused: boolean) => void;
|
|
15
16
|
onKeyDown: (event: KeyboardEvent) => boolean;
|
|
16
17
|
onMouseDown?: (view: EditorView) => void;
|
|
17
|
-
onSelection: (ranges: IRange[]) =>
|
|
18
|
+
onSelection: (ranges: IRange[]) => void;
|
|
18
19
|
enableTab?: boolean;
|
|
19
20
|
/** Placeholder to be shown when no text has been entered, yet. */
|
|
20
21
|
placeholder?: string;
|
|
21
22
|
showScrollBar?: boolean;
|
|
22
23
|
/** allow multiline entries when new line characters are entered */
|
|
23
24
|
multiline?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Code editor props
|
|
27
|
+
*/
|
|
28
|
+
codeEditorProps?: Omit<CodeEditorProps, "defaultValue" | "setEditorView" | "onChange" | "onCursorChange" | "onFocusChange" | "onKeyDown" | "onSelection" | "onMouseDown" | "shouldHaveMinimalSetup" | "preventLineNumbers" | "mode" | "name" | "enableTab" | "additionalExtensions" | "outerDivAttributes">;
|
|
24
29
|
}
|
|
25
30
|
export type IEditorProps = ExtendedCodeEditorProps;
|
|
26
31
|
/** Supports single-line and multiline editing. */
|
|
27
|
-
export declare const ExtendedCodeEditor: ({ multiline, initialValue, onKeyDown, enableTab, mode, setCM, onFocusChange, onMouseDown, onChange, placeholder, onCursorChange, onSelection, }: ExtendedCodeEditorProps) => React.JSX.Element;
|
|
32
|
+
export declare const ExtendedCodeEditor: ({ multiline, initialValue, onKeyDown, enableTab, mode, setCM, onFocusChange, onMouseDown, onChange, placeholder, onCursorChange, onSelection, codeEditorProps, }: ExtendedCodeEditorProps) => React.JSX.Element;
|
|
28
33
|
export default ExtendedCodeEditor;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { Extension } from "@codemirror/state";
|
|
3
3
|
import { EditorView, Rect } from "@codemirror/view";
|
|
4
|
+
import { IntentTypes } from "../../common/Intent";
|
|
5
|
+
import { TestableComponent } from "../../components/interfaces";
|
|
4
6
|
import { SupportedCodeEditorModes } from "./hooks/useCodemirrorModeExtension.hooks";
|
|
5
|
-
export interface CodeEditorProps {
|
|
6
|
-
setEditorView?: (editor: EditorView | undefined) =>
|
|
7
|
+
export interface CodeEditorProps extends TestableComponent {
|
|
8
|
+
setEditorView?: (editor: EditorView | undefined) => void;
|
|
7
9
|
/**
|
|
8
10
|
* `name` attribute of connected textarea element.
|
|
9
11
|
*/
|
|
@@ -25,7 +27,7 @@ export interface CodeEditorProps {
|
|
|
25
27
|
/**
|
|
26
28
|
* Called when the focus status changes
|
|
27
29
|
*/
|
|
28
|
-
onFocusChange?: (focused: boolean) =>
|
|
30
|
+
onFocusChange?: (focused: boolean) => void;
|
|
29
31
|
/**
|
|
30
32
|
* Called when the user presses a key
|
|
31
33
|
*/
|
|
@@ -40,7 +42,7 @@ export interface CodeEditorProps {
|
|
|
40
42
|
onSelection?: (ranges: {
|
|
41
43
|
from: number;
|
|
42
44
|
to: number;
|
|
43
|
-
}[]) =>
|
|
45
|
+
}[]) => void;
|
|
44
46
|
/**
|
|
45
47
|
* Called when the cursor position changes
|
|
46
48
|
*/
|
|
@@ -101,11 +103,27 @@ export interface CodeEditorProps {
|
|
|
101
103
|
* If the <Tab> key is enabled as normal input, i.e. it won't have the behavior of changing to the next input element, expected in a web app.
|
|
102
104
|
*/
|
|
103
105
|
enableTab?: boolean;
|
|
106
|
+
/**
|
|
107
|
+
* Enables linting feature in the editor ("turtle" and "javascript" modes can use linting currently).
|
|
108
|
+
*/
|
|
109
|
+
useLinting?: boolean;
|
|
110
|
+
/**
|
|
111
|
+
* Autofocus the editor when it is rendered
|
|
112
|
+
*/
|
|
113
|
+
autoFocus?: boolean;
|
|
114
|
+
/**
|
|
115
|
+
* Intent state of the code editor.
|
|
116
|
+
*/
|
|
117
|
+
intent?: IntentTypes | "edited" | "removed";
|
|
118
|
+
/**
|
|
119
|
+
* Disables the editor.
|
|
120
|
+
*/
|
|
121
|
+
disabled?: boolean;
|
|
104
122
|
}
|
|
105
123
|
/**
|
|
106
124
|
* Includes a code editor, currently we use CodeMirror library as base.
|
|
107
125
|
*/
|
|
108
126
|
export declare const CodeEditor: {
|
|
109
|
-
({ onChange, onSelection, onMouseDown, onFocusChange, onKeyDown, onCursorChange, name, id, mode, preventLineNumbers, defaultValue, readOnly, shouldHaveMinimalSetup, wrapLines, onScroll, setEditorView, supportCodeFolding, shouldHighlightActiveLine, outerDivAttributes, tabIntentSize, tabIntentStyle, placeholder, additionalExtensions, tabForceSpaceForModes, enableTab, height, }: CodeEditorProps): React.JSX.Element;
|
|
127
|
+
({ onChange, onSelection, onMouseDown, onFocusChange, onKeyDown, onCursorChange, name, id, mode, preventLineNumbers, defaultValue, readOnly, shouldHaveMinimalSetup, wrapLines, onScroll, setEditorView, supportCodeFolding, shouldHighlightActiveLine, outerDivAttributes, tabIntentSize, tabIntentStyle, placeholder, additionalExtensions, tabForceSpaceForModes, enableTab, height, useLinting, "data-test-id": dataTestId, autoFocus, disabled, intent, ...otherCodeEditorProps }: CodeEditorProps): React.JSX.Element;
|
|
110
128
|
supportedModes: ("markdown" | "python" | "sparql" | "turtle" | "xml" | "yaml" | "jinja2" | "json" | "ntriples" | "mathematica" | "sql" | "javascript")[];
|
|
111
129
|
};
|
|
@@ -1,23 +1,21 @@
|
|
|
1
|
-
import { javascript } from "@codemirror/lang-javascript";
|
|
2
1
|
import { json } from "@codemirror/lang-json";
|
|
3
2
|
import { markdown } from "@codemirror/lang-markdown";
|
|
4
|
-
import { sql } from "@codemirror/lang-sql";
|
|
5
3
|
import { xml } from "@codemirror/lang-xml";
|
|
6
|
-
import { yaml } from "@codemirror/lang-yaml";
|
|
7
4
|
import { StreamParser } from "@codemirror/language";
|
|
5
|
+
import { sql } from "@codemirror/legacy-modes/mode/sql";
|
|
8
6
|
declare const supportedModes: {
|
|
9
7
|
readonly markdown: typeof markdown;
|
|
10
8
|
readonly python: StreamParser<unknown>;
|
|
11
9
|
readonly sparql: StreamParser<unknown>;
|
|
12
10
|
readonly turtle: StreamParser<unknown>;
|
|
13
11
|
readonly xml: typeof xml;
|
|
14
|
-
readonly yaml:
|
|
12
|
+
readonly yaml: StreamParser<unknown>;
|
|
15
13
|
readonly jinja2: StreamParser<unknown>;
|
|
16
14
|
readonly json: typeof json;
|
|
17
15
|
readonly ntriples: StreamParser<unknown>;
|
|
18
16
|
readonly mathematica: StreamParser<unknown>;
|
|
19
17
|
readonly sql: typeof sql;
|
|
20
|
-
readonly javascript:
|
|
18
|
+
readonly javascript: StreamParser<unknown>;
|
|
21
19
|
};
|
|
22
20
|
export declare const supportedCodeEditorModes: Array<keyof typeof supportedModes>;
|
|
23
21
|
export type SupportedCodeEditorModes = (typeof supportedCodeEditorModes)[number];
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Diagnostic } from "@codemirror/lint";
|
|
2
|
+
import { Extension } from "@codemirror/state";
|
|
3
|
+
import { EditorView } from "@codemirror/view";
|
|
4
|
+
export type Linter = (view: EditorView) => ReadonlyArray<Diagnostic> | Promise<ReadonlyArray<Diagnostic>>;
|
|
5
|
+
export type ExtensionCreator<T = unknown> = (options?: T) => Extension;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eccenca/gui-elements",
|
|
3
3
|
"description": "GUI elements based on other libraries, usable in React application, written in Typescript.",
|
|
4
|
-
"version": "24.0.
|
|
4
|
+
"version": "24.1.0-rc.0",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"homepage": "https://github.com/eccenca/gui-elements",
|
|
7
7
|
"bugs": "https://github.com/eccenca/gui-elements/issues",
|
|
@@ -72,19 +72,18 @@
|
|
|
72
72
|
"@blueprintjs/core": "^5.16.2",
|
|
73
73
|
"@blueprintjs/select": "^5.3.7",
|
|
74
74
|
"@carbon/icons": "^11.53.0",
|
|
75
|
-
"@carbon/react": "1.72.0",
|
|
76
|
-
"@codemirror/lang-javascript": "^6.2.2",
|
|
75
|
+
"@carbon/react": "^1.72.0",
|
|
77
76
|
"@codemirror/lang-json": "^6.0.1",
|
|
78
77
|
"@codemirror/lang-markdown": "^6.3.1",
|
|
79
|
-
"@codemirror/lang-sql": "^6.8.0",
|
|
80
78
|
"@codemirror/lang-xml": "^6.1.0",
|
|
81
|
-
"@codemirror/lang-yaml": "^6.1.2",
|
|
82
79
|
"@codemirror/legacy-modes": "^6.4.2",
|
|
83
80
|
"@mavrin/remark-typograf": "^2.2.0",
|
|
84
81
|
"codemirror": "^6.0.1",
|
|
85
82
|
"color": "^4.2.3",
|
|
86
83
|
"compute-scroll-into-view": "^3.1.0",
|
|
84
|
+
"jshint": "^2.13.6",
|
|
87
85
|
"lodash": "^4.17.21",
|
|
86
|
+
"n3": "^1.23.1",
|
|
88
87
|
"re-resizable": "^6.10.1",
|
|
89
88
|
"react": "^16.13.1",
|
|
90
89
|
"react-dom": "^16.13.1",
|
|
@@ -129,7 +128,9 @@
|
|
|
129
128
|
"@types/codemirror": "^5.60.15",
|
|
130
129
|
"@types/color": "^3.0.6",
|
|
131
130
|
"@types/jest": "^29.5.14",
|
|
131
|
+
"@types/jshint": "^2.12.4",
|
|
132
132
|
"@types/lodash": "^4.17.13",
|
|
133
|
+
"@types/n3": "^1.21.1",
|
|
133
134
|
"@types/react-syntax-highlighter": "^15.5.13",
|
|
134
135
|
"@typescript-eslint/eslint-plugin": "^8.18.1",
|
|
135
136
|
"@typescript-eslint/parser": "^8.18.1",
|