@elice/material-exercise 1.231227.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.
Files changed (395) hide show
  1. package/cjs/components/material-exercise/MaterialExercise.i18n.js +2 -4
  2. package/cjs/components/material-exercise/MaterialExercise.js +54 -59
  3. package/cjs/components/material-exercise/MaterialExercise.styled.js +14 -20
  4. package/cjs/components/material-exercise/MaterialExerciseMobile.js +8 -15
  5. package/cjs/components/material-exercise/context/ExerciseIntlProvider.js +14 -18
  6. package/cjs/components/material-exercise/context/ExerciseProvider.js +58 -66
  7. package/cjs/components/material-exercise/context/ExerciseProviderNoImage.js +19 -24
  8. package/cjs/components/material-exercise/context/context.js +1 -7
  9. package/cjs/components/material-exercise/context/locales/noImage.en.json.js +1 -1
  10. package/cjs/components/material-exercise/context/locales/noImage.ko.json.js +1 -1
  11. package/cjs/components/material-exercise/context/recoil.js +293 -544
  12. package/cjs/components/material-exercise/context/recoilTypes.js +0 -2
  13. package/cjs/components/material-exercise/context/subjects.js +3 -5
  14. package/cjs/components/material-exercise/exercise-code-history/ExerciseCodeHistory.js +60 -67
  15. package/cjs/components/material-exercise/exercise-code-history/ExerciseCodeHistory.styled.js +8 -14
  16. package/cjs/components/material-exercise/exercise-code-history/locales/en.json.js +1 -1
  17. package/cjs/components/material-exercise/exercise-code-history/locales/ko.json.js +1 -1
  18. package/cjs/components/material-exercise/exercise-file/ExerciseFile.js +17 -21
  19. package/cjs/components/material-exercise/exercise-file-editor/ExerciseFileEditor.js +133 -203
  20. package/cjs/components/material-exercise/exercise-file-editor/ExerciseFileReadOnlyBanner.js +8 -12
  21. package/cjs/components/material-exercise/exercise-file-tabs/ExerciseFileTabs.js +24 -40
  22. package/cjs/components/material-exercise/exercise-file-tabs/ExerciseFileTabsFileTreeButton.js +38 -52
  23. package/cjs/components/material-exercise/exercise-file-tabs/ExerciseFileTabsLazy.js +5 -9
  24. package/cjs/components/material-exercise/exercise-file-tabs/locales/fileTreeButton.en.json.js +1 -1
  25. package/cjs/components/material-exercise/exercise-file-tabs/locales/fileTreeButton.ko.json.js +1 -1
  26. package/cjs/components/material-exercise/exercise-file-tree/ExerciseFileTree.js +189 -328
  27. package/cjs/components/material-exercise/exercise-file-tree/ExerciseFileTreeLazy.js +5 -9
  28. package/cjs/components/material-exercise/exercise-file-tree/locales/en.json.js +1 -1
  29. package/cjs/components/material-exercise/exercise-file-tree/locales/ko.json.js +1 -1
  30. package/cjs/components/material-exercise/exercise-file-viewer/ExerciseFileViewer.js +14 -17
  31. package/cjs/components/material-exercise/exercise-menu/ExerciseMenu.js +11 -15
  32. package/cjs/components/material-exercise/exercise-menu/ExerciseMenuArduinoAgentModalButton.js +7 -11
  33. package/cjs/components/material-exercise/exercise-menu/ExerciseMenuArduinoSettings.js +44 -65
  34. package/cjs/components/material-exercise/exercise-menu/ExerciseMenuDropdown.js +32 -61
  35. package/cjs/components/material-exercise/exercise-menu/ExerciseMenuReset.js +19 -35
  36. package/cjs/components/material-exercise/exercise-menu/ExerciseMenuStdioFileBrowser.js +48 -62
  37. package/cjs/components/material-exercise/exercise-menu/ExerciseMenuStdioFileBrowser.styled.js +12 -18
  38. package/cjs/components/material-exercise/exercise-menu/locales/en.json.js +1 -1
  39. package/cjs/components/material-exercise/exercise-menu/locales/ko.json.js +1 -1
  40. package/cjs/components/material-exercise/exercise-multilang-dropdown/ExerciseMultilangDropdown.js +21 -32
  41. package/cjs/components/material-exercise/exercise-multilang-dropdown/ExerciseMultilangDropdownLazy.js +4 -8
  42. package/cjs/components/material-exercise/exercise-preview/ExercisePreview.js +23 -27
  43. package/cjs/components/material-exercise/exercise-preview/ExercisePreviewDisplayModeButton.js +7 -17
  44. package/cjs/components/material-exercise/exercise-preview/locales/en.json.js +1 -1
  45. package/cjs/components/material-exercise/exercise-preview/locales/ko.json.js +1 -1
  46. package/cjs/components/material-exercise/exercise-rightpane/ExerciseRightpane.js +23 -32
  47. package/cjs/components/material-exercise/exercise-rightpane/ExerciseRightpaneEditorPerference.js +7 -15
  48. package/cjs/components/material-exercise/exercise-rightpane/ExerciseRightpaneEnvironment.js +79 -86
  49. package/cjs/components/material-exercise/exercise-rightpane/locales/en.json.js +1 -1
  50. package/cjs/components/material-exercise/exercise-rightpane/locales/ko.json.js +1 -1
  51. package/cjs/components/material-exercise/exercise-room/ExerciseRoom.js +11 -22
  52. package/cjs/components/material-exercise/exercise-room/ExerciseRoom.styled.js +12 -20
  53. package/cjs/components/material-exercise/exercise-room/ExerciseRoomDetail.js +180 -288
  54. package/cjs/components/material-exercise/exercise-room/ExerciseRoomList.js +82 -116
  55. package/cjs/components/material-exercise/exercise-room/helpers/exerciseRoomPermissionStringConvertor.js +2 -4
  56. package/cjs/components/material-exercise/exercise-room/locales/en.json.js +1 -1
  57. package/cjs/components/material-exercise/exercise-room/locales/ko.json.js +1 -1
  58. package/cjs/components/material-exercise/exercise-runner/ExerciseRunner.js +125 -181
  59. package/cjs/components/material-exercise/exercise-runner/ExerciseRunnerContext.js +1 -7
  60. package/cjs/components/material-exercise/exercise-runner/ExerciseRunnerController.js +13 -17
  61. package/cjs/components/material-exercise/exercise-runner/ExerciseRunnerControllerArduinoAgentModal.js +43 -58
  62. package/cjs/components/material-exercise/exercise-runner/ExerciseRunnerControllerArduinoStatusMessage.js +15 -27
  63. package/cjs/components/material-exercise/exercise-runner/ExerciseRunnerControllerButtonGroup.js +65 -68
  64. package/cjs/components/material-exercise/exercise-runner/ExerciseRunnerControllerCodeHelpRequestButton.js +23 -32
  65. package/cjs/components/material-exercise/exercise-runner/ExerciseRunnerControllerRunningInfo.js +58 -92
  66. package/cjs/components/material-exercise/exercise-runner/ExerciseRunnerControllerStatusIndicator.js +3 -7
  67. package/cjs/components/material-exercise/exercise-runner/ExerciseRunnerControllerStatusMessage.js +11 -16
  68. package/cjs/components/material-exercise/exercise-runner/ExerciseRunnerControllerTimer.js +18 -29
  69. package/cjs/components/material-exercise/exercise-runner/locales/en.json.js +1 -1
  70. package/cjs/components/material-exercise/exercise-runner/locales/ko.json.js +1 -1
  71. package/cjs/components/material-exercise/exercise-submit-history/ExerciseSubmitHistory.js +162 -282
  72. package/cjs/components/material-exercise/exercise-submit-history/ExerciseSubmitHistory.styled.js +8 -14
  73. package/cjs/components/material-exercise/exercise-submit-history/ExerciseSubmitHistoryOutput.js +41 -54
  74. package/cjs/components/material-exercise/exercise-submit-history/locales/en.json.js +1 -1
  75. package/cjs/components/material-exercise/exercise-submit-history/locales/ko.json.js +1 -1
  76. package/cjs/components/shared/exercise-menu-button/ExerciseMenuButton.js +15 -21
  77. package/cjs/components/shared/exercise-shimmer/ExerciseFileShimmer.js +14 -19
  78. package/cjs/components/shared/exercise-shimmer/ExerciseFileTabShimmer.js +16 -21
  79. package/cjs/components/shared/exercise-shimmer/ExerciseFileTabsShimmer.js +5 -10
  80. package/cjs/components/shared/exercise-shimmer/ExerciseFileTreeListItemShimmer.js +18 -23
  81. package/cjs/components/shared/exercise-shimmer/ExerciseFileTreeListShimmer.js +10 -21
  82. package/cjs/components/shared/exercise-version-list/ExerciseVersionList.js +5 -8
  83. package/cjs/components/shared/exercise-version-list/ExerciseVersionList.styled.js +1 -7
  84. package/cjs/components/shared/exercise-version-list/ExerciseVersionListItem.js +8 -11
  85. package/cjs/components/shared/exercise-version-list/ExerciseVersionListItem.styled.js +5 -15
  86. package/cjs/components/shared/file-icon/FileIcon.js +17 -23
  87. package/cjs/components/shared/file-tabs/FileTab.js +30 -36
  88. package/cjs/components/shared/file-tabs/FileTab.styled.js +15 -25
  89. package/cjs/components/shared/file-tabs/FileTabs.js +38 -63
  90. package/cjs/components/shared/file-tabs/FileTabs.styled.js +2 -8
  91. package/cjs/components/shared/file-tabs/util.js +14 -29
  92. package/cjs/components/shared/file-tree/FileTree.js +12 -17
  93. package/cjs/components/shared/file-tree/FileTreeConfig.js +22 -25
  94. package/cjs/components/shared/file-tree/FileTreeList.js +37 -39
  95. package/cjs/components/shared/file-tree/FileTreeListItemContent.js +61 -75
  96. package/cjs/components/shared/file-tree/FileTreeListItemContent.styled.js +21 -31
  97. package/cjs/components/shared/file-tree/FileTreeListItemContentInput.js +64 -72
  98. package/cjs/components/shared/file-tree/FileTreeListItemContentInput.styled.js +6 -12
  99. package/cjs/components/shared/file-tree/FileTreeListItemContentMenu.js +63 -74
  100. package/cjs/components/shared/file-tree/FileTreeListItems.js +136 -151
  101. package/cjs/components/shared/file-tree/FileTreeListItems.styled.js +2 -8
  102. package/cjs/components/shared/file-tree/FileTreeToolbar.js +31 -32
  103. package/cjs/components/shared/file-tree/FileTreeToolbar.styled.js +1 -7
  104. package/cjs/components/shared/file-tree/context/FileTreeContext.js +76 -97
  105. package/cjs/components/shared/file-tree/locales/en.json.js +1 -1
  106. package/cjs/components/shared/file-tree/locales/ko.json.js +1 -1
  107. package/cjs/components/shared/file-tree/utils/fileTreeFiles.js +20 -26
  108. package/cjs/components/shared/file-tree/utils/fileTreeGenerator.js +146 -195
  109. package/cjs/components/shared/file-tree/utils/fileTreeInput.js +0 -2
  110. package/cjs/components/shared/file-tree/utils/fileTreeItem.js +1 -3
  111. package/cjs/components/shared/file-tree/utils/fileTreePath.js +6 -7
  112. package/cjs/components/shared/file-viewer/FileViewer.js +37 -61
  113. package/cjs/components/shared/file-viewer/FileViewerCsv.js +108 -172
  114. package/cjs/components/shared/file-viewer/FileViewerImage.js +8 -12
  115. package/cjs/components/shared/file-viewer/FileViewerIpynb.js +10 -23
  116. package/cjs/components/shared/file-viewer/FileViewerNonViewable.js +33 -42
  117. package/cjs/components/shared/file-viewer/FileViewerText.js +12 -24
  118. package/cjs/components/shared/file-viewer/locales/en.json.js +1 -1
  119. package/cjs/components/shared/file-viewer/locales/ko.json.js +1 -1
  120. package/cjs/components/shared/file-viewer/locales/nonViewable.en.json.js +1 -1
  121. package/cjs/components/shared/file-viewer/locales/nonViewable.ko.json.js +1 -1
  122. package/cjs/components/shared/material-modal/MaterialModal.js +11 -14
  123. package/cjs/components/shared/material-modal/MaterialModal.styled.js +5 -11
  124. package/cjs/components/shared/monaco-editor/MonacoEditor.js +74 -99
  125. package/cjs/components/shared/monaco-editor/MonacoEditorLazy.js +6 -12
  126. package/cjs/components/shared/monaco-editor/MonacoEditorMobile.js +36 -50
  127. package/cjs/components/shared/monaco-editor/MonacoEditorPerferenceForm.js +91 -110
  128. package/cjs/components/shared/monaco-editor/constants/grammars/JSON.tmLanguage.json.js +1 -1
  129. package/cjs/components/shared/monaco-editor/constants/grammars/MagicPython.tmLanguage.json.js +1 -1
  130. package/cjs/components/shared/monaco-editor/constants/grammars/TypeScriptReact.tmLanguage.json.js +1 -1
  131. package/cjs/components/shared/monaco-editor/constants/grammars/asp-vb-net.tmlanguage.json.js +1 -1
  132. package/cjs/components/shared/monaco-editor/constants/grammars/c.tmLanguage.json.js +1 -1
  133. package/cjs/components/shared/monaco-editor/constants/grammars/cpp.tmLanguage.json.js +1 -1
  134. package/cjs/components/shared/monaco-editor/constants/grammars/csharp.tmLanguage.json.js +1 -1
  135. package/cjs/components/shared/monaco-editor/constants/grammars/css.tmLanguage.json.js +1 -1
  136. package/cjs/components/shared/monaco-editor/constants/grammars/dart.tmLanguage.json.js +1 -1
  137. package/cjs/components/shared/monaco-editor/constants/grammars/fsharp.tmLanguage.json.js +1 -1
  138. package/cjs/components/shared/monaco-editor/constants/grammars/go.tmLanguage.json.js +1 -1
  139. package/cjs/components/shared/monaco-editor/constants/grammars/html.tmLanguage.json.js +1 -1
  140. package/cjs/components/shared/monaco-editor/constants/grammars/index.js +28 -84
  141. package/cjs/components/shared/monaco-editor/constants/grammars/java.tmLanguage.json.js +1 -1
  142. package/cjs/components/shared/monaco-editor/constants/grammars/lua.tmLanguage.json.js +1 -1
  143. package/cjs/components/shared/monaco-editor/constants/grammars/objective-c.tmLanguage.json.js +1 -1
  144. package/cjs/components/shared/monaco-editor/constants/grammars/php.tmLanguage.json.js +1 -1
  145. package/cjs/components/shared/monaco-editor/constants/grammars/r.tmLanguage.json.js +1 -1
  146. package/cjs/components/shared/monaco-editor/constants/grammars/ruby.tmLanguage.json.js +1 -1
  147. package/cjs/components/shared/monaco-editor/constants/grammars/rust.tmLanguage.json.js +1 -1
  148. package/cjs/components/shared/monaco-editor/constants/grammars/scss.tmLanguage.json.js +1 -1
  149. package/cjs/components/shared/monaco-editor/constants/grammars/sql.tmLanguage.json.js +1 -1
  150. package/cjs/components/shared/monaco-editor/constants/grammars/swift.tmLanguage.json.js +1 -1
  151. package/cjs/components/shared/monaco-editor/constants/grammars/xml.tmLanguage.json.js +1 -1
  152. package/cjs/components/shared/monaco-editor/constants/grammars/yaml.tmLanguage.json.js +1 -1
  153. package/cjs/components/shared/monaco-editor/constants/monaco/preferences.js +5 -7
  154. package/cjs/components/shared/monaco-editor/constants/themes/abyss.json.js +1 -1
  155. package/cjs/components/shared/monaco-editor/constants/themes/elice.json.js +1 -1
  156. package/cjs/components/shared/monaco-editor/constants/themes/index.js +17 -51
  157. package/cjs/components/shared/monaco-editor/constants/themes/kimbie-dark.json.js +1 -1
  158. package/cjs/components/shared/monaco-editor/constants/themes/monokai.json.js +1 -1
  159. package/cjs/components/shared/monaco-editor/constants/themes/quietlight.json.js +1 -1
  160. package/cjs/components/shared/monaco-editor/constants/themes/red.json.js +1 -1
  161. package/cjs/components/shared/monaco-editor/constants/themes/solarized-dark.json.js +1 -1
  162. package/cjs/components/shared/monaco-editor/constants/themes/solarized-light.json.js +1 -1
  163. package/cjs/components/shared/monaco-editor/constants/themes/tomorrow-night-blue.json.js +1 -1
  164. package/cjs/components/shared/monaco-editor/constants/themes/vs-dark-plus.json.js +1 -1
  165. package/cjs/components/shared/monaco-editor/constants/themes/vs-dark.json.js +1 -1
  166. package/cjs/components/shared/monaco-editor/constants/themes/vs-hc-black.json.js +1 -1
  167. package/cjs/components/shared/monaco-editor/constants/themes/vs-hc-light.json.js +1 -1
  168. package/cjs/components/shared/monaco-editor/constants/themes/vs-light-plus.json.js +1 -1
  169. package/cjs/components/shared/monaco-editor/constants/themes/vs-light.json.js +1 -1
  170. package/cjs/components/shared/monaco-editor/editor-hooks/useMonacoEventChange.js +10 -13
  171. package/cjs/components/shared/monaco-editor/editor-hooks/useMonacoEventCursor.js +14 -17
  172. package/cjs/components/shared/monaco-editor/editor-hooks/useMonacoEventScroll.js +8 -11
  173. package/cjs/components/shared/monaco-editor/editor-hooks/useMonacoMarkers.js +30 -36
  174. package/cjs/components/shared/monaco-editor/editor-hooks/useMonacoOptions.js +7 -11
  175. package/cjs/components/shared/monaco-editor/editor-hooks/useMonacoTheme.js +6 -8
  176. package/cjs/components/shared/monaco-editor/editor-languages/css/formatter.js +11 -52
  177. package/cjs/components/shared/monaco-editor/editor-languages/css/index.js +7 -8
  178. package/cjs/components/shared/monaco-editor/editor-languages/html/formatter.js +11 -52
  179. package/cjs/components/shared/monaco-editor/editor-languages/html/index.js +5 -6
  180. package/cjs/components/shared/monaco-editor/editor-languages/index.js +4 -4
  181. package/cjs/components/shared/monaco-editor/editor-languages/typescript/dts/_helper.js +1 -3
  182. package/cjs/components/shared/monaco-editor/editor-languages/typescript/dts/express.js +1 -1
  183. package/cjs/components/shared/monaco-editor/editor-languages/typescript/dts/propTypes.js +1 -1
  184. package/cjs/components/shared/monaco-editor/editor-languages/typescript/dts/react.js +1 -1
  185. package/cjs/components/shared/monaco-editor/editor-languages/typescript/formatter.js +11 -56
  186. package/cjs/components/shared/monaco-editor/editor-languages/typescript/index.js +17 -18
  187. package/cjs/components/shared/monaco-editor/hooks/useEditorOptions.js +5 -13
  188. package/cjs/components/shared/monaco-editor/locales/en.json.js +1 -1
  189. package/cjs/components/shared/monaco-editor/locales/ko.json.js +1 -1
  190. package/cjs/components/shared/monaco-editor/utils/emmet/abbreviationActions.js +12 -12
  191. package/cjs/components/shared/monaco-editor/utils/emmet/emmet.js +0 -2
  192. package/cjs/components/shared/monaco-editor/utils/emmet/registerProvider.js +6 -14
  193. package/cjs/components/shared/monaco-editor/utils/grammar/index.js +25 -69
  194. package/cjs/components/shared/monaco-editor/utils/grammar/onigasm.js +6 -27
  195. package/cjs/components/shared/monaco-editor/utils/grammar/textmate.js +38 -73
  196. package/cjs/components/shared/monaco-editor/utils/monacoLanguage.js +8 -11
  197. package/cjs/components/shared/monaco-editor/utils/monacoPreference.js +4 -8
  198. package/cjs/components/shared/monaco-editor/utils/prettier/config.js +2 -4
  199. package/cjs/components/shared/monaco-editor/utils/prettier/index.js +8 -46
  200. package/cjs/components/shared/monaco-editor/utils/theme/convert.js +14 -26
  201. package/cjs/components/shared/monaco-editor/utils/theme/index.js +3 -24
  202. package/cjs/components/shared/monaco-editor/vendors/monaco-collab-ext/RemoteCursor.js +56 -79
  203. package/cjs/components/shared/monaco-editor/vendors/monaco-collab-ext/RemoteCursorManager.js +68 -84
  204. package/cjs/components/shared/monaco-editor/vendors/monaco-collab-ext/RemoteCursorWidget.js +93 -122
  205. package/cjs/components/shared/monaco-editor/vendors/monaco-collab-ext/RemoteSelection.js +133 -158
  206. package/cjs/components/shared/monaco-editor/vendors/monaco-collab-ext/RemoteSelectionManager.js +92 -106
  207. package/cjs/components/shared/monaco-editor/vendors/monaco-collab-ext/styles.js +2 -4
  208. package/cjs/components/shared/monaco-editor/vendors/vscode-emmet-helper/configCompat.js +6 -3
  209. package/cjs/components/shared/monaco-editor/vendors/vscode-emmet-helper/data.js +2 -4
  210. package/cjs/components/shared/monaco-editor/vendors/vscode-emmet-helper/emmetHelper.js +158 -179
  211. package/cjs/components/shared/monaco-editor/vendors/vscode-emmet-helper/utils.js +3 -5
  212. package/cjs/components/shared/no-vnc/NoVnc.js +57 -86
  213. package/cjs/components/shared/no-vnc/NoVncLazy.js +5 -11
  214. package/cjs/components/shared/preview-container/PreviewContainer.js +11 -15
  215. package/cjs/components/shared/web-browser/WebBrowser.js +37 -53
  216. package/cjs/components/shared/xterm/Xterm.js +58 -81
  217. package/cjs/components/shared/xterm/XtermLazy.js +5 -11
  218. package/cjs/components/shared/xterm/locales/en.json.js +1 -1
  219. package/cjs/components/shared/xterm/locales/ko.json.js +1 -1
  220. package/cjs/components/shared/xterm/utils/index.js +0 -2
  221. package/cjs/constants/arduino.js +10 -12
  222. package/cjs/constants/shortcutKeyMap.js +2 -4
  223. package/cjs/constants/stylesheets.js +5 -9
  224. package/cjs/hooks/useArduino.js +141 -284
  225. package/cjs/hooks/useExerciseFile.js +22 -26
  226. package/cjs/hooks/useExericseShortcut.js +4 -8
  227. package/cjs/hooks/useMaterialExerciseFileUrl.js +33 -57
  228. package/cjs/hooks/useRunnerRoomWebSocket.js +27 -53
  229. package/cjs/hooks/useStdioTextConcator.js +10 -22
  230. package/cjs/hooks/useStdioWebSocket.js +28 -34
  231. package/cjs/hooks/useUsercodeEditWebSocket.js +158 -240
  232. package/cjs/hooks/useUsercodeHistory.js +63 -117
  233. package/cjs/index.js +4 -6
  234. package/cjs/utils/arduino.js +11 -25
  235. package/cjs/utils/exerciseFile.js +10 -10
  236. package/cjs/utils/runner.js +15 -31
  237. package/es/components/material-exercise/MaterialExercise.i18n.js +2 -2
  238. package/es/components/material-exercise/MaterialExercise.js +34 -35
  239. package/es/components/material-exercise/MaterialExercise.styled.js +14 -14
  240. package/es/components/material-exercise/MaterialExerciseMobile.js +6 -9
  241. package/es/components/material-exercise/context/ExerciseIntlProvider.js +10 -8
  242. package/es/components/material-exercise/context/ExerciseProvider.js +52 -55
  243. package/es/components/material-exercise/context/ExerciseProviderNoImage.js +10 -10
  244. package/es/components/material-exercise/context/context.js +1 -1
  245. package/es/components/material-exercise/context/recoil.js +290 -535
  246. package/es/components/material-exercise/context/subjects.js +3 -3
  247. package/es/components/material-exercise/exercise-code-history/ExerciseCodeHistory.js +51 -53
  248. package/es/components/material-exercise/exercise-code-history/ExerciseCodeHistory.styled.js +8 -8
  249. package/es/components/material-exercise/exercise-file/ExerciseFile.js +9 -8
  250. package/es/components/material-exercise/exercise-file-editor/ExerciseFileEditor.js +127 -193
  251. package/es/components/material-exercise/exercise-file-editor/ExerciseFileReadOnlyBanner.js +5 -4
  252. package/es/components/material-exercise/exercise-file-tabs/ExerciseFileTabs.js +20 -31
  253. package/es/components/material-exercise/exercise-file-tabs/ExerciseFileTabsFileTreeButton.js +35 -44
  254. package/es/components/material-exercise/exercise-file-tabs/ExerciseFileTabsLazy.js +1 -1
  255. package/es/components/material-exercise/exercise-file-tree/ExerciseFileTree.js +181 -315
  256. package/es/components/material-exercise/exercise-file-tree/ExerciseFileTreeLazy.js +1 -1
  257. package/es/components/material-exercise/exercise-file-viewer/ExerciseFileViewer.js +11 -10
  258. package/es/components/material-exercise/exercise-menu/ExerciseMenu.js +7 -6
  259. package/es/components/material-exercise/exercise-menu/ExerciseMenuArduinoAgentModalButton.js +3 -3
  260. package/es/components/material-exercise/exercise-menu/ExerciseMenuArduinoSettings.js +25 -42
  261. package/es/components/material-exercise/exercise-menu/ExerciseMenuDropdown.js +26 -51
  262. package/es/components/material-exercise/exercise-menu/ExerciseMenuReset.js +11 -23
  263. package/es/components/material-exercise/exercise-menu/ExerciseMenuStdioFileBrowser.js +21 -31
  264. package/es/components/material-exercise/exercise-menu/ExerciseMenuStdioFileBrowser.styled.js +12 -12
  265. package/es/components/material-exercise/exercise-multilang-dropdown/ExerciseMultilangDropdown.js +19 -26
  266. package/es/components/material-exercise/exercise-multilang-dropdown/ExerciseMultilangDropdownLazy.js +1 -1
  267. package/es/components/material-exercise/exercise-preview/ExercisePreview.js +15 -14
  268. package/es/components/material-exercise/exercise-preview/ExercisePreviewDisplayModeButton.js +5 -11
  269. package/es/components/material-exercise/exercise-rightpane/ExerciseRightpane.js +11 -15
  270. package/es/components/material-exercise/exercise-rightpane/ExerciseRightpaneEditorPerference.js +5 -9
  271. package/es/components/material-exercise/exercise-rightpane/ExerciseRightpaneEnvironment.js +78 -80
  272. package/es/components/material-exercise/exercise-room/ExerciseRoom.js +6 -13
  273. package/es/components/material-exercise/exercise-room/ExerciseRoom.styled.js +12 -14
  274. package/es/components/material-exercise/exercise-room/ExerciseRoomDetail.js +134 -236
  275. package/es/components/material-exercise/exercise-room/ExerciseRoomList.js +65 -94
  276. package/es/components/material-exercise/exercise-room/helpers/exerciseRoomPermissionStringConvertor.js +2 -2
  277. package/es/components/material-exercise/exercise-runner/ExerciseRunner.js +116 -167
  278. package/es/components/material-exercise/exercise-runner/ExerciseRunnerContext.js +1 -1
  279. package/es/components/material-exercise/exercise-runner/ExerciseRunnerController.js +8 -7
  280. package/es/components/material-exercise/exercise-runner/ExerciseRunnerControllerArduinoAgentModal.js +17 -27
  281. package/es/components/material-exercise/exercise-runner/ExerciseRunnerControllerArduinoStatusMessage.js +11 -18
  282. package/es/components/material-exercise/exercise-runner/ExerciseRunnerControllerButtonGroup.js +52 -50
  283. package/es/components/material-exercise/exercise-runner/ExerciseRunnerControllerCodeHelpRequestButton.js +10 -14
  284. package/es/components/material-exercise/exercise-runner/ExerciseRunnerControllerRunningInfo.js +46 -75
  285. package/es/components/material-exercise/exercise-runner/ExerciseRunnerControllerStatusIndicator.js +2 -2
  286. package/es/components/material-exercise/exercise-runner/ExerciseRunnerControllerStatusMessage.js +4 -4
  287. package/es/components/material-exercise/exercise-runner/ExerciseRunnerControllerTimer.js +15 -21
  288. package/es/components/material-exercise/exercise-submit-history/ExerciseSubmitHistory.js +138 -253
  289. package/es/components/material-exercise/exercise-submit-history/ExerciseSubmitHistory.styled.js +8 -8
  290. package/es/components/material-exercise/exercise-submit-history/ExerciseSubmitHistoryOutput.js +29 -37
  291. package/es/components/shared/exercise-menu-button/ExerciseMenuButton.js +12 -13
  292. package/es/components/shared/exercise-shimmer/ExerciseFileShimmer.js +2 -2
  293. package/es/components/shared/exercise-shimmer/ExerciseFileTabShimmer.js +12 -12
  294. package/es/components/shared/exercise-shimmer/ExerciseFileTabsShimmer.js +2 -2
  295. package/es/components/shared/exercise-shimmer/ExerciseFileTreeListItemShimmer.js +14 -14
  296. package/es/components/shared/exercise-shimmer/ExerciseFileTreeListShimmer.js +9 -15
  297. package/es/components/shared/exercise-version-list/ExerciseVersionList.js +3 -2
  298. package/es/components/shared/exercise-version-list/ExerciseVersionList.styled.js +1 -1
  299. package/es/components/shared/exercise-version-list/ExerciseVersionListItem.js +6 -5
  300. package/es/components/shared/exercise-version-list/ExerciseVersionListItem.styled.js +5 -9
  301. package/es/components/shared/file-icon/FileIcon.js +15 -17
  302. package/es/components/shared/file-tabs/FileTab.js +22 -24
  303. package/es/components/shared/file-tabs/FileTab.styled.js +15 -19
  304. package/es/components/shared/file-tabs/FileTabs.js +35 -55
  305. package/es/components/shared/file-tabs/FileTabs.styled.js +2 -2
  306. package/es/components/shared/file-tabs/util.js +14 -27
  307. package/es/components/shared/file-tree/FileTree.js +3 -3
  308. package/es/components/shared/file-tree/FileTreeConfig.js +18 -15
  309. package/es/components/shared/file-tree/FileTreeList.js +33 -29
  310. package/es/components/shared/file-tree/FileTreeListItemContent.js +45 -55
  311. package/es/components/shared/file-tree/FileTreeListItemContent.styled.js +21 -25
  312. package/es/components/shared/file-tree/FileTreeListItemContentInput.js +60 -64
  313. package/es/components/shared/file-tree/FileTreeListItemContentInput.styled.js +6 -6
  314. package/es/components/shared/file-tree/FileTreeListItemContentMenu.js +39 -46
  315. package/es/components/shared/file-tree/FileTreeListItems.js +134 -145
  316. package/es/components/shared/file-tree/FileTreeListItems.styled.js +2 -2
  317. package/es/components/shared/file-tree/FileTreeToolbar.js +25 -22
  318. package/es/components/shared/file-tree/FileTreeToolbar.styled.js +1 -1
  319. package/es/components/shared/file-tree/context/FileTreeContext.js +74 -89
  320. package/es/components/shared/file-tree/utils/fileTreeFiles.js +20 -20
  321. package/es/components/shared/file-tree/utils/fileTreeGenerator.js +146 -193
  322. package/es/components/shared/file-tree/utils/fileTreeItem.js +1 -1
  323. package/es/components/shared/file-tree/utils/fileTreePath.js +6 -5
  324. package/es/components/shared/file-viewer/FileViewer.js +21 -38
  325. package/es/components/shared/file-viewer/FileViewerCsv.js +70 -129
  326. package/es/components/shared/file-viewer/FileViewerImage.js +4 -3
  327. package/es/components/shared/file-viewer/FileViewerIpynb.js +7 -14
  328. package/es/components/shared/file-viewer/FileViewerNonViewable.js +15 -18
  329. package/es/components/shared/file-viewer/FileViewerText.js +9 -17
  330. package/es/components/shared/material-modal/MaterialModal.js +8 -7
  331. package/es/components/shared/material-modal/MaterialModal.styled.js +5 -5
  332. package/es/components/shared/monaco-editor/MonacoEditor.js +67 -87
  333. package/es/components/shared/monaco-editor/MonacoEditorLazy.js +2 -4
  334. package/es/components/shared/monaco-editor/MonacoEditorMobile.js +31 -41
  335. package/es/components/shared/monaco-editor/MonacoEditorPerferenceForm.js +52 -66
  336. package/es/components/shared/monaco-editor/constants/grammars/index.js +28 -82
  337. package/es/components/shared/monaco-editor/constants/monaco/preferences.js +5 -5
  338. package/es/components/shared/monaco-editor/constants/themes/index.js +17 -49
  339. package/es/components/shared/monaco-editor/editor-hooks/useMonacoEventChange.js +10 -11
  340. package/es/components/shared/monaco-editor/editor-hooks/useMonacoEventCursor.js +14 -15
  341. package/es/components/shared/monaco-editor/editor-hooks/useMonacoEventScroll.js +8 -9
  342. package/es/components/shared/monaco-editor/editor-hooks/useMonacoMarkers.js +30 -34
  343. package/es/components/shared/monaco-editor/editor-hooks/useMonacoOptions.js +7 -9
  344. package/es/components/shared/monaco-editor/editor-hooks/useMonacoTheme.js +6 -6
  345. package/es/components/shared/monaco-editor/editor-languages/css/formatter.js +10 -33
  346. package/es/components/shared/monaco-editor/editor-languages/html/formatter.js +10 -33
  347. package/es/components/shared/monaco-editor/editor-languages/typescript/dts/_helper.js +1 -1
  348. package/es/components/shared/monaco-editor/editor-languages/typescript/formatter.js +10 -37
  349. package/es/components/shared/monaco-editor/editor-languages/typescript/index.js +3 -3
  350. package/es/components/shared/monaco-editor/hooks/useEditorOptions.js +5 -11
  351. package/es/components/shared/monaco-editor/utils/emmet/abbreviationActions.js +12 -10
  352. package/es/components/shared/monaco-editor/utils/emmet/registerProvider.js +6 -12
  353. package/es/components/shared/monaco-editor/utils/grammar/index.js +24 -68
  354. package/es/components/shared/monaco-editor/utils/grammar/onigasm.js +6 -25
  355. package/es/components/shared/monaco-editor/utils/grammar/textmate.js +35 -67
  356. package/es/components/shared/monaco-editor/utils/monacoLanguage.js +5 -5
  357. package/es/components/shared/monaco-editor/utils/monacoPreference.js +4 -6
  358. package/es/components/shared/monaco-editor/utils/prettier/config.js +2 -2
  359. package/es/components/shared/monaco-editor/utils/prettier/index.js +7 -27
  360. package/es/components/shared/monaco-editor/utils/theme/convert.js +13 -19
  361. package/es/components/shared/monaco-editor/utils/theme/index.js +3 -22
  362. package/es/components/shared/monaco-editor/vendors/monaco-collab-ext/RemoteCursor.js +56 -77
  363. package/es/components/shared/monaco-editor/vendors/monaco-collab-ext/RemoteCursorManager.js +68 -82
  364. package/es/components/shared/monaco-editor/vendors/monaco-collab-ext/RemoteCursorWidget.js +93 -120
  365. package/es/components/shared/monaco-editor/vendors/monaco-collab-ext/RemoteSelection.js +130 -152
  366. package/es/components/shared/monaco-editor/vendors/monaco-collab-ext/RemoteSelectionManager.js +92 -104
  367. package/es/components/shared/monaco-editor/vendors/monaco-collab-ext/styles.js +2 -2
  368. package/es/components/shared/monaco-editor/vendors/vscode-emmet-helper/configCompat.js +6 -1
  369. package/es/components/shared/monaco-editor/vendors/vscode-emmet-helper/data.js +2 -2
  370. package/es/components/shared/monaco-editor/vendors/vscode-emmet-helper/emmetHelper.js +157 -172
  371. package/es/components/shared/monaco-editor/vendors/vscode-emmet-helper/utils.js +3 -3
  372. package/es/components/shared/no-vnc/NoVnc.js +42 -59
  373. package/es/components/shared/no-vnc/NoVncLazy.js +2 -4
  374. package/es/components/shared/preview-container/PreviewContainer.js +8 -7
  375. package/es/components/shared/web-browser/WebBrowser.js +29 -40
  376. package/es/components/shared/xterm/Xterm.js +51 -69
  377. package/es/components/shared/xterm/XtermLazy.js +2 -4
  378. package/es/constants/arduino.js +10 -10
  379. package/es/constants/shortcutKeyMap.js +1 -3
  380. package/es/constants/stylesheets.js +5 -7
  381. package/es/hooks/useArduino.js +141 -278
  382. package/es/hooks/useExerciseFile.js +22 -24
  383. package/es/hooks/useExericseShortcut.js +4 -6
  384. package/es/hooks/useMaterialExerciseFileUrl.js +34 -52
  385. package/es/hooks/useRunnerRoomWebSocket.js +27 -51
  386. package/es/hooks/useStdioTextConcator.js +10 -16
  387. package/es/hooks/useStdioWebSocket.js +28 -32
  388. package/es/hooks/useUsercodeEditWebSocket.js +157 -232
  389. package/es/hooks/useUsercodeHistory.js +63 -115
  390. package/es/utils/arduino.js +11 -23
  391. package/es/utils/exerciseFile.js +10 -8
  392. package/es/utils/runner.js +15 -29
  393. package/package.json +11 -7
  394. package/cjs/_virtual/_rollupPluginBabelHelpers.js +0 -521
  395. package/es/_virtual/_rollupPluginBabelHelpers.js +0 -499
