@elice/material-exercise 1.230726.0 → 1.230817.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/cjs/_virtual/_rollupPluginBabelHelpers.js +6 -11
- package/cjs/components/material-exercise/MaterialExercise.d.ts +2 -2
- package/cjs/components/material-exercise/MaterialExerciseMobile.d.ts +1 -1
- package/cjs/components/material-exercise/context/ExerciseIntlProvider.d.ts +1 -1
- package/cjs/components/material-exercise/context/ExerciseProvider.d.ts +1 -1
- package/cjs/components/material-exercise/context/ExerciseProviderNoImage.d.ts +1 -1
- package/cjs/components/material-exercise/context/context.d.ts +2 -2
- package/cjs/components/material-exercise/context/recoilTypes.d.ts +14 -14
- package/cjs/components/material-exercise/context/types.d.ts +12 -12
- package/cjs/components/material-exercise/exercise-file-tabs/ExerciseFileTabsFileTreeButton.d.ts +1 -1
- package/cjs/components/material-exercise/exercise-file-tabs/ExerciseFileTabsLazy.d.ts +2 -2
- package/cjs/components/material-exercise/exercise-file-tree/ExerciseFileTreeLazy.d.ts +2 -2
- package/cjs/components/material-exercise/exercise-multilang-dropdown/ExerciseMultilangDropdownLazy.d.ts +2 -2
- package/cjs/components/material-exercise/exercise-multilang-dropdown/types.d.ts +2 -2
- package/cjs/components/material-exercise/exercise-preview/ExercisePreviewDisplayModeButton.d.ts +1 -1
- package/cjs/components/material-exercise/exercise-runner/ExerciseRunnerControllerCodeHelpRequestButton.d.ts +1 -1
- package/cjs/components/shared/exercise-menu-button/ExerciseMenuButton.d.ts +2 -2
- package/cjs/components/shared/file-icon/FileIcon.d.ts +1 -1
- package/cjs/components/shared/file-tabs/FileTab.d.ts +1 -1
- package/cjs/components/shared/file-tabs/FileTab.styled.d.ts +1 -1
- package/cjs/components/shared/file-tabs/FileTabs.js +6 -4
- package/cjs/components/shared/file-tree/FileTreeList.js +2 -2
- package/cjs/components/shared/file-tree/FileTreeListItems.js +2 -2
- package/cjs/components/shared/file-tree/context/FileTreeContext.d.ts +6 -6
- package/cjs/components/shared/file-tree/interface/index.d.ts +18 -18
- package/cjs/components/shared/file-viewer/FileViewer.d.ts +2 -2
- package/cjs/components/shared/file-viewer/FileViewerNonViewable.d.ts +2 -2
- package/cjs/components/shared/monaco-editor/MonacoEditor.d.ts +11 -11
- package/cjs/components/shared/monaco-editor/MonacoEditor.js +1 -1
- package/cjs/components/shared/monaco-editor/MonacoEditorPerferenceForm.d.ts +2 -2
- package/cjs/components/shared/monaco-editor/constants/monaco/preferences.d.ts +2 -2
- package/cjs/components/shared/monaco-editor/editor-hooks/useMonacoEventChange.d.ts +4 -4
- package/cjs/components/shared/monaco-editor/editor-hooks/useMonacoEventCursor.d.ts +3 -3
- package/cjs/components/shared/monaco-editor/editor-hooks/useMonacoEventScroll.d.ts +3 -3
- package/cjs/components/shared/monaco-editor/editor-hooks/useMonacoMarkers.d.ts +1 -1
- package/cjs/components/shared/monaco-editor/editor-hooks/useMonacoOptions.d.ts +1 -1
- package/cjs/components/shared/monaco-editor/editor-hooks/useMonacoOptions.js +3 -3
- package/cjs/components/shared/monaco-editor/editor-hooks/useMonacoTheme.d.ts +1 -1
- package/cjs/components/shared/monaco-editor/editor-languages/css/formatter.js +1 -1
- package/cjs/components/shared/monaco-editor/editor-languages/html/formatter.js +1 -1
- package/cjs/components/shared/monaco-editor/editor-languages/typescript/dts/_helper.d.ts +1 -1
- package/cjs/components/shared/monaco-editor/editor-languages/typescript/dts/express.d.ts +1 -1
- package/cjs/components/shared/monaco-editor/editor-languages/typescript/dts/propTypes.d.ts +1 -1
- package/cjs/components/shared/monaco-editor/editor-languages/typescript/dts/react.d.ts +1 -1
- package/cjs/components/shared/monaco-editor/editor-languages/typescript/formatter.js +12 -8
- package/cjs/components/shared/monaco-editor/hooks/useEditorOptions.d.ts +2 -2
- package/cjs/components/shared/monaco-editor/utils/prettier/index.d.ts +1 -1
- package/cjs/components/shared/monaco-editor/vendors/monaco-collab-ext/OnDisposed.d.ts +1 -1
- package/cjs/components/shared/monaco-editor/vendors/monaco-collab-ext/RemoteSelection.js +10 -10
- package/cjs/components/shared/monaco-editor/vendors/vscode-emmet-helper/emmetHelper.d.ts +5 -5
- package/cjs/components/shared/no-vnc/NoVnc.d.ts +1 -1
- package/cjs/constants/shortcutKeyMap.d.ts +1 -1
- package/cjs/hooks/useArduino.d.ts +1 -1
- package/cjs/hooks/useExericseShortcut.d.ts +2 -2
- package/cjs/hooks/useMaterialExerciseFileUrl.d.ts +1 -1
- package/cjs/hooks/useRunnerRoomWebSocket.d.ts +1 -1
- package/cjs/hooks/useStdioWebSocket.d.ts +3 -3
- package/cjs/hooks/useUsercodeEditWebSocket.d.ts +5 -5
- package/cjs/hooks/useUsercodeEditWebSocket.js +39 -33
- package/cjs/typings/arduino.d.ts +6 -6
- package/cjs/utils/exerciseFile.d.ts +1 -1
- package/cjs/utils/runner.d.ts +3 -3
- package/cjs/utils/runner.js +7 -7
- package/es/_virtual/_rollupPluginBabelHelpers.js +6 -11
- package/es/components/material-exercise/MaterialExercise.d.ts +2 -2
- package/es/components/material-exercise/MaterialExercise.js +1 -1
- package/es/components/material-exercise/MaterialExerciseMobile.d.ts +1 -1
- package/es/components/material-exercise/context/ExerciseIntlProvider.d.ts +1 -1
- package/es/components/material-exercise/context/ExerciseProvider.d.ts +1 -1
- package/es/components/material-exercise/context/ExerciseProviderNoImage.d.ts +1 -1
- package/es/components/material-exercise/context/context.d.ts +2 -2
- package/es/components/material-exercise/context/recoil.js +1 -1
- package/es/components/material-exercise/context/recoilTypes.d.ts +14 -14
- package/es/components/material-exercise/context/types.d.ts +12 -12
- package/es/components/material-exercise/exercise-code-history/ExerciseCodeHistory.js +1 -1
- package/es/components/material-exercise/exercise-file-editor/ExerciseFileEditor.js +1 -1
- package/es/components/material-exercise/exercise-file-tabs/ExerciseFileTabsFileTreeButton.d.ts +1 -1
- package/es/components/material-exercise/exercise-file-tabs/ExerciseFileTabsLazy.d.ts +2 -2
- package/es/components/material-exercise/exercise-file-tree/ExerciseFileTreeLazy.d.ts +2 -2
- package/es/components/material-exercise/exercise-menu/ExerciseMenuArduinoSettings.js +1 -1
- package/es/components/material-exercise/exercise-menu/ExerciseMenuStdioFileBrowser.js +2 -2
- package/es/components/material-exercise/exercise-multilang-dropdown/ExerciseMultilangDropdownLazy.d.ts +2 -2
- package/es/components/material-exercise/exercise-multilang-dropdown/types.d.ts +2 -2
- package/es/components/material-exercise/exercise-preview/ExercisePreviewDisplayModeButton.d.ts +1 -1
- package/es/components/material-exercise/exercise-rightpane/ExerciseRightpane.js +1 -1
- package/es/components/material-exercise/exercise-runner/ExerciseRunnerControllerArduinoAgentModal.js +1 -1
- package/es/components/material-exercise/exercise-runner/ExerciseRunnerControllerCodeHelpRequestButton.d.ts +1 -1
- package/es/components/material-exercise/exercise-runner/ExerciseRunnerControllerCodeHelpRequestButton.js +2 -2
- package/es/components/shared/exercise-menu-button/ExerciseMenuButton.d.ts +2 -2
- package/es/components/shared/file-icon/FileIcon.d.ts +1 -1
- package/es/components/shared/file-tabs/FileTab.d.ts +1 -1
- package/es/components/shared/file-tabs/FileTab.js +1 -1
- package/es/components/shared/file-tabs/FileTab.styled.d.ts +1 -1
- package/es/components/shared/file-tabs/FileTabs.js +6 -4
- package/es/components/shared/file-tree/FileTreeList.js +2 -2
- package/es/components/shared/file-tree/FileTreeListItemContentMenu.js +1 -1
- package/es/components/shared/file-tree/FileTreeListItems.js +2 -2
- package/es/components/shared/file-tree/context/FileTreeContext.d.ts +6 -6
- package/es/components/shared/file-tree/interface/index.d.ts +18 -18
- package/es/components/shared/file-viewer/FileViewer.d.ts +2 -2
- package/es/components/shared/file-viewer/FileViewerNonViewable.d.ts +2 -2
- package/es/components/shared/monaco-editor/MonacoEditor.d.ts +11 -11
- package/es/components/shared/monaco-editor/MonacoEditor.js +1 -1
- package/es/components/shared/monaco-editor/MonacoEditorPerferenceForm.d.ts +2 -2
- package/es/components/shared/monaco-editor/constants/monaco/preferences.d.ts +2 -2
- package/es/components/shared/monaco-editor/editor-hooks/useMonacoEventChange.d.ts +4 -4
- package/es/components/shared/monaco-editor/editor-hooks/useMonacoEventCursor.d.ts +3 -3
- package/es/components/shared/monaco-editor/editor-hooks/useMonacoEventScroll.d.ts +3 -3
- package/es/components/shared/monaco-editor/editor-hooks/useMonacoMarkers.d.ts +1 -1
- package/es/components/shared/monaco-editor/editor-hooks/useMonacoOptions.d.ts +1 -1
- package/es/components/shared/monaco-editor/editor-hooks/useMonacoOptions.js +3 -3
- package/es/components/shared/monaco-editor/editor-hooks/useMonacoTheme.d.ts +1 -1
- package/es/components/shared/monaco-editor/editor-languages/css/formatter.js +1 -1
- package/es/components/shared/monaco-editor/editor-languages/html/formatter.js +1 -1
- package/es/components/shared/monaco-editor/editor-languages/typescript/dts/_helper.d.ts +1 -1
- package/es/components/shared/monaco-editor/editor-languages/typescript/dts/express.d.ts +1 -1
- package/es/components/shared/monaco-editor/editor-languages/typescript/dts/propTypes.d.ts +1 -1
- package/es/components/shared/monaco-editor/editor-languages/typescript/dts/react.d.ts +1 -1
- package/es/components/shared/monaco-editor/editor-languages/typescript/formatter.js +12 -8
- package/es/components/shared/monaco-editor/hooks/useEditorOptions.d.ts +2 -2
- package/es/components/shared/monaco-editor/utils/prettier/index.d.ts +1 -1
- package/es/components/shared/monaco-editor/vendors/monaco-collab-ext/OnDisposed.d.ts +1 -1
- package/es/components/shared/monaco-editor/vendors/monaco-collab-ext/RemoteSelection.js +10 -10
- package/es/components/shared/monaco-editor/vendors/vscode-emmet-helper/emmetHelper.d.ts +5 -5
- package/es/components/shared/no-vnc/NoVnc.d.ts +1 -1
- package/es/constants/shortcutKeyMap.d.ts +1 -1
- package/es/hooks/useArduino.d.ts +1 -1
- package/es/hooks/useExerciseFile.js +1 -1
- package/es/hooks/useExericseShortcut.d.ts +2 -2
- package/es/hooks/useMaterialExerciseFileUrl.d.ts +1 -1
- package/es/hooks/useRunnerRoomWebSocket.d.ts +1 -1
- package/es/hooks/useStdioWebSocket.d.ts +3 -3
- package/es/hooks/useUsercodeEditWebSocket.d.ts +5 -5
- package/es/hooks/useUsercodeEditWebSocket.js +39 -33
- package/es/typings/arduino.d.ts +6 -6
- package/es/utils/exerciseFile.d.ts +1 -1
- package/es/utils/runner.d.ts +3 -3
- package/es/utils/runner.js +7 -7
- package/package.json +12 -16
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { editor } from 'monaco-editor/esm/vs/editor/editor.api';
|
|
2
2
|
import type React from 'react';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
type Monaco = React.MutableRefObject<editor.IStandaloneCodeEditor | null>;
|
|
4
|
+
type SuppressFlag = boolean | React.MutableRefObject<boolean>;
|
|
5
|
+
type ChangeEventCallback = (value: string) => void;
|
|
6
6
|
/**
|
|
7
7
|
* Hook for change event of monaco editor.
|
|
8
8
|
*/
|
|
9
|
-
export declare const useMonacoEventChange: (monaco: Monaco, cb?: ChangeEventCallback
|
|
9
|
+
export declare const useMonacoEventChange: (monaco: Monaco, cb?: ChangeEventCallback, _suppress?: SuppressFlag, deps?: unknown[]) => void;
|
|
10
10
|
export {};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type { editor } from 'monaco-editor/esm/vs/editor/editor.api';
|
|
2
2
|
import type React from 'react';
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
type Monaco = React.MutableRefObject<editor.IStandaloneCodeEditor | null>;
|
|
4
|
+
type CursorEventCallback = (range: {
|
|
5
5
|
from: number;
|
|
6
6
|
to: number;
|
|
7
7
|
}) => void;
|
|
8
8
|
/**
|
|
9
9
|
* Hook for cursor activity event of monaco editor.
|
|
10
10
|
*/
|
|
11
|
-
export declare const useMonacoEventCursor: (monaco: Monaco, cb?: CursorEventCallback
|
|
11
|
+
export declare const useMonacoEventCursor: (monaco: Monaco, cb?: CursorEventCallback, deps?: unknown[]) => void;
|
|
12
12
|
export {};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type { editor } from 'monaco-editor/esm/vs/editor/editor.api';
|
|
2
2
|
import type React from 'react';
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
type Monaco = React.MutableRefObject<editor.IStandaloneCodeEditor | null>;
|
|
4
|
+
type ScrollEventCallback = (position: {
|
|
5
5
|
x: number;
|
|
6
6
|
y: number;
|
|
7
7
|
}) => void;
|
|
8
8
|
/**
|
|
9
9
|
* Hook for scroll event of monaco editor.
|
|
10
10
|
*/
|
|
11
|
-
export declare const useMonacoEventScroll: (monaco: Monaco, cb?: ScrollEventCallback
|
|
11
|
+
export declare const useMonacoEventScroll: (monaco: Monaco, cb?: ScrollEventCallback, deps?: unknown[]) => void;
|
|
12
12
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { editor } from 'monaco-editor/esm/vs/editor/editor.api';
|
|
2
2
|
import type React from 'react';
|
|
3
|
-
|
|
3
|
+
type Monaco = React.MutableRefObject<editor.IStandaloneCodeEditor | null>;
|
|
4
4
|
interface UseMonacoMarkersReturns {
|
|
5
5
|
init: () => void;
|
|
6
6
|
dispose: () => void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { editor } from 'monaco-editor/esm/vs/editor/editor.api';
|
|
3
3
|
import type { EditorOptions } from '../hooks';
|
|
4
|
-
|
|
4
|
+
type Monaco = React.MutableRefObject<editor.IStandaloneCodeEditor | null>;
|
|
5
5
|
/**
|
|
6
6
|
* Hook for update options of monaco editor.
|
|
7
7
|
*/
|
|
@@ -30,11 +30,11 @@ var useMonacoOptions = function useMonacoOptions(monaco$1, options) {
|
|
|
30
30
|
// Load font and remeasure font of editor.
|
|
31
31
|
//
|
|
32
32
|
React.useEffect(function () {
|
|
33
|
-
var _a, _b
|
|
34
|
-
if (typeof ((
|
|
33
|
+
var _a, _b;
|
|
34
|
+
if (typeof ((_a = document === null || document === void 0 ? void 0 : document.fonts) === null || _a === void 0 ? void 0 : _a.load) !== 'function') {
|
|
35
35
|
return;
|
|
36
36
|
}
|
|
37
|
-
var size = (
|
|
37
|
+
var size = (_b = options.fontSize) !== null && _b !== void 0 ? _b : preferences.DEFAULT_MONACO_EDITOR_PREFERENCE.fontSize;
|
|
38
38
|
document.fonts.load("".concat(size, "px Elice Digital Coding"), FONT_LOAD_TEXT).then(function () {
|
|
39
39
|
return monaco.editor.remeasureFonts();
|
|
40
40
|
}).catch(function () {
|
|
@@ -33,7 +33,7 @@ var CssDocumentFormattingEditProvider = {
|
|
|
33
33
|
_context.t0 = index["default"];
|
|
34
34
|
_context.t1 = model.getValue();
|
|
35
35
|
_context.next = 4;
|
|
36
|
-
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require('prettier/
|
|
36
|
+
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require('prettier/plugins/postcss')); });
|
|
37
37
|
case 4:
|
|
38
38
|
_context.t2 = _context.sent;
|
|
39
39
|
_context.t3 = [_context.t2];
|
|
@@ -33,7 +33,7 @@ var HtmlDocumentFormattingEditProvider = {
|
|
|
33
33
|
_context.t0 = index["default"];
|
|
34
34
|
_context.t1 = model.getValue();
|
|
35
35
|
_context.next = 4;
|
|
36
|
-
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require('prettier/
|
|
36
|
+
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require('prettier/plugins/html')); });
|
|
37
37
|
case 4:
|
|
38
38
|
_context.t2 = _context.sent;
|
|
39
39
|
_context.t3 = [_context.t2];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type * as monaco from 'monaco-editor/esm/vs/editor/editor.api';
|
|
2
|
-
export
|
|
2
|
+
export type DtsParams = Parameters<(typeof monaco.languages.typescript.typescriptDefaults)['addExtraLib']>;
|
|
3
3
|
export interface DtsOptions {
|
|
4
4
|
path: DtsParams[1];
|
|
5
5
|
content: DtsParams[0];
|
|
@@ -33,23 +33,27 @@ var TypescriptDocumentFormattingEditProvider = {
|
|
|
33
33
|
_context.t0 = index["default"];
|
|
34
34
|
_context.t1 = model.getValue();
|
|
35
35
|
_context.next = 4;
|
|
36
|
-
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require('prettier/
|
|
36
|
+
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require('prettier/plugins/babel')); });
|
|
37
37
|
case 4:
|
|
38
38
|
_context.t2 = _context.sent;
|
|
39
|
-
_context.
|
|
40
|
-
|
|
39
|
+
_context.next = 7;
|
|
40
|
+
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require('prettier/plugins/estree')); });
|
|
41
|
+
case 7:
|
|
42
|
+
_context.t3 = _context.sent;
|
|
43
|
+
_context.t4 = [_context.t2, _context.t3];
|
|
44
|
+
_context.t5 = {
|
|
41
45
|
parser: 'babel-ts',
|
|
42
|
-
plugins: _context.
|
|
46
|
+
plugins: _context.t4
|
|
43
47
|
};
|
|
44
|
-
_context.next =
|
|
45
|
-
return (0, _context.t0)(_context.t1, _context.
|
|
46
|
-
case
|
|
48
|
+
_context.next = 12;
|
|
49
|
+
return (0, _context.t0)(_context.t1, _context.t5);
|
|
50
|
+
case 12:
|
|
47
51
|
text = _context.sent;
|
|
48
52
|
return _context.abrupt("return", [{
|
|
49
53
|
range: model.getFullModelRange(),
|
|
50
54
|
text: text
|
|
51
55
|
}]);
|
|
52
|
-
case
|
|
56
|
+
case 14:
|
|
53
57
|
case "end":
|
|
54
58
|
return _context.stop();
|
|
55
59
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type monaco from 'monaco-editor/esm/vs/editor/editor.api';
|
|
2
2
|
import type { MonacoEditorProps } from '../MonacoEditor';
|
|
3
|
-
export
|
|
4
|
-
export
|
|
3
|
+
export type EditorOptions = Parameters<monaco.editor.IStandaloneCodeEditor['updateOptions']>[0];
|
|
4
|
+
export type UseEditorOptionsProps = Required<Pick<MonacoEditorProps, 'width' | 'height' | 'preference' | 'noLanguageIntellisense'>>;
|
|
5
5
|
/**
|
|
6
6
|
* Hook to get editor options from props.
|
|
7
7
|
*/
|
|
@@ -55,18 +55,11 @@ var RemoteSelection = /*#__PURE__*/function () {
|
|
|
55
55
|
this._onDisposed = onDisposed;
|
|
56
56
|
}
|
|
57
57
|
/**
|
|
58
|
-
*
|
|
59
|
-
* style the color of the selection. The Monaco Editor only allows setting
|
|
60
|
-
* the class name of decorations, so we can not set a style property directly.
|
|
61
|
-
* This method will create, add, and return the style tag for this element.
|
|
58
|
+
* Gets the userland id of this selection.
|
|
62
59
|
*/
|
|
63
60
|
_rollupPluginBabelHelpers.createClass(RemoteSelection, [{
|
|
64
61
|
key: "getId",
|
|
65
|
-
value:
|
|
66
|
-
/**
|
|
67
|
-
* Gets the userland id of this selection.
|
|
68
|
-
*/
|
|
69
|
-
function getId() {
|
|
62
|
+
value: function getId() {
|
|
70
63
|
return this._id;
|
|
71
64
|
}
|
|
72
65
|
/**
|
|
@@ -178,7 +171,14 @@ var RemoteSelection = /*#__PURE__*/function () {
|
|
|
178
171
|
}
|
|
179
172
|
}], [{
|
|
180
173
|
key: "_addDynamicStyleElement",
|
|
181
|
-
value:
|
|
174
|
+
value:
|
|
175
|
+
/**
|
|
176
|
+
* A helper method to add a style tag to the head of the document that will
|
|
177
|
+
* style the color of the selection. The Monaco Editor only allows setting
|
|
178
|
+
* the class name of decorations, so we can not set a style property directly.
|
|
179
|
+
* This method will create, add, and return the style tag for this element.
|
|
180
|
+
*/
|
|
181
|
+
function _addDynamicStyleElement(className, color) {
|
|
182
182
|
var css = ".".concat(className, " { background-color: ").concat(color, "; }").trim();
|
|
183
183
|
var styleElement = document.createElement('style');
|
|
184
184
|
styleElement.innerText = css;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type * as monaco from 'monaco-editor/esm/vs/editor/editor.api';
|
|
2
2
|
import type { ExtractOptions, MarkupAbbreviation, Options, StylesheetAbbreviation, SyntaxType, UserConfig } from 'emmet';
|
|
3
3
|
import type { SnippetsMap } from './configCompat';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
type TextModel = monaco.editor.ITextModel;
|
|
5
|
+
type CompletionList = monaco.languages.CompletionList;
|
|
6
|
+
type Position = monaco.IPosition;
|
|
7
|
+
type Range = monaco.IRange;
|
|
8
8
|
/**
|
|
9
9
|
* Emmet configuration as derived from the Emmet related VS Code settings
|
|
10
10
|
*/
|
|
@@ -54,7 +54,7 @@ export declare function extractAbbreviationFromText(text: string, syntax: string
|
|
|
54
54
|
* @param abbreviation string
|
|
55
55
|
*/
|
|
56
56
|
export declare function isAbbreviationValid(syntax: string, abbreviation: string): boolean;
|
|
57
|
-
|
|
57
|
+
type ExpandOptionsConfig = {
|
|
58
58
|
type: SyntaxType;
|
|
59
59
|
options: Partial<Options>;
|
|
60
60
|
variables: SnippetsMap;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { GetOrgMaterialExerciseGetResponses } from '@elice/types';
|
|
3
|
-
|
|
3
|
+
type MaterialExerciseReadyExerciseImage = GetOrgMaterialExerciseGetResponses['materialExercise']['readyExerciseImage'];
|
|
4
4
|
export interface NoVncApis {
|
|
5
5
|
connect: () => void;
|
|
6
6
|
disconnect: () => void;
|
|
@@ -9,6 +9,6 @@ interface UseArduinoReturns {
|
|
|
9
9
|
sendText: (char: string) => void;
|
|
10
10
|
uploadHexFile: (hexFile: MaterialExerciseStdioFileFile) => void;
|
|
11
11
|
}
|
|
12
|
-
|
|
12
|
+
type UseArduino = (props: UseArduinoProps) => UseArduinoReturns;
|
|
13
13
|
export declare const useArduino: UseArduino;
|
|
14
14
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { EXERCISE_SHORTCUT_KEY_MAP } from "../constants";
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
type Name = keyof typeof EXERCISE_SHORTCUT_KEY_MAP;
|
|
3
|
+
type Callback = (e: KeyboardEvent) => any;
|
|
4
4
|
export declare const useExericseShortcut: (name: Name, fn: Callback) => void;
|
|
5
5
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { GetOrgMaterialExerciseGetResponses } from '@elice/types';
|
|
2
|
-
|
|
2
|
+
type UseMaterialExerciseFileUrl = (props: UseMaterialExerciseFileUrlProps) => string | null;
|
|
3
3
|
interface UseMaterialExerciseFileUrlProps {
|
|
4
4
|
filename: string | null;
|
|
5
5
|
exercise: GetOrgMaterialExerciseGetResponses['materialExercise'] | null;
|
|
@@ -12,7 +12,7 @@ export interface UseRunnerRoomWebSocketReturns {
|
|
|
12
12
|
isRunning: boolean;
|
|
13
13
|
reconnect: () => void;
|
|
14
14
|
}
|
|
15
|
-
export
|
|
15
|
+
export type UseRunnerRoomWebSocket = (props: UseRunnerRoomWebSocketProps) => UseRunnerRoomWebSocketReturns;
|
|
16
16
|
/**
|
|
17
17
|
*
|
|
18
18
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { WebsocketStdioReceivingMessage, WebsocketStdioSendingMessageSignal, WebsocketStdioSendingMessageText, WebsocketStdioSendingMessageTtyResize } from '@elice/types';
|
|
2
|
-
export
|
|
3
|
-
export
|
|
2
|
+
export type MaterialExerciseStdioTextType = Exclude<WebsocketStdioReceivingMessage['type'], 'image' | 'file'>;
|
|
3
|
+
export type MaterialExerciseStdioFile = MaterialExerciseStdioImageFile | MaterialExerciseStdioFileFile;
|
|
4
4
|
export interface MaterialExerciseStdioImageFile {
|
|
5
5
|
type: 'image';
|
|
6
6
|
mime: string;
|
|
@@ -27,7 +27,7 @@ interface UseStdioWebSocketReturns {
|
|
|
27
27
|
sendSync: () => void;
|
|
28
28
|
reconnect: () => void;
|
|
29
29
|
}
|
|
30
|
-
|
|
30
|
+
type UseStdioWebSocket = (props: UseStdioWebSocketProps) => UseStdioWebSocketReturns;
|
|
31
31
|
/**
|
|
32
32
|
*
|
|
33
33
|
*/
|
|
@@ -12,11 +12,11 @@ export interface UsercodeMarker extends CursorRange {
|
|
|
12
12
|
/**
|
|
13
13
|
* Event handler for init.
|
|
14
14
|
*/
|
|
15
|
-
export
|
|
15
|
+
export type UseUsercodeEditWebSocketPropOnInit = (doc: string) => void;
|
|
16
16
|
/**
|
|
17
17
|
* Event handler for `WRITE_NOTI` event.
|
|
18
18
|
*/
|
|
19
|
-
export
|
|
19
|
+
export type UseUsercodeEditWebSocketPropOnWriteNoti = (ots: TextOp, isFromServer: boolean) => void;
|
|
20
20
|
/**
|
|
21
21
|
* Props of `useUsercodeEditWebSocket`.
|
|
22
22
|
*/
|
|
@@ -29,11 +29,11 @@ interface UseUsercodeEditWebSocketProps {
|
|
|
29
29
|
/**
|
|
30
30
|
*
|
|
31
31
|
*/
|
|
32
|
-
export
|
|
32
|
+
export type UseUsercodeEditWebSocketReturnSendCursor = (range: CursorRange) => void;
|
|
33
33
|
/**
|
|
34
34
|
* Event handler for websocket message.
|
|
35
35
|
*/
|
|
36
|
-
export
|
|
36
|
+
export type UseUsercodeEditWebSocketReturnSendOTs = (ots: TextOp) => void;
|
|
37
37
|
/**
|
|
38
38
|
* Return type of `useUsercodeEditWebSocket`.
|
|
39
39
|
*/
|
|
@@ -49,7 +49,7 @@ interface UseUsercodeEditWebSocketReturns {
|
|
|
49
49
|
_startMonkey: () => void;
|
|
50
50
|
_stopMonkey: () => void;
|
|
51
51
|
}
|
|
52
|
-
|
|
52
|
+
type UseUsercodeEditWebSocket = (props: UseUsercodeEditWebSocketProps) => UseUsercodeEditWebSocketReturns;
|
|
53
53
|
/**
|
|
54
54
|
*
|
|
55
55
|
*/
|
|
@@ -211,45 +211,51 @@ var useUsercodeEditWebSocket = function useUsercodeEditWebSocket(_ref) {
|
|
|
211
211
|
/**
|
|
212
212
|
* Send `FETCH`.
|
|
213
213
|
*/
|
|
214
|
-
var sendFetch = React.
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
214
|
+
var sendFetch = React.useMemo(function () {
|
|
215
|
+
return debounce__default["default"](function () {
|
|
216
|
+
var _a;
|
|
217
|
+
(_a = websocket$1.current) === null || _a === void 0 ? void 0 : _a.sendJson({
|
|
218
|
+
type: 'FETCH',
|
|
219
|
+
from: version.current
|
|
220
|
+
});
|
|
221
|
+
}, 1000);
|
|
222
|
+
}, []);
|
|
221
223
|
/**
|
|
222
224
|
* Send `WRITE`.
|
|
223
225
|
*/
|
|
224
|
-
var sendWrite = React.
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
226
|
+
var sendWrite = React.useMemo(function () {
|
|
227
|
+
return debounce__default["default"](function () {
|
|
228
|
+
var _a;
|
|
229
|
+
if (otsBuffer.current.length === 0 || writeIndex.current !== 0) {
|
|
230
|
+
return;
|
|
231
|
+
}
|
|
232
|
+
writeIndex.current = otsBuffer.current.length;
|
|
233
|
+
var ots = otsBuffer.current[0];
|
|
234
|
+
for (var i = 1; i < writeIndex.current; i++) {
|
|
235
|
+
ots = otTextUnicode.type.compose(ots, otsBuffer.current[i]);
|
|
236
|
+
}
|
|
237
|
+
(_a = websocket$1.current) === null || _a === void 0 ? void 0 : _a.sendJson({
|
|
238
|
+
type: 'WRITE',
|
|
239
|
+
to: version.current + 1,
|
|
240
|
+
ots: ots
|
|
241
|
+
});
|
|
242
|
+
}, 100);
|
|
243
|
+
}, []);
|
|
240
244
|
/**
|
|
241
245
|
* Send `CURSOR`.
|
|
242
246
|
*/
|
|
243
|
-
var sendCursor = React.
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
247
|
+
var sendCursor = React.useMemo(function () {
|
|
248
|
+
return debounce__default["default"](function (_ref15) {
|
|
249
|
+
var from = _ref15.from,
|
|
250
|
+
to = _ref15.to;
|
|
251
|
+
var _a;
|
|
252
|
+
(_a = websocket$1.current) === null || _a === void 0 ? void 0 : _a.sendJson({
|
|
253
|
+
type: 'CURSOR',
|
|
254
|
+
cursor_start: from,
|
|
255
|
+
cursor_end: to
|
|
256
|
+
});
|
|
257
|
+
}, 500);
|
|
258
|
+
}, []);
|
|
253
259
|
/**
|
|
254
260
|
* Send OTs.
|
|
255
261
|
*/
|
package/cjs/typings/arduino.d.ts
CHANGED
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
* - `program [portName] [board:name] [$path/to/filename/without/extension]`
|
|
12
12
|
* - `programfromurl [portName] [board:name] [urlToHexFile]`
|
|
13
13
|
*/
|
|
14
|
-
export
|
|
15
|
-
export
|
|
14
|
+
export type ArduinoAgentCommand = 'list' | 'open' | 'send' | 'sendnobuf' | 'close' | 'bufferalgorithms' | 'baudrates' | 'restart' | 'exit' | 'program' | 'programfromurl';
|
|
15
|
+
export type ArduinoAgentMessage = ArduinoAgentMessageVersion | ArduinoAgentMessageCommands | ArduinoAgentMessageHostname | ArduinoAgentMessageOs | ArduinoAgentMessagePorts | ArduinoAgentMessageDownloadStatus | ArduinoAgentMessageCmd | ArduinoAgentMessageProgrammerStatus | ArduinoAgentMessageD;
|
|
16
16
|
export interface ArduinoAgentMessageVersion {
|
|
17
17
|
Version: string;
|
|
18
18
|
}
|
|
@@ -52,7 +52,7 @@ export interface ArduinoAgentMessageCmd {
|
|
|
52
52
|
Baud: number;
|
|
53
53
|
BufferType: string;
|
|
54
54
|
}
|
|
55
|
-
export
|
|
55
|
+
export type ArduinoAgentMessageProgrammerStatus = ArduinoAgentMessageProgrammerStatusStarting | ArduinoAgentMessageProgrammerStatusBusy | ArduinoAgentMessageProgrammerStatusDone | ArduinoAgentMessageProgrammerStatusError;
|
|
56
56
|
export interface ArduinoAgentMessageProgrammerStatusStarting {
|
|
57
57
|
ProgrammerStatus: 'Starting';
|
|
58
58
|
Cmd: string;
|
|
@@ -72,6 +72,6 @@ export interface ArduinoAgentMessageProgrammerStatusError {
|
|
|
72
72
|
export interface ArduinoAgentMessageD {
|
|
73
73
|
D: string;
|
|
74
74
|
}
|
|
75
|
-
export
|
|
76
|
-
export
|
|
77
|
-
export
|
|
75
|
+
export type ArduinoPort = ArduinoAgentMessagePorts['Ports'][number];
|
|
76
|
+
export type ArduinoUploadProgressStatus = 'ready' | 'receivedHex' | 'starting' | 'busy' | 'error' | 'done';
|
|
77
|
+
export type ArduinoAgentConnectionStatus = 'disconnected' | 'connecting' | 'reconnecting' | 'connected';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { GetOrgMaterialExerciseExerciseRoomGetResponses, GetOrgMaterialExerciseGetResponses } from '@elice/types';
|
|
2
|
-
|
|
2
|
+
type ExerciseFileCheckFn = (filename: string | null, deps: {
|
|
3
3
|
exercise: null | GetOrgMaterialExerciseGetResponses['materialExercise'];
|
|
4
4
|
exerciseRoom: null | GetOrgMaterialExerciseExerciseRoomGetResponses['exerciseRoom'];
|
|
5
5
|
}) => boolean;
|
package/cjs/utils/runner.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export
|
|
1
|
+
type ErrorType = 'runtime' | 'compile' | 'syntax';
|
|
2
|
+
type ErrorLangType = 'python' | 'c/cpp' | 'java' | 'javascript';
|
|
3
|
+
export type CodeHelperError = {
|
|
4
4
|
errorCode: string;
|
|
5
5
|
errorLangType: ErrorLangType;
|
|
6
6
|
errorType: ErrorType;
|
package/cjs/utils/runner.js
CHANGED
|
@@ -6,19 +6,19 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
6
6
|
// This logic is based on the following spreadsheet.
|
|
7
7
|
// https://docs.google.com/spreadsheets/d/1AeIf1eIlxp2MFR5hZijr-s304xVHMdtuAzcODS6nL-g/edit#gid=0
|
|
8
8
|
//
|
|
9
|
+
var PythonRuntimeErrorRegex = new RegExp(/Traceback \(most recent call last\):\n\s*File "\S+", line \d+, in \S+\n\s*.*\n(.+\n)*\S+Error:\s.+/gm);
|
|
10
|
+
var PythonSyntaxErrorRegex = new RegExp(/File "(.*?)", line (\d+)\n\s*.+\n\s*(\^+)\n(.+)Error:\s(.+)/gm);
|
|
11
|
+
var CCCPCompileErrorRegex = new RegExp(/(.*?):(\d+):(\d+):\s+(warning|error|note):\s+(.*)(\n.+\n.+)?/gm);
|
|
12
|
+
var CCCPRuntimeErrorRegex = new RegExp(/(\w+ fault)\s+\(.*\)/gm);
|
|
13
|
+
var JavaCompileErrorRegex = new RegExp(/(.*?):(\d+):\s+error:\s+(.*)\n.+\n.+(\n\s*symbol.+)?(\n\s*location.+)?/gm);
|
|
14
|
+
var JavaRuntimeErrorRegex = new RegExp(/^Exception in thread ".+" (.+)$\n((?:\s+at .+$\n)+)/gm);
|
|
15
|
+
var JavascriptRuntimeErrorRegex = new RegExp(/(Uncaught )?(\w+Error):\s+(.*)\n((?:\s+at .+$\n)+)/gm);
|
|
9
16
|
/**
|
|
10
17
|
* Get Programming Error Results from text.
|
|
11
18
|
*/
|
|
12
19
|
function getProgrammingErrorResult(text) {
|
|
13
20
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
14
21
|
var escapedText = text.replace(/[\r|\\]/gm, '');
|
|
15
|
-
var PythonRuntimeErrorRegex = new RegExp(/Traceback \(most recent call last\):\n\s*File "\S+", line \d+, in \S+\n\s*.*\n(.+\n)*\S+Error:\s.+/gm);
|
|
16
|
-
var PythonSyntaxErrorRegex = new RegExp(/File "(.*?)", line (\d+)\n\s*.+\n\s*(\^+)\n(.+)Error:\s(.+)/gm);
|
|
17
|
-
var CCCPCompileErrorRegex = new RegExp(/(.*?):(\d+):(\d+):\s+(warning|error|note):\s+(.*)(\n.+\n.+)?/gm);
|
|
18
|
-
var CCCPRuntimeErrorRegex = new RegExp(/(\w+ fault)\s+\(.*\)/gm);
|
|
19
|
-
var JavaCompileErrorRegex = new RegExp(/(.*?):(\d+):\s+error:\s+(.*)\n.+\n.+(\n\s*symbol.+)?(\n\s*location.+)?/gm);
|
|
20
|
-
var JavaRuntimeErrorRegex = new RegExp(/^Exception in thread ".+" (.+)$\n((?:\s+at .+$\n)+)/gm);
|
|
21
|
-
var JavascriptRuntimeErrorRegex = new RegExp(/(Uncaught )?(\w+Error):\s+(.*)\n((?:\s+at .+$\n)+)/gm);
|
|
22
22
|
switch (true) {
|
|
23
23
|
case PythonRuntimeErrorRegex.test(escapedText):
|
|
24
24
|
return {
|
|
@@ -131,7 +131,10 @@ function _regeneratorRuntime() {
|
|
|
131
131
|
if ("executing" === state) throw new Error("Generator is already running");
|
|
132
132
|
if ("completed" === state) {
|
|
133
133
|
if ("throw" === method) throw arg;
|
|
134
|
-
return
|
|
134
|
+
return {
|
|
135
|
+
value: void 0,
|
|
136
|
+
done: !0
|
|
137
|
+
};
|
|
135
138
|
}
|
|
136
139
|
for (context.method = method, context.arg = arg;;) {
|
|
137
140
|
var delegate = context.delegate;
|
|
@@ -184,7 +187,7 @@ function _regeneratorRuntime() {
|
|
|
184
187
|
}], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);
|
|
185
188
|
}
|
|
186
189
|
function values(iterable) {
|
|
187
|
-
if (iterable) {
|
|
190
|
+
if (iterable || "" === iterable) {
|
|
188
191
|
var iteratorMethod = iterable[iteratorSymbol];
|
|
189
192
|
if (iteratorMethod) return iteratorMethod.call(iterable);
|
|
190
193
|
if ("function" == typeof iterable.next) return iterable;
|
|
@@ -197,15 +200,7 @@ function _regeneratorRuntime() {
|
|
|
197
200
|
return next.next = next;
|
|
198
201
|
}
|
|
199
202
|
}
|
|
200
|
-
|
|
201
|
-
next: doneResult
|
|
202
|
-
};
|
|
203
|
-
}
|
|
204
|
-
function doneResult() {
|
|
205
|
-
return {
|
|
206
|
-
value: undefined,
|
|
207
|
-
done: !0
|
|
208
|
-
};
|
|
203
|
+
throw new TypeError(typeof iterable + " is not iterable");
|
|
209
204
|
}
|
|
210
205
|
return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", {
|
|
211
206
|
value: GeneratorFunctionPrototype,
|
|
@@ -3,6 +3,6 @@ import type { MaterialExerciseCommonApis, MaterialExerciseCommonProps } from './
|
|
|
3
3
|
export interface MaterialExerciseProps extends MaterialExerciseCommonProps {
|
|
4
4
|
locale?: string;
|
|
5
5
|
}
|
|
6
|
-
export
|
|
7
|
-
declare const _default: React.ForwardRefExoticComponent<
|
|
6
|
+
export type MaterialExerciseApis = MaterialExerciseCommonApis;
|
|
7
|
+
declare const _default: React.ForwardRefExoticComponent<Omit<MaterialExerciseProps & React.RefAttributes<MaterialExerciseCommonApis> & import("@elice/material-shared-utils").MaterialCommponentCommonProps, "ref"> & React.RefAttributes<MaterialExerciseCommonApis>>;
|
|
8
8
|
export default _default;
|
|
@@ -23,7 +23,7 @@ import ExerciseMultilangDropdownLazy from './exercise-multilang-dropdown/Exercis
|
|
|
23
23
|
import ExercisePreview from './exercise-preview/ExercisePreview.js';
|
|
24
24
|
import ExerciseRightpane from './exercise-rightpane/ExerciseRightpane.js';
|
|
25
25
|
import ExerciseRunner from './exercise-runner/ExerciseRunner.js';
|
|
26
|
-
import { StyledExerciseContainer, EXERCISE_PREVIEW_MIN_WIDTH, EXERCISE_HORIZONTAL_RATIO, StyledExerciseMain,
|
|
26
|
+
import { StyledExerciseContainer, EXERCISE_PREVIEW_MIN_WIDTH, EXERCISE_HORIZONTAL_RATIO, StyledExerciseMain, StyledExerciseFileAndTabWrap, StyledExerciseTabBar, StyledExerciseRunnerWrap, EXERCISE_RUNNER_MIN_HEIGHT, StyledxerciseFileTreeContaner, EXERCISE_FILE_TREE_MIN_WIDTH, StyledExerciseFileTreeWrap, StyledExerciseTabsWrap, StyledExerciseTabMenuWrap, StyledExerciseFileWrap } from './MaterialExercise.styled.js';
|
|
27
27
|
import * as MaterialExercise_i18n from './MaterialExercise.i18n.js';
|
|
28
28
|
import { en } from './MaterialExercise.i18n.js';
|
|
29
29
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { MaterialExerciseCommonProps } from './context';
|
|
3
|
-
|
|
3
|
+
type PickedMaterialExerciseCommonProps = Pick<MaterialExerciseCommonProps, 'materialExerciseId' | 'exerciseRoomId' | 'readOnlyEditor' | 'onExerciseRoomIdChange' | 'onDefaultExerciseRoomIdSet' | 'onError'>;
|
|
4
4
|
export interface MaterialExerciseMobileProps extends PickedMaterialExerciseCommonProps {
|
|
5
5
|
filename: string;
|
|
6
6
|
}
|