@elice/material-exercise 1.240718.0-trasncript.2 → 1.240718.2
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/assets/empty.png.js +2 -1
- package/cjs/components/material-exercise/MaterialExercise.d.ts +1 -1
- package/cjs/components/material-exercise/MaterialExercise.js +75 -111
- package/cjs/components/material-exercise/MaterialExercise.styled.js +14 -18
- package/cjs/components/material-exercise/MaterialExerciseMobile.d.ts +1 -1
- package/cjs/components/material-exercise/MaterialExerciseMobile.js +7 -17
- package/cjs/components/material-exercise/context/ExerciseProvider.js +58 -68
- package/cjs/components/material-exercise/context/ExerciseProviderNoImage.js +30 -39
- package/cjs/components/material-exercise/context/context.js +1 -5
- package/cjs/components/material-exercise/context/recoil.js +293 -542
- package/cjs/components/material-exercise/context/subjects.js +4 -4
- package/cjs/components/material-exercise/context/types.d.ts +2 -2
- package/cjs/components/material-exercise/exercise-code-history/ExerciseCodeHistory.js +78 -100
- package/cjs/components/material-exercise/exercise-code-history/ExerciseCodeHistory.styled.js +8 -12
- package/cjs/components/material-exercise/exercise-file/ExerciseFile.js +27 -30
- package/cjs/components/material-exercise/exercise-file-editor/ExerciseFileEditor.js +149 -225
- package/cjs/components/material-exercise/exercise-file-editor/ExerciseFileReadOnlyBanner.js +13 -20
- package/cjs/components/material-exercise/exercise-file-tabs/ExerciseFileTabs.js +29 -49
- package/cjs/components/material-exercise/exercise-file-tabs/ExerciseFileTabsLazy.d.ts +2 -1
- package/cjs/components/material-exercise/exercise-file-tabs/ExerciseFileTabsLazy.js +4 -10
- package/cjs/components/material-exercise/exercise-file-tabs/exercise-file-tabs-file-tree-button/ExerciseFileTabsFileTreeButton.js +36 -53
- package/cjs/components/material-exercise/exercise-file-tree/ExerciseFileTree.js +211 -353
- package/cjs/components/material-exercise/exercise-file-tree/ExerciseFileTreeLazy.d.ts +2 -1
- package/cjs/components/material-exercise/exercise-file-tree/ExerciseFileTreeLazy.js +4 -10
- package/cjs/components/material-exercise/exercise-file-viewer/ExerciseFileViewer.js +15 -18
- package/cjs/components/material-exercise/exercise-menu/ExerciseMenu.js +12 -21
- package/cjs/components/material-exercise/exercise-menu/ExerciseMenuArduinoAgentModalButton.js +11 -12
- package/cjs/components/material-exercise/exercise-menu/ExerciseMenuArduinoSettings.js +80 -123
- package/cjs/components/material-exercise/exercise-menu/ExerciseMenuDropdown.js +67 -100
- package/cjs/components/material-exercise/exercise-menu/ExerciseMenuReset.js +22 -40
- package/cjs/components/material-exercise/exercise-menu/ExerciseMenuStdioFileBrowser.js +119 -144
- package/cjs/components/material-exercise/exercise-menu/ExerciseMenuStdioFileBrowser.styled.js +13 -17
- package/cjs/components/material-exercise/exercise-multilang-dropdown/ExerciseMultilangDropdown.js +19 -32
- package/cjs/components/material-exercise/exercise-multilang-dropdown/ExerciseMultilangDropdownLazy.d.ts +2 -1
- package/cjs/components/material-exercise/exercise-multilang-dropdown/ExerciseMultilangDropdownLazy.js +4 -10
- package/cjs/components/material-exercise/exercise-preview/ExercisePreview.js +24 -31
- package/cjs/components/material-exercise/exercise-preview/ExercisePreviewDisplayModeButton.js +6 -13
- package/cjs/components/material-exercise/exercise-rightpane/ExerciseRightpane.js +35 -51
- package/cjs/components/material-exercise/exercise-rightpane/ExerciseRightpaneEditorPerference.js +6 -14
- package/cjs/components/material-exercise/exercise-rightpane/ExerciseRightpaneEnvironment.js +78 -90
- package/cjs/components/material-exercise/exercise-room/ExerciseRoom.js +12 -25
- package/cjs/components/material-exercise/exercise-room/ExerciseRoom.styled.js +12 -18
- package/cjs/components/material-exercise/exercise-room/ExerciseRoomDetail.js +349 -504
- package/cjs/components/material-exercise/exercise-room/ExerciseRoomList.js +132 -197
- package/cjs/components/material-exercise/exercise-room/helpers/exerciseRoomPermissionStringConvertor.js +2 -2
- package/cjs/components/material-exercise/exercise-runner/ExerciseRunner.js +142 -205
- package/cjs/components/material-exercise/exercise-runner/ExerciseRunnerContext.js +1 -5
- package/cjs/components/material-exercise/exercise-runner/ExerciseRunnerController.js +16 -25
- package/cjs/components/material-exercise/exercise-runner/ExerciseRunnerControllerArduinoAgentModal.js +86 -118
- package/cjs/components/material-exercise/exercise-runner/ExerciseRunnerControllerArduinoStatusMessage.js +19 -33
- package/cjs/components/material-exercise/exercise-runner/ExerciseRunnerControllerButtonGroup.js +82 -95
- package/cjs/components/material-exercise/exercise-runner/ExerciseRunnerControllerCodeHelpRequestButton.js +52 -68
- package/cjs/components/material-exercise/exercise-runner/ExerciseRunnerControllerRunningInfo.js +87 -136
- package/cjs/components/material-exercise/exercise-runner/ExerciseRunnerControllerStatusIndicator.js +2 -6
- package/cjs/components/material-exercise/exercise-runner/ExerciseRunnerControllerStatusMessage.js +15 -21
- package/cjs/components/material-exercise/exercise-runner/ExerciseRunnerControllerTimer.js +23 -36
- package/cjs/components/material-exercise/exercise-submit-history/ExerciseSubmitHistory.js +248 -402
- package/cjs/components/material-exercise/exercise-submit-history/ExerciseSubmitHistory.styled.js +8 -12
- package/cjs/components/material-exercise/exercise-submit-history/ExerciseSubmitHistoryOutput.js +50 -74
- package/cjs/components/shared/exercise-menu-button/ExerciseMenuButton.js +23 -32
- package/cjs/components/shared/exercise-shimmer/ExerciseFileShimmer.js +38 -44
- package/cjs/components/shared/exercise-shimmer/ExerciseFileTabShimmer.js +20 -26
- package/cjs/components/shared/exercise-shimmer/ExerciseFileTabsShimmer.js +8 -14
- package/cjs/components/shared/exercise-shimmer/ExerciseFileTreeListItemShimmer.js +22 -28
- package/cjs/components/shared/exercise-shimmer/ExerciseFileTreeListShimmer.js +9 -24
- package/cjs/components/shared/exercise-version-list/ExerciseVersionList.js +5 -6
- package/cjs/components/shared/exercise-version-list/ExerciseVersionList.styled.js +1 -5
- package/cjs/components/shared/exercise-version-list/ExerciseVersionListItem.js +10 -10
- package/cjs/components/shared/exercise-version-list/ExerciseVersionListItem.styled.js +5 -13
- package/cjs/components/shared/file-icon/FileIcon.js +16 -23
- package/cjs/components/shared/file-tabs/FileTab.js +33 -47
- package/cjs/components/shared/file-tabs/FileTab.styled.js +15 -23
- package/cjs/components/shared/file-tabs/FileTabs.js +39 -66
- package/cjs/components/shared/file-tabs/FileTabs.styled.js +2 -6
- package/cjs/components/shared/file-tabs/util.js +14 -27
- package/cjs/components/shared/file-tree/FileTree.js +10 -20
- package/cjs/components/shared/file-tree/FileTreeConfig.js +40 -46
- package/cjs/components/shared/file-tree/FileTreeList.js +40 -43
- package/cjs/components/shared/file-tree/FileTreeListItemContent.js +99 -128
- package/cjs/components/shared/file-tree/FileTreeListItemContent.styled.js +21 -29
- package/cjs/components/shared/file-tree/FileTreeListItemContentInput.js +96 -106
- package/cjs/components/shared/file-tree/FileTreeListItemContentInput.styled.js +6 -10
- package/cjs/components/shared/file-tree/FileTreeListItemContentMenu.js +91 -133
- package/cjs/components/shared/file-tree/FileTreeListItems.js +137 -149
- package/cjs/components/shared/file-tree/FileTreeListItems.styled.js +2 -6
- package/cjs/components/shared/file-tree/FileTreeToolbar.styled.js +1 -5
- package/cjs/components/shared/file-tree/context/FileTreeContext.d.ts +1 -1
- package/cjs/components/shared/file-tree/context/FileTreeContext.js +79 -101
- package/cjs/components/shared/file-tree/file-tree-toolbar/FileTreeToolbar.js +54 -59
- package/cjs/components/shared/file-tree/utils/fileTreeFiles.js +20 -24
- package/cjs/components/shared/file-tree/utils/fileTreeGenerator.js +146 -193
- package/cjs/components/shared/file-tree/utils/fileTreeInput.js +0 -11
- package/cjs/components/shared/file-tree/utils/fileTreeItem.js +1 -1
- package/cjs/components/shared/file-tree/utils/fileTreePath.js +6 -5
- package/cjs/components/shared/file-viewer/FileViewer.js +46 -76
- package/cjs/components/shared/file-viewer/FileViewerCsv.js +167 -262
- package/cjs/components/shared/file-viewer/FileViewerImage.js +12 -16
- package/cjs/components/shared/file-viewer/FileViewerIpynb.js +11 -27
- package/cjs/components/shared/file-viewer/FileViewerNonViewable.js +47 -65
- package/cjs/components/shared/file-viewer/FileViewerText.js +11 -23
- package/cjs/components/shared/material-modal/MaterialModal.js +11 -20
- package/cjs/components/shared/material-modal/MaterialModal.styled.js +5 -9
- package/cjs/components/shared/monaco-editor/MonacoEditor.js +74 -102
- package/cjs/components/shared/monaco-editor/MonacoEditorLazy.js +7 -15
- package/cjs/components/shared/monaco-editor/MonacoEditorMobile.js +34 -49
- package/cjs/components/shared/monaco-editor/MonacoEditorPerferenceForm.js +194 -249
- package/cjs/components/shared/monaco-editor/constants/grammars/index.js +28 -82
- package/cjs/components/shared/monaco-editor/constants/monaco/preferences.js +5 -5
- package/cjs/components/shared/monaco-editor/constants/themes/index.js +17 -49
- package/cjs/components/shared/monaco-editor/editor-hooks/useMonacoEventChange.js +10 -11
- package/cjs/components/shared/monaco-editor/editor-hooks/useMonacoEventCursor.js +14 -15
- package/cjs/components/shared/monaco-editor/editor-hooks/useMonacoEventScroll.js +8 -9
- package/cjs/components/shared/monaco-editor/editor-hooks/useMonacoMarkers.js +30 -34
- package/cjs/components/shared/monaco-editor/editor-hooks/useMonacoOptions.js +7 -9
- package/cjs/components/shared/monaco-editor/editor-hooks/useMonacoTheme.js +6 -6
- package/cjs/components/shared/monaco-editor/editor-languages/css/formatter.js +10 -33
- package/cjs/components/shared/monaco-editor/editor-languages/css/index.js +2 -3
- package/cjs/components/shared/monaco-editor/editor-languages/html/formatter.js +10 -33
- package/cjs/components/shared/monaco-editor/editor-languages/html/index.js +2 -3
- package/cjs/components/shared/monaco-editor/editor-languages/typescript/dts/_helper.js +1 -1
- package/cjs/components/shared/monaco-editor/editor-languages/typescript/formatter.js +10 -37
- package/cjs/components/shared/monaco-editor/editor-languages/typescript/index.js +5 -6
- package/cjs/components/shared/monaco-editor/hooks/useEditorOptions.js +5 -11
- package/cjs/components/shared/monaco-editor/utils/emmet/abbreviationActions.js +12 -10
- package/cjs/components/shared/monaco-editor/utils/emmet/registerProvider.js +6 -12
- package/cjs/components/shared/monaco-editor/utils/grammar/index.js +24 -67
- package/cjs/components/shared/monaco-editor/utils/grammar/onigasm.js +6 -25
- package/cjs/components/shared/monaco-editor/utils/grammar/textmate.js +37 -70
- package/cjs/components/shared/monaco-editor/utils/monacoLanguage.js +7 -8
- package/cjs/components/shared/monaco-editor/utils/monacoPreference.js +4 -6
- package/cjs/components/shared/monaco-editor/utils/prettier/config.js +2 -2
- package/cjs/components/shared/monaco-editor/utils/prettier/index.js +7 -27
- package/cjs/components/shared/monaco-editor/utils/theme/convert.js +14 -24
- package/cjs/components/shared/monaco-editor/utils/theme/index.js +3 -22
- package/cjs/components/shared/monaco-editor/vendors/monaco-collab-ext/RemoteCursor.js +56 -77
- package/cjs/components/shared/monaco-editor/vendors/monaco-collab-ext/RemoteCursorManager.js +68 -82
- package/cjs/components/shared/monaco-editor/vendors/monaco-collab-ext/RemoteCursorWidget.js +93 -120
- package/cjs/components/shared/monaco-editor/vendors/monaco-collab-ext/RemoteSelection.js +132 -155
- package/cjs/components/shared/monaco-editor/vendors/monaco-collab-ext/RemoteSelectionManager.js +92 -104
- package/cjs/components/shared/monaco-editor/vendors/monaco-collab-ext/styles.js +2 -2
- package/cjs/components/shared/monaco-editor/vendors/vscode-emmet-helper/configCompat.js +6 -1
- package/cjs/components/shared/monaco-editor/vendors/vscode-emmet-helper/data.js +2 -2
- package/cjs/components/shared/monaco-editor/vendors/vscode-emmet-helper/emmetHelper.js +158 -177
- package/cjs/components/shared/monaco-editor/vendors/vscode-emmet-helper/utils.js +3 -3
- package/cjs/components/shared/no-vnc/NoVnc.js +78 -118
- package/cjs/components/shared/no-vnc/NoVncLazy.js +7 -15
- package/cjs/components/shared/preview-container/PreviewContainer.js +13 -18
- package/cjs/components/shared/web-browser/WebBrowser.js +52 -74
- package/cjs/components/shared/xterm/Xterm.js +57 -82
- package/cjs/components/shared/xterm/XtermLazy.js +7 -15
- package/cjs/constants/arduino.js +10 -10
- package/cjs/constants/color.js +1 -1
- package/cjs/constants/shortcutKeyMap.js +1 -3
- package/cjs/constants/stylesheets.js +5 -7
- package/cjs/hooks/useArduino.js +141 -282
- package/cjs/hooks/useExerciseFile.js +22 -24
- package/cjs/hooks/useExericseShortcut.js +4 -6
- package/cjs/hooks/useMaterialExerciseFileUrl.js +33 -55
- package/cjs/hooks/useRunnerRoomWebSocket.js +27 -51
- package/cjs/hooks/useStdioTextConcator.js +11 -15
- package/cjs/hooks/useStdioWebSocket.js +28 -32
- package/cjs/hooks/useUsercodeEditWebSocket.js +158 -238
- package/cjs/hooks/useUsercodeHistory.js +63 -115
- package/cjs/utils/arduino.js +11 -23
- package/cjs/utils/exerciseFile.js +10 -8
- package/cjs/utils/runner.js +17 -33
- package/es/assets/empty.png.js +2 -1
- package/es/components/material-exercise/MaterialExercise.d.ts +1 -1
- package/es/components/material-exercise/MaterialExercise.js +75 -107
- package/es/components/material-exercise/MaterialExercise.styled.js +14 -14
- package/es/components/material-exercise/MaterialExerciseMobile.d.ts +1 -1
- package/es/components/material-exercise/MaterialExerciseMobile.js +7 -13
- package/es/components/material-exercise/context/ExerciseProvider.js +58 -63
- package/es/components/material-exercise/context/ExerciseProviderNoImage.js +30 -35
- package/es/components/material-exercise/context/context.js +1 -1
- package/es/components/material-exercise/context/recoil.js +290 -535
- package/es/components/material-exercise/context/subjects.js +4 -4
- package/es/components/material-exercise/context/types.d.ts +2 -2
- package/es/components/material-exercise/exercise-code-history/ExerciseCodeHistory.js +78 -95
- package/es/components/material-exercise/exercise-code-history/ExerciseCodeHistory.styled.js +8 -8
- package/es/components/material-exercise/exercise-file/ExerciseFile.js +27 -25
- package/es/components/material-exercise/exercise-file-editor/ExerciseFileEditor.js +149 -221
- package/es/components/material-exercise/exercise-file-editor/ExerciseFileReadOnlyBanner.js +13 -15
- package/es/components/material-exercise/exercise-file-tabs/ExerciseFileTabs.js +29 -44
- package/es/components/material-exercise/exercise-file-tabs/ExerciseFileTabsLazy.d.ts +2 -1
- package/es/components/material-exercise/exercise-file-tabs/ExerciseFileTabsLazy.js +4 -6
- package/es/components/material-exercise/exercise-file-tabs/exercise-file-tabs-file-tree-button/ExerciseFileTabsFileTreeButton.js +36 -48
- package/es/components/material-exercise/exercise-file-tree/ExerciseFileTree.js +211 -348
- package/es/components/material-exercise/exercise-file-tree/ExerciseFileTreeLazy.d.ts +2 -1
- package/es/components/material-exercise/exercise-file-tree/ExerciseFileTreeLazy.js +4 -6
- package/es/components/material-exercise/exercise-file-viewer/ExerciseFileViewer.js +15 -14
- package/es/components/material-exercise/exercise-menu/ExerciseMenu.js +12 -16
- package/es/components/material-exercise/exercise-menu/ExerciseMenuArduinoAgentModalButton.js +11 -12
- package/es/components/material-exercise/exercise-menu/ExerciseMenuArduinoSettings.js +80 -119
- package/es/components/material-exercise/exercise-menu/ExerciseMenuDropdown.js +67 -96
- package/es/components/material-exercise/exercise-menu/ExerciseMenuReset.js +23 -41
- package/es/components/material-exercise/exercise-menu/ExerciseMenuStdioFileBrowser.js +122 -143
- package/es/components/material-exercise/exercise-menu/ExerciseMenuStdioFileBrowser.styled.js +13 -13
- package/es/components/material-exercise/exercise-multilang-dropdown/ExerciseMultilangDropdown.js +19 -28
- package/es/components/material-exercise/exercise-multilang-dropdown/ExerciseMultilangDropdownLazy.d.ts +2 -1
- package/es/components/material-exercise/exercise-multilang-dropdown/ExerciseMultilangDropdownLazy.js +4 -6
- package/es/components/material-exercise/exercise-preview/ExercisePreview.js +24 -26
- package/es/components/material-exercise/exercise-preview/ExercisePreviewDisplayModeButton.js +7 -14
- package/es/components/material-exercise/exercise-rightpane/ExerciseRightpane.js +35 -47
- package/es/components/material-exercise/exercise-rightpane/ExerciseRightpaneEditorPerference.js +6 -10
- package/es/components/material-exercise/exercise-rightpane/ExerciseRightpaneEnvironment.js +78 -85
- package/es/components/material-exercise/exercise-room/ExerciseRoom.js +12 -21
- package/es/components/material-exercise/exercise-room/ExerciseRoom.styled.js +12 -14
- package/es/components/material-exercise/exercise-room/ExerciseRoomDetail.js +349 -498
- package/es/components/material-exercise/exercise-room/ExerciseRoomList.js +133 -193
- package/es/components/material-exercise/exercise-room/helpers/exerciseRoomPermissionStringConvertor.js +2 -2
- package/es/components/material-exercise/exercise-runner/ExerciseRunner.js +142 -200
- package/es/components/material-exercise/exercise-runner/ExerciseRunnerContext.js +1 -1
- package/es/components/material-exercise/exercise-runner/ExerciseRunnerController.js +16 -20
- package/es/components/material-exercise/exercise-runner/ExerciseRunnerControllerArduinoAgentModal.js +85 -112
- package/es/components/material-exercise/exercise-runner/ExerciseRunnerControllerArduinoStatusMessage.js +20 -30
- package/es/components/material-exercise/exercise-runner/ExerciseRunnerControllerButtonGroup.js +82 -90
- package/es/components/material-exercise/exercise-runner/ExerciseRunnerControllerCodeHelpRequestButton.js +52 -63
- package/es/components/material-exercise/exercise-runner/ExerciseRunnerControllerRunningInfo.js +87 -131
- package/es/components/material-exercise/exercise-runner/ExerciseRunnerControllerStatusIndicator.js +2 -2
- package/es/components/material-exercise/exercise-runner/ExerciseRunnerControllerStatusMessage.js +15 -17
- package/es/components/material-exercise/exercise-runner/ExerciseRunnerControllerTimer.js +23 -31
- package/es/components/material-exercise/exercise-submit-history/ExerciseSubmitHistory.js +250 -399
- package/es/components/material-exercise/exercise-submit-history/ExerciseSubmitHistory.styled.js +8 -8
- package/es/components/material-exercise/exercise-submit-history/ExerciseSubmitHistoryOutput.js +49 -68
- package/es/components/shared/exercise-menu-button/ExerciseMenuButton.js +24 -29
- package/es/components/shared/exercise-shimmer/ExerciseFileShimmer.js +38 -40
- package/es/components/shared/exercise-shimmer/ExerciseFileTabShimmer.js +20 -22
- package/es/components/shared/exercise-shimmer/ExerciseFileTabsShimmer.js +8 -10
- package/es/components/shared/exercise-shimmer/ExerciseFileTreeListItemShimmer.js +22 -24
- package/es/components/shared/exercise-shimmer/ExerciseFileTreeListShimmer.js +9 -19
- package/es/components/shared/exercise-version-list/ExerciseVersionList.js +5 -6
- package/es/components/shared/exercise-version-list/ExerciseVersionList.styled.js +1 -1
- package/es/components/shared/exercise-version-list/ExerciseVersionListItem.js +10 -10
- package/es/components/shared/exercise-version-list/ExerciseVersionListItem.styled.js +5 -9
- package/es/components/shared/file-icon/FileIcon.js +16 -19
- package/es/components/shared/file-tabs/FileTab.js +33 -43
- package/es/components/shared/file-tabs/FileTab.styled.js +15 -19
- package/es/components/shared/file-tabs/FileTabs.js +40 -62
- package/es/components/shared/file-tabs/FileTabs.styled.js +2 -2
- package/es/components/shared/file-tabs/util.js +14 -27
- package/es/components/shared/file-tree/FileTree.js +10 -16
- package/es/components/shared/file-tree/FileTreeConfig.js +39 -39
- package/es/components/shared/file-tree/FileTreeList.js +40 -38
- package/es/components/shared/file-tree/FileTreeListItemContent.js +99 -124
- package/es/components/shared/file-tree/FileTreeListItemContent.styled.js +21 -25
- package/es/components/shared/file-tree/FileTreeListItemContentInput.js +96 -102
- package/es/components/shared/file-tree/FileTreeListItemContentInput.styled.js +6 -6
- package/es/components/shared/file-tree/FileTreeListItemContentMenu.js +91 -129
- package/es/components/shared/file-tree/FileTreeListItems.js +137 -149
- package/es/components/shared/file-tree/FileTreeListItems.styled.js +2 -2
- package/es/components/shared/file-tree/FileTreeToolbar.styled.js +1 -1
- package/es/components/shared/file-tree/context/FileTreeContext.d.ts +1 -1
- package/es/components/shared/file-tree/context/FileTreeContext.js +79 -97
- package/es/components/shared/file-tree/file-tree-toolbar/FileTreeToolbar.js +54 -55
- package/es/components/shared/file-tree/utils/fileTreeFiles.js +20 -20
- package/es/components/shared/file-tree/utils/fileTreeGenerator.js +146 -193
- package/es/components/shared/file-tree/utils/fileTreeInput.js +1 -11
- package/es/components/shared/file-tree/utils/fileTreeItem.js +1 -1
- package/es/components/shared/file-tree/utils/fileTreePath.js +6 -5
- package/es/components/shared/file-viewer/FileViewer.js +46 -69
- package/es/components/shared/file-viewer/FileViewerCsv.js +167 -257
- package/es/components/shared/file-viewer/FileViewerImage.js +12 -12
- package/es/components/shared/file-viewer/FileViewerIpynb.js +11 -21
- package/es/components/shared/file-viewer/FileViewerNonViewable.js +47 -60
- package/es/components/shared/file-viewer/FileViewerText.js +11 -19
- package/es/components/shared/material-modal/MaterialModal.js +11 -20
- package/es/components/shared/material-modal/MaterialModal.styled.js +5 -5
- package/es/components/shared/monaco-editor/MonacoEditor.js +72 -95
- package/es/components/shared/monaco-editor/MonacoEditorLazy.js +7 -11
- package/es/components/shared/monaco-editor/MonacoEditorMobile.js +32 -43
- package/es/components/shared/monaco-editor/MonacoEditorPerferenceForm.js +194 -244
- package/es/components/shared/monaco-editor/constants/grammars/index.js +28 -82
- package/es/components/shared/monaco-editor/constants/monaco/preferences.js +5 -5
- package/es/components/shared/monaco-editor/constants/themes/index.js +17 -49
- package/es/components/shared/monaco-editor/editor-hooks/useMonacoEventChange.js +10 -11
- package/es/components/shared/monaco-editor/editor-hooks/useMonacoEventCursor.js +14 -15
- package/es/components/shared/monaco-editor/editor-hooks/useMonacoEventScroll.js +8 -9
- package/es/components/shared/monaco-editor/editor-hooks/useMonacoMarkers.js +30 -34
- package/es/components/shared/monaco-editor/editor-hooks/useMonacoOptions.js +7 -9
- package/es/components/shared/monaco-editor/editor-hooks/useMonacoTheme.js +6 -6
- package/es/components/shared/monaco-editor/editor-languages/css/formatter.js +10 -33
- package/es/components/shared/monaco-editor/editor-languages/html/formatter.js +10 -33
- package/es/components/shared/monaco-editor/editor-languages/typescript/dts/_helper.js +1 -1
- package/es/components/shared/monaco-editor/editor-languages/typescript/formatter.js +10 -37
- package/es/components/shared/monaco-editor/editor-languages/typescript/index.js +3 -3
- package/es/components/shared/monaco-editor/hooks/useEditorOptions.js +5 -11
- package/es/components/shared/monaco-editor/utils/emmet/abbreviationActions.js +12 -10
- package/es/components/shared/monaco-editor/utils/emmet/registerProvider.js +6 -12
- package/es/components/shared/monaco-editor/utils/grammar/index.js +24 -67
- package/es/components/shared/monaco-editor/utils/grammar/onigasm.js +6 -25
- package/es/components/shared/monaco-editor/utils/grammar/textmate.js +35 -67
- package/es/components/shared/monaco-editor/utils/monacoLanguage.js +5 -5
- package/es/components/shared/monaco-editor/utils/monacoPreference.js +4 -6
- package/es/components/shared/monaco-editor/utils/prettier/config.js +2 -2
- package/es/components/shared/monaco-editor/utils/prettier/index.js +7 -27
- package/es/components/shared/monaco-editor/utils/theme/convert.js +13 -19
- package/es/components/shared/monaco-editor/utils/theme/index.js +3 -22
- package/es/components/shared/monaco-editor/vendors/monaco-collab-ext/RemoteCursor.js +56 -77
- package/es/components/shared/monaco-editor/vendors/monaco-collab-ext/RemoteCursorManager.js +68 -82
- package/es/components/shared/monaco-editor/vendors/monaco-collab-ext/RemoteCursorWidget.js +93 -120
- package/es/components/shared/monaco-editor/vendors/monaco-collab-ext/RemoteSelection.js +130 -152
- package/es/components/shared/monaco-editor/vendors/monaco-collab-ext/RemoteSelectionManager.js +92 -104
- package/es/components/shared/monaco-editor/vendors/monaco-collab-ext/styles.js +2 -2
- package/es/components/shared/monaco-editor/vendors/vscode-emmet-helper/configCompat.js +6 -1
- package/es/components/shared/monaco-editor/vendors/vscode-emmet-helper/data.js +2 -2
- package/es/components/shared/monaco-editor/vendors/vscode-emmet-helper/emmetHelper.js +156 -171
- package/es/components/shared/monaco-editor/vendors/vscode-emmet-helper/utils.js +3 -3
- package/es/components/shared/no-vnc/NoVnc.js +71 -99
- package/es/components/shared/no-vnc/NoVncLazy.js +7 -11
- package/es/components/shared/preview-container/PreviewContainer.js +14 -15
- package/es/components/shared/web-browser/WebBrowser.js +52 -69
- package/es/components/shared/xterm/Xterm.js +57 -77
- package/es/components/shared/xterm/XtermLazy.js +7 -11
- package/es/constants/arduino.js +10 -10
- package/es/constants/color.js +1 -1
- package/es/constants/shortcutKeyMap.js +1 -3
- package/es/constants/stylesheets.js +5 -7
- package/es/hooks/useArduino.js +141 -278
- package/es/hooks/useExerciseFile.js +22 -24
- package/es/hooks/useExericseShortcut.js +4 -6
- package/es/hooks/useMaterialExerciseFileUrl.js +34 -52
- package/es/hooks/useRunnerRoomWebSocket.js +27 -51
- package/es/hooks/useStdioTextConcator.js +11 -11
- package/es/hooks/useStdioWebSocket.js +28 -32
- package/es/hooks/useUsercodeEditWebSocket.js +157 -232
- package/es/hooks/useUsercodeHistory.js +63 -115
- package/es/utils/arduino.js +12 -24
- package/es/utils/exerciseFile.js +10 -8
- package/es/utils/runner.js +17 -33
- package/package.json +15 -11
- package/cjs/_virtual/_rollupPluginBabelHelpers.js +0 -519
- package/cjs/components/index.js +0 -25
- package/cjs/components/locales/index.js +0 -13
- package/cjs/components/material-exercise/context/index.js +0 -57
- package/cjs/components/material-exercise/exercise-code-history/index.js +0 -7
- package/cjs/components/material-exercise/exercise-code-history/locales/index.js +0 -13
- package/cjs/components/material-exercise/exercise-file/index.js +0 -7
- package/cjs/components/material-exercise/exercise-file-editor/index.js +0 -7
- package/cjs/components/material-exercise/exercise-file-editor/locales/index.js +0 -13
- package/cjs/components/material-exercise/exercise-file-tabs/exercise-file-tabs-file-tree-button/index.js +0 -7
- package/cjs/components/material-exercise/exercise-file-tabs/exercise-file-tabs-file-tree-button/locales/index.js +0 -13
- package/cjs/components/material-exercise/exercise-file-tabs/index.js +0 -9
- package/cjs/components/material-exercise/exercise-file-tabs/locales/index.js +0 -13
- package/cjs/components/material-exercise/exercise-file-tree/index.js +0 -9
- package/cjs/components/material-exercise/exercise-file-tree/locales/index.js +0 -13
- package/cjs/components/material-exercise/exercise-file-viewer/index.js +0 -7
- package/cjs/components/material-exercise/exercise-menu/index.js +0 -7
- package/cjs/components/material-exercise/exercise-menu/locales/index.js +0 -13
- package/cjs/components/material-exercise/exercise-multilang-dropdown/index.js +0 -9
- package/cjs/components/material-exercise/exercise-preview/index.js +0 -7
- package/cjs/components/material-exercise/exercise-preview/locales/index.js +0 -13
- package/cjs/components/material-exercise/exercise-rightpane/index.js +0 -7
- package/cjs/components/material-exercise/exercise-rightpane/locales/index.js +0 -13
- package/cjs/components/material-exercise/exercise-room/helpers/index.js +0 -7
- package/cjs/components/material-exercise/exercise-room/index.js +0 -7
- package/cjs/components/material-exercise/exercise-room/locales/index.js +0 -13
- package/cjs/components/material-exercise/exercise-runner/index.js +0 -7
- package/cjs/components/material-exercise/exercise-runner/locales/index.js +0 -13
- package/cjs/components/material-exercise/exercise-submit-history/index.js +0 -7
- package/cjs/components/material-exercise/exercise-submit-history/locales/index.js +0 -13
- package/cjs/components/material-exercise/index.js +0 -9
- package/cjs/components/shared/exercise-menu-button/index.js +0 -7
- package/cjs/components/shared/exercise-shimmer/index.js +0 -15
- package/cjs/components/shared/exercise-version-list/index.js +0 -9
- package/cjs/components/shared/file-icon/index.js +0 -7
- package/cjs/components/shared/file-tabs/index.js +0 -7
- package/cjs/components/shared/file-tree/context/index.js +0 -9
- package/cjs/components/shared/file-tree/file-tree-toolbar/index.js +0 -7
- package/cjs/components/shared/file-tree/file-tree-toolbar/locales/index.js +0 -13
- package/cjs/components/shared/file-tree/index.js +0 -7
- package/cjs/components/shared/file-tree/locales/index.js +0 -13
- package/cjs/components/shared/file-tree/utils/index.js +0 -20
- package/cjs/components/shared/file-viewer/index.js +0 -7
- package/cjs/components/shared/file-viewer/locales/index.js +0 -21
- package/cjs/components/shared/material-modal/index.js +0 -7
- package/cjs/components/shared/monaco-editor/constants/index.js +0 -13
- package/cjs/components/shared/monaco-editor/constants/monaco/index.js +0 -11
- package/cjs/components/shared/monaco-editor/editor-hooks/index.js +0 -17
- package/cjs/components/shared/monaco-editor/editor-languages/typescript/dts/index.js +0 -11
- package/cjs/components/shared/monaco-editor/hooks/index.js +0 -7
- package/cjs/components/shared/monaco-editor/index.js +0 -21
- package/cjs/components/shared/monaco-editor/locales/index.js +0 -13
- package/cjs/components/shared/monaco-editor/utils/emmet/index.js +0 -9
- package/cjs/components/shared/monaco-editor/utils/index.js +0 -9
- package/cjs/components/shared/monaco-editor/vendors/monaco-collab-ext/index.js +0 -12
- package/cjs/components/shared/monaco-editor/vendors/vscode-emmet-helper/index.js +0 -11
- package/cjs/components/shared/no-vnc/index.js +0 -7
- package/cjs/components/shared/preview-container/index.js +0 -9
- package/cjs/components/shared/web-browser/index.js +0 -7
- package/cjs/components/shared/xterm/index.js +0 -7
- package/cjs/components/shared/xterm/locales/index.js +0 -13
- package/cjs/constants/index.js +0 -7
- package/cjs/hooks/index.js +0 -20
- package/cjs/utils/index.js +0 -10
- package/es/_virtual/_rollupPluginBabelHelpers.js +0 -499
- package/es/components/index.js +0 -8
- package/es/components/locales/index.js +0 -4
- package/es/components/material-exercise/context/index.js +0 -5
- package/es/components/material-exercise/exercise-code-history/index.js +0 -1
- package/es/components/material-exercise/exercise-code-history/locales/index.js +0 -4
- package/es/components/material-exercise/exercise-file/index.js +0 -1
- package/es/components/material-exercise/exercise-file-editor/index.js +0 -1
- package/es/components/material-exercise/exercise-file-editor/locales/index.js +0 -4
- package/es/components/material-exercise/exercise-file-tabs/exercise-file-tabs-file-tree-button/index.js +0 -1
- package/es/components/material-exercise/exercise-file-tabs/exercise-file-tabs-file-tree-button/locales/index.js +0 -4
- package/es/components/material-exercise/exercise-file-tabs/index.js +0 -2
- package/es/components/material-exercise/exercise-file-tabs/locales/index.js +0 -4
- package/es/components/material-exercise/exercise-file-tree/index.js +0 -2
- package/es/components/material-exercise/exercise-file-tree/locales/index.js +0 -4
- package/es/components/material-exercise/exercise-file-viewer/index.js +0 -1
- package/es/components/material-exercise/exercise-menu/index.js +0 -1
- package/es/components/material-exercise/exercise-menu/locales/index.js +0 -4
- package/es/components/material-exercise/exercise-multilang-dropdown/index.js +0 -2
- package/es/components/material-exercise/exercise-preview/index.js +0 -1
- package/es/components/material-exercise/exercise-preview/locales/index.js +0 -4
- package/es/components/material-exercise/exercise-rightpane/index.js +0 -1
- package/es/components/material-exercise/exercise-rightpane/locales/index.js +0 -4
- package/es/components/material-exercise/exercise-room/helpers/index.js +0 -1
- package/es/components/material-exercise/exercise-room/index.js +0 -1
- package/es/components/material-exercise/exercise-room/locales/index.js +0 -4
- package/es/components/material-exercise/exercise-runner/index.js +0 -1
- package/es/components/material-exercise/exercise-runner/locales/index.js +0 -4
- package/es/components/material-exercise/exercise-submit-history/index.js +0 -1
- package/es/components/material-exercise/exercise-submit-history/locales/index.js +0 -4
- package/es/components/material-exercise/index.js +0 -2
- package/es/components/shared/exercise-menu-button/index.js +0 -1
- package/es/components/shared/exercise-shimmer/index.js +0 -5
- package/es/components/shared/exercise-version-list/index.js +0 -2
- package/es/components/shared/file-icon/index.js +0 -1
- package/es/components/shared/file-tabs/index.js +0 -1
- package/es/components/shared/file-tree/context/index.js +0 -1
- package/es/components/shared/file-tree/file-tree-toolbar/index.js +0 -1
- package/es/components/shared/file-tree/file-tree-toolbar/locales/index.js +0 -4
- package/es/components/shared/file-tree/index.js +0 -1
- package/es/components/shared/file-tree/locales/index.js +0 -4
- package/es/components/shared/file-tree/utils/index.js +0 -5
- package/es/components/shared/file-viewer/index.js +0 -1
- package/es/components/shared/file-viewer/locales/index.js +0 -8
- package/es/components/shared/material-modal/index.js +0 -1
- package/es/components/shared/monaco-editor/constants/index.js +0 -2
- package/es/components/shared/monaco-editor/constants/monaco/index.js +0 -1
- package/es/components/shared/monaco-editor/editor-hooks/index.js +0 -6
- package/es/components/shared/monaco-editor/editor-languages/typescript/dts/index.js +0 -3
- package/es/components/shared/monaco-editor/hooks/index.js +0 -1
- package/es/components/shared/monaco-editor/index.js +0 -6
- package/es/components/shared/monaco-editor/locales/index.js +0 -4
- package/es/components/shared/monaco-editor/utils/emmet/index.js +0 -1
- package/es/components/shared/monaco-editor/utils/index.js +0 -2
- package/es/components/shared/monaco-editor/vendors/monaco-collab-ext/index.js +0 -3
- package/es/components/shared/monaco-editor/vendors/vscode-emmet-helper/index.js +0 -2
- package/es/components/shared/no-vnc/index.js +0 -1
- package/es/components/shared/preview-container/index.js +0 -1
- package/es/components/shared/web-browser/index.js +0 -1
- package/es/components/shared/xterm/index.js +0 -1
- package/es/components/shared/xterm/locales/index.js +0 -4
- package/es/constants/index.js +0 -1
- package/es/hooks/index.js +0 -7
- package/es/utils/index.js +0 -2
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { defineProperty as _defineProperty, asyncToGenerator as _asyncToGenerator, regeneratorRuntime as _regeneratorRuntime, slicedToArray as _slicedToArray } from '../../../_virtual/_rollupPluginBabelHelpers.js';
|
|
2
1
|
import { postGlobalAccountPreferenceEdit, postOrgMaterialExerciseExerciseRoomUserFileAdd, getOrgLectureGet, getOrgMaterialExerciseGet, getOrgLecturePageResolve, getOrgMaterialExerciseExerciseRoomGet, getOrgUserGet, getGlobalAccountPreferenceGet, getOrgMaterialExerciseExerciseImageExerciseFileGet, getOrgMaterialExerciseExerciseRoomUserFileGet } from '@elice/api-client';
|
|
3
2
|
import { enums } from '@elice/types';
|
|
4
3
|
import { EliceWebSocket } from '@elice/websocket';
|
|
@@ -15,211 +14,106 @@ import { ExercisePreviewType, ExercisePreviewDisplayMode } from './recoilTypes.j
|
|
|
15
14
|
//
|
|
16
15
|
//
|
|
17
16
|
//
|
|
18
|
-
|
|
17
|
+
const KEY_PREFIX = 'MaterialExercise/Exercise/Global';
|
|
19
18
|
//
|
|
20
19
|
// =============== entities ===============
|
|
21
20
|
//
|
|
22
21
|
/**
|
|
23
22
|
* Lecture.
|
|
24
23
|
*/
|
|
25
|
-
|
|
26
|
-
key:
|
|
24
|
+
const exerciseLectureState = atomFamily({
|
|
25
|
+
key: `${KEY_PREFIX}/Lecture`,
|
|
27
26
|
default: null,
|
|
28
|
-
effects:
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
return getOrgLectureGet({
|
|
48
|
-
lectureId: lectureId
|
|
49
|
-
}).then(function (res) {
|
|
50
|
-
return res.lecture;
|
|
51
|
-
}).catch(function () {
|
|
52
|
-
return null;
|
|
53
|
-
});
|
|
54
|
-
case 6:
|
|
55
|
-
_context.t1 = _context.sent;
|
|
56
|
-
(0, _context.t0)(_context.t1);
|
|
57
|
-
case 8:
|
|
58
|
-
case "end":
|
|
59
|
-
return _context.stop();
|
|
60
|
-
}
|
|
61
|
-
}, _callee);
|
|
62
|
-
}));
|
|
63
|
-
return function get() {
|
|
64
|
-
return _ref2.apply(this, arguments);
|
|
65
|
-
};
|
|
66
|
-
}();
|
|
67
|
-
if (trigger === 'get') {
|
|
27
|
+
effects: lectureId => [({
|
|
28
|
+
setSelf,
|
|
29
|
+
trigger,
|
|
30
|
+
onSet
|
|
31
|
+
}) => {
|
|
32
|
+
const get = async () => {
|
|
33
|
+
if (!lectureId) {
|
|
34
|
+
setSelf(null);
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
setSelf(await getOrgLectureGet({
|
|
38
|
+
lectureId: lectureId
|
|
39
|
+
}).then(res => res.lecture).catch(() => null));
|
|
40
|
+
};
|
|
41
|
+
if (trigger === 'get') {
|
|
42
|
+
void get();
|
|
43
|
+
}
|
|
44
|
+
onSet((_prevValue, _newValue, isReset) => {
|
|
45
|
+
if (isReset) {
|
|
68
46
|
void get();
|
|
69
47
|
}
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
void get();
|
|
73
|
-
}
|
|
74
|
-
});
|
|
75
|
-
}];
|
|
76
|
-
}
|
|
48
|
+
});
|
|
49
|
+
}]
|
|
77
50
|
});
|
|
78
51
|
/**
|
|
79
52
|
* Material exercise.
|
|
80
53
|
*/
|
|
81
|
-
|
|
82
|
-
key:
|
|
54
|
+
const exerciseState = atomFamily({
|
|
55
|
+
key: `${KEY_PREFIX}/Exercise`,
|
|
83
56
|
default: null,
|
|
84
|
-
effects:
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
_lecturePageId: res.lecturePageId,
|
|
108
|
-
_orderNo: res.orderNo
|
|
109
|
-
};
|
|
110
|
-
}).catch(function (err) {
|
|
111
|
-
throw err;
|
|
112
|
-
})]);
|
|
113
|
-
}).then(function (_ref5) {
|
|
114
|
-
var _ref6 = _slicedToArray(_ref5, 2),
|
|
115
|
-
materialExercise = _ref6[0],
|
|
116
|
-
lecturePageResolve = _ref6[1];
|
|
117
|
-
return Object.assign(Object.assign({}, materialExercise), lecturePageResolve);
|
|
118
|
-
}).catch(function () {
|
|
119
|
-
return null;
|
|
120
|
-
});
|
|
121
|
-
case 3:
|
|
122
|
-
_context2.t1 = _context2.sent;
|
|
123
|
-
(0, _context2.t0)(_context2.t1);
|
|
124
|
-
case 5:
|
|
125
|
-
case "end":
|
|
126
|
-
return _context2.stop();
|
|
127
|
-
}
|
|
128
|
-
}, _callee2);
|
|
129
|
-
}));
|
|
130
|
-
return function get() {
|
|
131
|
-
return _ref4.apply(this, arguments);
|
|
132
|
-
};
|
|
133
|
-
}();
|
|
134
|
-
if (trigger === 'get') {
|
|
135
|
-
void get();
|
|
136
|
-
}
|
|
137
|
-
}];
|
|
138
|
-
}
|
|
57
|
+
effects: materialExerciseId => [({
|
|
58
|
+
setSelf,
|
|
59
|
+
trigger
|
|
60
|
+
}) => {
|
|
61
|
+
const get = async () => {
|
|
62
|
+
setSelf(await getOrgMaterialExerciseGet({
|
|
63
|
+
materialExerciseId
|
|
64
|
+
}).then(res => res.materialExercise).then(materialExercise => Promise.all([materialExercise, getOrgLecturePageResolve({
|
|
65
|
+
materialId: materialExercise.id,
|
|
66
|
+
materialType: enums.LectureMaterialType.Exercise
|
|
67
|
+
}).then(res => ({
|
|
68
|
+
_courseId: res.courseId,
|
|
69
|
+
_lectureId: res.lectureId,
|
|
70
|
+
_lecturePageId: res.lecturePageId,
|
|
71
|
+
_orderNo: res.orderNo
|
|
72
|
+
})).catch(err => {
|
|
73
|
+
throw err;
|
|
74
|
+
})])).then(([materialExercise, lecturePageResolve]) => Object.assign(Object.assign({}, materialExercise), lecturePageResolve)).catch(() => null));
|
|
75
|
+
};
|
|
76
|
+
if (trigger === 'get') {
|
|
77
|
+
void get();
|
|
78
|
+
}
|
|
79
|
+
}]
|
|
139
80
|
});
|
|
140
81
|
/**
|
|
141
82
|
* Material exercise room.
|
|
142
83
|
*/
|
|
143
|
-
|
|
144
|
-
key:
|
|
84
|
+
const exerciseRoomState = atomFamily({
|
|
85
|
+
key: `${KEY_PREFIX}/ExerciseRoom`,
|
|
145
86
|
default: null,
|
|
146
|
-
effects:
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
while (1) switch (_context3.prev = _context3.next) {
|
|
154
|
-
case 0:
|
|
155
|
-
if (exerciseRoomId) {
|
|
156
|
-
_context3.next = 2;
|
|
157
|
-
break;
|
|
158
|
-
}
|
|
159
|
-
return _context3.abrupt("return", null);
|
|
160
|
-
case 2:
|
|
161
|
-
_context3.t0 = setSelf;
|
|
162
|
-
_context3.next = 5;
|
|
163
|
-
return getOrgMaterialExerciseExerciseRoomGet({
|
|
164
|
-
exerciseRoomId: exerciseRoomId
|
|
165
|
-
}).then(function (res) {
|
|
166
|
-
return res.exerciseRoom;
|
|
167
|
-
}).catch(function () {
|
|
168
|
-
return null;
|
|
169
|
-
});
|
|
170
|
-
case 5:
|
|
171
|
-
_context3.t1 = _context3.sent;
|
|
172
|
-
(0, _context3.t0)(_context3.t1);
|
|
173
|
-
case 7:
|
|
174
|
-
case "end":
|
|
175
|
-
return _context3.stop();
|
|
176
|
-
}
|
|
177
|
-
}, _callee3);
|
|
178
|
-
}));
|
|
179
|
-
return function get() {
|
|
180
|
-
return _ref8.apply(this, arguments);
|
|
181
|
-
};
|
|
182
|
-
}();
|
|
183
|
-
if (trigger === 'get') {
|
|
184
|
-
void get();
|
|
87
|
+
effects: exerciseRoomId => [({
|
|
88
|
+
setSelf,
|
|
89
|
+
trigger
|
|
90
|
+
}) => {
|
|
91
|
+
const get = async () => {
|
|
92
|
+
if (!exerciseRoomId) {
|
|
93
|
+
return null;
|
|
185
94
|
}
|
|
186
|
-
|
|
187
|
-
|
|
95
|
+
setSelf(await getOrgMaterialExerciseExerciseRoomGet({
|
|
96
|
+
exerciseRoomId
|
|
97
|
+
}).then(res => res.exerciseRoom).catch(() => null));
|
|
98
|
+
};
|
|
99
|
+
if (trigger === 'get') {
|
|
100
|
+
void get();
|
|
101
|
+
}
|
|
102
|
+
}]
|
|
188
103
|
});
|
|
189
104
|
/**
|
|
190
105
|
* User.
|
|
191
106
|
*/
|
|
192
|
-
|
|
193
|
-
key:
|
|
107
|
+
const exerciseUserState = atom({
|
|
108
|
+
key: `${KEY_PREFIX}/User`,
|
|
194
109
|
default: null,
|
|
195
|
-
effects: [
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
case 0:
|
|
203
|
-
_context4.t0 = setSelf;
|
|
204
|
-
_context4.next = 3;
|
|
205
|
-
return getOrgUserGet().then(function (res) {
|
|
206
|
-
return res.user;
|
|
207
|
-
}).catch(function () {
|
|
208
|
-
return null;
|
|
209
|
-
});
|
|
210
|
-
case 3:
|
|
211
|
-
_context4.t1 = _context4.sent;
|
|
212
|
-
(0, _context4.t0)(_context4.t1);
|
|
213
|
-
case 5:
|
|
214
|
-
case "end":
|
|
215
|
-
return _context4.stop();
|
|
216
|
-
}
|
|
217
|
-
}, _callee4);
|
|
218
|
-
}));
|
|
219
|
-
return function get() {
|
|
220
|
-
return _ref10.apply(this, arguments);
|
|
221
|
-
};
|
|
222
|
-
}();
|
|
110
|
+
effects: [({
|
|
111
|
+
setSelf,
|
|
112
|
+
trigger
|
|
113
|
+
}) => {
|
|
114
|
+
const get = async () => {
|
|
115
|
+
setSelf(await getOrgUserGet().then(res => res.user).catch(() => null));
|
|
116
|
+
};
|
|
223
117
|
if (trigger === 'get') {
|
|
224
118
|
void get();
|
|
225
119
|
}
|
|
@@ -231,44 +125,29 @@ var exerciseUserState = atom({
|
|
|
231
125
|
/**
|
|
232
126
|
*
|
|
233
127
|
*/
|
|
234
|
-
|
|
235
|
-
key:
|
|
128
|
+
const exerciseFileTabsOpenedState = atomFamily({
|
|
129
|
+
key: `${KEY_PREFIX}/FileTabs/Opened`,
|
|
236
130
|
default: selectorFamily({
|
|
237
|
-
key:
|
|
238
|
-
get:
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
}
|
|
258
|
-
openFilelist = (_b = (_a = mulLang === null || mulLang === void 0 ? void 0 : mulLang[mulEnv === null || mulEnv === void 0 ? void 0 : mulEnv.language]) === null || _a === void 0 ? void 0 : _a.initialOpenFilelist) !== null && _b !== void 0 ? _b : [];
|
|
259
|
-
return _context5.abrupt("return", openFilelist);
|
|
260
|
-
case 9:
|
|
261
|
-
return _context5.abrupt("return", (_d = (_c = exercise === null || exercise === void 0 ? void 0 : exercise.readyExerciseImage) === null || _c === void 0 ? void 0 : _c.initialOpenFilelist) !== null && _d !== void 0 ? _d : []);
|
|
262
|
-
case 10:
|
|
263
|
-
case "end":
|
|
264
|
-
return _context5.stop();
|
|
265
|
-
}
|
|
266
|
-
}, _callee5);
|
|
267
|
-
}));
|
|
268
|
-
return function (_x) {
|
|
269
|
-
return _ref13.apply(this, arguments);
|
|
270
|
-
};
|
|
271
|
-
}();
|
|
131
|
+
key: `${KEY_PREFIX}}/FileTabs/Opened/Default`,
|
|
132
|
+
get: ({
|
|
133
|
+
materialExerciseId,
|
|
134
|
+
exerciseRoomId
|
|
135
|
+
}) => async ({
|
|
136
|
+
get
|
|
137
|
+
}) => {
|
|
138
|
+
var _a, _b, _c, _d;
|
|
139
|
+
const exercise = get(exerciseState(materialExerciseId));
|
|
140
|
+
const mulLang = get(exerciseMultilangLanguagesState(materialExerciseId));
|
|
141
|
+
const mulEnv = get(exerciseMultilangEnvironmentState({
|
|
142
|
+
materialExerciseId,
|
|
143
|
+
exerciseRoomId
|
|
144
|
+
}));
|
|
145
|
+
if ((exercise === null || exercise === void 0 ? void 0 : exercise.envType) === enums.ExerciseEnvType.MultiLanguage && mulLang && mulEnv) {
|
|
146
|
+
const openFilelist = (_b = (_a = mulLang === null || mulLang === void 0 ? void 0 : mulLang[mulEnv === null || mulEnv === void 0 ? void 0 : mulEnv.language]) === null || _a === void 0 ? void 0 : _a.initialOpenFilelist) !== null && _b !== void 0 ? _b : [];
|
|
147
|
+
return openFilelist;
|
|
148
|
+
} else {
|
|
149
|
+
return (_d = (_c = exercise === null || exercise === void 0 ? void 0 : exercise.readyExerciseImage) === null || _c === void 0 ? void 0 : _c.initialOpenFilelist) !== null && _d !== void 0 ? _d : [];
|
|
150
|
+
}
|
|
272
151
|
}
|
|
273
152
|
})
|
|
274
153
|
});
|
|
@@ -278,55 +157,34 @@ var exerciseFileTabsOpenedState = atomFamily({
|
|
|
278
157
|
/**
|
|
279
158
|
*
|
|
280
159
|
*/
|
|
281
|
-
|
|
282
|
-
key:
|
|
160
|
+
const exerciseFileTreeOpenedState = atom({
|
|
161
|
+
key: `${KEY_PREFIX}/FileTree/Opened`,
|
|
283
162
|
default: false
|
|
284
163
|
});
|
|
285
164
|
//
|
|
286
165
|
// =============== preference ===============
|
|
287
166
|
//
|
|
288
|
-
|
|
167
|
+
const EDITOR_ACCOUNT_PREFERENCE_PKEY_MONACO = 'material.exercise.editor.preference';
|
|
289
168
|
/**
|
|
290
169
|
* Editor preference.
|
|
291
170
|
*/
|
|
292
|
-
|
|
293
|
-
key:
|
|
171
|
+
const exerciseEditorPreferenceState = atom({
|
|
172
|
+
key: `${KEY_PREFIX}/EditorPreference`,
|
|
294
173
|
default: DEFAULT_MONACO_EDITOR_PREFERENCE,
|
|
295
|
-
effects: [
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
_context6.next = 3;
|
|
306
|
-
return getGlobalAccountPreferenceGet({
|
|
307
|
-
pkey: EDITOR_ACCOUNT_PREFERENCE_PKEY_MONACO
|
|
308
|
-
}).then(function (res) {
|
|
309
|
-
return normalizeMonacoPreference(res.pvalue);
|
|
310
|
-
}).catch(function () {
|
|
311
|
-
return DEFAULT_MONACO_EDITOR_PREFERENCE;
|
|
312
|
-
});
|
|
313
|
-
case 3:
|
|
314
|
-
_context6.t1 = _context6.sent;
|
|
315
|
-
(0, _context6.t0)(_context6.t1);
|
|
316
|
-
case 5:
|
|
317
|
-
case "end":
|
|
318
|
-
return _context6.stop();
|
|
319
|
-
}
|
|
320
|
-
}, _callee6);
|
|
321
|
-
}));
|
|
322
|
-
return function get() {
|
|
323
|
-
return _ref15.apply(this, arguments);
|
|
324
|
-
};
|
|
325
|
-
}();
|
|
174
|
+
effects: [({
|
|
175
|
+
setSelf,
|
|
176
|
+
trigger,
|
|
177
|
+
onSet
|
|
178
|
+
}) => {
|
|
179
|
+
const get = async () => {
|
|
180
|
+
setSelf(await getGlobalAccountPreferenceGet({
|
|
181
|
+
pkey: EDITOR_ACCOUNT_PREFERENCE_PKEY_MONACO
|
|
182
|
+
}).then(res => normalizeMonacoPreference(res.pvalue)).catch(() => DEFAULT_MONACO_EDITOR_PREFERENCE));
|
|
183
|
+
};
|
|
326
184
|
if (trigger === 'get') {
|
|
327
185
|
void get();
|
|
328
186
|
}
|
|
329
|
-
onSet(
|
|
187
|
+
onSet((newPreference, prevPreference, isReset) => {
|
|
330
188
|
if (!isEqual(newPreference, prevPreference) && !isReset) {
|
|
331
189
|
void postGlobalAccountPreferenceEdit({
|
|
332
190
|
pkey: EDITOR_ACCOUNT_PREFERENCE_PKEY_MONACO,
|
|
@@ -339,69 +197,47 @@ var exerciseEditorPreferenceState = atom({
|
|
|
339
197
|
//
|
|
340
198
|
// =============== preview ===============
|
|
341
199
|
//
|
|
342
|
-
|
|
200
|
+
const EDITOR_ACCOUNT_PREFERENCE_PKEY_PREVIEW_MODE = 'material.exercise.preview.mode';
|
|
343
201
|
/**
|
|
344
202
|
*
|
|
345
203
|
*/
|
|
346
|
-
|
|
347
|
-
key:
|
|
348
|
-
get:
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
};
|
|
204
|
+
const exercisePreviewTypeState = selectorFamily({
|
|
205
|
+
key: `${KEY_PREFIX}/Preview/Type`,
|
|
206
|
+
get: materialExerciseId => ({
|
|
207
|
+
get
|
|
208
|
+
}) => {
|
|
209
|
+
const exercise = get(exerciseState(materialExerciseId));
|
|
210
|
+
const readyExerciseImage = exercise === null || exercise === void 0 ? void 0 : exercise.readyExerciseImage;
|
|
211
|
+
switch (true) {
|
|
212
|
+
case Boolean(readyExerciseImage === null || readyExerciseImage === void 0 ? void 0 : readyExerciseImage.isVnc):
|
|
213
|
+
return ExercisePreviewType.NoVnc;
|
|
214
|
+
case Boolean(readyExerciseImage === null || readyExerciseImage === void 0 ? void 0 : readyExerciseImage.httpPort):
|
|
215
|
+
return ExercisePreviewType.WebBrowser;
|
|
216
|
+
default:
|
|
217
|
+
return ExercisePreviewType.None;
|
|
218
|
+
}
|
|
362
219
|
}
|
|
363
220
|
});
|
|
364
221
|
/**
|
|
365
222
|
*
|
|
366
223
|
*/
|
|
367
|
-
|
|
368
|
-
key:
|
|
224
|
+
const exercisePreviewDisplayModeState = atom({
|
|
225
|
+
key: `${KEY_PREFIX}/Preview/DisplayMode`,
|
|
369
226
|
default: ExercisePreviewDisplayMode.Mini,
|
|
370
|
-
effects: [
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
_context7.next = 3;
|
|
381
|
-
return getGlobalAccountPreferenceGet({
|
|
382
|
-
pkey: EDITOR_ACCOUNT_PREFERENCE_PKEY_PREVIEW_MODE
|
|
383
|
-
}).then(function (res) {
|
|
384
|
-
return Number(res.pvalue) || ExercisePreviewDisplayMode.Mini;
|
|
385
|
-
}).catch(function () {
|
|
386
|
-
return ExercisePreviewDisplayMode.Mini;
|
|
387
|
-
});
|
|
388
|
-
case 3:
|
|
389
|
-
_context7.t1 = _context7.sent;
|
|
390
|
-
(0, _context7.t0)(_context7.t1);
|
|
391
|
-
case 5:
|
|
392
|
-
case "end":
|
|
393
|
-
return _context7.stop();
|
|
394
|
-
}
|
|
395
|
-
}, _callee7);
|
|
396
|
-
}));
|
|
397
|
-
return function get() {
|
|
398
|
-
return _ref18.apply(this, arguments);
|
|
399
|
-
};
|
|
400
|
-
}();
|
|
227
|
+
effects: [({
|
|
228
|
+
trigger,
|
|
229
|
+
setSelf,
|
|
230
|
+
onSet
|
|
231
|
+
}) => {
|
|
232
|
+
const get = async () => {
|
|
233
|
+
setSelf(await getGlobalAccountPreferenceGet({
|
|
234
|
+
pkey: EDITOR_ACCOUNT_PREFERENCE_PKEY_PREVIEW_MODE
|
|
235
|
+
}).then(res => Number(res.pvalue) || ExercisePreviewDisplayMode.Mini).catch(() => ExercisePreviewDisplayMode.Mini));
|
|
236
|
+
};
|
|
401
237
|
if (trigger === 'get') {
|
|
402
238
|
void get();
|
|
403
239
|
}
|
|
404
|
-
onSet(
|
|
240
|
+
onSet((newDisplayMode, prevDisplayMode, isReset) => {
|
|
405
241
|
if (!isEqual(newDisplayMode, prevDisplayMode) && !isReset) {
|
|
406
242
|
void postGlobalAccountPreferenceEdit({
|
|
407
243
|
pkey: EDITOR_ACCOUNT_PREFERENCE_PKEY_PREVIEW_MODE,
|
|
@@ -417,54 +253,53 @@ var exercisePreviewDisplayModeState = atom({
|
|
|
417
253
|
/**
|
|
418
254
|
*
|
|
419
255
|
*/
|
|
420
|
-
|
|
421
|
-
key:
|
|
256
|
+
const exerciseRunnerSubmittingState = atom({
|
|
257
|
+
key: `${KEY_PREFIX}/Runner/Submitting`,
|
|
422
258
|
default: false
|
|
423
259
|
});
|
|
424
260
|
/**
|
|
425
261
|
*
|
|
426
262
|
*/
|
|
427
|
-
|
|
428
|
-
key:
|
|
263
|
+
const exerciseRunnerRunningState = atom({
|
|
264
|
+
key: `${KEY_PREFIX}/Runner/Running`,
|
|
429
265
|
default: false
|
|
430
266
|
});
|
|
431
267
|
/**
|
|
432
268
|
*
|
|
433
269
|
*/
|
|
434
|
-
|
|
435
|
-
key:
|
|
270
|
+
const exerciseRunnerRunTypeState = atom({
|
|
271
|
+
key: `${KEY_PREFIX}/Runner/RunType`,
|
|
436
272
|
default: null
|
|
437
273
|
});
|
|
438
274
|
/**
|
|
439
275
|
*
|
|
440
276
|
*/
|
|
441
|
-
|
|
442
|
-
key:
|
|
277
|
+
const exerciseRunnerRoomConnectionInfoState = atom({
|
|
278
|
+
key: `${KEY_PREFIX}/Runner/RoomConnectionInfoState`,
|
|
443
279
|
default: null
|
|
444
280
|
});
|
|
445
281
|
/**
|
|
446
282
|
*
|
|
447
283
|
*/
|
|
448
|
-
|
|
449
|
-
key:
|
|
284
|
+
const exerciseRunnerStdioFilesState = atom({
|
|
285
|
+
key: `${KEY_PREFIX}/Runner/StdioFiles`,
|
|
450
286
|
default: []
|
|
451
287
|
});
|
|
452
288
|
/**
|
|
453
289
|
*
|
|
454
290
|
*/
|
|
455
|
-
|
|
456
|
-
key:
|
|
457
|
-
get:
|
|
458
|
-
|
|
459
|
-
|
|
291
|
+
const exerciseRunnerWebSocketStatusQuery = selector({
|
|
292
|
+
key: `${KEY_PREFIX}/Runner/WebsocketState`,
|
|
293
|
+
get: ({
|
|
294
|
+
get
|
|
295
|
+
}) => {
|
|
296
|
+
const states = Object.freeze([get(exerciseWebsocketStates).runnerRoom, get(exerciseWebsocketStates).stdio]);
|
|
460
297
|
// connecting
|
|
461
298
|
if (states.includes(EliceWebSocket.CLOSED) || states.includes(EliceWebSocket.CONNECTING)) {
|
|
462
299
|
return EliceWebSocket.CONNECTING;
|
|
463
300
|
}
|
|
464
301
|
// connected
|
|
465
|
-
else if (states.every(
|
|
466
|
-
return state === WebSocket.OPEN;
|
|
467
|
-
})) {
|
|
302
|
+
else if (states.every(state => state === WebSocket.OPEN)) {
|
|
468
303
|
return EliceWebSocket.OPEN;
|
|
469
304
|
}
|
|
470
305
|
// reconnecting
|
|
@@ -479,8 +314,8 @@ var exerciseRunnerWebSocketStatusQuery = selector({
|
|
|
479
314
|
/**
|
|
480
315
|
*
|
|
481
316
|
*/
|
|
482
|
-
|
|
483
|
-
key:
|
|
317
|
+
const exerciseWebsocketStates = atom({
|
|
318
|
+
key: `${KEY_PREFIX}/Websocket/States`,
|
|
484
319
|
default: {
|
|
485
320
|
runnerRoom: EliceWebSocket.CLOSED,
|
|
486
321
|
stdio: EliceWebSocket.CLOSED,
|
|
@@ -490,222 +325,142 @@ var exerciseWebsocketStates = atom({
|
|
|
490
325
|
/**
|
|
491
326
|
*
|
|
492
327
|
*/
|
|
493
|
-
|
|
494
|
-
key:
|
|
495
|
-
get:
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
};
|
|
328
|
+
const exerciseWebsocketQuery = selectorFamily({
|
|
329
|
+
key: `${KEY_PREFIX}/Websocket/State`,
|
|
330
|
+
get: key => ({
|
|
331
|
+
get
|
|
332
|
+
}) => {
|
|
333
|
+
return get(exerciseWebsocketStates)[key];
|
|
500
334
|
},
|
|
501
|
-
set:
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
335
|
+
set: key => ({
|
|
336
|
+
get,
|
|
337
|
+
set
|
|
338
|
+
}, newWebSocketState) => {
|
|
339
|
+
set(exerciseWebsocketStates, Object.assign(Object.assign({}, get(exerciseWebsocketStates)), {
|
|
340
|
+
[key]: newWebSocketState
|
|
341
|
+
}));
|
|
507
342
|
}
|
|
508
343
|
});
|
|
509
344
|
//
|
|
510
345
|
// =============== multi language ===============
|
|
511
346
|
//
|
|
512
|
-
|
|
513
|
-
|
|
347
|
+
const MULTILANG_ENVIRONMENT_FILENAME = '.environment.json';
|
|
348
|
+
const MULTILANG_LANGUAGES_FILENAME = '.languages.json';
|
|
514
349
|
/**
|
|
515
350
|
*
|
|
516
351
|
*/
|
|
517
|
-
|
|
518
|
-
key:
|
|
352
|
+
const exerciseMultilangLanguagesState = atomFamily({
|
|
353
|
+
key: `${KEY_PREFIX}/Multilang/Languages`,
|
|
519
354
|
default: undefined,
|
|
520
|
-
effects:
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
setSelf(undefined);
|
|
548
|
-
return _context8.abrupt("return");
|
|
549
|
-
case 9:
|
|
550
|
-
_context8.t0 = setSelf;
|
|
551
|
-
_context8.next = 12;
|
|
552
|
-
return getOrgMaterialExerciseExerciseImageExerciseFileGet({
|
|
553
|
-
exerciseImageId: (_b = (_a = exercise.readyExerciseImage) === null || _a === void 0 ? void 0 : _a.id) !== null && _b !== void 0 ? _b : 0,
|
|
554
|
-
filename: MULTILANG_LANGUAGES_FILENAME
|
|
555
|
-
}).then(function (res) {
|
|
556
|
-
return res.exerciseFile.content;
|
|
557
|
-
}).then(function (content) {
|
|
558
|
-
return camelizeKeys(JSON.parse(content));
|
|
559
|
-
}).catch(function () {
|
|
560
|
-
return null;
|
|
561
|
-
});
|
|
562
|
-
case 12:
|
|
563
|
-
_context8.t1 = _context8.sent;
|
|
564
|
-
(0, _context8.t0)(_context8.t1);
|
|
565
|
-
case 14:
|
|
566
|
-
case "end":
|
|
567
|
-
return _context8.stop();
|
|
568
|
-
}
|
|
569
|
-
}, _callee8);
|
|
570
|
-
}));
|
|
571
|
-
return function get() {
|
|
572
|
-
return _ref23.apply(this, arguments);
|
|
573
|
-
};
|
|
574
|
-
}();
|
|
575
|
-
if (trigger === 'get') {
|
|
355
|
+
effects: materialExerciseId => [({
|
|
356
|
+
getPromise,
|
|
357
|
+
trigger,
|
|
358
|
+
setSelf,
|
|
359
|
+
onSet
|
|
360
|
+
}) => {
|
|
361
|
+
const get = async () => {
|
|
362
|
+
var _a, _b;
|
|
363
|
+
if (!materialExerciseId) {
|
|
364
|
+
setSelf(undefined);
|
|
365
|
+
return;
|
|
366
|
+
}
|
|
367
|
+
const exercise = await getPromise(exerciseState(materialExerciseId));
|
|
368
|
+
if (!exercise) {
|
|
369
|
+
setSelf(undefined);
|
|
370
|
+
return;
|
|
371
|
+
}
|
|
372
|
+
setSelf(await getOrgMaterialExerciseExerciseImageExerciseFileGet({
|
|
373
|
+
exerciseImageId: (_b = (_a = exercise.readyExerciseImage) === null || _a === void 0 ? void 0 : _a.id) !== null && _b !== void 0 ? _b : 0,
|
|
374
|
+
filename: MULTILANG_LANGUAGES_FILENAME
|
|
375
|
+
}).then(res => res.exerciseFile.content).then(content => camelizeKeys(JSON.parse(content))).catch(() => null));
|
|
376
|
+
};
|
|
377
|
+
if (trigger === 'get') {
|
|
378
|
+
void get();
|
|
379
|
+
}
|
|
380
|
+
onSet((_prevValue, _newValue, isReset) => {
|
|
381
|
+
if (isReset) {
|
|
576
382
|
void get();
|
|
577
383
|
}
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
void get();
|
|
581
|
-
}
|
|
582
|
-
});
|
|
583
|
-
}];
|
|
584
|
-
}
|
|
384
|
+
});
|
|
385
|
+
}]
|
|
585
386
|
});
|
|
586
387
|
/**
|
|
587
388
|
*
|
|
588
389
|
*/
|
|
589
|
-
|
|
590
|
-
key:
|
|
390
|
+
const exerciseMultilangEnvironmentState = atomFamily({
|
|
391
|
+
key: `${KEY_PREFIX}/Multilang/Environment`,
|
|
591
392
|
default: null,
|
|
592
|
-
effects:
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
while (1) switch (_context9.prev = _context9.next) {
|
|
613
|
-
case 0:
|
|
614
|
-
return _context9.abrupt("return", getPromise(exerciseMultilangLanguagesState(materialExerciseId)).then(function (languages) {
|
|
615
|
-
if (!languages) {
|
|
616
|
-
throw new Error('err_no_languages');
|
|
617
|
-
}
|
|
618
|
-
var language = Object.keys(languages)[0];
|
|
619
|
-
return {
|
|
620
|
-
language: language
|
|
621
|
-
};
|
|
622
|
-
}).catch(function () {
|
|
623
|
-
return null;
|
|
624
|
-
}));
|
|
625
|
-
case 1:
|
|
626
|
-
case "end":
|
|
627
|
-
return _context9.stop();
|
|
628
|
-
}
|
|
629
|
-
}, _callee9);
|
|
630
|
-
}))));
|
|
631
|
-
case 1:
|
|
632
|
-
case "end":
|
|
633
|
-
return _context10.stop();
|
|
634
|
-
}
|
|
635
|
-
}, _callee10);
|
|
636
|
-
}));
|
|
637
|
-
return function get() {
|
|
638
|
-
return _ref26.apply(this, arguments);
|
|
393
|
+
effects: ({
|
|
394
|
+
materialExerciseId,
|
|
395
|
+
exerciseRoomId
|
|
396
|
+
}) => [({
|
|
397
|
+
trigger,
|
|
398
|
+
getPromise,
|
|
399
|
+
setSelf,
|
|
400
|
+
onSet
|
|
401
|
+
}) => {
|
|
402
|
+
const get = async () => {
|
|
403
|
+
setSelf(getOrgMaterialExerciseExerciseRoomUserFileGet({
|
|
404
|
+
exerciseRoomId,
|
|
405
|
+
filename: MULTILANG_ENVIRONMENT_FILENAME
|
|
406
|
+
}).then(res => camelizeKeys(JSON.parse(res.userFile.content))).catch(async () => getPromise(exerciseMultilangLanguagesState(materialExerciseId)).then(languages => {
|
|
407
|
+
if (!languages) {
|
|
408
|
+
throw new Error('err_no_languages');
|
|
409
|
+
}
|
|
410
|
+
const language = Object.keys(languages)[0];
|
|
411
|
+
return {
|
|
412
|
+
language
|
|
639
413
|
};
|
|
640
|
-
}();
|
|
641
|
-
|
|
642
|
-
|
|
414
|
+
}).catch(() => null)));
|
|
415
|
+
};
|
|
416
|
+
if (trigger === 'get') {
|
|
417
|
+
void get();
|
|
418
|
+
}
|
|
419
|
+
onSet((newEnvJson, _, isReset) => {
|
|
420
|
+
if (isReset) {
|
|
421
|
+
return;
|
|
643
422
|
}
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
type: 'application/json'
|
|
652
|
-
}),
|
|
653
|
-
path: '',
|
|
654
|
-
overwrite: true
|
|
655
|
-
});
|
|
423
|
+
void postOrgMaterialExerciseExerciseRoomUserFileAdd({
|
|
424
|
+
exerciseRoomId,
|
|
425
|
+
userFile: new File([JSON.stringify(newEnvJson)], MULTILANG_ENVIRONMENT_FILENAME, {
|
|
426
|
+
type: 'application/json'
|
|
427
|
+
}),
|
|
428
|
+
path: '',
|
|
429
|
+
overwrite: true
|
|
656
430
|
});
|
|
657
|
-
}
|
|
658
|
-
}
|
|
431
|
+
});
|
|
432
|
+
}]
|
|
659
433
|
});
|
|
660
434
|
//
|
|
661
435
|
// =============== arduino ===============
|
|
662
436
|
//
|
|
663
|
-
|
|
664
|
-
|
|
437
|
+
const ARDUINO_ACCOUNT_PREFERENCE_KEY = 'material.exercise.arduino.preference';
|
|
438
|
+
const DEFAULT_ARDUINO_PREFERENCE = {
|
|
665
439
|
baudRate: 9600,
|
|
666
440
|
port: ''
|
|
667
441
|
};
|
|
668
442
|
/**
|
|
669
443
|
* Arduino preference.
|
|
670
444
|
*/
|
|
671
|
-
|
|
672
|
-
key:
|
|
445
|
+
const exerciseArduinoPreferenceState = atom({
|
|
446
|
+
key: `${KEY_PREFIX}/Arduino/Preference`,
|
|
673
447
|
default: DEFAULT_ARDUINO_PREFERENCE,
|
|
674
|
-
effects: [
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
pkey: ARDUINO_ACCOUNT_PREFERENCE_KEY
|
|
687
|
-
}).then(function (res) {
|
|
688
|
-
return Object.assign(Object.assign({}, DEFAULT_ARDUINO_PREFERENCE), res.pvalue);
|
|
689
|
-
}).catch(function () {
|
|
690
|
-
return DEFAULT_ARDUINO_PREFERENCE;
|
|
691
|
-
});
|
|
692
|
-
case 3:
|
|
693
|
-
_context11.t1 = _context11.sent;
|
|
694
|
-
(0, _context11.t0)(_context11.t1);
|
|
695
|
-
case 5:
|
|
696
|
-
case "end":
|
|
697
|
-
return _context11.stop();
|
|
698
|
-
}
|
|
699
|
-
}, _callee11);
|
|
700
|
-
}));
|
|
701
|
-
return function get() {
|
|
702
|
-
return _ref29.apply(this, arguments);
|
|
703
|
-
};
|
|
704
|
-
}();
|
|
448
|
+
effects: [({
|
|
449
|
+
trigger,
|
|
450
|
+
setSelf,
|
|
451
|
+
onSet
|
|
452
|
+
}) => {
|
|
453
|
+
const get = async () => {
|
|
454
|
+
setSelf(await getGlobalAccountPreferenceGet({
|
|
455
|
+
pkey: ARDUINO_ACCOUNT_PREFERENCE_KEY
|
|
456
|
+
}).then(res => {
|
|
457
|
+
return Object.assign(Object.assign({}, DEFAULT_ARDUINO_PREFERENCE), res.pvalue);
|
|
458
|
+
}).catch(() => DEFAULT_ARDUINO_PREFERENCE));
|
|
459
|
+
};
|
|
705
460
|
if (trigger === 'get') {
|
|
706
461
|
void get();
|
|
707
462
|
}
|
|
708
|
-
onSet(
|
|
463
|
+
onSet((newPreference, prevPreference, isReset) => {
|
|
709
464
|
if (!isEqual(newPreference, prevPreference) && !isReset) {
|
|
710
465
|
void postGlobalAccountPreferenceEdit({
|
|
711
466
|
pkey: ARDUINO_ACCOUNT_PREFERENCE_KEY,
|
|
@@ -718,45 +473,45 @@ var exerciseArduinoPreferenceState = atom({
|
|
|
718
473
|
/**
|
|
719
474
|
* Arduino ports.
|
|
720
475
|
*/
|
|
721
|
-
|
|
722
|
-
key:
|
|
476
|
+
const exerciseArduinoPortsState = atom({
|
|
477
|
+
key: `${KEY_PREFIX}/Arduino/Ports`,
|
|
723
478
|
default: []
|
|
724
479
|
});
|
|
725
480
|
/**
|
|
726
481
|
* Opened arduino port.
|
|
727
482
|
*/
|
|
728
|
-
|
|
729
|
-
key:
|
|
483
|
+
const exerciseArduinoOpenedPortNameState = atom({
|
|
484
|
+
key: `${KEY_PREFIX}/Arduino/OpenedPortName`,
|
|
730
485
|
default: null
|
|
731
486
|
});
|
|
732
487
|
/**
|
|
733
488
|
* Arduino port open handler.
|
|
734
489
|
*/
|
|
735
|
-
|
|
736
|
-
key:
|
|
737
|
-
default:
|
|
490
|
+
const exerciseArduinoOnSelectPortState = atom({
|
|
491
|
+
key: `${KEY_PREFIX}/Arduino/OnSelectPort`,
|
|
492
|
+
default: name => {
|
|
738
493
|
// do nothing.
|
|
739
494
|
}
|
|
740
495
|
});
|
|
741
496
|
/**
|
|
742
497
|
* Arduino agent connection status.
|
|
743
498
|
*/
|
|
744
|
-
|
|
745
|
-
key:
|
|
499
|
+
const exerciseArduinoAgentConnectionState = atom({
|
|
500
|
+
key: `${KEY_PREFIX}/Arduino/AgentConnection`,
|
|
746
501
|
default: 'disconnected'
|
|
747
502
|
});
|
|
748
503
|
/**
|
|
749
504
|
* Arduino upload progress.
|
|
750
505
|
*/
|
|
751
|
-
|
|
752
|
-
key:
|
|
506
|
+
const exerciseArduinoUploadProgressState = atom({
|
|
507
|
+
key: `${KEY_PREFIX}/Arduino/UploadProgressState`,
|
|
753
508
|
default: 'ready'
|
|
754
509
|
});
|
|
755
510
|
/**
|
|
756
511
|
* Arduino agent modal open status.
|
|
757
512
|
*/
|
|
758
|
-
|
|
759
|
-
key:
|
|
513
|
+
const exerciseArduinoAgentModalState = atom({
|
|
514
|
+
key: `${KEY_PREFIX}/Arduino/AgentModalState`,
|
|
760
515
|
default: false
|
|
761
516
|
});
|
|
762
517
|
//
|
|
@@ -765,22 +520,22 @@ var exerciseArduinoAgentModalState = atom({
|
|
|
765
520
|
/**
|
|
766
521
|
*
|
|
767
522
|
*/
|
|
768
|
-
|
|
769
|
-
key:
|
|
523
|
+
const exerciseActiveFilenameState = atom({
|
|
524
|
+
key: `${KEY_PREFIX}/ActiveFilename`,
|
|
770
525
|
default: null
|
|
771
526
|
});
|
|
772
527
|
/**
|
|
773
528
|
*
|
|
774
529
|
*/
|
|
775
|
-
|
|
776
|
-
key:
|
|
530
|
+
const exerciseRightpaneActiveState = atom({
|
|
531
|
+
key: `${KEY_PREFIX}/RightpaneActive`,
|
|
777
532
|
default: null
|
|
778
533
|
});
|
|
779
534
|
/**
|
|
780
535
|
*
|
|
781
536
|
*/
|
|
782
|
-
|
|
783
|
-
key:
|
|
537
|
+
const exerciseContainerSizeState = atom({
|
|
538
|
+
key: `${KEY_PREFIX}/ContainerSize`,
|
|
784
539
|
default: {
|
|
785
540
|
width: 0,
|
|
786
541
|
height: 0
|
|
@@ -789,15 +544,15 @@ var exerciseContainerSizeState = atom({
|
|
|
789
544
|
/**
|
|
790
545
|
*
|
|
791
546
|
*/
|
|
792
|
-
|
|
793
|
-
key:
|
|
547
|
+
const exerciseAibotInfoEnableState = atom({
|
|
548
|
+
key: `${KEY_PREFIX}/AibotInfoEnable`,
|
|
794
549
|
default: false
|
|
795
550
|
});
|
|
796
551
|
/**
|
|
797
552
|
*
|
|
798
553
|
*/
|
|
799
|
-
|
|
800
|
-
key:
|
|
554
|
+
const exerciseFileEditorCursorState = atom({
|
|
555
|
+
key: `${KEY_PREFIX}/FileEditorCursor`,
|
|
801
556
|
default: {
|
|
802
557
|
from: 0,
|
|
803
558
|
to: 0
|
|
@@ -806,15 +561,15 @@ var exerciseFileEditorCursorState = atom({
|
|
|
806
561
|
/**
|
|
807
562
|
*
|
|
808
563
|
*/
|
|
809
|
-
|
|
810
|
-
key:
|
|
564
|
+
const exerciseFileEditorCursorSelectionValueState = atom({
|
|
565
|
+
key: `${KEY_PREFIX}/FileEditorCursorSelectionValue`,
|
|
811
566
|
default: null
|
|
812
567
|
});
|
|
813
568
|
/**
|
|
814
569
|
*
|
|
815
570
|
*/
|
|
816
|
-
|
|
817
|
-
key:
|
|
571
|
+
const exerciseMonacoEditorApisState = atom({
|
|
572
|
+
key: `${KEY_PREFIX}/MonacoEditorApisState`,
|
|
818
573
|
default: null,
|
|
819
574
|
dangerouslyAllowMutability: true
|
|
820
575
|
});
|