@elice/material-exercise 1.231212.0 → 1.231228.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/components/material-exercise/MaterialExercise.i18n.js +2 -4
- package/cjs/components/material-exercise/MaterialExercise.js +54 -59
- package/cjs/components/material-exercise/MaterialExercise.styled.js +14 -20
- package/cjs/components/material-exercise/MaterialExerciseMobile.js +8 -15
- package/cjs/components/material-exercise/context/ExerciseIntlProvider.js +14 -18
- package/cjs/components/material-exercise/context/ExerciseProvider.js +58 -66
- package/cjs/components/material-exercise/context/ExerciseProviderNoImage.js +19 -24
- package/cjs/components/material-exercise/context/context.js +1 -7
- package/cjs/components/material-exercise/context/locales/noImage.en.json.js +1 -1
- package/cjs/components/material-exercise/context/locales/noImage.ko.json.js +1 -1
- package/cjs/components/material-exercise/context/recoil.js +293 -544
- package/cjs/components/material-exercise/context/recoilTypes.js +0 -2
- package/cjs/components/material-exercise/context/subjects.js +3 -5
- package/cjs/components/material-exercise/exercise-code-history/ExerciseCodeHistory.js +60 -67
- package/cjs/components/material-exercise/exercise-code-history/ExerciseCodeHistory.styled.js +8 -14
- package/cjs/components/material-exercise/exercise-code-history/locales/en.json.js +1 -1
- package/cjs/components/material-exercise/exercise-code-history/locales/ko.json.js +1 -1
- package/cjs/components/material-exercise/exercise-file/ExerciseFile.js +17 -21
- package/cjs/components/material-exercise/exercise-file-editor/ExerciseFileEditor.js +133 -203
- package/cjs/components/material-exercise/exercise-file-editor/ExerciseFileReadOnlyBanner.js +8 -12
- package/cjs/components/material-exercise/exercise-file-tabs/ExerciseFileTabs.js +24 -40
- package/cjs/components/material-exercise/exercise-file-tabs/ExerciseFileTabsFileTreeButton.js +38 -52
- package/cjs/components/material-exercise/exercise-file-tabs/ExerciseFileTabsLazy.js +5 -9
- package/cjs/components/material-exercise/exercise-file-tabs/locales/fileTreeButton.en.json.js +1 -1
- package/cjs/components/material-exercise/exercise-file-tabs/locales/fileTreeButton.ko.json.js +1 -1
- package/cjs/components/material-exercise/exercise-file-tree/ExerciseFileTree.js +189 -328
- package/cjs/components/material-exercise/exercise-file-tree/ExerciseFileTreeLazy.js +5 -9
- package/cjs/components/material-exercise/exercise-file-tree/locales/en.json.js +1 -1
- package/cjs/components/material-exercise/exercise-file-tree/locales/ko.json.js +1 -1
- package/cjs/components/material-exercise/exercise-file-viewer/ExerciseFileViewer.js +14 -17
- package/cjs/components/material-exercise/exercise-menu/ExerciseMenu.js +11 -15
- package/cjs/components/material-exercise/exercise-menu/ExerciseMenuArduinoAgentModalButton.js +7 -11
- package/cjs/components/material-exercise/exercise-menu/ExerciseMenuArduinoSettings.js +44 -65
- package/cjs/components/material-exercise/exercise-menu/ExerciseMenuDropdown.js +32 -61
- package/cjs/components/material-exercise/exercise-menu/ExerciseMenuReset.js +19 -35
- package/cjs/components/material-exercise/exercise-menu/ExerciseMenuStdioFileBrowser.js +48 -62
- package/cjs/components/material-exercise/exercise-menu/ExerciseMenuStdioFileBrowser.styled.js +12 -18
- package/cjs/components/material-exercise/exercise-menu/locales/en.json.js +1 -1
- package/cjs/components/material-exercise/exercise-menu/locales/ko.json.js +1 -1
- package/cjs/components/material-exercise/exercise-multilang-dropdown/ExerciseMultilangDropdown.js +21 -32
- package/cjs/components/material-exercise/exercise-multilang-dropdown/ExerciseMultilangDropdownLazy.js +4 -8
- package/cjs/components/material-exercise/exercise-preview/ExercisePreview.js +23 -27
- package/cjs/components/material-exercise/exercise-preview/ExercisePreviewDisplayModeButton.js +7 -17
- package/cjs/components/material-exercise/exercise-preview/locales/en.json.js +1 -1
- package/cjs/components/material-exercise/exercise-preview/locales/ko.json.js +1 -1
- package/cjs/components/material-exercise/exercise-rightpane/ExerciseRightpane.js +23 -32
- package/cjs/components/material-exercise/exercise-rightpane/ExerciseRightpaneEditorPerference.js +7 -15
- package/cjs/components/material-exercise/exercise-rightpane/ExerciseRightpaneEnvironment.js +79 -86
- package/cjs/components/material-exercise/exercise-rightpane/locales/en.json.js +1 -1
- package/cjs/components/material-exercise/exercise-rightpane/locales/ko.json.js +1 -1
- package/cjs/components/material-exercise/exercise-room/ExerciseRoom.js +11 -22
- package/cjs/components/material-exercise/exercise-room/ExerciseRoom.styled.js +12 -20
- package/cjs/components/material-exercise/exercise-room/ExerciseRoomDetail.js +180 -288
- package/cjs/components/material-exercise/exercise-room/ExerciseRoomList.js +82 -116
- package/cjs/components/material-exercise/exercise-room/helpers/exerciseRoomPermissionStringConvertor.js +2 -4
- package/cjs/components/material-exercise/exercise-room/locales/en.json.js +1 -1
- package/cjs/components/material-exercise/exercise-room/locales/ko.json.js +1 -1
- package/cjs/components/material-exercise/exercise-runner/ExerciseRunner.js +125 -181
- package/cjs/components/material-exercise/exercise-runner/ExerciseRunnerContext.js +1 -7
- package/cjs/components/material-exercise/exercise-runner/ExerciseRunnerController.js +13 -17
- package/cjs/components/material-exercise/exercise-runner/ExerciseRunnerControllerArduinoAgentModal.js +43 -58
- package/cjs/components/material-exercise/exercise-runner/ExerciseRunnerControllerArduinoStatusMessage.js +15 -27
- package/cjs/components/material-exercise/exercise-runner/ExerciseRunnerControllerButtonGroup.js +65 -68
- package/cjs/components/material-exercise/exercise-runner/ExerciseRunnerControllerCodeHelpRequestButton.js +23 -32
- package/cjs/components/material-exercise/exercise-runner/ExerciseRunnerControllerRunningInfo.js +58 -92
- package/cjs/components/material-exercise/exercise-runner/ExerciseRunnerControllerStatusIndicator.js +3 -7
- package/cjs/components/material-exercise/exercise-runner/ExerciseRunnerControllerStatusMessage.js +11 -16
- package/cjs/components/material-exercise/exercise-runner/ExerciseRunnerControllerTimer.js +18 -29
- package/cjs/components/material-exercise/exercise-runner/locales/en.json.js +1 -1
- package/cjs/components/material-exercise/exercise-runner/locales/ko.json.js +1 -1
- package/cjs/components/material-exercise/exercise-submit-history/ExerciseSubmitHistory.js +162 -282
- package/cjs/components/material-exercise/exercise-submit-history/ExerciseSubmitHistory.styled.js +8 -14
- package/cjs/components/material-exercise/exercise-submit-history/ExerciseSubmitHistoryOutput.js +41 -54
- package/cjs/components/material-exercise/exercise-submit-history/locales/en.json.js +1 -1
- package/cjs/components/material-exercise/exercise-submit-history/locales/ko.json.js +1 -1
- package/cjs/components/shared/exercise-menu-button/ExerciseMenuButton.js +15 -21
- package/cjs/components/shared/exercise-shimmer/ExerciseFileShimmer.js +14 -19
- package/cjs/components/shared/exercise-shimmer/ExerciseFileTabShimmer.js +16 -21
- package/cjs/components/shared/exercise-shimmer/ExerciseFileTabsShimmer.js +5 -10
- package/cjs/components/shared/exercise-shimmer/ExerciseFileTreeListItemShimmer.js +18 -23
- package/cjs/components/shared/exercise-shimmer/ExerciseFileTreeListShimmer.js +10 -21
- package/cjs/components/shared/exercise-version-list/ExerciseVersionList.js +5 -8
- package/cjs/components/shared/exercise-version-list/ExerciseVersionList.styled.js +1 -7
- package/cjs/components/shared/exercise-version-list/ExerciseVersionListItem.js +8 -11
- package/cjs/components/shared/exercise-version-list/ExerciseVersionListItem.styled.js +5 -15
- package/cjs/components/shared/file-icon/FileIcon.js +17 -23
- package/cjs/components/shared/file-tabs/FileTab.js +30 -36
- package/cjs/components/shared/file-tabs/FileTab.styled.js +15 -25
- package/cjs/components/shared/file-tabs/FileTabs.js +38 -63
- package/cjs/components/shared/file-tabs/FileTabs.styled.js +2 -8
- package/cjs/components/shared/file-tabs/util.js +14 -29
- package/cjs/components/shared/file-tree/FileTree.js +12 -17
- package/cjs/components/shared/file-tree/FileTreeConfig.js +22 -25
- package/cjs/components/shared/file-tree/FileTreeList.js +37 -39
- package/cjs/components/shared/file-tree/FileTreeListItemContent.js +61 -75
- package/cjs/components/shared/file-tree/FileTreeListItemContent.styled.js +21 -31
- package/cjs/components/shared/file-tree/FileTreeListItemContentInput.js +64 -72
- package/cjs/components/shared/file-tree/FileTreeListItemContentInput.styled.js +6 -12
- package/cjs/components/shared/file-tree/FileTreeListItemContentMenu.js +63 -74
- package/cjs/components/shared/file-tree/FileTreeListItems.js +136 -151
- package/cjs/components/shared/file-tree/FileTreeListItems.styled.js +2 -8
- package/cjs/components/shared/file-tree/FileTreeToolbar.js +31 -32
- package/cjs/components/shared/file-tree/FileTreeToolbar.styled.js +1 -7
- package/cjs/components/shared/file-tree/context/FileTreeContext.js +76 -97
- package/cjs/components/shared/file-tree/locales/en.json.js +1 -1
- package/cjs/components/shared/file-tree/locales/ko.json.js +1 -1
- package/cjs/components/shared/file-tree/utils/fileTreeFiles.js +20 -26
- package/cjs/components/shared/file-tree/utils/fileTreeGenerator.js +146 -195
- package/cjs/components/shared/file-tree/utils/fileTreeInput.js +0 -2
- package/cjs/components/shared/file-tree/utils/fileTreeItem.js +1 -3
- package/cjs/components/shared/file-tree/utils/fileTreePath.js +6 -7
- package/cjs/components/shared/file-viewer/FileViewer.js +37 -61
- package/cjs/components/shared/file-viewer/FileViewerCsv.js +108 -172
- package/cjs/components/shared/file-viewer/FileViewerImage.js +8 -12
- package/cjs/components/shared/file-viewer/FileViewerIpynb.js +10 -23
- package/cjs/components/shared/file-viewer/FileViewerNonViewable.js +33 -42
- package/cjs/components/shared/file-viewer/FileViewerText.js +12 -24
- package/cjs/components/shared/file-viewer/locales/en.json.js +1 -1
- package/cjs/components/shared/file-viewer/locales/ko.json.js +1 -1
- package/cjs/components/shared/file-viewer/locales/nonViewable.en.json.js +1 -1
- package/cjs/components/shared/file-viewer/locales/nonViewable.ko.json.js +1 -1
- package/cjs/components/shared/material-modal/MaterialModal.js +11 -14
- package/cjs/components/shared/material-modal/MaterialModal.styled.js +5 -11
- package/cjs/components/shared/monaco-editor/MonacoEditor.js +74 -99
- package/cjs/components/shared/monaco-editor/MonacoEditorLazy.js +6 -12
- package/cjs/components/shared/monaco-editor/MonacoEditorMobile.js +36 -50
- package/cjs/components/shared/monaco-editor/MonacoEditorPerferenceForm.js +91 -110
- package/cjs/components/shared/monaco-editor/constants/grammars/JSON.tmLanguage.json.js +1 -1
- package/cjs/components/shared/monaco-editor/constants/grammars/MagicPython.tmLanguage.json.js +1 -1
- package/cjs/components/shared/monaco-editor/constants/grammars/TypeScriptReact.tmLanguage.json.js +1 -1
- package/cjs/components/shared/monaco-editor/constants/grammars/asp-vb-net.tmlanguage.json.js +1 -1
- package/cjs/components/shared/monaco-editor/constants/grammars/c.tmLanguage.json.js +1 -1
- package/cjs/components/shared/monaco-editor/constants/grammars/cpp.tmLanguage.json.js +1 -1
- package/cjs/components/shared/monaco-editor/constants/grammars/csharp.tmLanguage.json.js +1 -1
- package/cjs/components/shared/monaco-editor/constants/grammars/css.tmLanguage.json.js +1 -1
- package/cjs/components/shared/monaco-editor/constants/grammars/dart.tmLanguage.json.js +1 -1
- package/cjs/components/shared/monaco-editor/constants/grammars/fsharp.tmLanguage.json.js +1 -1
- package/cjs/components/shared/monaco-editor/constants/grammars/go.tmLanguage.json.js +1 -1
- package/cjs/components/shared/monaco-editor/constants/grammars/html.tmLanguage.json.js +1 -1
- package/cjs/components/shared/monaco-editor/constants/grammars/index.js +28 -84
- package/cjs/components/shared/monaco-editor/constants/grammars/java.tmLanguage.json.js +1 -1
- package/cjs/components/shared/monaco-editor/constants/grammars/lua.tmLanguage.json.js +1 -1
- package/cjs/components/shared/monaco-editor/constants/grammars/objective-c.tmLanguage.json.js +1 -1
- package/cjs/components/shared/monaco-editor/constants/grammars/php.tmLanguage.json.js +1 -1
- package/cjs/components/shared/monaco-editor/constants/grammars/r.tmLanguage.json.js +1 -1
- package/cjs/components/shared/monaco-editor/constants/grammars/ruby.tmLanguage.json.js +1 -1
- package/cjs/components/shared/monaco-editor/constants/grammars/rust.tmLanguage.json.js +1 -1
- package/cjs/components/shared/monaco-editor/constants/grammars/scss.tmLanguage.json.js +1 -1
- package/cjs/components/shared/monaco-editor/constants/grammars/sql.tmLanguage.json.js +1 -1
- package/cjs/components/shared/monaco-editor/constants/grammars/swift.tmLanguage.json.js +1 -1
- package/cjs/components/shared/monaco-editor/constants/grammars/xml.tmLanguage.json.js +1 -1
- package/cjs/components/shared/monaco-editor/constants/grammars/yaml.tmLanguage.json.js +1 -1
- package/cjs/components/shared/monaco-editor/constants/monaco/preferences.js +5 -7
- package/cjs/components/shared/monaco-editor/constants/themes/abyss.json.js +1 -1
- package/cjs/components/shared/monaco-editor/constants/themes/elice.json.js +1 -1
- package/cjs/components/shared/monaco-editor/constants/themes/index.js +17 -51
- package/cjs/components/shared/monaco-editor/constants/themes/kimbie-dark.json.js +1 -1
- package/cjs/components/shared/monaco-editor/constants/themes/monokai.json.js +1 -1
- package/cjs/components/shared/monaco-editor/constants/themes/quietlight.json.js +1 -1
- package/cjs/components/shared/monaco-editor/constants/themes/red.json.js +1 -1
- package/cjs/components/shared/monaco-editor/constants/themes/solarized-dark.json.js +1 -1
- package/cjs/components/shared/monaco-editor/constants/themes/solarized-light.json.js +1 -1
- package/cjs/components/shared/monaco-editor/constants/themes/tomorrow-night-blue.json.js +1 -1
- package/cjs/components/shared/monaco-editor/constants/themes/vs-dark-plus.json.js +1 -1
- package/cjs/components/shared/monaco-editor/constants/themes/vs-dark.json.js +1 -1
- package/cjs/components/shared/monaco-editor/constants/themes/vs-hc-black.json.js +1 -1
- package/cjs/components/shared/monaco-editor/constants/themes/vs-hc-light.json.js +1 -1
- package/cjs/components/shared/monaco-editor/constants/themes/vs-light-plus.json.js +1 -1
- package/cjs/components/shared/monaco-editor/constants/themes/vs-light.json.js +1 -1
- package/cjs/components/shared/monaco-editor/editor-hooks/useMonacoEventChange.js +10 -13
- package/cjs/components/shared/monaco-editor/editor-hooks/useMonacoEventCursor.js +14 -17
- package/cjs/components/shared/monaco-editor/editor-hooks/useMonacoEventScroll.js +8 -11
- package/cjs/components/shared/monaco-editor/editor-hooks/useMonacoMarkers.js +30 -36
- package/cjs/components/shared/monaco-editor/editor-hooks/useMonacoOptions.js +7 -11
- package/cjs/components/shared/monaco-editor/editor-hooks/useMonacoTheme.js +6 -8
- package/cjs/components/shared/monaco-editor/editor-languages/css/formatter.js +11 -52
- package/cjs/components/shared/monaco-editor/editor-languages/css/index.js +7 -8
- package/cjs/components/shared/monaco-editor/editor-languages/html/formatter.js +11 -52
- package/cjs/components/shared/monaco-editor/editor-languages/html/index.js +5 -6
- package/cjs/components/shared/monaco-editor/editor-languages/index.js +4 -4
- package/cjs/components/shared/monaco-editor/editor-languages/typescript/dts/_helper.js +1 -3
- package/cjs/components/shared/monaco-editor/editor-languages/typescript/dts/express.js +1 -1
- package/cjs/components/shared/monaco-editor/editor-languages/typescript/dts/propTypes.js +1 -1
- package/cjs/components/shared/monaco-editor/editor-languages/typescript/dts/react.js +1 -1
- package/cjs/components/shared/monaco-editor/editor-languages/typescript/formatter.js +11 -56
- package/cjs/components/shared/monaco-editor/editor-languages/typescript/index.js +17 -18
- package/cjs/components/shared/monaco-editor/hooks/useEditorOptions.js +5 -13
- package/cjs/components/shared/monaco-editor/locales/en.json.js +1 -1
- package/cjs/components/shared/monaco-editor/locales/ko.json.js +1 -1
- package/cjs/components/shared/monaco-editor/utils/emmet/abbreviationActions.js +12 -12
- package/cjs/components/shared/monaco-editor/utils/emmet/emmet.js +0 -2
- package/cjs/components/shared/monaco-editor/utils/emmet/registerProvider.js +6 -14
- package/cjs/components/shared/monaco-editor/utils/grammar/index.js +25 -69
- package/cjs/components/shared/monaco-editor/utils/grammar/onigasm.js +6 -27
- package/cjs/components/shared/monaco-editor/utils/grammar/textmate.js +38 -73
- package/cjs/components/shared/monaco-editor/utils/monacoLanguage.js +8 -11
- package/cjs/components/shared/monaco-editor/utils/monacoPreference.js +4 -8
- package/cjs/components/shared/monaco-editor/utils/prettier/config.js +2 -4
- package/cjs/components/shared/monaco-editor/utils/prettier/index.js +8 -46
- package/cjs/components/shared/monaco-editor/utils/theme/convert.js +14 -26
- package/cjs/components/shared/monaco-editor/utils/theme/index.js +3 -24
- package/cjs/components/shared/monaco-editor/vendors/monaco-collab-ext/RemoteCursor.js +56 -79
- package/cjs/components/shared/monaco-editor/vendors/monaco-collab-ext/RemoteCursorManager.js +68 -84
- package/cjs/components/shared/monaco-editor/vendors/monaco-collab-ext/RemoteCursorWidget.js +93 -122
- package/cjs/components/shared/monaco-editor/vendors/monaco-collab-ext/RemoteSelection.js +133 -158
- package/cjs/components/shared/monaco-editor/vendors/monaco-collab-ext/RemoteSelectionManager.js +92 -106
- package/cjs/components/shared/monaco-editor/vendors/monaco-collab-ext/styles.js +2 -4
- package/cjs/components/shared/monaco-editor/vendors/vscode-emmet-helper/configCompat.js +6 -3
- package/cjs/components/shared/monaco-editor/vendors/vscode-emmet-helper/data.js +2 -4
- package/cjs/components/shared/monaco-editor/vendors/vscode-emmet-helper/emmetHelper.js +158 -179
- package/cjs/components/shared/monaco-editor/vendors/vscode-emmet-helper/utils.js +3 -5
- package/cjs/components/shared/no-vnc/NoVnc.js +57 -86
- package/cjs/components/shared/no-vnc/NoVncLazy.js +5 -11
- package/cjs/components/shared/preview-container/PreviewContainer.js +11 -15
- package/cjs/components/shared/web-browser/WebBrowser.js +37 -53
- package/cjs/components/shared/xterm/Xterm.js +58 -81
- package/cjs/components/shared/xterm/XtermLazy.js +5 -11
- package/cjs/components/shared/xterm/locales/en.json.js +1 -1
- package/cjs/components/shared/xterm/locales/ko.json.js +1 -1
- package/cjs/components/shared/xterm/utils/index.js +0 -2
- package/cjs/constants/arduino.js +10 -12
- package/cjs/constants/shortcutKeyMap.js +2 -4
- package/cjs/constants/stylesheets.js +5 -9
- package/cjs/hooks/useArduino.js +141 -284
- package/cjs/hooks/useExerciseFile.js +22 -26
- package/cjs/hooks/useExericseShortcut.js +4 -8
- package/cjs/hooks/useMaterialExerciseFileUrl.js +33 -57
- package/cjs/hooks/useRunnerRoomWebSocket.js +27 -53
- package/cjs/hooks/useStdioTextConcator.js +10 -22
- package/cjs/hooks/useStdioWebSocket.js +28 -34
- package/cjs/hooks/useUsercodeEditWebSocket.js +158 -240
- package/cjs/hooks/useUsercodeHistory.js +63 -117
- package/cjs/index.js +4 -6
- package/cjs/utils/arduino.js +11 -25
- package/cjs/utils/exerciseFile.js +10 -10
- package/cjs/utils/runner.js +15 -31
- package/es/components/material-exercise/MaterialExercise.i18n.js +2 -2
- package/es/components/material-exercise/MaterialExercise.js +34 -35
- package/es/components/material-exercise/MaterialExercise.styled.js +14 -14
- package/es/components/material-exercise/MaterialExerciseMobile.js +6 -9
- package/es/components/material-exercise/context/ExerciseIntlProvider.js +10 -8
- package/es/components/material-exercise/context/ExerciseProvider.js +52 -55
- package/es/components/material-exercise/context/ExerciseProviderNoImage.js +10 -10
- 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 +3 -3
- package/es/components/material-exercise/exercise-code-history/ExerciseCodeHistory.js +51 -53
- package/es/components/material-exercise/exercise-code-history/ExerciseCodeHistory.styled.js +8 -8
- package/es/components/material-exercise/exercise-file/ExerciseFile.js +9 -8
- package/es/components/material-exercise/exercise-file-editor/ExerciseFileEditor.js +127 -193
- package/es/components/material-exercise/exercise-file-editor/ExerciseFileReadOnlyBanner.js +5 -4
- package/es/components/material-exercise/exercise-file-tabs/ExerciseFileTabs.js +20 -31
- package/es/components/material-exercise/exercise-file-tabs/ExerciseFileTabsFileTreeButton.js +35 -44
- package/es/components/material-exercise/exercise-file-tabs/ExerciseFileTabsLazy.js +1 -1
- package/es/components/material-exercise/exercise-file-tree/ExerciseFileTree.js +181 -315
- package/es/components/material-exercise/exercise-file-tree/ExerciseFileTreeLazy.js +1 -1
- package/es/components/material-exercise/exercise-file-viewer/ExerciseFileViewer.js +11 -10
- package/es/components/material-exercise/exercise-menu/ExerciseMenu.js +7 -6
- package/es/components/material-exercise/exercise-menu/ExerciseMenuArduinoAgentModalButton.js +3 -3
- package/es/components/material-exercise/exercise-menu/ExerciseMenuArduinoSettings.js +25 -42
- package/es/components/material-exercise/exercise-menu/ExerciseMenuDropdown.js +26 -51
- package/es/components/material-exercise/exercise-menu/ExerciseMenuReset.js +11 -23
- package/es/components/material-exercise/exercise-menu/ExerciseMenuStdioFileBrowser.js +21 -31
- package/es/components/material-exercise/exercise-menu/ExerciseMenuStdioFileBrowser.styled.js +12 -12
- package/es/components/material-exercise/exercise-multilang-dropdown/ExerciseMultilangDropdown.js +19 -26
- package/es/components/material-exercise/exercise-multilang-dropdown/ExerciseMultilangDropdownLazy.js +1 -1
- package/es/components/material-exercise/exercise-preview/ExercisePreview.js +15 -14
- package/es/components/material-exercise/exercise-preview/ExercisePreviewDisplayModeButton.js +5 -11
- package/es/components/material-exercise/exercise-rightpane/ExerciseRightpane.js +11 -15
- package/es/components/material-exercise/exercise-rightpane/ExerciseRightpaneEditorPerference.js +5 -9
- package/es/components/material-exercise/exercise-rightpane/ExerciseRightpaneEnvironment.js +78 -80
- package/es/components/material-exercise/exercise-room/ExerciseRoom.js +6 -13
- package/es/components/material-exercise/exercise-room/ExerciseRoom.styled.js +12 -14
- package/es/components/material-exercise/exercise-room/ExerciseRoomDetail.js +134 -236
- package/es/components/material-exercise/exercise-room/ExerciseRoomList.js +65 -94
- package/es/components/material-exercise/exercise-room/helpers/exerciseRoomPermissionStringConvertor.js +2 -2
- package/es/components/material-exercise/exercise-runner/ExerciseRunner.js +116 -167
- package/es/components/material-exercise/exercise-runner/ExerciseRunnerContext.js +1 -1
- package/es/components/material-exercise/exercise-runner/ExerciseRunnerController.js +8 -7
- package/es/components/material-exercise/exercise-runner/ExerciseRunnerControllerArduinoAgentModal.js +17 -27
- package/es/components/material-exercise/exercise-runner/ExerciseRunnerControllerArduinoStatusMessage.js +11 -18
- package/es/components/material-exercise/exercise-runner/ExerciseRunnerControllerButtonGroup.js +52 -50
- package/es/components/material-exercise/exercise-runner/ExerciseRunnerControllerCodeHelpRequestButton.js +10 -14
- package/es/components/material-exercise/exercise-runner/ExerciseRunnerControllerRunningInfo.js +46 -75
- package/es/components/material-exercise/exercise-runner/ExerciseRunnerControllerStatusIndicator.js +2 -2
- package/es/components/material-exercise/exercise-runner/ExerciseRunnerControllerStatusMessage.js +4 -4
- package/es/components/material-exercise/exercise-runner/ExerciseRunnerControllerTimer.js +15 -21
- package/es/components/material-exercise/exercise-submit-history/ExerciseSubmitHistory.js +138 -253
- package/es/components/material-exercise/exercise-submit-history/ExerciseSubmitHistory.styled.js +8 -8
- package/es/components/material-exercise/exercise-submit-history/ExerciseSubmitHistoryOutput.js +29 -37
- package/es/components/shared/exercise-menu-button/ExerciseMenuButton.js +12 -13
- package/es/components/shared/exercise-shimmer/ExerciseFileShimmer.js +2 -2
- package/es/components/shared/exercise-shimmer/ExerciseFileTabShimmer.js +12 -12
- package/es/components/shared/exercise-shimmer/ExerciseFileTabsShimmer.js +2 -2
- package/es/components/shared/exercise-shimmer/ExerciseFileTreeListItemShimmer.js +14 -14
- package/es/components/shared/exercise-shimmer/ExerciseFileTreeListShimmer.js +9 -15
- package/es/components/shared/exercise-version-list/ExerciseVersionList.js +3 -2
- package/es/components/shared/exercise-version-list/ExerciseVersionList.styled.js +1 -1
- package/es/components/shared/exercise-version-list/ExerciseVersionListItem.js +6 -5
- package/es/components/shared/exercise-version-list/ExerciseVersionListItem.styled.js +5 -9
- package/es/components/shared/file-icon/FileIcon.js +15 -17
- package/es/components/shared/file-tabs/FileTab.js +22 -24
- package/es/components/shared/file-tabs/FileTab.styled.js +15 -19
- package/es/components/shared/file-tabs/FileTabs.js +35 -55
- 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 +3 -3
- package/es/components/shared/file-tree/FileTreeConfig.js +18 -15
- package/es/components/shared/file-tree/FileTreeList.js +33 -29
- package/es/components/shared/file-tree/FileTreeListItemContent.js +45 -55
- package/es/components/shared/file-tree/FileTreeListItemContent.styled.js +21 -25
- package/es/components/shared/file-tree/FileTreeListItemContentInput.js +60 -64
- package/es/components/shared/file-tree/FileTreeListItemContentInput.styled.js +6 -6
- package/es/components/shared/file-tree/FileTreeListItemContentMenu.js +39 -46
- package/es/components/shared/file-tree/FileTreeListItems.js +134 -145
- package/es/components/shared/file-tree/FileTreeListItems.styled.js +2 -2
- package/es/components/shared/file-tree/FileTreeToolbar.js +25 -22
- package/es/components/shared/file-tree/FileTreeToolbar.styled.js +1 -1
- package/es/components/shared/file-tree/context/FileTreeContext.js +74 -89
- 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/fileTreeItem.js +1 -1
- package/es/components/shared/file-tree/utils/fileTreePath.js +6 -5
- package/es/components/shared/file-viewer/FileViewer.js +21 -38
- package/es/components/shared/file-viewer/FileViewerCsv.js +70 -129
- package/es/components/shared/file-viewer/FileViewerImage.js +4 -3
- package/es/components/shared/file-viewer/FileViewerIpynb.js +7 -14
- package/es/components/shared/file-viewer/FileViewerNonViewable.js +15 -18
- package/es/components/shared/file-viewer/FileViewerText.js +9 -17
- package/es/components/shared/material-modal/MaterialModal.js +8 -7
- package/es/components/shared/material-modal/MaterialModal.styled.js +5 -5
- package/es/components/shared/monaco-editor/MonacoEditor.js +67 -87
- package/es/components/shared/monaco-editor/MonacoEditorLazy.js +2 -4
- package/es/components/shared/monaco-editor/MonacoEditorMobile.js +31 -41
- package/es/components/shared/monaco-editor/MonacoEditorPerferenceForm.js +52 -66
- 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 -68
- 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 +157 -172
- package/es/components/shared/monaco-editor/vendors/vscode-emmet-helper/utils.js +3 -3
- package/es/components/shared/no-vnc/NoVnc.js +42 -59
- package/es/components/shared/no-vnc/NoVncLazy.js +2 -4
- package/es/components/shared/preview-container/PreviewContainer.js +8 -7
- package/es/components/shared/web-browser/WebBrowser.js +29 -40
- package/es/components/shared/xterm/Xterm.js +51 -69
- package/es/components/shared/xterm/XtermLazy.js +2 -4
- package/es/constants/arduino.js +10 -10
- 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 +10 -16
- 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 +11 -23
- package/es/utils/exerciseFile.js +10 -8
- package/es/utils/runner.js +15 -29
- package/package.json +11 -7
- package/cjs/_virtual/_rollupPluginBabelHelpers.js +0 -521
- package/es/_virtual/_rollupPluginBabelHelpers.js +0 -499
|
@@ -1,20 +1,14 @@
|
|
|
1
|
-
import { toConsumableArray as _toConsumableArray, createClass as _createClass, classCallCheck as _classCallCheck, createForOfIteratorHelper as _createForOfIteratorHelper } from '../../../../_virtual/_rollupPluginBabelHelpers.js';
|
|
2
1
|
import { getTitle } from './fileTreeItem.js';
|
|
3
2
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
openedDirectoryList = _ref$openedDirectoryL === void 0 ? [] : _ref$openedDirectoryL,
|
|
14
|
-
renameInputPath = _ref.renameInputPath,
|
|
15
|
-
_ref$initialOpenFilel = _ref.initialOpenFilelist,
|
|
16
|
-
initialOpenFilelist = _ref$initialOpenFilel === void 0 ? [] : _ref$initialOpenFilel;
|
|
17
|
-
_classCallCheck(this, FileTreeRoot);
|
|
3
|
+
class FileTreeRoot {
|
|
4
|
+
constructor({
|
|
5
|
+
imageFilelist = [],
|
|
6
|
+
readOnlyFilelist = [],
|
|
7
|
+
hiddenFilelist = [],
|
|
8
|
+
openedDirectoryList = [],
|
|
9
|
+
renameInputPath,
|
|
10
|
+
initialOpenFilelist = []
|
|
11
|
+
}) {
|
|
18
12
|
this.root = new FileTreeNode({
|
|
19
13
|
path: '',
|
|
20
14
|
expanded: true,
|
|
@@ -28,147 +22,116 @@ var FileTreeRoot = /*#__PURE__*/function () {
|
|
|
28
22
|
this.renameInputPath = renameInputPath;
|
|
29
23
|
this.initialOpenFilelist = initialOpenFilelist;
|
|
30
24
|
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
var grandParentNode = this.getParentNode(parentPath);
|
|
63
|
-
var parentNode = this.createDirectoryNode(parentPath, grandParentNode.path);
|
|
64
|
-
grandParentNode.children.push(parentNode);
|
|
65
|
-
grandParentNode.children = arrangeFileAndDirectoryNameByPath(grandParentNode.children);
|
|
66
|
-
this.directoryNodes[parentPath] = parentNode;
|
|
67
|
-
return parentNode;
|
|
68
|
-
}
|
|
25
|
+
createDirectoryNode(path, parentPath) {
|
|
26
|
+
return new FileTreeNode({
|
|
27
|
+
path,
|
|
28
|
+
expanded: this.openedDirectoryList.includes(path),
|
|
29
|
+
isDirectory: true,
|
|
30
|
+
isRenaming: path === this.renameInputPath,
|
|
31
|
+
parentPath
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
createFileNode(path, parentPath) {
|
|
35
|
+
return new FileTreeNode({
|
|
36
|
+
path,
|
|
37
|
+
isRenaming: path === this.renameInputPath,
|
|
38
|
+
parentPath,
|
|
39
|
+
isInitialOpen: this.initialOpenFilelist.includes(path)
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
getParentNode(path) {
|
|
43
|
+
const parentPath = getParentPath(path);
|
|
44
|
+
// root scope
|
|
45
|
+
if (!parentPath) {
|
|
46
|
+
return this.root;
|
|
47
|
+
} else if (this.directoryNodes[parentPath]) {
|
|
48
|
+
return this.directoryNodes[parentPath];
|
|
49
|
+
} else {
|
|
50
|
+
const grandParentNode = this.getParentNode(parentPath);
|
|
51
|
+
const parentNode = this.createDirectoryNode(parentPath, grandParentNode.path);
|
|
52
|
+
grandParentNode.children.push(parentNode);
|
|
53
|
+
grandParentNode.children = arrangeFileAndDirectoryNameByPath(grandParentNode.children);
|
|
54
|
+
this.directoryNodes[parentPath] = parentNode;
|
|
55
|
+
return parentNode;
|
|
69
56
|
}
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
this.directoryNodes[cleanPath] = node;
|
|
83
|
-
parentNode.children.push(node);
|
|
84
|
-
parentNode.children = arrangeFileAndDirectoryNameByPath(parentNode.children);
|
|
85
|
-
}
|
|
86
|
-
} else {
|
|
87
|
-
// file
|
|
88
|
-
parentNode = this.getParentNode(path);
|
|
89
|
-
node = this.createFileNode(path, parentNode.path);
|
|
90
|
-
if (this.imageFilelist.includes(path)) {
|
|
91
|
-
node.isRemovable = false;
|
|
92
|
-
node.isReadonly = this.readOnlyFilelist.includes(path);
|
|
93
|
-
node.isHidden = this.hiddenFilelist.includes(path);
|
|
94
|
-
}
|
|
57
|
+
}
|
|
58
|
+
insert(path) {
|
|
59
|
+
let parentNode = null;
|
|
60
|
+
let node = null;
|
|
61
|
+
// folder
|
|
62
|
+
if (path.endsWith('/')) {
|
|
63
|
+
const cleanPath = path.slice(0, path.length - 1);
|
|
64
|
+
parentNode = this.getParentNode(cleanPath);
|
|
65
|
+
node = this.createDirectoryNode(cleanPath, parentNode.path);
|
|
66
|
+
// if directory does not exist, add a new node
|
|
67
|
+
if (!this.directoryNodes[cleanPath]) {
|
|
68
|
+
this.directoryNodes[cleanPath] = node;
|
|
95
69
|
parentNode.children.push(node);
|
|
96
70
|
parentNode.children = arrangeFileAndDirectoryNameByPath(parentNode.children);
|
|
97
71
|
}
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
isDirectory: inputType === 'directory',
|
|
107
|
-
isEdit: true,
|
|
108
|
-
title: '*',
|
|
109
|
-
parentPath: path
|
|
110
|
-
});
|
|
111
|
-
if (isRoot) {
|
|
112
|
-
this.root.children = [tree].concat(_toConsumableArray(this.root.children));
|
|
113
|
-
this.root.children = arrangeFileAndDirectoryNameByPath(this.root.children);
|
|
114
|
-
} else {
|
|
115
|
-
this.directoryNodes[path].expanded = true;
|
|
116
|
-
this.directoryNodes[path].children = [tree].concat(_toConsumableArray(this.directoryNodes[path].children));
|
|
117
|
-
this.directoryNodes[path].children = arrangeFileAndDirectoryNameByPath(this.directoryNodes[path].children);
|
|
72
|
+
} else {
|
|
73
|
+
// file
|
|
74
|
+
parentNode = this.getParentNode(path);
|
|
75
|
+
node = this.createFileNode(path, parentNode.path);
|
|
76
|
+
if (this.imageFilelist.includes(path)) {
|
|
77
|
+
node.isRemovable = false;
|
|
78
|
+
node.isReadonly = this.readOnlyFilelist.includes(path);
|
|
79
|
+
node.isHidden = this.hiddenFilelist.includes(path);
|
|
118
80
|
}
|
|
81
|
+
parentNode.children.push(node);
|
|
82
|
+
parentNode.children = arrangeFileAndDirectoryNameByPath(parentNode.children);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
insertInputNode(path, inputType) {
|
|
86
|
+
const isRoot = path === '';
|
|
87
|
+
const tree = new FileTreeNode({
|
|
88
|
+
path: isRoot ? '' : path + '/',
|
|
89
|
+
expanded: this.openedDirectoryList.includes(path),
|
|
90
|
+
isDirectory: inputType === 'directory',
|
|
91
|
+
isEdit: true,
|
|
92
|
+
title: '*',
|
|
93
|
+
parentPath: path
|
|
94
|
+
});
|
|
95
|
+
if (isRoot) {
|
|
96
|
+
this.root.children = [tree, ...this.root.children];
|
|
97
|
+
this.root.children = arrangeFileAndDirectoryNameByPath(this.root.children);
|
|
98
|
+
} else {
|
|
99
|
+
this.directoryNodes[path].expanded = true;
|
|
100
|
+
this.directoryNodes[path].children = [tree, ...this.directoryNodes[path].children];
|
|
101
|
+
this.directoryNodes[path].children = arrangeFileAndDirectoryNameByPath(this.directoryNodes[path].children);
|
|
119
102
|
}
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
127
|
-
var child = _step.value;
|
|
128
|
-
if (child.isDirectory) {
|
|
129
|
-
if (!this._setDirectoriesRemovable(child)) {
|
|
130
|
-
node.isRemovable = false;
|
|
131
|
-
}
|
|
132
|
-
} else if (!child.isRemovable) {
|
|
133
|
-
node.isRemovable = false;
|
|
134
|
-
}
|
|
103
|
+
}
|
|
104
|
+
_setDirectoriesRemovable(node) {
|
|
105
|
+
for (const child of node.children) {
|
|
106
|
+
if (child.isDirectory) {
|
|
107
|
+
if (!this._setDirectoriesRemovable(child)) {
|
|
108
|
+
node.isRemovable = false;
|
|
135
109
|
}
|
|
136
|
-
}
|
|
137
|
-
_iterator.e(err);
|
|
138
|
-
} finally {
|
|
139
|
-
_iterator.f();
|
|
140
|
-
}
|
|
141
|
-
if (this.imageFilelist.includes(node.path + '/')) {
|
|
110
|
+
} else if (!child.isRemovable) {
|
|
142
111
|
node.isRemovable = false;
|
|
143
112
|
}
|
|
144
|
-
return node.isRemovable;
|
|
145
113
|
}
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
isRenaming = _ref2$isRenaming === void 0 ? false : _ref2$isRenaming,
|
|
168
|
-
_ref2$isInitialOpen = _ref2.isInitialOpen,
|
|
169
|
-
isInitialOpen = _ref2$isInitialOpen === void 0 ? false : _ref2$isInitialOpen;
|
|
170
|
-
_classCallCheck(this, FileTreeNode);
|
|
171
|
-
var _title = title === undefined ? getTitle(path) : title;
|
|
114
|
+
if (this.imageFilelist.includes(node.path + '/')) {
|
|
115
|
+
node.isRemovable = false;
|
|
116
|
+
}
|
|
117
|
+
return node.isRemovable;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
class FileTreeNode {
|
|
121
|
+
constructor({
|
|
122
|
+
path,
|
|
123
|
+
parentPath,
|
|
124
|
+
title,
|
|
125
|
+
isDirectory = false,
|
|
126
|
+
isReadonly = false,
|
|
127
|
+
isRemovable = true,
|
|
128
|
+
isHidden = false,
|
|
129
|
+
expanded = false,
|
|
130
|
+
isEdit = false,
|
|
131
|
+
isRenaming = false,
|
|
132
|
+
isInitialOpen = false
|
|
133
|
+
}) {
|
|
134
|
+
const _title = title === undefined ? getTitle(path) : title;
|
|
172
135
|
this.path = path;
|
|
173
136
|
this.parentPath = parentPath;
|
|
174
137
|
this.title = _title;
|
|
@@ -182,46 +145,38 @@ var FileTreeNode = /*#__PURE__*/function () {
|
|
|
182
145
|
this.isInitialOpen = isInitialOpen;
|
|
183
146
|
this.children = [];
|
|
184
147
|
}
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
for (var i = 0; i < this.children.length; i++) {
|
|
193
|
-
if (path.split('/')[depth] === this.children[i].path.split('/')[depth]) {
|
|
194
|
-
return this.findTreeNode.call(this.children[i], path, depth + 1);
|
|
195
|
-
}
|
|
148
|
+
findTreeNode(path, depth = 0) {
|
|
149
|
+
if (this.path === path) {
|
|
150
|
+
return this;
|
|
151
|
+
}
|
|
152
|
+
for (let i = 0; i < this.children.length; i++) {
|
|
153
|
+
if (path.split('/')[depth] === this.children[i].path.split('/')[depth]) {
|
|
154
|
+
return this.findTreeNode.call(this.children[i], path, depth + 1);
|
|
196
155
|
}
|
|
197
|
-
return;
|
|
198
156
|
}
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
}
|
|
202
|
-
function create(
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
initialOpenFilelist: initialOpenFilelist
|
|
220
|
-
});
|
|
221
|
-
var allPathes = removeDuplicatedString([].concat(_toConsumableArray(exerciseRoomFilelist), _toConsumableArray(imageFilelist)));
|
|
222
|
-
allPathes.forEach(function (path) {
|
|
223
|
-
return tree.insert(path);
|
|
157
|
+
return;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
function create({
|
|
161
|
+
imageFilelist,
|
|
162
|
+
exerciseRoomFilelist,
|
|
163
|
+
openedDirectoryList,
|
|
164
|
+
hiddenFilelist = [],
|
|
165
|
+
readOnlyFilelist = [],
|
|
166
|
+
newInput,
|
|
167
|
+
renameInputPath,
|
|
168
|
+
initialOpenFilelist
|
|
169
|
+
}) {
|
|
170
|
+
const tree = new FileTreeRoot({
|
|
171
|
+
imageFilelist,
|
|
172
|
+
hiddenFilelist,
|
|
173
|
+
openedDirectoryList,
|
|
174
|
+
readOnlyFilelist,
|
|
175
|
+
renameInputPath,
|
|
176
|
+
initialOpenFilelist
|
|
224
177
|
});
|
|
178
|
+
const allPathes = removeDuplicatedString([...exerciseRoomFilelist, ...imageFilelist]);
|
|
179
|
+
allPathes.forEach(path => tree.insert(path));
|
|
225
180
|
if (newInput) {
|
|
226
181
|
tree.insertInputNode(newInput.path, newInput.type);
|
|
227
182
|
}
|
|
@@ -229,16 +184,15 @@ function create(_ref3) {
|
|
|
229
184
|
return tree.root;
|
|
230
185
|
}
|
|
231
186
|
function removeDuplicatedString(array) {
|
|
232
|
-
return
|
|
187
|
+
return [...new Set(array)];
|
|
233
188
|
}
|
|
234
189
|
function getParentPath(path) {
|
|
235
190
|
return path.includes('/') ? path.slice(0, path.lastIndexOf('/')) : '';
|
|
236
191
|
}
|
|
237
192
|
function arrangeFileAndDirectoryNameByPath(fileTreeNodeList) {
|
|
238
|
-
return [
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
}).sort(function (a, b) {
|
|
193
|
+
return [...fileTreeNodeList.filter(({
|
|
194
|
+
isDirectory
|
|
195
|
+
}) => isDirectory).sort((a, b) => {
|
|
242
196
|
if (a.path < b.path) {
|
|
243
197
|
return -1;
|
|
244
198
|
}
|
|
@@ -246,10 +200,9 @@ function arrangeFileAndDirectoryNameByPath(fileTreeNodeList) {
|
|
|
246
200
|
return 1;
|
|
247
201
|
}
|
|
248
202
|
return 0;
|
|
249
|
-
})
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
}).sort(function (a, b) {
|
|
203
|
+
}), ...fileTreeNodeList.filter(({
|
|
204
|
+
isDirectory
|
|
205
|
+
}) => !isDirectory).sort((a, b) => {
|
|
253
206
|
if (a.path < b.path) {
|
|
254
207
|
return -1;
|
|
255
208
|
}
|
|
@@ -257,7 +210,7 @@ function arrangeFileAndDirectoryNameByPath(fileTreeNodeList) {
|
|
|
257
210
|
return 1;
|
|
258
211
|
}
|
|
259
212
|
return 0;
|
|
260
|
-
})
|
|
213
|
+
})];
|
|
261
214
|
}
|
|
262
215
|
|
|
263
216
|
export { FileTreeNode, FileTreeRoot, create, getParentPath };
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
2
|
*
|
|
3
3
|
*/
|
|
4
|
-
function isMovingTheSamePath(
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
function isMovingTheSamePath({
|
|
5
|
+
draggedPath,
|
|
6
|
+
dropzonePath,
|
|
7
|
+
dragFileTreeNode
|
|
8
|
+
}) {
|
|
8
9
|
var _a;
|
|
9
|
-
return draggedPath ===
|
|
10
|
+
return draggedPath === `${dropzonePath || ''}${dropzonePath ? '/' : ''}${(_a = dragFileTreeNode === null || dragFileTreeNode === void 0 ? void 0 : dragFileTreeNode.title) !== null && _a !== void 0 ? _a : ''}`;
|
|
10
11
|
}
|
|
11
12
|
|
|
12
13
|
export { isMovingTheSamePath };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { slicedToArray as _slicedToArray } from '../../../_virtual/_rollupPluginBabelHelpers.js';
|
|
2
1
|
import React, { useState } from 'react';
|
|
3
2
|
import { FormattedMessage } from 'react-intl';
|
|
4
3
|
import { Flex, Hspace, Icon } from '@elice/blocks';
|
|
@@ -17,42 +16,30 @@ import phrasesEn from './locales/en.json.js';
|
|
|
17
16
|
import phrasesKo from './locales/ko.json.js';
|
|
18
17
|
import FileViewerNonViewable from './FileViewerNonViewable.js';
|
|
19
18
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
});
|
|
26
|
-
var AsyncFileViewerIpynb = React.lazy(function () {
|
|
27
|
-
return import('./FileViewerIpynb.js');
|
|
28
|
-
});
|
|
29
|
-
var AsyncFileViewerText = React.lazy(function () {
|
|
30
|
-
return import('./FileViewerText.js');
|
|
31
|
-
});
|
|
32
|
-
var StyledFileWrapper = styled.div.withConfig({
|
|
19
|
+
const AsyncFileViewerCsv = React.lazy(() => import('./FileViewerCsv.js'));
|
|
20
|
+
const AsyncFileViewerImage = React.lazy(() => import('./FileViewerImage.js'));
|
|
21
|
+
const AsyncFileViewerIpynb = React.lazy(() => import('./FileViewerIpynb.js'));
|
|
22
|
+
const AsyncFileViewerText = React.lazy(() => import('./FileViewerText.js'));
|
|
23
|
+
const StyledFileWrapper = styled.div.withConfig({
|
|
33
24
|
componentId: "sc-197v06u-0"
|
|
34
25
|
})(["display:flex;justify-content:center;align-items:center;background-color:", ";width:100%;height:100%;"], base.color.navy9);
|
|
35
|
-
|
|
26
|
+
const StyledReadonlyBanner = styled.div.withConfig({
|
|
36
27
|
componentId: "sc-197v06u-1"
|
|
37
28
|
})(["width:100%;padding:0.7rem;color:white;font-size:0.7rem;a{color:", ";font-weight:bold;text-decoration:underline;.eb-icon{margin-right:0.25rem;}}"], base.color.primary5);
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
showInTextViewer = _useState2[0],
|
|
45
|
-
setShowInTextViewer = _useState2[1];
|
|
29
|
+
const FileViewer = ({
|
|
30
|
+
filename,
|
|
31
|
+
fileurl,
|
|
32
|
+
locale
|
|
33
|
+
}) => {
|
|
34
|
+
const [showInTextViewer, setShowInTextViewer] = useState(false);
|
|
46
35
|
/**
|
|
47
36
|
* Mime type of file.
|
|
48
37
|
*/
|
|
49
|
-
|
|
50
|
-
return mime.getType(filename || '') || filename.split('.').pop() || '';
|
|
51
|
-
}, [filename]);
|
|
38
|
+
const mimeType = React.useMemo(() => mime.getType(filename || '') || filename.split('.').pop() || '', [filename]);
|
|
52
39
|
/**
|
|
53
40
|
* Preview component.
|
|
54
41
|
*/
|
|
55
|
-
|
|
42
|
+
const PreviewComponent = React.useMemo(() => {
|
|
56
43
|
// Binary file which shows as text
|
|
57
44
|
if (showInTextViewer) {
|
|
58
45
|
return AsyncFileViewerText;
|
|
@@ -81,17 +68,13 @@ var FileViewer = function FileViewer(_ref) {
|
|
|
81
68
|
/**
|
|
82
69
|
* Handle download button click.
|
|
83
70
|
*/
|
|
84
|
-
|
|
71
|
+
const handleDownloadClick = e => {
|
|
85
72
|
e.preventDefault();
|
|
86
73
|
if (!fileurl) {
|
|
87
74
|
return;
|
|
88
75
|
}
|
|
89
|
-
fetch(fileurl).then(
|
|
90
|
-
|
|
91
|
-
}).then(function (blob) {
|
|
92
|
-
return FileSaver.saveAs(blob, filename);
|
|
93
|
-
}).catch(function () {
|
|
94
|
-
var win = window.open(fileurl, '_blank');
|
|
76
|
+
fetch(fileurl).then(res => res.blob()).then(blob => FileSaver.saveAs(blob, filename)).catch(() => {
|
|
77
|
+
const win = window.open(fileurl, '_blank');
|
|
95
78
|
if (win) {
|
|
96
79
|
win.focus();
|
|
97
80
|
}
|
|
@@ -100,7 +83,7 @@ var FileViewer = function FileViewer(_ref) {
|
|
|
100
83
|
/**
|
|
101
84
|
* Readonly banner.
|
|
102
85
|
*/
|
|
103
|
-
|
|
86
|
+
const renderReadonlyBanner = () => {
|
|
104
87
|
if (!fileurl) {
|
|
105
88
|
return null;
|
|
106
89
|
}
|
|
@@ -121,7 +104,7 @@ var FileViewer = function FileViewer(_ref) {
|
|
|
121
104
|
/**
|
|
122
105
|
* File viewer.
|
|
123
106
|
*/
|
|
124
|
-
|
|
107
|
+
const renderFileViewer = () => {
|
|
125
108
|
// preview-able file
|
|
126
109
|
if (PreviewComponent) {
|
|
127
110
|
return React.createElement(React.Suspense, {
|
|
@@ -140,7 +123,7 @@ var FileViewer = function FileViewer(_ref) {
|
|
|
140
123
|
fileurl: fileurl,
|
|
141
124
|
filename: filename,
|
|
142
125
|
locale: locale,
|
|
143
|
-
onTextViewerClick:
|
|
126
|
+
onTextViewerClick: () => {
|
|
144
127
|
setShowInTextViewer(true);
|
|
145
128
|
}
|
|
146
129
|
});
|
|
@@ -155,7 +138,7 @@ var FileViewer = function FileViewer(_ref) {
|
|
|
155
138
|
//
|
|
156
139
|
//
|
|
157
140
|
//
|
|
158
|
-
var FileViewer$1 = (
|
|
141
|
+
var FileViewer$1 = (props => {
|
|
159
142
|
return React.createElement(MaterialIntlProvider, {
|
|
160
143
|
locale: props.locale,
|
|
161
144
|
phrases: {
|