@@ -1,5 +1,3 @@
1
- import { createClass as _createClass, classCallCheck as _classCallCheck } from '../../../../../_virtual/_rollupPluginBabelHelpers.js';
2
-
3
1
  /* ====================================================================================================
4
2
  * These codes forked and modified from `convergencelabs/monaco-collab-ext`
5
3
  * under the terms of the MIT license.
@@ -11,85 +9,66 @@ import { createClass as _createClass, classCallCheck as _classCallCheck } from '
11
9
  * The RemoteCursor class represents a remote cursor in the MonacoEditor. This
12
10
  * class allows you to control the location and visibility of the cursor.
13
11
  */
14
- var RemoteCursor = /*#__PURE__*/function () {
15
- function RemoteCursor(delegate) {
16
- _classCallCheck(this, RemoteCursor);
12
+ class RemoteCursor {
13
+ constructor(delegate) {
17
14
  this._delegate = delegate;
18
15
  }
19
16
  /**
20
17
  * Gets the unique id of this cursor.
21
18
  */
22
- _createClass(RemoteCursor, [{
23
- key: "getId",
24
- value: function getId() {
25
- return this._delegate.getId();
26
- }
27
- /**
28
- * Gets the position of the cursor.
29
- */
30
- }, {
31
- key: "getPosition",
32
- value: function getPosition() {
33
- var _a;
34
- return (_a = this._delegate.getPosition()) === null || _a === void 0 ? void 0 : _a.position;
35
- }
36
- /**
37
- * Sets the location of the cursor based on a Monaco Editor IPosition.
38
- */
39
- }, {
40
- key: "setPosition",
41
- value: function setPosition(position) {
42
- this._delegate.setPosition(position);
43
- }
44
- /**
45
- * Sets the location of the cursor using a zero-based text offset.
46
- *
47
- * @param offset
48
- * The offset of the cursor.
49
- */
50
- }, {
51
- key: "setOffset",
52
- value: function setOffset(offset) {
53
- this._delegate.setOffset(offset);
54
- }
55
- /**
56
- * Shows the cursor if it is hidden.
57
- */
58
- }, {
59
- key: "show",
60
- value: function show() {
61
- this._delegate.show();
62
- }
63
- /**
64
- * Hides the cursor if it is shown.
65
- */
66
- }, {
67
- key: "hide",
68
- value: function hide() {
69
- this._delegate.hide();
70
- }
71
- /**
72
- * Determines if the cursor has already been disposed. A cursor is disposed
73
- * when it has been permanently removed from the editor.
74
- *
75
- * @returns
76
- * True if the cursor has been disposed, false otherwise.
77
- */
78
- }, {
79
- key: "isDisposed",
80
- value: function isDisposed() {
81
- return this._delegate.isDisposed();
82
- }
83
- /**
84
- * Disposes of this cursor, removing it from the editor.
85
- */
86
- }, {
87
- key: "dispose",
88
- value: function dispose() {
89
- this._delegate.dispose();
90
- }
91
- }]);
92
- return RemoteCursor;
93
- }();
19
+ getId() {
20
+ return this._delegate.getId();
21
+ }
22
+ /**
23
+ * Gets the position of the cursor.
24
+ */
25
+ getPosition() {
26
+ var _a;
27
+ return (_a = this._delegate.getPosition()) === null || _a === void 0 ? void 0 : _a.position;
28
+ }
29
+ /**
30
+ * Sets the location of the cursor based on a Monaco Editor IPosition.
31
+ */
32
+ setPosition(position) {
33
+ this._delegate.setPosition(position);
34
+ }
35
+ /**
36
+ * Sets the location of the cursor using a zero-based text offset.
37
+ *
38
+ * @param offset
39
+ * The offset of the cursor.
40
+ */
41
+ setOffset(offset) {
42
+ this._delegate.setOffset(offset);
43
+ }
44
+ /**
45
+ * Shows the cursor if it is hidden.
46
+ */
47
+ show() {
48
+ this._delegate.show();
49
+ }
50
+ /**
51
+ * Hides the cursor if it is shown.
52
+ */
53
+ hide() {
54
+ this._delegate.hide();
55
+ }
56
+ /**
57
+ * Determines if the cursor has already been disposed. A cursor is disposed
58
+ * when it has been permanently removed from the editor.
59
+ *
60
+ * @returns
61
+ * True if the cursor has been disposed, false otherwise.
62
+ */
63
+ isDisposed() {
64
+ return this._delegate.isDisposed();
65
+ }
66
+ /**
67
+ * Disposes of this cursor, removing it from the editor.
68
+ */
69
+ dispose() {
70
+ this._delegate.dispose();
71
+ }
72
+ }
94
73
 
95
74
  export { RemoteCursor };
@@ -1,10 +1,15 @@
1
- import { createClass as _createClass, classCallCheck as _classCallCheck } from '../../../../../_virtual/_rollupPluginBabelHelpers.js';
2
1
  import { RemoteCursor } from './RemoteCursor.js';
3
2
  import { RemoteCursorWidget } from './RemoteCursorWidget.js';
4
3
 
5
- var RemoteCursorManager = /*#__PURE__*/function () {
6
- function RemoteCursorManager(options) {
7
- _classCallCheck(this, RemoteCursorManager);
4
+ /* ====================================================================================================
5
+ * These codes forked and modified from `convergencelabs/monaco-collab-ext`
6
+ * under the terms of the MIT license.
7
+ * Make sure to check the original project if any issue exists.
8
+ * - project: https://github.com/convergencelabs/monaco-collab-ext
9
+ * - codes: https://github.com/convergencelabs/monaco-collab-ext/tree/6ece72028e4b8fb35e9928a304fbdfe28a4e7be9/src/ts
10
+ * ==================================================================================================== */
11
+ class RemoteCursorManager {
12
+ constructor(options) {
8
13
  var _a, _b;
9
14
  this._options = {
10
15
  editor: options.editor,
@@ -17,88 +22,69 @@ var RemoteCursorManager = /*#__PURE__*/function () {
17
22
  /**
18
23
  * Adds a new remote cursor to the editor.
19
24
  */
20
- _createClass(RemoteCursorManager, [{
21
- key: "addCursor",
22
- value: function addCursor(id, color, label) {
23
- var _this = this;
24
- var widgetId = "".concat(this._nextWidgetId++);
25
- var tooltipDurationMs = this._options.tooltipDuration * 1000;
26
- var cursorWidget = new RemoteCursorWidget(this._options.editor, widgetId, color, label !== null && label !== void 0 ? label : '', this._options.tooltips, tooltipDurationMs, function () {
27
- return _this.removeCursor(id);
28
- });
29
- this._cursorWidgets.set(id, cursorWidget);
30
- return new RemoteCursor(cursorWidget);
31
- }
32
- /**
33
- * Removes the remote cursor from the editor.
34
- */
35
- }, {
36
- key: "removeCursor",
37
- value: function removeCursor(id) {
38
- var remoteCursorWidget = this._getCursor(id);
39
- if (remoteCursorWidget && !remoteCursorWidget.isDisposed()) {
40
- remoteCursorWidget.dispose();
41
- }
42
- this._cursorWidgets.delete(id);
43
- }
44
- /**
45
- * Updates the location of the specified remote cursor
46
- * using a Monaco IPosition object.
47
- */
48
- }, {
49
- key: "setCursorPosition",
50
- value: function setCursorPosition(id, position) {
51
- var remoteCursorWidget = this._getCursor(id);
52
- if (remoteCursorWidget) {
53
- remoteCursorWidget.setPosition(position);
54
- }
25
+ addCursor(id, color, label) {
26
+ const widgetId = `${this._nextWidgetId++}`;
27
+ const tooltipDurationMs = this._options.tooltipDuration * 1000;
28
+ const cursorWidget = new RemoteCursorWidget(this._options.editor, widgetId, color, label !== null && label !== void 0 ? label : '', this._options.tooltips, tooltipDurationMs, () => this.removeCursor(id));
29
+ this._cursorWidgets.set(id, cursorWidget);
30
+ return new RemoteCursor(cursorWidget);
31
+ }
32
+ /**
33
+ * Removes the remote cursor from the editor.
34
+ */
35
+ removeCursor(id) {
36
+ const remoteCursorWidget = this._getCursor(id);
37
+ if (remoteCursorWidget && !remoteCursorWidget.isDisposed()) {
38
+ remoteCursorWidget.dispose();
55
39
  }
56
- /**
57
- * Updates the location of the specified remote cursor
58
- * based on a zero-based text offset.
59
- */
60
- }, {
61
- key: "setCursorOffset",
62
- value: function setCursorOffset(id, offset) {
63
- var remoteCursorWidget = this._getCursor(id);
64
- if (remoteCursorWidget) {
65
- remoteCursorWidget.setOffset(offset);
66
- }
40
+ this._cursorWidgets.delete(id);
41
+ }
42
+ /**
43
+ * Updates the location of the specified remote cursor
44
+ * using a Monaco IPosition object.
45
+ */
46
+ setCursorPosition(id, position) {
47
+ const remoteCursorWidget = this._getCursor(id);
48
+ if (remoteCursorWidget) {
49
+ remoteCursorWidget.setPosition(position);
67
50
  }
68
- /**
69
- * Shows the specified cursor. Note the cursor may be scrolled out of view.
70
- */
71
- }, {
72
- key: "showCursor",
73
- value: function showCursor(id) {
74
- var remoteCursorWidget = this._getCursor(id);
75
- if (remoteCursorWidget) {
76
- remoteCursorWidget.show();
77
- }
51
+ }
52
+ /**
53
+ * Updates the location of the specified remote cursor
54
+ * based on a zero-based text offset.
55
+ */
56
+ setCursorOffset(id, offset) {
57
+ const remoteCursorWidget = this._getCursor(id);
58
+ if (remoteCursorWidget) {
59
+ remoteCursorWidget.setOffset(offset);
78
60
  }
79
- /**
80
- * Hides the specified cursor.
81
- */
82
- }, {
83
- key: "hideCursor",
84
- value: function hideCursor(id) {
85
- var remoteCursorWidget = this._getCursor(id);
86
- if (remoteCursorWidget) {
87
- remoteCursorWidget.hide();
88
- }
61
+ }
62
+ /**
63
+ * Shows the specified cursor. Note the cursor may be scrolled out of view.
64
+ */
65
+ showCursor(id) {
66
+ const remoteCursorWidget = this._getCursor(id);
67
+ if (remoteCursorWidget) {
68
+ remoteCursorWidget.show();
89
69
  }
90
- /**
91
- * A helper method that gets a cursor by id, or throws an exception.
92
- * @internal
93
- */
94
- }, {
95
- key: "_getCursor",
96
- value: function _getCursor(id) {
97
- var _a;
98
- return (_a = this._cursorWidgets.get(id)) !== null && _a !== void 0 ? _a : null;
70
+ }
71
+ /**
72
+ * Hides the specified cursor.
73
+ */
74
+ hideCursor(id) {
75
+ const remoteCursorWidget = this._getCursor(id);
76
+ if (remoteCursorWidget) {
77
+ remoteCursorWidget.hide();
99
78
  }
100
- }]);
101
- return RemoteCursorManager;
102
- }();
79
+ }
80
+ /**
81
+ * A helper method that gets a cursor by id, or throws an exception.
82
+ * @internal
83
+ */
84
+ _getCursor(id) {
85
+ var _a;
86
+ return (_a = this._cursorWidgets.get(id)) !== null && _a !== void 0 ? _a : null;
87
+ }
88
+ }
103
89
 
104
90
  export { RemoteCursorManager };
@@ -1,7 +1,13 @@
1
- import { createClass as _createClass, classCallCheck as _classCallCheck } from '../../../../../_virtual/_rollupPluginBabelHelpers.js';
2
1
  import { editor } from 'monaco-editor/esm/vs/editor/editor.api';
3
2
  import { REMOTE_MARKER_CLASS_NAME } from './styles.js';
4
3
 
4
+ /* ====================================================================================================
5
+ * These codes forked and modified from `convergencelabs/monaco-collab-ext`
6
+ * under the terms of the MIT license.
7
+ * Make sure to check the original project if any issue exists.
8
+ * - project: https://github.com/convergencelabs/monaco-collab-ext
9
+ * - codes: https://github.com/convergencelabs/monaco-collab-ext/tree/6ece72028e4b8fb35e9928a304fbdfe28a4e7be9/src/ts
10
+ * ==================================================================================================== */
5
11
  function getConfiguration(editorInstance) {
6
12
  // Support for Monaco < 0.19.0
7
13
  if (typeof editorInstance.getConfiguration === 'function') {
@@ -11,33 +17,32 @@ function getConfiguration(editorInstance) {
11
17
  lineHeight: editorInstance.getOption(editor.EditorOption.lineHeight)
12
18
  };
13
19
  }
14
- var RemoteCursorWidget = /*#__PURE__*/function () {
15
- function RemoteCursorWidget(codeEditor, widgetId, color, label, tooltipEnabled, tooltipDuration, onDisposed) {
16
- var _this = this;
17
- _classCallCheck(this, RemoteCursorWidget);
20
+ class RemoteCursorWidget {
21
+ constructor(codeEditor, widgetId, color, label, tooltipEnabled, tooltipDuration, onDisposed) {
18
22
  this._position = null;
19
23
  this._editor = codeEditor;
20
24
  this._tooltipDuration = tooltipDuration;
21
- this._id = "".concat(REMOTE_MARKER_CLASS_NAME, "-cursor-").concat(widgetId);
25
+ this._id = `${REMOTE_MARKER_CLASS_NAME}-cursor-${widgetId}`;
22
26
  this._onDisposed = onDisposed;
23
27
  // Create the main node for the cursor element.
24
- var _getConfiguration = getConfiguration(this._editor),
25
- lineHeight = _getConfiguration.lineHeight;
28
+ const {
29
+ lineHeight
30
+ } = getConfiguration(this._editor);
26
31
  this._domNode = document.createElement('div');
27
- this._domNode.className = "".concat(REMOTE_MARKER_CLASS_NAME, "-cursor");
32
+ this._domNode.className = `${REMOTE_MARKER_CLASS_NAME}-cursor`;
28
33
  this._domNode.style.background = color;
29
- this._domNode.style.height = "".concat(lineHeight, "px");
34
+ this._domNode.style.height = `${lineHeight}px`;
30
35
  // Create the tooltip element if the tooltip is enabled.
31
36
  if (tooltipEnabled) {
32
37
  this._tooltipNode = document.createElement('div');
33
- this._tooltipNode.className = "".concat(REMOTE_MARKER_CLASS_NAME, "-cursor-tooltip");
38
+ this._tooltipNode.className = `${REMOTE_MARKER_CLASS_NAME}-cursor-tooltip`;
34
39
  this._tooltipNode.style.background = color;
35
40
  this._tooltipNode.innerHTML = label;
36
41
  this._domNode.appendChild(this._tooltipNode);
37
42
  // we only need to listen to scroll positions to update the
38
43
  // tooltip location on scrolling.
39
- this._scrollListener = this._editor.onDidScrollChange(function () {
40
- _this._updateTooltipPosition();
44
+ this._scrollListener = this._editor.onDidScrollChange(() => {
45
+ this._updateTooltipPosition();
41
46
  });
42
47
  } else {
43
48
  this._tooltipNode = null;
@@ -47,121 +52,89 @@ var RemoteCursorWidget = /*#__PURE__*/function () {
47
52
  this._editor.addContentWidget(this);
48
53
  this._disposed = false;
49
54
  }
50
- _createClass(RemoteCursorWidget, [{
51
- key: "hide",
52
- value: function hide() {
53
- this._domNode.style.display = 'none';
54
- }
55
- }, {
56
- key: "show",
57
- value: function show() {
58
- this._domNode.style.display = 'inherit';
59
- }
60
- }, {
61
- key: "setOffset",
62
- value: function setOffset(offset) {
63
- var _a;
64
- var position = (_a = this._editor.getModel()) === null || _a === void 0 ? void 0 : _a.getPositionAt(offset);
65
- if (position) {
66
- this.setPosition(position);
67
- }
68
- }
69
- }, {
70
- key: "setPosition",
71
- value: function setPosition(position) {
72
- var _this2 = this;
73
- this._updatePosition(position);
74
- if (this._tooltipNode !== null) {
75
- setTimeout(function () {
76
- return _this2._showTooltip();
77
- }, 0);
78
- }
79
- }
80
- }, {
81
- key: "isDisposed",
82
- value: function isDisposed() {
83
- return this._disposed;
55
+ hide() {
56
+ this._domNode.style.display = 'none';
57
+ }
58
+ show() {
59
+ this._domNode.style.display = 'inherit';
60
+ }
61
+ setOffset(offset) {
62
+ var _a;
63
+ const position = (_a = this._editor.getModel()) === null || _a === void 0 ? void 0 : _a.getPositionAt(offset);
64
+ if (position) {
65
+ this.setPosition(position);
84
66
  }
85
- }, {
86
- key: "dispose",
87
- value: function dispose() {
88
- if (this._disposed) {
89
- return;
90
- }
91
- this._editor.removeContentWidget(this);
92
- if (this._scrollListener !== null) {
93
- this._scrollListener.dispose();
94
- }
95
- this._disposed = true;
96
- this._onDisposed();
67
+ }
68
+ setPosition(position) {
69
+ this._updatePosition(position);
70
+ if (this._tooltipNode !== null) {
71
+ setTimeout(() => this._showTooltip(), 0);
97
72
  }
98
- }, {
99
- key: "getId",
100
- value: function getId() {
101
- return this._id;
73
+ }
74
+ isDisposed() {
75
+ return this._disposed;
76
+ }
77
+ dispose() {
78
+ if (this._disposed) {
79
+ return;
102
80
  }
103
- }, {
104
- key: "getDomNode",
105
- value: function getDomNode() {
106
- return this._domNode;
81
+ this._editor.removeContentWidget(this);
82
+ if (this._scrollListener !== null) {
83
+ this._scrollListener.dispose();
107
84
  }
108
- }, {
109
- key: "getPosition",
110
- value: function getPosition() {
111
- return this._position;
85
+ this._disposed = true;
86
+ this._onDisposed();
87
+ }
88
+ getId() {
89
+ return this._id;
90
+ }
91
+ getDomNode() {
92
+ return this._domNode;
93
+ }
94
+ getPosition() {
95
+ return this._position;
96
+ }
97
+ _updatePosition(position) {
98
+ this._position = {
99
+ position: Object.assign({}, position),
100
+ preference: [editor.ContentWidgetPositionPreference.EXACT]
101
+ };
102
+ this._editor.layoutContentWidget(this);
103
+ }
104
+ _showTooltip() {
105
+ this._updateTooltipPosition();
106
+ if (this._hideTimer !== null) {
107
+ clearTimeout(this._hideTimer);
108
+ } else {
109
+ this._setTooltipVisible(true);
112
110
  }
113
- }, {
114
- key: "_updatePosition",
115
- value: function _updatePosition(position) {
116
- this._position = {
117
- position: Object.assign({}, position),
118
- preference: [editor.ContentWidgetPositionPreference.EXACT]
119
- };
120
- this._editor.layoutContentWidget(this);
111
+ this._hideTimer = setTimeout(() => {
112
+ this._setTooltipVisible(false);
113
+ this._hideTimer = null;
114
+ }, this._tooltipDuration);
115
+ }
116
+ _updateTooltipPosition() {
117
+ if (!this._tooltipNode) {
118
+ return;
121
119
  }
122
- }, {
123
- key: "_showTooltip",
124
- value: function _showTooltip() {
125
- var _this3 = this;
126
- this._updateTooltipPosition();
127
- if (this._hideTimer !== null) {
128
- clearTimeout(this._hideTimer);
129
- } else {
130
- this._setTooltipVisible(true);
131
- }
132
- this._hideTimer = setTimeout(function () {
133
- _this3._setTooltipVisible(false);
134
- _this3._hideTimer = null;
135
- }, this._tooltipDuration);
120
+ const distanceFromTop = this._domNode.offsetTop - this._editor.getScrollTop();
121
+ if (distanceFromTop - this._tooltipNode.offsetHeight < 5) {
122
+ this._tooltipNode.style.top = `${this._tooltipNode.offsetHeight + 2}px`;
123
+ } else {
124
+ this._tooltipNode.style.top = `-${this._tooltipNode.offsetHeight}px`;
136
125
  }
137
- }, {
138
- key: "_updateTooltipPosition",
139
- value: function _updateTooltipPosition() {
140
- if (!this._tooltipNode) {
141
- return;
142
- }
143
- var distanceFromTop = this._domNode.offsetTop - this._editor.getScrollTop();
144
- if (distanceFromTop - this._tooltipNode.offsetHeight < 5) {
145
- this._tooltipNode.style.top = "".concat(this._tooltipNode.offsetHeight + 2, "px");
146
- } else {
147
- this._tooltipNode.style.top = "-".concat(this._tooltipNode.offsetHeight, "px");
148
- }
149
- this._tooltipNode.style.left = '0';
126
+ this._tooltipNode.style.left = '0';
127
+ }
128
+ _setTooltipVisible(visible) {
129
+ if (!this._tooltipNode) {
130
+ return;
150
131
  }
151
- }, {
152
- key: "_setTooltipVisible",
153
- value: function _setTooltipVisible(visible) {
154
- if (!this._tooltipNode) {
155
- return;
156
- }
157
- if (visible) {
158
- this._tooltipNode.style.opacity = '1.0';
159
- } else {
160
- this._tooltipNode.style.opacity = '0';
161
- }
132
+ if (visible) {
133
+ this._tooltipNode.style.opacity = '1.0';
134
+ } else {
135
+ this._tooltipNode.style.opacity = '0';
162
136
  }
163
- }]);
164
- return RemoteCursorWidget;
165
- }();
137
+ }
138
+ }
166
139
 
167
140
  export { RemoteCursorWidget };