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