@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,37 +1,24 @@
|
|
|
1
|
-
import { createForOfIteratorHelper as _createForOfIteratorHelper } from '../../../_virtual/_rollupPluginBabelHelpers.js';
|
|
2
|
-
|
|
3
1
|
/**
|
|
4
2
|
* Get file tab props.
|
|
5
3
|
*/
|
|
6
4
|
function getTabProps(paths) {
|
|
7
|
-
|
|
5
|
+
const tabs = [];
|
|
8
6
|
// parse file paths
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
chunks: chunks,
|
|
20
|
-
filename: filename,
|
|
21
|
-
isFilenameDuplicated: false
|
|
22
|
-
});
|
|
23
|
-
}
|
|
7
|
+
for (const path of paths) {
|
|
8
|
+
const chunks = path.split('/');
|
|
9
|
+
const filename = chunks.pop();
|
|
10
|
+
if (filename) {
|
|
11
|
+
tabs.push({
|
|
12
|
+
fullname: path,
|
|
13
|
+
chunks,
|
|
14
|
+
filename,
|
|
15
|
+
isFilenameDuplicated: false
|
|
16
|
+
});
|
|
24
17
|
}
|
|
25
|
-
// check filename duplication
|
|
26
|
-
} catch (err) {
|
|
27
|
-
_iterator.e(err);
|
|
28
|
-
} finally {
|
|
29
|
-
_iterator.f();
|
|
30
18
|
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}).length > 1;
|
|
19
|
+
// check filename duplication
|
|
20
|
+
tabs.forEach(thisTab => {
|
|
21
|
+
thisTab.isFilenameDuplicated = tabs.filter(thatTab => thisTab.filename === thatTab.filename).length > 1;
|
|
35
22
|
});
|
|
36
23
|
return tabs;
|
|
37
24
|
}
|
|
@@ -10,13 +10,13 @@ import FileTreeConfig from './FileTreeConfig.js';
|
|
|
10
10
|
import FileTreeList from './FileTreeList.js';
|
|
11
11
|
import FileTreeToolbar from './FileTreeToolbar.js';
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
const StyledFileTreeWrapper = styled.div.withConfig({
|
|
14
14
|
componentId: "sc-6ext2i-0"
|
|
15
15
|
})(["display:flex;flex-direction:column;user-select:none;overflow:hidden;"]);
|
|
16
|
-
|
|
16
|
+
const StyledLoading = styled.div.withConfig({
|
|
17
17
|
componentId: "sc-6ext2i-1"
|
|
18
18
|
})(["position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);background-color:", ";opacity:0.5;width:100%;height:100%;display:flex;align-items:center;justify-content:center;z-index:100;"], base.color.navy7);
|
|
19
|
-
|
|
19
|
+
const FileTree = props => {
|
|
20
20
|
return React.createElement(MaterialIntlProvider, {
|
|
21
21
|
locale: props.locale,
|
|
22
22
|
phrases: {
|
|
@@ -5,23 +5,26 @@ import classnames from 'classnames';
|
|
|
5
5
|
import styled from 'styled-components';
|
|
6
6
|
import { useFileTreeState, useFileTreeDispatch } from './context/FileTreeContext.js';
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
const StyledFileTreeConfig = styled.div.withConfig({
|
|
9
9
|
componentId: "sc-1dxe3z0-0"
|
|
10
10
|
})(["background-color:", ";padding:1rem;"], base.color.navy8);
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
11
|
+
const FileTreeConfig = forwardRef(({
|
|
12
|
+
className,
|
|
13
|
+
style,
|
|
14
|
+
onInitialOpenFileListChange,
|
|
15
|
+
initialOpenFilelist
|
|
16
|
+
}, ref) => {
|
|
17
|
+
const {
|
|
18
|
+
mode,
|
|
19
|
+
initialOpenFileListTemp
|
|
20
|
+
} = useFileTreeState();
|
|
21
|
+
const {
|
|
22
|
+
dispatch
|
|
23
|
+
} = useFileTreeDispatch();
|
|
24
|
+
React.useEffect(() => {
|
|
22
25
|
dispatch({
|
|
23
26
|
type: 'INITIAL_OPEN_FILELIST_UPDATE',
|
|
24
|
-
initialOpenFilelist
|
|
27
|
+
initialOpenFilelist
|
|
25
28
|
});
|
|
26
29
|
}, [dispatch, initialOpenFilelist]);
|
|
27
30
|
return React.createElement(StyledFileTreeConfig, {
|
|
@@ -33,7 +36,7 @@ var FileTreeConfig = forwardRef(function (_ref, ref) {
|
|
|
33
36
|
size: "small",
|
|
34
37
|
role: "white",
|
|
35
38
|
transparent: true,
|
|
36
|
-
onClick:
|
|
39
|
+
onClick: () => {
|
|
37
40
|
if ([
|
|
38
41
|
// when mode changes from 'checkbox' to 'default'
|
|
39
42
|
mode === 'checkbox',
|
|
@@ -48,7 +51,7 @@ var FileTreeConfig = forwardRef(function (_ref, ref) {
|
|
|
48
51
|
mode: mode === 'checkbox' ? 'default' : 'checkbox'
|
|
49
52
|
});
|
|
50
53
|
}
|
|
51
|
-
}, mode === 'default' ?
|
|
54
|
+
}, mode === 'default' ? `Initial Open Files(${initialOpenFileListTemp.length})` : `Settings (${initialOpenFileListTemp.length})`));
|
|
52
55
|
});
|
|
53
56
|
var FileTreeConfig$1 = FileTreeConfig;
|
|
54
57
|
|
|
@@ -8,35 +8,39 @@ import FileTreeListItems from './FileTreeListItems.js';
|
|
|
8
8
|
import { validateFilesSize } from './utils/fileTreeFiles.js';
|
|
9
9
|
import { isMovingTheSamePath } from './utils/fileTreePath.js';
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
const StyledFileTreeList = styled.div.withConfig({
|
|
12
12
|
componentId: "sc-5ddw80-0"
|
|
13
13
|
})(["flex:auto;background-color:", ";overflow-x:hidden;overflow-y:overlay;", ""], base.color.navy9, getMaterialScrollBarCss({
|
|
14
14
|
width: '0.375rem',
|
|
15
15
|
borderRadius: '2px',
|
|
16
16
|
hideable: true
|
|
17
17
|
}));
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
18
|
+
const FileTreeList = forwardRef(({
|
|
19
|
+
className,
|
|
20
|
+
style,
|
|
21
|
+
options
|
|
22
|
+
}, ref) => {
|
|
23
|
+
const {
|
|
24
|
+
fileTree,
|
|
25
|
+
dropzonePath,
|
|
26
|
+
draggedPath,
|
|
27
|
+
maxFileUploadSize
|
|
28
|
+
} = useFileTreeState();
|
|
29
|
+
const {
|
|
30
|
+
dispatch,
|
|
31
|
+
onDirectoryMove,
|
|
32
|
+
onFileMove,
|
|
33
|
+
onFilesUpload
|
|
34
|
+
} = useFileTreeDispatch();
|
|
35
|
+
const handleFilesUpload = ({
|
|
36
|
+
files,
|
|
37
|
+
path
|
|
38
|
+
}) => {
|
|
35
39
|
if (validateFilesSize(files, maxFileUploadSize)) {
|
|
36
40
|
if (typeof onFilesUpload === 'function') {
|
|
37
41
|
onFilesUpload({
|
|
38
|
-
files
|
|
39
|
-
path
|
|
42
|
+
files,
|
|
43
|
+
path
|
|
40
44
|
});
|
|
41
45
|
}
|
|
42
46
|
}
|
|
@@ -48,10 +52,10 @@ var FileTreeList = forwardRef(function (_ref, ref) {
|
|
|
48
52
|
style: Object.assign({
|
|
49
53
|
backgroundColor: dropzonePath === '' ? base.color.primary7 : ''
|
|
50
54
|
}, style),
|
|
51
|
-
onDragEnter:
|
|
55
|
+
onDragEnter: e => {
|
|
52
56
|
e.preventDefault();
|
|
53
57
|
e.stopPropagation();
|
|
54
|
-
|
|
58
|
+
const isFiles = e.dataTransfer.types[0] === 'Files';
|
|
55
59
|
if (draggedPath !== null || isFiles) {
|
|
56
60
|
dispatch({
|
|
57
61
|
type: 'UPDATE_DROPZONE_PATH',
|
|
@@ -59,14 +63,14 @@ var FileTreeList = forwardRef(function (_ref, ref) {
|
|
|
59
63
|
});
|
|
60
64
|
}
|
|
61
65
|
},
|
|
62
|
-
onDragOver:
|
|
66
|
+
onDragOver: e => {
|
|
63
67
|
e.preventDefault();
|
|
64
68
|
e.stopPropagation();
|
|
65
69
|
},
|
|
66
|
-
onDrop:
|
|
70
|
+
onDrop: e => {
|
|
67
71
|
e.stopPropagation();
|
|
68
72
|
e.preventDefault();
|
|
69
|
-
|
|
73
|
+
const draggedPath = e.dataTransfer.getData('text');
|
|
70
74
|
// file drop
|
|
71
75
|
if (e.dataTransfer.files.length > 0) {
|
|
72
76
|
handleFilesUpload({
|
|
@@ -83,12 +87,12 @@ var FileTreeList = forwardRef(function (_ref, ref) {
|
|
|
83
87
|
});
|
|
84
88
|
} else {
|
|
85
89
|
// file move
|
|
86
|
-
|
|
90
|
+
const dragFileTreeNode = fileTree.findTreeNode(draggedPath);
|
|
87
91
|
// file does not move. from a to a (the same path).
|
|
88
92
|
if (isMovingTheSamePath({
|
|
89
|
-
draggedPath
|
|
90
|
-
dropzonePath
|
|
91
|
-
dragFileTreeNode
|
|
93
|
+
draggedPath,
|
|
94
|
+
dropzonePath,
|
|
95
|
+
dragFileTreeNode
|
|
92
96
|
})) {
|
|
93
97
|
return;
|
|
94
98
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { slicedToArray as _slicedToArray } from '../../../_virtual/_rollupPluginBabelHelpers.js';
|
|
2
1
|
import React from 'react';
|
|
3
2
|
import { Icon, Checkbox } from '@elice/blocks';
|
|
4
3
|
import { base } from '@elice/design-tokens';
|
|
@@ -9,48 +8,45 @@ import FileTreeListItemContentInput from './FileTreeListItemContentInput.js';
|
|
|
9
8
|
import FileTreeListItemContentMenu from './FileTreeListItemContentMenu.js';
|
|
10
9
|
import { StyledContentIndents, StyledContentIndentGuide, StyledContent, StyledContentLabel, StyledContentLabelDirArrowWrap, StyledContentLabelIconWrap, StyledContentLabelFilename, StyledContentLabelStatusIcon, StyledContentLabelMenuButton } from './FileTreeListItemContent.styled.js';
|
|
11
10
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
mode
|
|
20
|
-
activePath
|
|
21
|
-
dropzonePath
|
|
22
|
-
newInput
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
var isNewItem = newInput && node.isEdit;
|
|
11
|
+
const ITEM_IDENT_WIDTH = 8; // 0.5rem
|
|
12
|
+
const FileTreeListItemContent = ({
|
|
13
|
+
node,
|
|
14
|
+
parentNode,
|
|
15
|
+
indent = 1
|
|
16
|
+
}) => {
|
|
17
|
+
const {
|
|
18
|
+
mode,
|
|
19
|
+
activePath,
|
|
20
|
+
dropzonePath,
|
|
21
|
+
newInput
|
|
22
|
+
} = useFileTreeState();
|
|
23
|
+
const {
|
|
24
|
+
dispatch,
|
|
25
|
+
onActivePathChange
|
|
26
|
+
} = useFileTreeDispatch();
|
|
27
|
+
const [menuAnchorEl, setMenuAnchorEl] = React.useState();
|
|
28
|
+
const isNewItem = newInput && node.isEdit;
|
|
31
29
|
/**
|
|
32
30
|
* Indent.
|
|
33
31
|
*/
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
32
|
+
const contentIndents = React.useMemo(() => {
|
|
33
|
+
const depth = (node.path.match(/\//g) || []).length;
|
|
34
|
+
const counts = depth === 0 ? 0 : indent * depth;
|
|
37
35
|
return React.createElement(StyledContentIndents, {
|
|
38
36
|
style: {
|
|
39
|
-
flex:
|
|
37
|
+
flex: `0 0 ${ITEM_IDENT_WIDTH * counts}px`
|
|
40
38
|
}
|
|
41
|
-
}, Array(counts).fill(0).map(
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
});
|
|
48
|
-
}));
|
|
39
|
+
}, Array(counts).fill(0).map((_, index) => React.createElement(StyledContentIndentGuide, {
|
|
40
|
+
key: index,
|
|
41
|
+
style: {
|
|
42
|
+
width: `${ITEM_IDENT_WIDTH}px`
|
|
43
|
+
}
|
|
44
|
+
})));
|
|
49
45
|
}, [node, indent]);
|
|
50
46
|
/**
|
|
51
47
|
* Handle item click.
|
|
52
48
|
*/
|
|
53
|
-
|
|
49
|
+
const handleClick = () => {
|
|
54
50
|
if (node.isEdit) {
|
|
55
51
|
return;
|
|
56
52
|
}
|
|
@@ -65,7 +61,7 @@ var FileTreeListItemContent = function FileTreeListItemContent(_ref) {
|
|
|
65
61
|
/**
|
|
66
62
|
* Handle item right-click.
|
|
67
63
|
*/
|
|
68
|
-
|
|
64
|
+
const handleContextMenu = e => {
|
|
69
65
|
e.preventDefault();
|
|
70
66
|
setMenuAnchorEl({
|
|
71
67
|
x: e.clientX,
|
|
@@ -75,7 +71,7 @@ var FileTreeListItemContent = function FileTreeListItemContent(_ref) {
|
|
|
75
71
|
/**
|
|
76
72
|
* Directory expand arrow.
|
|
77
73
|
*/
|
|
78
|
-
|
|
74
|
+
const renderContentDirectoryExpandArrow = () => {
|
|
79
75
|
// new or directory
|
|
80
76
|
if (isNewItem || !node.isDirectory) {
|
|
81
77
|
return React.createElement(StyledContentLabelDirArrowWrap, null);
|
|
@@ -90,7 +86,7 @@ var FileTreeListItemContent = function FileTreeListItemContent(_ref) {
|
|
|
90
86
|
/**
|
|
91
87
|
* Icon.
|
|
92
88
|
*/
|
|
93
|
-
|
|
89
|
+
const renderContentIcon = () => {
|
|
94
90
|
// new
|
|
95
91
|
if (isNewItem) {
|
|
96
92
|
return React.createElement(StyledContentLabelIconWrap, null, React.createElement(FileIcon, {
|
|
@@ -105,7 +101,7 @@ var FileTreeListItemContent = function FileTreeListItemContent(_ref) {
|
|
|
105
101
|
return React.createElement(StyledContentLabelIconWrap, null, React.createElement(Checkbox, {
|
|
106
102
|
value: node.isInitialOpen,
|
|
107
103
|
dark: true,
|
|
108
|
-
onChange:
|
|
104
|
+
onChange: checked => {
|
|
109
105
|
dispatch({
|
|
110
106
|
type: checked ? 'INITIAL_OPEN_FILELIST_ADD' : 'INITIAL_OPEN_FILELIST_REMOVE',
|
|
111
107
|
path: node.path
|
|
@@ -124,7 +120,7 @@ var FileTreeListItemContent = function FileTreeListItemContent(_ref) {
|
|
|
124
120
|
/**
|
|
125
121
|
* Filename.
|
|
126
122
|
*/
|
|
127
|
-
|
|
123
|
+
const renderContentFilename = () => {
|
|
128
124
|
var _a;
|
|
129
125
|
// new
|
|
130
126
|
if (isNewItem) {
|
|
@@ -132,10 +128,9 @@ var FileTreeListItemContent = function FileTreeListItemContent(_ref) {
|
|
|
132
128
|
type: "new",
|
|
133
129
|
newInputType: (_a = newInput === null || newInput === void 0 ? void 0 : newInput.type) !== null && _a !== void 0 ? _a : 'file',
|
|
134
130
|
currentPath: node.path,
|
|
135
|
-
currentDirTitleList: parentNode.children.map(
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
})
|
|
131
|
+
currentDirTitleList: parentNode.children.map(({
|
|
132
|
+
title
|
|
133
|
+
}) => title)
|
|
139
134
|
});
|
|
140
135
|
}
|
|
141
136
|
// rename
|
|
@@ -145,12 +140,9 @@ var FileTreeListItemContent = function FileTreeListItemContent(_ref) {
|
|
|
145
140
|
initialValue: node.title,
|
|
146
141
|
newInputType: node.isDirectory ? 'directory' : 'file',
|
|
147
142
|
currentPath: node.path,
|
|
148
|
-
currentDirTitleList: parentNode.children.map(
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
}).filter(function (title) {
|
|
152
|
-
return title !== node.title;
|
|
153
|
-
})
|
|
143
|
+
currentDirTitleList: parentNode.children.map(({
|
|
144
|
+
title
|
|
145
|
+
}) => title).filter(title => title !== node.title)
|
|
154
146
|
});
|
|
155
147
|
}
|
|
156
148
|
return React.createElement(StyledContentLabelFilename, {
|
|
@@ -162,7 +154,7 @@ var FileTreeListItemContent = function FileTreeListItemContent(_ref) {
|
|
|
162
154
|
/**
|
|
163
155
|
* Status icon.
|
|
164
156
|
*/
|
|
165
|
-
|
|
157
|
+
const renderContentStatusIcon = () => {
|
|
166
158
|
// new or rename
|
|
167
159
|
if (isNewItem || node.isRenaming) {
|
|
168
160
|
return null;
|
|
@@ -188,7 +180,7 @@ var FileTreeListItemContent = function FileTreeListItemContent(_ref) {
|
|
|
188
180
|
/**
|
|
189
181
|
* Menu button.
|
|
190
182
|
*/
|
|
191
|
-
|
|
183
|
+
const renderContentMenuButton = () => {
|
|
192
184
|
// new or rename
|
|
193
185
|
if (isNewItem || node.isRenaming) {
|
|
194
186
|
return null;
|
|
@@ -199,23 +191,21 @@ var FileTreeListItemContent = function FileTreeListItemContent(_ref) {
|
|
|
199
191
|
role: "white",
|
|
200
192
|
transparent: true,
|
|
201
193
|
border: false,
|
|
202
|
-
onClick:
|
|
194
|
+
onClick: e => {
|
|
203
195
|
e.stopPropagation();
|
|
204
196
|
setMenuAnchorEl(e.currentTarget);
|
|
205
197
|
}
|
|
206
198
|
}), React.createElement(FileTreeListItemContentMenu, {
|
|
207
199
|
node: node,
|
|
208
200
|
anchorEl: menuAnchorEl,
|
|
209
|
-
onClose:
|
|
210
|
-
return setMenuAnchorEl(undefined);
|
|
211
|
-
}
|
|
201
|
+
onClose: () => setMenuAnchorEl(undefined)
|
|
212
202
|
}));
|
|
213
203
|
};
|
|
214
204
|
//
|
|
215
205
|
//
|
|
216
206
|
//
|
|
217
207
|
return React.createElement(StyledContent, {
|
|
218
|
-
title:
|
|
208
|
+
title: `~/${node.path}`,
|
|
219
209
|
active: activePath === node.path,
|
|
220
210
|
isDragging: dropzonePath !== null,
|
|
221
211
|
onClick: handleClick,
|
|
@@ -5,74 +5,70 @@ import styled, { css } from 'styled-components';
|
|
|
5
5
|
//
|
|
6
6
|
//
|
|
7
7
|
//
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
8
|
+
const CONTENT_MIN_HEIGHT = 28; // 1.75rem
|
|
9
|
+
const CONTENT_LEFT_BORDER_WIDTH = 3; // 0.1875rem
|
|
10
|
+
const CONTENT_RIGHT_PADDING = 12; // 0.75rem
|
|
11
|
+
const CONTENT_LABEL_VERTICAL_PADDING = 4; // 0.25rem
|
|
12
|
+
const CONTENT_LABEL_ICON_SIZE = 16; // 1rem
|
|
13
|
+
const CONTENT_LABEL_ICON_AFTER_MARGIN = 4; // 1rem
|
|
14
|
+
const CONTENT_LABEL_DIR_ARROW_PADDING = 4; // 0.25rem
|
|
15
|
+
const CONTENT_LABEL_DIR_ARROW_SIZE = 12; // 0.75rem
|
|
16
|
+
const CONTENT_LABEL_MENU_BUTTON_SIZE = CONTENT_MIN_HEIGHT - CONTENT_LABEL_VERTICAL_PADDING * 2;
|
|
17
17
|
//
|
|
18
18
|
//
|
|
19
19
|
//
|
|
20
20
|
/**
|
|
21
21
|
* indent
|
|
22
22
|
*/
|
|
23
|
-
|
|
23
|
+
const StyledContentIndents = styled.div.withConfig({
|
|
24
24
|
componentId: "sc-3wfxns-0"
|
|
25
25
|
})([""]);
|
|
26
|
-
|
|
26
|
+
const StyledContentIndentGuide = styled.div.withConfig({
|
|
27
27
|
componentId: "sc-3wfxns-1"
|
|
28
28
|
})(["display:inline-block;height:100%;border-right:0.5px solid ", ";"], base.color.gray7);
|
|
29
29
|
/**
|
|
30
30
|
* label
|
|
31
31
|
*/
|
|
32
|
-
|
|
32
|
+
const StyledContentLabel = styled.div.withConfig({
|
|
33
33
|
componentId: "sc-3wfxns-2"
|
|
34
34
|
})(["flex:1;display:flex;align-items:center;padding-top:", "px;padding-bottom:", "px;overflow:hidden;"], CONTENT_LABEL_VERTICAL_PADDING, CONTENT_LABEL_VERTICAL_PADDING);
|
|
35
35
|
/**
|
|
36
36
|
* label > dir arrow
|
|
37
37
|
*/
|
|
38
|
-
|
|
38
|
+
const StyledContentLabelDirArrowWrap = styled.div.withConfig({
|
|
39
39
|
componentId: "sc-3wfxns-3"
|
|
40
40
|
})(["flex:0 0 ", "px;display:flex;justify-content:center;align-items:center;padding:", ";height:", "px;"], CONTENT_LABEL_DIR_ARROW_SIZE + CONTENT_LABEL_DIR_ARROW_PADDING * 2, CONTENT_LABEL_DIR_ARROW_PADDING, CONTENT_LABEL_DIR_ARROW_SIZE);
|
|
41
41
|
/**
|
|
42
42
|
* label > icon
|
|
43
43
|
*/
|
|
44
|
-
|
|
44
|
+
const StyledContentLabelIconWrap = styled.div.withConfig({
|
|
45
45
|
componentId: "sc-3wfxns-4"
|
|
46
46
|
})(["flex:0 0 ", "px;display:flex;margin-right:", "px;height:", "px;"], CONTENT_LABEL_ICON_SIZE + CONTENT_LABEL_ICON_AFTER_MARGIN, CONTENT_LABEL_ICON_AFTER_MARGIN, CONTENT_LABEL_ICON_SIZE);
|
|
47
47
|
/**
|
|
48
48
|
* label > filename
|
|
49
49
|
*/
|
|
50
|
-
|
|
50
|
+
const StyledContentLabelFilename = styled(Text).withConfig({
|
|
51
51
|
componentId: "sc-3wfxns-5"
|
|
52
52
|
})(["flex:1;margin-right:0.125rem;color:", ";font-weight:500;"], base.color.gray4);
|
|
53
53
|
/**
|
|
54
54
|
* label > status icon
|
|
55
55
|
*/
|
|
56
|
-
|
|
56
|
+
const StyledContentLabelStatusIcon = styled(Icon).withConfig({
|
|
57
57
|
componentId: "sc-3wfxns-6"
|
|
58
58
|
})(["margin-left:0.25rem;margin-right:0;&:last-of-type{margin-right:0.25rem;}"]);
|
|
59
59
|
/**
|
|
60
60
|
* label > menu button
|
|
61
61
|
*/
|
|
62
|
-
|
|
62
|
+
const StyledContentLabelMenuButton = styled(IconButton).withConfig({
|
|
63
63
|
componentId: "sc-3wfxns-7"
|
|
64
64
|
})(["flex:0 0 ", "px;width:", "px !important;height:", "px !important;opacity:0;transition:opacity 150ms ease-in-out;"], CONTENT_LABEL_MENU_BUTTON_SIZE, CONTENT_LABEL_MENU_BUTTON_SIZE, CONTENT_LABEL_MENU_BUTTON_SIZE);
|
|
65
65
|
//
|
|
66
66
|
//
|
|
67
67
|
//
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
68
|
+
const cssStyledContentActive = css(["border-left-color:", ";background-color:", ";", "{color:", ";}"], base.color.primary4, base.color.navy7, StyledContentLabelFilename, base.color.gray3);
|
|
69
|
+
const cssStyledContentDragging = css(["border-left-color:transparent !important;background-color:transparent !important;"]);
|
|
70
|
+
const StyledContent = styled.div.withConfig({
|
|
71
71
|
componentId: "sc-3wfxns-8"
|
|
72
|
-
})(["display:flex;padding-right:", "px;width:100%;min-width:0;min-height:", "px;border-left-width:", "px;border-left-style:solid;border-left-color:transparent;user-select:none;", " ", " &:hover{background-color:", ";", "{color:", ";}", "{opacity:1;}}"], CONTENT_RIGHT_PADDING, CONTENT_MIN_HEIGHT, CONTENT_LEFT_BORDER_WIDTH,
|
|
73
|
-
return props.active && cssStyledContentActive;
|
|
74
|
-
}, function (props) {
|
|
75
|
-
return props.isDragging && cssStyledContentDragging;
|
|
76
|
-
}, base.color.navy8, StyledContentLabelFilename, base.color.gray3, StyledContentLabelMenuButton);
|
|
72
|
+
})(["display:flex;padding-right:", "px;width:100%;min-width:0;min-height:", "px;border-left-width:", "px;border-left-style:solid;border-left-color:transparent;user-select:none;", " ", " &:hover{background-color:", ";", "{color:", ";}", "{opacity:1;}}"], CONTENT_RIGHT_PADDING, CONTENT_MIN_HEIGHT, CONTENT_LEFT_BORDER_WIDTH, props => props.active && cssStyledContentActive, props => props.isDragging && cssStyledContentDragging, base.color.navy8, StyledContentLabelFilename, base.color.gray3, StyledContentLabelMenuButton);
|
|
77
73
|
|
|
78
74
|
export { StyledContent, StyledContentIndentGuide, StyledContentIndents, StyledContentLabel, StyledContentLabelDirArrowWrap, StyledContentLabelFilename, StyledContentLabelIconWrap, StyledContentLabelMenuButton, StyledContentLabelStatusIcon };
|