@elice/material-exercise 1.230325.0 → 1.230418.0

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