@elice/material-exercise 1.230726.0 → 1.230817.1
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
|
@@ -3,27 +3,27 @@ import * as monaco from 'monaco-editor/esm/vs/editor/editor.api';
|
|
|
3
3
|
import type { MonacoEditorPreference } from './constants';
|
|
4
4
|
import type { MonacoEditorMarker } from './editor-hooks';
|
|
5
5
|
/** Has editor undo/redo history? */
|
|
6
|
-
|
|
6
|
+
type MonacoEditorApiHasHistory = () => boolean;
|
|
7
7
|
/** Get current monaco editor model. */
|
|
8
|
-
|
|
8
|
+
type MonacoEditorApiGetMonacoModel = () => monaco.editor.ITextModel | null;
|
|
9
9
|
/** Clear editor undo/redo history. */
|
|
10
|
-
|
|
10
|
+
type MonacoEditorApiClearHistory = () => void;
|
|
11
11
|
/** Get current value of editor. */
|
|
12
|
-
|
|
12
|
+
type MonacoEditorApiGetValue = () => string;
|
|
13
13
|
/** Get value in range of editor. */
|
|
14
|
-
|
|
14
|
+
type MonacoEditorApiGetValueInRange = (from: number, to: number) => string;
|
|
15
15
|
/** Set (overwrite) value to editor. */
|
|
16
|
-
|
|
16
|
+
type MonacoEditorApiSetValue = (value: string) => void;
|
|
17
17
|
/** Insert value at specific position. */
|
|
18
|
-
|
|
18
|
+
type MonacoEditorApiInsertValue = (offset: number, value: string) => void;
|
|
19
19
|
/** Remove value at specific range. */
|
|
20
|
-
|
|
20
|
+
type MonacoEditorApiRemoveValue = (from: number, to: number) => void;
|
|
21
21
|
/** Get offset of current cursor position. */
|
|
22
|
-
|
|
22
|
+
type MonacoEditorApiGetPositionOffset = () => number;
|
|
23
23
|
/** Set selection of editor with specific range. */
|
|
24
|
-
|
|
24
|
+
type MonacoEditorApiSetSelection = (from: number, to: number) => void;
|
|
25
25
|
/** Scroll editor to specific `scrollTop`. */
|
|
26
|
-
|
|
26
|
+
type MonacoEditorApiScrollTo = (scrollTop: number) => void;
|
|
27
27
|
/** API of CodeEditorNext. */
|
|
28
28
|
export interface MonacoEditorApis {
|
|
29
29
|
editor: monaco.editor.IStandaloneCodeEditor | null;
|
|
@@ -276,7 +276,7 @@ var MonacoEditor = forwardRef(function (_ref, ref) {
|
|
|
276
276
|
// add keyboard shortcut.
|
|
277
277
|
editor.current.addCommand(monaco.KeyMod.CtrlCmd | monaco.KeyCode.KeyS, function () {
|
|
278
278
|
var _a, _b, _c;
|
|
279
|
-
(_b = (_a = editor.current) === null || _a === void 0 ? void 0 : _a.getAction('editor.action.formatDocument')) === null || _b === void 0 ? void 0 : _b.run();
|
|
279
|
+
void ((_b = (_a = editor.current) === null || _a === void 0 ? void 0 : _a.getAction('editor.action.formatDocument')) === null || _b === void 0 ? void 0 : _b.run());
|
|
280
280
|
if (typeof onSave === 'function') {
|
|
281
281
|
var content = ((_c = getMonacoModel()) === null || _c === void 0 ? void 0 : _c.getValue()) || '';
|
|
282
282
|
onSave(content);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import type { MonacoEditorPreference } from './constants';
|
|
3
3
|
export interface PerferenceFormProps {
|
|
4
4
|
value: Partial<MonacoEditorPreference>;
|
|
5
5
|
locale?: string;
|
|
6
6
|
onChange?: (value: Required<MonacoEditorPreference>) => void;
|
|
7
7
|
}
|
|
8
|
-
declare const _default: (props: PerferenceFormProps) => JSX.Element;
|
|
8
|
+
declare const _default: (props: PerferenceFormProps) => React.JSX.Element;
|
|
9
9
|
export default _default;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { editor } from 'monaco-editor/esm/vs/editor/editor.api';
|
|
2
|
-
|
|
2
|
+
type PickedMonacoStandaloneEditorOptions = Pick<editor.IStandaloneEditorConstructionOptions, 'autoClosingBrackets' | 'cursorSmoothCaretAnimation' | 'detectIndentation' | 'fontSize' | 'minimap' | 'readOnly' | 'renderWhitespace' | 'scrollBeyondLastLine' | 'tabSize' | 'theme' | 'wordWrap'>;
|
|
3
3
|
/**
|
|
4
4
|
* Monaco editor preferences for elice exercise.
|
|
5
5
|
*/
|
|
@@ -21,7 +21,7 @@ export declare const MONACO_EDITOR_PREFERENCE_OPTIONS_TAB_SIZES: readonly number
|
|
|
21
21
|
/**
|
|
22
22
|
* White space preference.
|
|
23
23
|
*/
|
|
24
|
-
export declare const MONACO_EDITOR_RENDER_WHITESPACE_OPTIONS: readonly ("none" | "
|
|
24
|
+
export declare const MONACO_EDITOR_RENDER_WHITESPACE_OPTIONS: readonly ("none" | "selection" | "boundary" | "trailing" | "all")[];
|
|
25
25
|
/**
|
|
26
26
|
* Font family.
|
|
27
27
|
*/
|
|
@@ -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
|
*/
|
|
@@ -26,11 +26,11 @@ var useMonacoOptions = function useMonacoOptions(monaco, options) {
|
|
|
26
26
|
// Load font and remeasure font of editor.
|
|
27
27
|
//
|
|
28
28
|
useEffect(function () {
|
|
29
|
-
var _a, _b
|
|
30
|
-
if (typeof ((
|
|
29
|
+
var _a, _b;
|
|
30
|
+
if (typeof ((_a = document === null || document === void 0 ? void 0 : document.fonts) === null || _a === void 0 ? void 0 : _a.load) !== 'function') {
|
|
31
31
|
return;
|
|
32
32
|
}
|
|
33
|
-
var size = (
|
|
33
|
+
var size = (_b = options.fontSize) !== null && _b !== void 0 ? _b : DEFAULT_MONACO_EDITOR_PREFERENCE.fontSize;
|
|
34
34
|
document.fonts.load("".concat(size, "px Elice Digital Coding"), FONT_LOAD_TEXT).then(function () {
|
|
35
35
|
return editor.remeasureFonts();
|
|
36
36
|
}).catch(function () {
|
|
@@ -11,7 +11,7 @@ var CssDocumentFormattingEditProvider = {
|
|
|
11
11
|
_context.t0 = prettier;
|
|
12
12
|
_context.t1 = model.getValue();
|
|
13
13
|
_context.next = 4;
|
|
14
|
-
return import('prettier/
|
|
14
|
+
return import('prettier/plugins/postcss');
|
|
15
15
|
case 4:
|
|
16
16
|
_context.t2 = _context.sent;
|
|
17
17
|
_context.t3 = [_context.t2];
|
|
@@ -11,7 +11,7 @@ var HtmlDocumentFormattingEditProvider = {
|
|
|
11
11
|
_context.t0 = prettier;
|
|
12
12
|
_context.t1 = model.getValue();
|
|
13
13
|
_context.next = 4;
|
|
14
|
-
return import('prettier/
|
|
14
|
+
return import('prettier/plugins/html');
|
|
15
15
|
case 4:
|
|
16
16
|
_context.t2 = _context.sent;
|
|
17
17
|
_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];
|
|
@@ -11,23 +11,27 @@ var TypescriptDocumentFormattingEditProvider = {
|
|
|
11
11
|
_context.t0 = prettier;
|
|
12
12
|
_context.t1 = model.getValue();
|
|
13
13
|
_context.next = 4;
|
|
14
|
-
return import('prettier/
|
|
14
|
+
return import('prettier/plugins/babel');
|
|
15
15
|
case 4:
|
|
16
16
|
_context.t2 = _context.sent;
|
|
17
|
-
_context.
|
|
18
|
-
|
|
17
|
+
_context.next = 7;
|
|
18
|
+
return import('prettier/plugins/estree');
|
|
19
|
+
case 7:
|
|
20
|
+
_context.t3 = _context.sent;
|
|
21
|
+
_context.t4 = [_context.t2, _context.t3];
|
|
22
|
+
_context.t5 = {
|
|
19
23
|
parser: 'babel-ts',
|
|
20
|
-
plugins: _context.
|
|
24
|
+
plugins: _context.t4
|
|
21
25
|
};
|
|
22
|
-
_context.next =
|
|
23
|
-
return (0, _context.t0)(_context.t1, _context.
|
|
24
|
-
case
|
|
26
|
+
_context.next = 12;
|
|
27
|
+
return (0, _context.t0)(_context.t1, _context.t5);
|
|
28
|
+
case 12:
|
|
25
29
|
text = _context.sent;
|
|
26
30
|
return _context.abrupt("return", [{
|
|
27
31
|
range: model.getFullModelRange(),
|
|
28
32
|
text: text
|
|
29
33
|
}]);
|
|
30
|
-
case
|
|
34
|
+
case 14:
|
|
31
35
|
case "end":
|
|
32
36
|
return _context.stop();
|
|
33
37
|
}
|
|
@@ -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
|
*/
|
|
@@ -31,18 +31,11 @@ var RemoteSelection = /*#__PURE__*/function () {
|
|
|
31
31
|
this._onDisposed = onDisposed;
|
|
32
32
|
}
|
|
33
33
|
/**
|
|
34
|
-
*
|
|
35
|
-
* style the color of the selection. The Monaco Editor only allows setting
|
|
36
|
-
* the class name of decorations, so we can not set a style property directly.
|
|
37
|
-
* This method will create, add, and return the style tag for this element.
|
|
34
|
+
* Gets the userland id of this selection.
|
|
38
35
|
*/
|
|
39
36
|
_createClass(RemoteSelection, [{
|
|
40
37
|
key: "getId",
|
|
41
|
-
value:
|
|
42
|
-
/**
|
|
43
|
-
* Gets the userland id of this selection.
|
|
44
|
-
*/
|
|
45
|
-
function getId() {
|
|
38
|
+
value: function getId() {
|
|
46
39
|
return this._id;
|
|
47
40
|
}
|
|
48
41
|
/**
|
|
@@ -154,7 +147,14 @@ var RemoteSelection = /*#__PURE__*/function () {
|
|
|
154
147
|
}
|
|
155
148
|
}], [{
|
|
156
149
|
key: "_addDynamicStyleElement",
|
|
157
|
-
value:
|
|
150
|
+
value:
|
|
151
|
+
/**
|
|
152
|
+
* A helper method to add a style tag to the head of the document that will
|
|
153
|
+
* style the color of the selection. The Monaco Editor only allows setting
|
|
154
|
+
* the class name of decorations, so we can not set a style property directly.
|
|
155
|
+
* This method will create, add, and return the style tag for this element.
|
|
156
|
+
*/
|
|
157
|
+
function _addDynamicStyleElement(className, color) {
|
|
158
158
|
var css = ".".concat(className, " { background-color: ").concat(color, "; }").trim();
|
|
159
159
|
var styleElement = document.createElement('style');
|
|
160
160
|
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;
|
package/es/hooks/useArduino.d.ts
CHANGED
|
@@ -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,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useContext, useMemo } from 'react';
|
|
2
2
|
import { useRecoilValue } from 'recoil';
|
|
3
3
|
import { exerciseState, exerciseRoomState } from '../components/material-exercise/context/recoil.js';
|
|
4
4
|
import { ExerciseContext } from '../components/material-exercise/context/context.js';
|
|
@@ -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
|
*/
|
|
@@ -202,45 +202,51 @@ var useUsercodeEditWebSocket = function useUsercodeEditWebSocket(_ref) {
|
|
|
202
202
|
/**
|
|
203
203
|
* Send `FETCH`.
|
|
204
204
|
*/
|
|
205
|
-
var sendFetch =
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
205
|
+
var sendFetch = useMemo(function () {
|
|
206
|
+
return debounce(function () {
|
|
207
|
+
var _a;
|
|
208
|
+
(_a = websocket.current) === null || _a === void 0 ? void 0 : _a.sendJson({
|
|
209
|
+
type: 'FETCH',
|
|
210
|
+
from: version.current
|
|
211
|
+
});
|
|
212
|
+
}, 1000);
|
|
213
|
+
}, []);
|
|
212
214
|
/**
|
|
213
215
|
* Send `WRITE`.
|
|
214
216
|
*/
|
|
215
|
-
var sendWrite =
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
217
|
+
var sendWrite = useMemo(function () {
|
|
218
|
+
return debounce(function () {
|
|
219
|
+
var _a;
|
|
220
|
+
if (otsBuffer.current.length === 0 || writeIndex.current !== 0) {
|
|
221
|
+
return;
|
|
222
|
+
}
|
|
223
|
+
writeIndex.current = otsBuffer.current.length;
|
|
224
|
+
var ots = otsBuffer.current[0];
|
|
225
|
+
for (var i = 1; i < writeIndex.current; i++) {
|
|
226
|
+
ots = type.compose(ots, otsBuffer.current[i]);
|
|
227
|
+
}
|
|
228
|
+
(_a = websocket.current) === null || _a === void 0 ? void 0 : _a.sendJson({
|
|
229
|
+
type: 'WRITE',
|
|
230
|
+
to: version.current + 1,
|
|
231
|
+
ots: ots
|
|
232
|
+
});
|
|
233
|
+
}, 100);
|
|
234
|
+
}, []);
|
|
231
235
|
/**
|
|
232
236
|
* Send `CURSOR`.
|
|
233
237
|
*/
|
|
234
|
-
var sendCursor =
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
238
|
+
var sendCursor = useMemo(function () {
|
|
239
|
+
return debounce(function (_ref15) {
|
|
240
|
+
var from = _ref15.from,
|
|
241
|
+
to = _ref15.to;
|
|
242
|
+
var _a;
|
|
243
|
+
(_a = websocket.current) === null || _a === void 0 ? void 0 : _a.sendJson({
|
|
244
|
+
type: 'CURSOR',
|
|
245
|
+
cursor_start: from,
|
|
246
|
+
cursor_end: to
|
|
247
|
+
});
|
|
248
|
+
}, 500);
|
|
249
|
+
}, []);
|
|
244
250
|
/**
|
|
245
251
|
* Send OTs.
|
|
246
252
|
*/
|
package/es/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/es/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;
|