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