@elice/material-exercise 1.230328.0 → 1.230418.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (369) 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.js +559 -371
  12. package/cjs/components/material-exercise/context/recoilTypes.js +0 -5
  13. package/cjs/components/material-exercise/context/subjects.js +3 -6
  14. package/cjs/components/material-exercise/exercise-code-history/ExerciseCodeHistory.d.ts +2 -2
  15. package/cjs/components/material-exercise/exercise-code-history/ExerciseCodeHistory.js +78 -65
  16. package/cjs/components/material-exercise/exercise-code-history/ExerciseCodeHistory.styled.js +8 -8
  17. package/cjs/components/material-exercise/exercise-code-history/locales/en.json.js +7 -0
  18. package/cjs/components/material-exercise/exercise-code-history/locales/ko.json.js +7 -0
  19. package/cjs/components/material-exercise/exercise-file/ExerciseFile.js +20 -21
  20. package/cjs/components/material-exercise/exercise-file-editor/ExerciseFileEditor.js +225 -198
  21. package/cjs/components/material-exercise/exercise-file-editor/ExerciseFileReadOnlyBanner.js +8 -10
  22. package/cjs/components/material-exercise/exercise-file-tabs/ExerciseFileTabs.js +35 -32
  23. package/cjs/components/material-exercise/exercise-file-tabs/ExerciseFileTabsFileTreeButton.js +57 -48
  24. package/cjs/components/material-exercise/exercise-file-tabs/ExerciseFileTabsLazy.js +6 -4
  25. package/cjs/components/material-exercise/exercise-file-tabs/locales/fileTreeButton.en.json.js +3 -1
  26. package/cjs/components/material-exercise/exercise-file-tabs/locales/fileTreeButton.ko.json.js +3 -1
  27. package/cjs/components/material-exercise/exercise-file-tree/ExerciseFileTree.js +327 -231
  28. package/cjs/components/material-exercise/exercise-file-tree/ExerciseFileTreeLazy.js +6 -4
  29. package/cjs/components/material-exercise/exercise-file-tree/locales/en.json.js +3 -1
  30. package/cjs/components/material-exercise/exercise-file-tree/locales/ko.json.js +3 -1
  31. package/cjs/components/material-exercise/exercise-file-viewer/ExerciseFileViewer.js +17 -17
  32. package/cjs/components/material-exercise/exercise-menu/ExerciseMenu.js +13 -14
  33. package/cjs/components/material-exercise/exercise-menu/ExerciseMenuArduinoAgentModalButton.js +6 -6
  34. package/cjs/components/material-exercise/exercise-menu/ExerciseMenuArduinoSettings.js +47 -38
  35. package/cjs/components/material-exercise/exercise-menu/ExerciseMenuDropdown.js +60 -42
  36. package/cjs/components/material-exercise/exercise-menu/ExerciseMenuReset.js +29 -22
  37. package/cjs/components/material-exercise/exercise-menu/ExerciseMenuStdioFileBrowser.js +45 -56
  38. package/cjs/components/material-exercise/exercise-menu/ExerciseMenuStdioFileBrowser.styled.js +12 -12
  39. package/cjs/components/material-exercise/exercise-menu/locales/en.json.js +3 -1
  40. package/cjs/components/material-exercise/exercise-menu/locales/ko.json.js +3 -1
  41. package/cjs/components/material-exercise/exercise-multilang-dropdown/ExerciseMultilangDropdown.js +28 -20
  42. package/cjs/components/material-exercise/exercise-multilang-dropdown/ExerciseMultilangDropdownLazy.js +5 -3
  43. package/cjs/components/material-exercise/exercise-preview/ExercisePreview.js +30 -41
  44. package/cjs/components/material-exercise/exercise-preview/ExercisePreviewDisplayModeButton.js +17 -12
  45. package/cjs/components/material-exercise/exercise-preview/locales/en.json.js +3 -1
  46. package/cjs/components/material-exercise/exercise-preview/locales/ko.json.js +3 -1
  47. package/cjs/components/material-exercise/exercise-rightpane/ExerciseRightpane.js +24 -33
  48. package/cjs/components/material-exercise/exercise-rightpane/ExerciseRightpaneEditorPerference.js +13 -8
  49. package/cjs/components/material-exercise/exercise-rightpane/ExerciseRightpaneEnvironment.js +84 -83
  50. package/cjs/components/material-exercise/exercise-rightpane/locales/en.json.js +3 -1
  51. package/cjs/components/material-exercise/exercise-rightpane/locales/ko.json.js +3 -1
  52. package/cjs/components/material-exercise/exercise-room/ExerciseRoom.js +20 -12
  53. package/cjs/components/material-exercise/exercise-room/ExerciseRoom.styled.js +14 -12
  54. package/cjs/components/material-exercise/exercise-room/ExerciseRoomDetail.js +239 -147
  55. package/cjs/components/material-exercise/exercise-room/ExerciseRoomList.js +92 -63
  56. package/cjs/components/material-exercise/exercise-room/helpers/exerciseRoomPermissionStringConvertor.js +2 -8
  57. package/cjs/components/material-exercise/exercise-room/locales/en.json.js +3 -1
  58. package/cjs/components/material-exercise/exercise-room/locales/ko.json.js +3 -1
  59. package/cjs/components/material-exercise/exercise-runner/ExerciseRunner.js +219 -220
  60. package/cjs/components/material-exercise/exercise-runner/ExerciseRunnerContext.js +1 -1
  61. package/cjs/components/material-exercise/exercise-runner/ExerciseRunnerController.js +13 -13
  62. package/cjs/components/material-exercise/exercise-runner/ExerciseRunnerControllerArduinoAgentModal.js +30 -26
  63. package/cjs/components/material-exercise/exercise-runner/ExerciseRunnerControllerArduinoStatusMessage.js +26 -26
  64. package/cjs/components/material-exercise/exercise-runner/ExerciseRunnerControllerButtonGroup.js +70 -95
  65. package/cjs/components/material-exercise/exercise-runner/ExerciseRunnerControllerCodeHelpRequestButton.js +27 -27
  66. package/cjs/components/material-exercise/exercise-runner/ExerciseRunnerControllerRunningInfo.js +54 -60
  67. package/cjs/components/material-exercise/exercise-runner/ExerciseRunnerControllerStatusIndicator.js +5 -5
  68. package/cjs/components/material-exercise/exercise-runner/ExerciseRunnerControllerStatusMessage.js +10 -13
  69. package/cjs/components/material-exercise/exercise-runner/ExerciseRunnerControllerTimer.js +29 -26
  70. package/cjs/components/material-exercise/exercise-runner/locales/en.json.js +3 -1
  71. package/cjs/components/material-exercise/exercise-runner/locales/ko.json.js +3 -1
  72. package/cjs/components/material-exercise/exercise-submit-history/ExerciseSubmitHistory.d.ts +2 -2
  73. package/cjs/components/material-exercise/exercise-submit-history/ExerciseSubmitHistory.js +290 -180
  74. package/cjs/components/material-exercise/exercise-submit-history/ExerciseSubmitHistory.styled.js +8 -8
  75. package/cjs/components/material-exercise/exercise-submit-history/ExerciseSubmitHistoryOutput.js +41 -45
  76. package/cjs/components/material-exercise/exercise-submit-history/locales/en.json.js +7 -0
  77. package/cjs/components/material-exercise/exercise-submit-history/locales/ko.json.js +7 -0
  78. package/cjs/components/shared/exercise-menu-button/ExerciseMenuButton.js +19 -17
  79. package/cjs/components/shared/exercise-shimmer/ExerciseFileShimmer.js +5 -4
  80. package/cjs/components/shared/exercise-shimmer/ExerciseFileTabShimmer.js +15 -14
  81. package/cjs/components/shared/exercise-shimmer/ExerciseFileTabsShimmer.js +7 -6
  82. package/cjs/components/shared/exercise-shimmer/ExerciseFileTreeListItemShimmer.js +17 -16
  83. package/cjs/components/shared/exercise-shimmer/ExerciseFileTreeListShimmer.js +18 -11
  84. package/cjs/components/shared/exercise-version-list/ExerciseVersionList.js +5 -4
  85. package/cjs/components/shared/exercise-version-list/ExerciseVersionList.styled.js +1 -1
  86. package/cjs/components/shared/exercise-version-list/ExerciseVersionListItem.js +8 -7
  87. package/cjs/components/shared/exercise-version-list/ExerciseVersionListItem.styled.js +9 -5
  88. package/cjs/components/shared/file-icon/FileIcon.js +23 -23
  89. package/cjs/components/shared/file-tabs/FileTab.js +32 -43
  90. package/cjs/components/shared/file-tabs/FileTab.styled.js +26 -22
  91. package/cjs/components/shared/file-tabs/FileTabs.js +55 -49
  92. package/cjs/components/shared/file-tabs/FileTabs.styled.js +2 -2
  93. package/cjs/components/shared/file-tabs/util.js +29 -18
  94. package/cjs/components/shared/file-tree/FileTree.js +11 -11
  95. package/cjs/components/shared/file-tree/FileTreeConfig.js +24 -23
  96. package/cjs/components/shared/file-tree/FileTreeList.js +35 -41
  97. package/cjs/components/shared/file-tree/FileTreeListItemContent.js +75 -91
  98. package/cjs/components/shared/file-tree/FileTreeListItemContent.styled.js +29 -40
  99. package/cjs/components/shared/file-tree/FileTreeListItemContentInput.js +77 -101
  100. package/cjs/components/shared/file-tree/FileTreeListItemContentInput.styled.js +6 -6
  101. package/cjs/components/shared/file-tree/FileTreeListItemContentMenu.js +51 -86
  102. package/cjs/components/shared/file-tree/FileTreeListItems.js +150 -153
  103. package/cjs/components/shared/file-tree/FileTreeListItems.styled.js +2 -2
  104. package/cjs/components/shared/file-tree/FileTreeToolbar.js +30 -41
  105. package/cjs/components/shared/file-tree/FileTreeToolbar.styled.js +1 -1
  106. package/cjs/components/shared/file-tree/context/FileTreeContext.js +91 -97
  107. package/cjs/components/shared/file-tree/locales/en.json.js +3 -1
  108. package/cjs/components/shared/file-tree/locales/ko.json.js +3 -1
  109. package/cjs/components/shared/file-tree/utils/fileTreeFiles.js +20 -22
  110. package/cjs/components/shared/file-tree/utils/fileTreeGenerator.js +193 -173
  111. package/cjs/components/shared/file-tree/utils/fileTreeInput.js +0 -1
  112. package/cjs/components/shared/file-tree/utils/fileTreeItem.js +1 -1
  113. package/cjs/components/shared/file-tree/utils/fileTreePath.js +5 -7
  114. package/cjs/components/shared/file-viewer/FileViewer.js +59 -60
  115. package/cjs/components/shared/file-viewer/FileViewerCsv.js +145 -101
  116. package/cjs/components/shared/file-viewer/FileViewerImage.js +7 -8
  117. package/cjs/components/shared/file-viewer/FileViewerIpynb.js +20 -14
  118. package/cjs/components/shared/file-viewer/FileViewerNonViewable.js +28 -34
  119. package/cjs/components/shared/file-viewer/FileViewerText.js +23 -16
  120. package/cjs/components/shared/file-viewer/locales/en.json.js +3 -1
  121. package/cjs/components/shared/file-viewer/locales/ko.json.js +3 -1
  122. package/cjs/components/shared/file-viewer/locales/nonViewable.en.json.js +3 -1
  123. package/cjs/components/shared/file-viewer/locales/nonViewable.ko.json.js +3 -1
  124. package/cjs/components/shared/material-modal/MaterialModal.js +10 -12
  125. package/cjs/components/shared/material-modal/MaterialModal.styled.js +5 -5
  126. package/cjs/components/shared/monaco-editor/MonacoEditor.js +123 -149
  127. package/cjs/components/shared/monaco-editor/MonacoEditorLazy.js +10 -8
  128. package/cjs/components/shared/monaco-editor/MonacoEditorMobile.js +49 -58
  129. package/cjs/components/shared/monaco-editor/MonacoEditorPerferenceForm.js +78 -85
  130. package/cjs/components/shared/monaco-editor/constants/grammars/index.js +131 -52
  131. package/cjs/components/shared/monaco-editor/constants/monaco/preferences.js +5 -9
  132. package/cjs/components/shared/monaco-editor/constants/themes/index.js +80 -32
  133. package/cjs/components/shared/monaco-editor/editor-hooks/useMonacoEventChange.js +10 -13
  134. package/cjs/components/shared/monaco-editor/editor-hooks/useMonacoEventCursor.js +14 -18
  135. package/cjs/components/shared/monaco-editor/editor-hooks/useMonacoEventScroll.js +8 -9
  136. package/cjs/components/shared/monaco-editor/editor-hooks/useMonacoMarkers.js +54 -72
  137. package/cjs/components/shared/monaco-editor/editor-hooks/useMonacoOptions.js +14 -15
  138. package/cjs/components/shared/monaco-editor/editor-hooks/useMonacoTheme.js +8 -9
  139. package/cjs/components/shared/monaco-editor/editor-languages/css/formatter.js +36 -12
  140. package/cjs/components/shared/monaco-editor/editor-languages/css/index.js +5 -8
  141. package/cjs/components/shared/monaco-editor/editor-languages/html/formatter.js +36 -12
  142. package/cjs/components/shared/monaco-editor/editor-languages/html/index.js +3 -6
  143. package/cjs/components/shared/monaco-editor/editor-languages/index.js +3 -1
  144. package/cjs/components/shared/monaco-editor/editor-languages/typescript/dts/_helper.js +1 -1
  145. package/cjs/components/shared/monaco-editor/editor-languages/typescript/dts/express.js +3 -2
  146. package/cjs/components/shared/monaco-editor/editor-languages/typescript/dts/propTypes.js +3 -2
  147. package/cjs/components/shared/monaco-editor/editor-languages/typescript/dts/react.js +3 -2
  148. package/cjs/components/shared/monaco-editor/editor-languages/typescript/formatter.js +36 -12
  149. package/cjs/components/shared/monaco-editor/editor-languages/typescript/index.js +18 -24
  150. package/cjs/components/shared/monaco-editor/hooks/useEditorOptions.js +12 -9
  151. package/cjs/components/shared/monaco-editor/locales/en.json.js +3 -1
  152. package/cjs/components/shared/monaco-editor/locales/ko.json.js +3 -1
  153. package/cjs/components/shared/monaco-editor/utils/emmet/abbreviationActions.js +18 -28
  154. package/cjs/components/shared/monaco-editor/utils/emmet/emmet.js +0 -3
  155. package/cjs/components/shared/monaco-editor/utils/emmet/registerProvider.js +12 -8
  156. package/cjs/components/shared/monaco-editor/utils/grammar/index.js +70 -32
  157. package/cjs/components/shared/monaco-editor/utils/grammar/onigasm.js +25 -7
  158. package/cjs/components/shared/monaco-editor/utils/grammar/textmate.js +67 -43
  159. package/cjs/components/shared/monaco-editor/utils/monacoLanguage.js +9 -19
  160. package/cjs/components/shared/monaco-editor/utils/monacoPreference.js +6 -5
  161. package/cjs/components/shared/monaco-editor/utils/prettier/config.js +2 -3
  162. package/cjs/components/shared/monaco-editor/utils/prettier/index.js +30 -9
  163. package/cjs/components/shared/monaco-editor/utils/theme/convert.js +20 -26
  164. package/cjs/components/shared/monaco-editor/utils/theme/index.js +22 -5
  165. package/cjs/components/shared/monaco-editor/vendors/monaco-collab-ext/RemoteCursor.js +77 -75
  166. package/cjs/components/shared/monaco-editor/vendors/monaco-collab-ext/RemoteCursorManager.js +82 -93
  167. package/cjs/components/shared/monaco-editor/vendors/monaco-collab-ext/RemoteCursorWidget.js +125 -135
  168. package/cjs/components/shared/monaco-editor/vendors/monaco-collab-ext/RemoteSelection.js +148 -160
  169. package/cjs/components/shared/monaco-editor/vendors/monaco-collab-ext/RemoteSelectionManager.js +104 -118
  170. package/cjs/components/shared/monaco-editor/vendors/monaco-collab-ext/styles.js +2 -2
  171. package/cjs/components/shared/monaco-editor/vendors/vscode-emmet-helper/configCompat.js +1 -3
  172. package/cjs/components/shared/monaco-editor/vendors/vscode-emmet-helper/data.js +2 -3
  173. package/cjs/components/shared/monaco-editor/vendors/vscode-emmet-helper/emmetHelper.js +218 -329
  174. package/cjs/components/shared/monaco-editor/vendors/vscode-emmet-helper/utils.js +3 -6
  175. package/cjs/components/shared/no-vnc/NoVnc.js +93 -90
  176. package/cjs/components/shared/no-vnc/NoVncLazy.js +7 -5
  177. package/cjs/components/shared/preview-container/PreviewContainer.js +7 -10
  178. package/cjs/components/shared/web-browser/WebBrowser.js +54 -59
  179. package/cjs/components/shared/xterm/Xterm.js +112 -105
  180. package/cjs/components/shared/xterm/XtermLazy.js +7 -5
  181. package/cjs/components/shared/xterm/locales/en.json.js +3 -1
  182. package/cjs/components/shared/xterm/locales/ko.json.js +3 -1
  183. package/cjs/constants/arduino.js +10 -10
  184. package/cjs/constants/shortcutKeyMap.js +5 -5
  185. package/cjs/constants/stylesheets.js +7 -10
  186. package/cjs/hooks/useArduino.js +327 -255
  187. package/cjs/hooks/useExerciseFile.js +24 -24
  188. package/cjs/hooks/useExericseShortcut.js +6 -5
  189. package/cjs/hooks/useMaterialExerciseFileUrl.js +54 -37
  190. package/cjs/hooks/useRunnerRoomWebSocket.js +58 -56
  191. package/cjs/hooks/useStdioTextConcator.js +18 -12
  192. package/cjs/hooks/useStdioWebSocket.js +41 -67
  193. package/cjs/hooks/useUsercodeEditWebSocket.js +230 -252
  194. package/cjs/hooks/useUsercodeHistory.js +121 -82
  195. package/cjs/index.js +4 -4
  196. package/cjs/utils/arduino.js +23 -25
  197. package/cjs/utils/exerciseFile.js +8 -16
  198. package/cjs/utils/runner.js +29 -25
  199. package/es/_virtual/_rollupPluginBabelHelpers.js +504 -0
  200. package/es/components/material-exercise/MaterialExercise.js +33 -54
  201. package/es/components/material-exercise/MaterialExercise.styled.js +20 -23
  202. package/es/components/material-exercise/MaterialExerciseMobile.js +15 -13
  203. package/es/components/material-exercise/context/ExerciseIntlProvider.js +9 -13
  204. package/es/components/material-exercise/context/ExerciseProvider.js +79 -79
  205. package/es/components/material-exercise/context/ExerciseProviderNoImage.js +11 -13
  206. package/es/components/material-exercise/context/context.js +1 -1
  207. package/es/components/material-exercise/context/recoil.js +560 -372
  208. package/es/components/material-exercise/context/recoilTypes.js +0 -5
  209. package/es/components/material-exercise/context/subjects.js +3 -6
  210. package/es/components/material-exercise/exercise-code-history/ExerciseCodeHistory.d.ts +2 -2
  211. package/es/components/material-exercise/exercise-code-history/ExerciseCodeHistory.js +73 -62
  212. package/es/components/material-exercise/exercise-code-history/ExerciseCodeHistory.styled.js +8 -8
  213. package/es/components/material-exercise/exercise-code-history/locales/en.json.js +3 -0
  214. package/es/components/material-exercise/exercise-code-history/locales/ko.json.js +3 -0
  215. package/es/components/material-exercise/exercise-file/ExerciseFile.js +15 -18
  216. package/es/components/material-exercise/exercise-file-editor/ExerciseFileEditor.js +218 -193
  217. package/es/components/material-exercise/exercise-file-editor/ExerciseFileReadOnlyBanner.js +5 -9
  218. package/es/components/material-exercise/exercise-file-tabs/ExerciseFileTabs.js +31 -28
  219. package/es/components/material-exercise/exercise-file-tabs/ExerciseFileTabsFileTreeButton.js +52 -45
  220. package/es/components/material-exercise/exercise-file-tabs/ExerciseFileTabsLazy.js +1 -1
  221. package/es/components/material-exercise/exercise-file-tree/ExerciseFileTree.js +321 -225
  222. package/es/components/material-exercise/exercise-file-tree/ExerciseFileTreeLazy.js +1 -1
  223. package/es/components/material-exercise/exercise-file-viewer/ExerciseFileViewer.js +12 -14
  224. package/es/components/material-exercise/exercise-menu/ExerciseMenu.js +7 -10
  225. package/es/components/material-exercise/exercise-menu/ExerciseMenuArduinoAgentModalButton.js +3 -5
  226. package/es/components/material-exercise/exercise-menu/ExerciseMenuArduinoSettings.js +43 -36
  227. package/es/components/material-exercise/exercise-menu/ExerciseMenuDropdown.js +53 -37
  228. package/es/components/material-exercise/exercise-menu/ExerciseMenuReset.js +25 -20
  229. package/es/components/material-exercise/exercise-menu/ExerciseMenuStdioFileBrowser.js +41 -54
  230. package/es/components/material-exercise/exercise-menu/ExerciseMenuStdioFileBrowser.styled.js +12 -12
  231. package/es/components/material-exercise/exercise-multilang-dropdown/ExerciseMultilangDropdown.js +25 -19
  232. package/es/components/material-exercise/exercise-multilang-dropdown/ExerciseMultilangDropdownLazy.js +1 -1
  233. package/es/components/material-exercise/exercise-preview/ExercisePreview.js +21 -34
  234. package/es/components/material-exercise/exercise-preview/ExercisePreviewDisplayModeButton.js +13 -10
  235. package/es/components/material-exercise/exercise-rightpane/ExerciseRightpane.js +17 -28
  236. package/es/components/material-exercise/exercise-rightpane/ExerciseRightpaneEditorPerference.js +9 -6
  237. package/es/components/material-exercise/exercise-rightpane/ExerciseRightpaneEnvironment.js +81 -82
  238. package/es/components/material-exercise/exercise-room/ExerciseRoom.js +13 -7
  239. package/es/components/material-exercise/exercise-room/ExerciseRoom.styled.js +14 -12
  240. package/es/components/material-exercise/exercise-room/ExerciseRoomDetail.js +236 -146
  241. package/es/components/material-exercise/exercise-room/ExerciseRoomList.js +90 -63
  242. package/es/components/material-exercise/exercise-room/helpers/exerciseRoomPermissionStringConvertor.js +2 -8
  243. package/es/components/material-exercise/exercise-runner/ExerciseRunner.js +212 -215
  244. package/es/components/material-exercise/exercise-runner/ExerciseRunnerContext.js +1 -1
  245. package/es/components/material-exercise/exercise-runner/ExerciseRunnerController.js +7 -9
  246. package/es/components/material-exercise/exercise-runner/ExerciseRunnerControllerArduinoAgentModal.js +27 -25
  247. package/es/components/material-exercise/exercise-runner/ExerciseRunnerControllerArduinoStatusMessage.js +22 -24
  248. package/es/components/material-exercise/exercise-runner/ExerciseRunnerControllerButtonGroup.js +66 -93
  249. package/es/components/material-exercise/exercise-runner/ExerciseRunnerControllerCodeHelpRequestButton.js +24 -26
  250. package/es/components/material-exercise/exercise-runner/ExerciseRunnerControllerRunningInfo.js +51 -59
  251. package/es/components/material-exercise/exercise-runner/ExerciseRunnerControllerStatusIndicator.js +2 -4
  252. package/es/components/material-exercise/exercise-runner/ExerciseRunnerControllerStatusMessage.js +6 -11
  253. package/es/components/material-exercise/exercise-runner/ExerciseRunnerControllerTimer.js +26 -25
  254. package/es/components/material-exercise/exercise-submit-history/ExerciseSubmitHistory.d.ts +2 -2
  255. package/es/components/material-exercise/exercise-submit-history/ExerciseSubmitHistory.js +284 -174
  256. package/es/components/material-exercise/exercise-submit-history/ExerciseSubmitHistory.styled.js +8 -8
  257. package/es/components/material-exercise/exercise-submit-history/ExerciseSubmitHistoryOutput.js +38 -44
  258. package/es/components/material-exercise/exercise-submit-history/locales/en.json.js +3 -0
  259. package/es/components/material-exercise/exercise-submit-history/locales/ko.json.js +3 -0
  260. package/es/components/shared/exercise-menu-button/ExerciseMenuButton.js +16 -16
  261. package/es/components/shared/exercise-shimmer/ExerciseFileShimmer.js +2 -3
  262. package/es/components/shared/exercise-shimmer/ExerciseFileTabShimmer.js +12 -13
  263. package/es/components/shared/exercise-shimmer/ExerciseFileTabsShimmer.js +2 -3
  264. package/es/components/shared/exercise-shimmer/ExerciseFileTreeListItemShimmer.js +14 -15
  265. package/es/components/shared/exercise-shimmer/ExerciseFileTreeListShimmer.js +15 -10
  266. package/es/components/shared/exercise-version-list/ExerciseVersionList.js +2 -3
  267. package/es/components/shared/exercise-version-list/ExerciseVersionList.styled.js +1 -1
  268. package/es/components/shared/exercise-version-list/ExerciseVersionListItem.js +5 -6
  269. package/es/components/shared/exercise-version-list/ExerciseVersionListItem.styled.js +9 -5
  270. package/es/components/shared/file-icon/FileIcon.js +20 -22
  271. package/es/components/shared/file-tabs/FileTab.js +28 -41
  272. package/es/components/shared/file-tabs/FileTab.styled.js +26 -22
  273. package/es/components/shared/file-tabs/FileTabs.js +52 -48
  274. package/es/components/shared/file-tabs/FileTabs.styled.js +2 -2
  275. package/es/components/shared/file-tabs/util.js +29 -18
  276. package/es/components/shared/file-tree/FileTree.js +3 -5
  277. package/es/components/shared/file-tree/FileTreeConfig.js +21 -22
  278. package/es/components/shared/file-tree/FileTreeList.js +31 -39
  279. package/es/components/shared/file-tree/FileTreeListItemContent.js +67 -85
  280. package/es/components/shared/file-tree/FileTreeListItemContent.styled.js +29 -40
  281. package/es/components/shared/file-tree/FileTreeListItemContentInput.js +74 -100
  282. package/es/components/shared/file-tree/FileTreeListItemContentInput.styled.js +6 -6
  283. package/es/components/shared/file-tree/FileTreeListItemContentMenu.js +48 -85
  284. package/es/components/shared/file-tree/FileTreeListItems.js +147 -152
  285. package/es/components/shared/file-tree/FileTreeListItems.styled.js +2 -2
  286. package/es/components/shared/file-tree/FileTreeToolbar.js +24 -37
  287. package/es/components/shared/file-tree/FileTreeToolbar.styled.js +1 -1
  288. package/es/components/shared/file-tree/context/FileTreeContext.js +91 -97
  289. package/es/components/shared/file-tree/utils/fileTreeFiles.js +20 -22
  290. package/es/components/shared/file-tree/utils/fileTreeGenerator.js +193 -173
  291. package/es/components/shared/file-tree/utils/fileTreeInput.js +0 -1
  292. package/es/components/shared/file-tree/utils/fileTreeItem.js +1 -1
  293. package/es/components/shared/file-tree/utils/fileTreePath.js +5 -7
  294. package/es/components/shared/file-viewer/FileViewer.js +52 -53
  295. package/es/components/shared/file-viewer/FileViewerCsv.js +141 -99
  296. package/es/components/shared/file-viewer/FileViewerImage.js +3 -6
  297. package/es/components/shared/file-viewer/FileViewerIpynb.js +16 -12
  298. package/es/components/shared/file-viewer/FileViewerNonViewable.js +22 -30
  299. package/es/components/shared/file-viewer/FileViewerText.js +18 -13
  300. package/es/components/shared/material-modal/MaterialModal.js +7 -11
  301. package/es/components/shared/material-modal/MaterialModal.styled.js +5 -5
  302. package/es/components/shared/monaco-editor/MonacoEditor.js +119 -147
  303. package/es/components/shared/monaco-editor/MonacoEditorLazy.js +6 -4
  304. package/es/components/shared/monaco-editor/MonacoEditorMobile.js +45 -56
  305. package/es/components/shared/monaco-editor/MonacoEditorPerferenceForm.js +73 -82
  306. package/es/components/shared/monaco-editor/constants/grammars/index.js +131 -52
  307. package/es/components/shared/monaco-editor/constants/monaco/preferences.js +5 -9
  308. package/es/components/shared/monaco-editor/constants/themes/index.js +80 -32
  309. package/es/components/shared/monaco-editor/editor-hooks/useMonacoEventChange.js +10 -13
  310. package/es/components/shared/monaco-editor/editor-hooks/useMonacoEventCursor.js +14 -18
  311. package/es/components/shared/monaco-editor/editor-hooks/useMonacoEventScroll.js +8 -9
  312. package/es/components/shared/monaco-editor/editor-hooks/useMonacoMarkers.js +54 -72
  313. package/es/components/shared/monaco-editor/editor-hooks/useMonacoOptions.js +14 -15
  314. package/es/components/shared/monaco-editor/editor-hooks/useMonacoTheme.js +8 -9
  315. package/es/components/shared/monaco-editor/editor-languages/css/formatter.js +33 -11
  316. package/es/components/shared/monaco-editor/editor-languages/css/index.js +2 -5
  317. package/es/components/shared/monaco-editor/editor-languages/html/formatter.js +33 -11
  318. package/es/components/shared/monaco-editor/editor-languages/html/index.js +2 -5
  319. package/es/components/shared/monaco-editor/editor-languages/typescript/dts/_helper.js +1 -1
  320. package/es/components/shared/monaco-editor/editor-languages/typescript/dts/express.js +0 -1
  321. package/es/components/shared/monaco-editor/editor-languages/typescript/dts/propTypes.js +0 -1
  322. package/es/components/shared/monaco-editor/editor-languages/typescript/dts/react.js +0 -1
  323. package/es/components/shared/monaco-editor/editor-languages/typescript/formatter.js +33 -11
  324. package/es/components/shared/monaco-editor/editor-languages/typescript/index.js +10 -16
  325. package/es/components/shared/monaco-editor/hooks/useEditorOptions.js +12 -9
  326. package/es/components/shared/monaco-editor/utils/emmet/abbreviationActions.js +18 -28
  327. package/es/components/shared/monaco-editor/utils/emmet/emmet.js +0 -3
  328. package/es/components/shared/monaco-editor/utils/emmet/registerProvider.js +12 -8
  329. package/es/components/shared/monaco-editor/utils/grammar/index.js +67 -31
  330. package/es/components/shared/monaco-editor/utils/grammar/onigasm.js +25 -7
  331. package/es/components/shared/monaco-editor/utils/grammar/textmate.js +67 -43
  332. package/es/components/shared/monaco-editor/utils/monacoLanguage.js +9 -19
  333. package/es/components/shared/monaco-editor/utils/monacoPreference.js +6 -5
  334. package/es/components/shared/monaco-editor/utils/prettier/config.js +2 -3
  335. package/es/components/shared/monaco-editor/utils/prettier/index.js +27 -8
  336. package/es/components/shared/monaco-editor/utils/theme/convert.js +20 -26
  337. package/es/components/shared/monaco-editor/utils/theme/index.js +22 -5
  338. package/es/components/shared/monaco-editor/vendors/monaco-collab-ext/RemoteCursor.js +77 -75
  339. package/es/components/shared/monaco-editor/vendors/monaco-collab-ext/RemoteCursorManager.js +82 -93
  340. package/es/components/shared/monaco-editor/vendors/monaco-collab-ext/RemoteCursorWidget.js +125 -135
  341. package/es/components/shared/monaco-editor/vendors/monaco-collab-ext/RemoteSelection.js +148 -160
  342. package/es/components/shared/monaco-editor/vendors/monaco-collab-ext/RemoteSelectionManager.js +104 -118
  343. package/es/components/shared/monaco-editor/vendors/monaco-collab-ext/styles.js +2 -2
  344. package/es/components/shared/monaco-editor/vendors/vscode-emmet-helper/configCompat.js +1 -3
  345. package/es/components/shared/monaco-editor/vendors/vscode-emmet-helper/data.js +2 -3
  346. package/es/components/shared/monaco-editor/vendors/vscode-emmet-helper/emmetHelper.js +219 -330
  347. package/es/components/shared/monaco-editor/vendors/vscode-emmet-helper/utils.js +3 -6
  348. package/es/components/shared/no-vnc/NoVnc.js +89 -88
  349. package/es/components/shared/no-vnc/NoVncLazy.js +4 -2
  350. package/es/components/shared/preview-container/PreviewContainer.js +7 -10
  351. package/es/components/shared/web-browser/WebBrowser.js +49 -56
  352. package/es/components/shared/xterm/Xterm.js +107 -102
  353. package/es/components/shared/xterm/XtermLazy.js +4 -2
  354. package/es/constants/arduino.js +10 -10
  355. package/es/constants/shortcutKeyMap.js +3 -5
  356. package/es/constants/stylesheets.js +7 -10
  357. package/es/hooks/useArduino.js +327 -255
  358. package/es/hooks/useExerciseFile.js +24 -24
  359. package/es/hooks/useExericseShortcut.js +6 -5
  360. package/es/hooks/useMaterialExerciseFileUrl.js +55 -38
  361. package/es/hooks/useRunnerRoomWebSocket.js +58 -56
  362. package/es/hooks/useStdioTextConcator.js +18 -12
  363. package/es/hooks/useStdioWebSocket.js +41 -67
  364. package/es/hooks/useUsercodeEditWebSocket.js +230 -252
  365. package/es/hooks/useUsercodeHistory.js +122 -83
  366. package/es/utils/arduino.js +23 -25
  367. package/es/utils/exerciseFile.js +8 -16
  368. package/es/utils/runner.js +29 -25
  369. package/package.json +8 -8
@@ -2,6 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
+ var _rollupPluginBabelHelpers = require('../../../../../_virtual/_rollupPluginBabelHelpers.js');
5
6
  var expand = require('emmet');
6
7
  var data = require('./data.js');
7
8
  var configCompat = require('./configCompat.js');
@@ -10,99 +11,79 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
10
11
 
11
12
  var expand__default = /*#__PURE__*/_interopDefaultLegacy(expand);
12
13
 
13
- /* ====================================================================================================
14
- * These codes forked and modified from `microsoft/vscode-emmet-helper`
15
- * under the terms of the MIT license.
16
- * Make sure to check the original project if any issue exists.
17
- * - project: https://github.com/microsoft/vscode-emmet-helper
18
- * - codes: https://github.com/microsoft/vscode-emmet-helper/blob/e64481648451f0189216794979ce2ace82ee8148/src/emmetHelper.ts
19
- * ==================================================================================================== */
14
+ // /* workaround for webpack issue: https://github.com/webpack/webpack/issues/5756
20
15
  // @emmetio/extract-abbreviation has a cjs that uses a default export
21
16
  // */
22
17
  // const extract = typeof _extractAbbreviation === 'function' ? _extractAbbreviation : _extractAbbreviation.default;
23
-
24
- const snippetKeyCache = new Map();
25
- let markupSnippetKeys;
26
- const stylesheetCustomSnippetsKeyCache = new Map();
27
- const htmlAbbreviationStartRegex = /^[a-z,A-Z,!,(,[,#,\.\{]/; // take off { for jsx because it interferes with the language
28
-
29
- const jsxAbbreviationStartRegex = /^[a-z,A-Z,!,(,[,#,\.]/;
30
- const cssAbbreviationRegex = /^-?[a-z,A-Z,!,@,#]/;
31
- const htmlAbbreviationRegex = /[a-z,A-Z\.]/;
32
- const commonlyUsedTags = [...data.htmlData.tags, 'lorem'];
33
- const bemFilterSuffix = 'bem';
34
- const filterDelimitor = '|';
35
- const trimFilterSuffix = 't';
36
- const commentFilterSuffix = 'c';
37
- const maxFilters = 3;
18
+ var snippetKeyCache = new Map();
19
+ var markupSnippetKeys;
20
+ var stylesheetCustomSnippetsKeyCache = new Map();
21
+ var htmlAbbreviationStartRegex = /^[a-z,A-Z,!,(,[,#,\.\{]/;
22
+ // take off { for jsx because it interferes with the language
23
+ var jsxAbbreviationStartRegex = /^[a-z,A-Z,!,(,[,#,\.]/;
24
+ var cssAbbreviationRegex = /^-?[a-z,A-Z,!,@,#]/;
25
+ var htmlAbbreviationRegex = /[a-z,A-Z\.]/;
26
+ var commonlyUsedTags = [].concat(_rollupPluginBabelHelpers.toConsumableArray(data.htmlData.tags), ['lorem']);
27
+ var bemFilterSuffix = 'bem';
28
+ var filterDelimitor = '|';
29
+ var trimFilterSuffix = 't';
30
+ var commentFilterSuffix = 'c';
31
+ var maxFilters = 3;
38
32
  /**
39
33
  * Returns all applicable emmet expansions for abbreviation at given position in a CompletionList
40
34
  */
41
-
42
35
  function doComplete(_monaco, model, position, syntax, emmetConfig) {
43
36
  var _a, _b;
44
-
45
37
  if (emmetConfig.showExpandedAbbreviation === 'never' || !getEmmetMode(syntax, emmetConfig.excludeLanguages)) {
46
38
  return;
47
39
  }
48
-
49
- const isStyleSheetRes = isStyleSheet(syntax); // Fetch markupSnippets so that we can provide possible abbreviation completions
40
+ var isStyleSheetRes = isStyleSheet(syntax);
41
+ // Fetch markupSnippets so that we can provide possible abbreviation completions
50
42
  // For example, when text at position is `a`, completions should return `a:blank`, `a:link`, `acr` etc.
51
-
52
43
  if (!isStyleSheetRes) {
53
44
  if (!snippetKeyCache.has(syntax)) {
54
- const registry = (_a = customSnippetsRegistry[syntax]) !== null && _a !== void 0 ? _a : getDefaultSnippets(syntax);
45
+ var registry = (_a = customSnippetsRegistry[syntax]) !== null && _a !== void 0 ? _a : getDefaultSnippets(syntax);
55
46
  snippetKeyCache.set(syntax, Object.keys(registry));
56
47
  }
57
-
58
48
  markupSnippetKeys = (_b = snippetKeyCache.get(syntax)) !== null && _b !== void 0 ? _b : [];
59
49
  }
60
-
61
- const extractOptions = {
50
+ var extractOptions = {
62
51
  lookAhead: !isStyleSheetRes,
63
52
  type: isStyleSheetRes ? 'stylesheet' : 'markup'
64
53
  };
65
- const extractedValue = extractAbbreviation(_monaco, model, position, extractOptions);
66
-
54
+ var extractedValue = extractAbbreviation(_monaco, model, position, extractOptions);
67
55
  if (!extractedValue) {
68
56
  return;
69
57
  }
70
-
71
- const {
72
- abbreviationRange,
73
- abbreviation,
74
- filter
75
- } = extractedValue;
76
- const currentLineTillPosition = getCurrentLine(model, position).substr(0, position.column - 1);
77
- const currentWord = getCurrentWord(currentLineTillPosition); // Don't attempt to expand open tags
78
-
79
- if (currentWord === abbreviation && currentLineTillPosition.endsWith(`<${abbreviation}`) && configCompat.syntaxes.markup.includes(syntax)) {
58
+ var abbreviationRange = extractedValue.abbreviationRange,
59
+ abbreviation = extractedValue.abbreviation,
60
+ filter = extractedValue.filter;
61
+ var currentLineTillPosition = getCurrentLine(model, position).substr(0, position.column - 1);
62
+ var currentWord = getCurrentWord(currentLineTillPosition);
63
+ // Don't attempt to expand open tags
64
+ if (currentWord === abbreviation && currentLineTillPosition.endsWith("<".concat(abbreviation)) && configCompat.syntaxes.markup.includes(syntax)) {
80
65
  return;
81
66
  }
82
-
83
- const expandOptions = getExpandOptions(syntax, emmetConfig, filter);
84
- let expandedText = "";
85
- let expandedAbbr;
86
- let completionItems = []; // Create completion item after expanding given abbreviation
67
+ var expandOptions = getExpandOptions(syntax, emmetConfig, filter);
68
+ var expandedText = "";
69
+ var expandedAbbr;
70
+ var completionItems = [];
71
+ // Create completion item after expanding given abbreviation
87
72
  // if abbreviation is valid and expanded value is not noise
88
-
89
- const createExpandedAbbr = (syntax, abbr) => {
73
+ var createExpandedAbbr = function createExpandedAbbr(syntax, abbr) {
90
74
  if (!isAbbreviationValid(syntax, abbreviation)) {
91
75
  return;
92
76
  }
93
-
94
77
  try {
95
- expandedText = expand__default["default"](abbr, expandOptions); // manually patch https://github.com/microsoft/vscode/issues/120245 for now
96
-
78
+ expandedText = expand__default["default"](abbr, expandOptions);
79
+ // manually patch https://github.com/microsoft/vscode/issues/120245 for now
97
80
  if (isStyleSheetRes && '!important'.startsWith(abbr)) {
98
81
  expandedText = '!important';
99
82
  }
100
83
  } catch (e) {}
101
-
102
84
  if (!expandedText || isExpandedTextNoise(syntax, abbr, expandedText, expandOptions.options)) {
103
85
  return;
104
86
  }
105
-
106
87
  expandedAbbr = {
107
88
  kind: _monaco.languages.CompletionItemKind.Property,
108
89
  label: abbreviation + (filter ? '|' + filter.replace(',', '|') : ''),
@@ -114,33 +95,35 @@ function doComplete(_monaco, model, position, syntax, emmetConfig) {
114
95
  };
115
96
  completionItems = [expandedAbbr];
116
97
  };
117
-
118
98
  if (isStyleSheet(syntax)) {
119
- createExpandedAbbr(syntax, abbreviation); // When abbr is longer than usual emmet snippets and matches better with existing css property, then no emmet
120
-
121
- if (abbreviation.length > 4 && data.cssData.properties.find(x => x.startsWith(abbreviation))) {
99
+ createExpandedAbbr(syntax, abbreviation);
100
+ // When abbr is longer than usual emmet snippets and matches better with existing css property, then no emmet
101
+ if (abbreviation.length > 4 && data.cssData.properties.find(function (x) {
102
+ return x.startsWith(abbreviation);
103
+ })) {
122
104
  return {
123
105
  suggestions: [],
124
106
  incomplete: true
125
107
  };
126
108
  }
127
-
128
109
  if (expandedAbbr && expandedText.length) {
129
110
  expandedAbbr.range = abbreviationRange;
130
111
  expandedAbbr.insertText = escapeNonTabStopDollar(addFinalTabStop(expandedText));
131
112
  expandedAbbr.documentation = replaceTabStopsWithCursors(expandedText);
132
113
  expandedAbbr.label = removeTabStops(expandedText);
133
- expandedAbbr.filterText = abbreviation; // Custom snippets should show up in completions if abbreviation is a prefix
134
-
135
- const stylesheetCustomSnippetsKeys = stylesheetCustomSnippetsKeyCache.has(syntax) ? stylesheetCustomSnippetsKeyCache.get(syntax) : stylesheetCustomSnippetsKeyCache.get('css');
114
+ expandedAbbr.filterText = abbreviation;
115
+ // Custom snippets should show up in completions if abbreviation is a prefix
116
+ var stylesheetCustomSnippetsKeys = stylesheetCustomSnippetsKeyCache.has(syntax) ? stylesheetCustomSnippetsKeyCache.get(syntax) : stylesheetCustomSnippetsKeyCache.get('css');
136
117
  completionItems = makeSnippetSuggestion(_monaco, stylesheetCustomSnippetsKeys !== null && stylesheetCustomSnippetsKeys !== void 0 ? stylesheetCustomSnippetsKeys : [], abbreviation, abbreviation, abbreviationRange, expandOptions, 'Emmet Custom Snippet', false);
137
-
138
- if (!completionItems.find(x => x.insertText === (expandedAbbr === null || expandedAbbr === void 0 ? void 0 : expandedAbbr.insertText))) {
118
+ if (!completionItems.find(function (x) {
119
+ return x.insertText === (expandedAbbr === null || expandedAbbr === void 0 ? void 0 : expandedAbbr.insertText);
120
+ })) {
139
121
  // Fix for https://github.com/Microsoft/vscode/issues/28933#issuecomment-309236902
140
122
  // When user types in propertyname, emmet uses it to match with snippet names, resulting in width -> widows or font-family -> font: family
141
123
  // Filter out those cases here.
142
- const abbrRegex = new RegExp('.*' + abbreviation.split('').map(x => x === '$' || x === '+' ? '\\' + x : x).join('.*') + '.*', 'i');
143
-
124
+ var abbrRegex = new RegExp('.*' + abbreviation.split('').map(function (x) {
125
+ return x === '$' || x === '+' ? '\\' + x : x;
126
+ }).join('.*') + '.*', 'i');
144
127
  if (/\d/.test(abbreviation) || abbrRegex.test(expandedAbbr.label)) {
145
128
  completionItems.push(expandedAbbr);
146
129
  }
@@ -148,44 +131,43 @@ function doComplete(_monaco, model, position, syntax, emmetConfig) {
148
131
  }
149
132
  } else {
150
133
  createExpandedAbbr(syntax, abbreviation);
151
- let tagToFindMoreSuggestionsFor = abbreviation;
152
- const newTagMatches = /(>|\+)([\w:-]+)$/.exec(abbreviation);
153
-
134
+ var tagToFindMoreSuggestionsFor = abbreviation;
135
+ var newTagMatches = /(>|\+)([\w:-]+)$/.exec(abbreviation);
154
136
  if (newTagMatches && newTagMatches.length === 3) {
155
137
  tagToFindMoreSuggestionsFor = newTagMatches[2];
156
138
  }
157
-
158
139
  if (syntax !== 'xml') {
159
- const commonlyUsedTagSuggestions = makeSnippetSuggestion(_monaco, commonlyUsedTags, tagToFindMoreSuggestionsFor, abbreviation, abbreviationRange, expandOptions, 'Emmet Abbreviation');
140
+ var commonlyUsedTagSuggestions = makeSnippetSuggestion(_monaco, commonlyUsedTags, tagToFindMoreSuggestionsFor, abbreviation, abbreviationRange, expandOptions, 'Emmet Abbreviation');
160
141
  completionItems = completionItems.concat(commonlyUsedTagSuggestions);
161
142
  }
162
-
163
143
  if (emmetConfig.showAbbreviationSuggestions === true) {
164
- const abbreviationSuggestions = makeSnippetSuggestion(_monaco, markupSnippetKeys.filter(x => !commonlyUsedTags.includes(x)), tagToFindMoreSuggestionsFor, abbreviation, abbreviationRange, expandOptions, 'Emmet Abbreviation'); // Workaround for the main expanded abbr not appearing before the snippet suggestions
165
-
144
+ var abbreviationSuggestions = makeSnippetSuggestion(_monaco, markupSnippetKeys.filter(function (x) {
145
+ return !commonlyUsedTags.includes(x);
146
+ }), tagToFindMoreSuggestionsFor, abbreviation, abbreviationRange, expandOptions, 'Emmet Abbreviation');
147
+ // Workaround for the main expanded abbr not appearing before the snippet suggestions
166
148
  if (expandedAbbr && abbreviationSuggestions.length > 0 && tagToFindMoreSuggestionsFor !== abbreviation) {
167
149
  expandedAbbr.sortText = '0' + expandedAbbr.label;
168
- abbreviationSuggestions.forEach(item => {
150
+ abbreviationSuggestions.forEach(function (item) {
169
151
  // Workaround for snippet suggestions items getting filtered out as the complete abbr does not start with snippetKey
170
- item.filterText = abbreviation; // Workaround for the main expanded abbr not appearing before the snippet suggestions
171
-
152
+ item.filterText = abbreviation;
153
+ // Workaround for the main expanded abbr not appearing before the snippet suggestions
172
154
  item.sortText = '9' + abbreviation;
173
155
  });
174
156
  }
175
-
176
157
  completionItems = completionItems.concat(abbreviationSuggestions);
177
- } // https://github.com/microsoft/vscode/issues/66680
178
-
179
-
180
- if (syntax === 'html' && completionItems.length >= 2 && abbreviation.includes(":") && (expandedAbbr === null || expandedAbbr === void 0 ? void 0 : expandedAbbr.insertText) === `<${abbreviation}>\${0}</${abbreviation}>`) {
181
- completionItems = completionItems.filter(item => item.label !== abbreviation);
158
+ }
159
+ // https://github.com/microsoft/vscode/issues/66680
160
+ if (syntax === 'html' && completionItems.length >= 2 && abbreviation.includes(":") && (expandedAbbr === null || expandedAbbr === void 0 ? void 0 : expandedAbbr.insertText) === "<".concat(abbreviation, ">${0}</").concat(abbreviation, ">")) {
161
+ completionItems = completionItems.filter(function (item) {
162
+ return item.label !== abbreviation;
163
+ });
182
164
  }
183
165
  }
184
-
185
166
  if (emmetConfig.showSuggestionsAsSnippets === true) {
186
- completionItems.forEach(x => x.kind = _monaco.languages.CompletionItemKind.Snippet);
167
+ completionItems.forEach(function (x) {
168
+ return x.kind = _monaco.languages.CompletionItemKind.Snippet;
169
+ });
187
170
  }
188
-
189
171
  return completionItems.length ? {
190
172
  suggestions: completionItems,
191
173
  incomplete: true
@@ -194,30 +176,25 @@ function doComplete(_monaco, model, position, syntax, emmetConfig) {
194
176
  /**
195
177
  * Create & return snippets for snippet keys that start with given prefix
196
178
  */
197
-
198
- function makeSnippetSuggestion(_monaco, snippetKeys, prefix, abbreviation, abbreviationRange, expandOptions, snippetDetail, skipFullMatch = true) {
179
+ function makeSnippetSuggestion(_monaco, snippetKeys, prefix, abbreviation, abbreviationRange, expandOptions, snippetDetail) {
180
+ var skipFullMatch = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : true;
199
181
  if (!prefix || !snippetKeys) {
200
182
  return [];
201
183
  }
202
-
203
- const snippetCompletions = [];
204
- snippetKeys.forEach(snippetKey => {
184
+ var snippetCompletions = [];
185
+ snippetKeys.forEach(function (snippetKey) {
205
186
  if (!snippetKey.startsWith(prefix.toLowerCase()) || skipFullMatch && snippetKey === prefix.toLowerCase()) {
206
187
  return;
207
188
  }
208
-
209
- const currentAbbr = abbreviation + snippetKey.substr(prefix.length);
210
- let expandedAbbr;
211
-
189
+ var currentAbbr = abbreviation + snippetKey.substr(prefix.length);
190
+ var expandedAbbr;
212
191
  try {
213
192
  expandedAbbr = expand__default["default"](currentAbbr, expandOptions);
214
193
  } catch (e) {}
215
-
216
194
  if (!expandedAbbr) {
217
195
  return;
218
196
  }
219
-
220
- const item = {
197
+ var item = {
221
198
  kind: _monaco.languages.CompletionItemKind.Property,
222
199
  label: prefix + snippetKey.substr(prefix.length),
223
200
  documentation: replaceTabStopsWithCursors(expandedAbbr),
@@ -230,73 +207,58 @@ function makeSnippetSuggestion(_monaco, snippetKeys, prefix, abbreviation, abbre
230
207
  });
231
208
  return snippetCompletions;
232
209
  }
233
-
234
210
  function getCurrentWord(currentLineTillPosition) {
235
211
  if (currentLineTillPosition) {
236
- const matches = /[\w,:,-,\.]*$/.exec(currentLineTillPosition);
237
-
212
+ var matches = /[\w,:,-,\.]*$/.exec(currentLineTillPosition);
238
213
  if (matches) {
239
214
  return matches[0];
240
215
  }
241
216
  }
242
217
  }
243
-
244
218
  function replaceTabStopsWithCursors(expandedWord) {
245
219
  return expandedWord.replace(/([^\\])\$\{\d+\}/g, '$1|').replace(/\$\{\d+:([^\}]+)\}/g, '$1');
246
220
  }
247
-
248
221
  function removeTabStops(expandedWord) {
249
222
  return expandedWord.replace(/([^\\])\$\{\d+\}/g, '$1').replace(/\$\{\d+:([^\}]+)\}/g, '$1');
250
223
  }
251
-
252
224
  function escapeNonTabStopDollar(text) {
253
225
  return text ? text.replace(/([^\\])(\$)([^\{])/g, '$1\\$2$3') : text;
254
226
  }
255
-
256
227
  function addFinalTabStop(text) {
257
228
  if (!text || !text.trim()) {
258
229
  return text;
259
230
  }
260
-
261
- let maxTabStop = -1;
262
- let maxTabStopRanges = [];
263
- let foundLastStop = false;
264
- let replaceWithLastStop = false;
265
- let i = 0;
266
- const n = text.length;
267
-
231
+ var maxTabStop = -1;
232
+ var maxTabStopRanges = [];
233
+ var foundLastStop = false;
234
+ var replaceWithLastStop = false;
235
+ var i = 0;
236
+ var n = text.length;
268
237
  try {
269
238
  while (i < n && !foundLastStop) {
270
239
  // Look for ${
271
240
  if (text[i++] != '$' || text[i++] != '{') {
272
241
  continue;
273
- } // Find tabstop
274
-
275
-
276
- let numberStart = -1;
277
- let numberEnd = -1;
278
-
242
+ }
243
+ // Find tabstop
244
+ var numberStart = -1;
245
+ var numberEnd = -1;
279
246
  while (i < n && /\d/.test(text[i])) {
280
247
  numberStart = numberStart < 0 ? i : numberStart;
281
248
  numberEnd = i + 1;
282
249
  i++;
283
- } // If ${ was not followed by a number and either } or :, then its not a tabstop
284
-
285
-
250
+ }
251
+ // If ${ was not followed by a number and either } or :, then its not a tabstop
286
252
  if (numberStart === -1 || numberEnd === -1 || i >= n || text[i] != '}' && text[i] != ':') {
287
253
  continue;
288
- } // If ${0} was found, then break
289
-
290
-
291
- const currentTabStop = text.substring(numberStart, numberEnd);
254
+ }
255
+ // If ${0} was found, then break
256
+ var currentTabStop = text.substring(numberStart, numberEnd);
292
257
  foundLastStop = currentTabStop === '0';
293
-
294
258
  if (foundLastStop) {
295
259
  break;
296
260
  }
297
-
298
- let foundPlaceholder = false;
299
-
261
+ var foundPlaceholder = false;
300
262
  if (text[i++] == ':') {
301
263
  // TODO: Nested placeholders may break here
302
264
  while (i < n) {
@@ -304,95 +266,84 @@ function addFinalTabStop(text) {
304
266
  foundPlaceholder = true;
305
267
  break;
306
268
  }
307
-
308
269
  i++;
309
270
  }
310
- } // Decide to replace currentTabStop with ${0} only if its the max among all tabstops and is not a placeholder
311
-
312
-
271
+ }
272
+ // Decide to replace currentTabStop with ${0} only if its the max among all tabstops and is not a placeholder
313
273
  if (Number(currentTabStop) > Number(maxTabStop)) {
314
274
  maxTabStop = Number(currentTabStop);
315
275
  maxTabStopRanges = [{
316
- numberStart,
317
- numberEnd
276
+ numberStart: numberStart,
277
+ numberEnd: numberEnd
318
278
  }];
319
279
  replaceWithLastStop = !foundPlaceholder;
320
280
  } else if (Number(currentTabStop) === maxTabStop) {
321
281
  maxTabStopRanges.push({
322
- numberStart,
323
- numberEnd
282
+ numberStart: numberStart,
283
+ numberEnd: numberEnd
324
284
  });
325
285
  }
326
286
  }
327
287
  } catch (e) {}
328
-
329
288
  if (replaceWithLastStop && !foundLastStop) {
330
- for (let i = 0; i < maxTabStopRanges.length; i++) {
331
- const rangeStart = maxTabStopRanges[i].numberStart;
332
- const rangeEnd = maxTabStopRanges[i].numberEnd;
289
+ for (var _i = 0; _i < maxTabStopRanges.length; _i++) {
290
+ var rangeStart = maxTabStopRanges[_i].numberStart;
291
+ var rangeEnd = maxTabStopRanges[_i].numberEnd;
333
292
  text = text.substr(0, rangeStart) + '0' + text.substr(rangeEnd);
334
293
  }
335
294
  }
336
-
337
295
  return text;
338
296
  }
339
-
340
297
  function getCurrentLine(model, position) {
341
- const currentLine = model.getLineContent(position.lineNumber);
298
+ var currentLine = model.getLineContent(position.lineNumber);
342
299
  return currentLine;
343
300
  }
344
-
345
- let customSnippetsRegistry = {};
346
- let variablesFromFile = {};
347
- let profilesFromFile = {};
348
- const emmetSnippetField = (index, placeholder) => `\${${index}${placeholder ? ':' + placeholder : ''}}`;
301
+ var customSnippetsRegistry = {};
302
+ var variablesFromFile = {};
303
+ var profilesFromFile = {};
304
+ var emmetSnippetField = function emmetSnippetField(index, placeholder) {
305
+ return "${".concat(index).concat(placeholder ? ':' + placeholder : '', "}");
306
+ };
349
307
  /** Returns whether or not syntax is a supported stylesheet syntax, like CSS */
350
-
351
308
  function isStyleSheet(syntax) {
352
309
  return configCompat.syntaxes.stylesheet.includes(syntax);
353
310
  }
354
311
  /** Returns the syntax type, either markup (e.g. for HTML) or stylesheet (e.g. for CSS) */
355
-
356
312
  function getSyntaxType(syntax) {
357
313
  return isStyleSheet(syntax) ? 'stylesheet' : 'markup';
358
314
  }
359
315
  /** Returns the default syntax (html or css) to use for the snippets registry */
360
-
361
316
  function getDefaultSyntax(syntax) {
362
317
  return isStyleSheet(syntax) ? 'css' : 'html';
363
318
  }
364
319
  /** Returns the default snippets that Emmet suggests */
365
-
366
320
  function getDefaultSnippets(syntax) {
367
- const syntaxType = getSyntaxType(syntax);
368
- const emptyUserConfig = {
321
+ var syntaxType = getSyntaxType(syntax);
322
+ var emptyUserConfig = {
369
323
  type: syntaxType,
370
- syntax
324
+ syntax: syntax
371
325
  };
372
- const resolvedConfig = expand.resolveConfig(emptyUserConfig); // https://github.com/microsoft/vscode/issues/97632
326
+ var resolvedConfig = expand.resolveConfig(emptyUserConfig);
327
+ // https://github.com/microsoft/vscode/issues/97632
373
328
  // don't return markup (HTML) snippets for XML
374
-
375
329
  return syntax === 'xml' ? {} : resolvedConfig.snippets;
376
330
  }
377
-
378
331
  function getFilters(text, pos) {
379
- let filter;
380
-
381
- for (let i = 0; i < maxFilters; i++) {
382
- if (text.endsWith(`${filterDelimitor}${bemFilterSuffix}`, pos)) {
332
+ var filter;
333
+ for (var i = 0; i < maxFilters; i++) {
334
+ if (text.endsWith("".concat(filterDelimitor).concat(bemFilterSuffix), pos)) {
383
335
  pos -= bemFilterSuffix.length + 1;
384
336
  filter = filter ? bemFilterSuffix + ',' + filter : bemFilterSuffix;
385
- } else if (text.endsWith(`${filterDelimitor}${commentFilterSuffix}`, pos)) {
337
+ } else if (text.endsWith("".concat(filterDelimitor).concat(commentFilterSuffix), pos)) {
386
338
  pos -= commentFilterSuffix.length + 1;
387
339
  filter = filter ? commentFilterSuffix + ',' + filter : commentFilterSuffix;
388
- } else if (text.endsWith(`${filterDelimitor}${trimFilterSuffix}`, pos)) {
340
+ } else if (text.endsWith("".concat(filterDelimitor).concat(trimFilterSuffix), pos)) {
389
341
  pos -= trimFilterSuffix.length + 1;
390
342
  filter = filter ? trimFilterSuffix + ',' + filter : trimFilterSuffix;
391
343
  } else {
392
344
  break;
393
345
  }
394
346
  }
395
-
396
347
  return {
397
348
  pos: pos,
398
349
  filter: filter
@@ -401,27 +352,22 @@ function getFilters(text, pos) {
401
352
  /**
402
353
  * Extracts abbreviation from the given position in the given document
403
354
  */
404
-
405
-
406
355
  function extractAbbreviation(_monaco, model, position, options) {
407
- const currentLine = model.getLineContent(position.lineNumber);
408
- const currentLineTillPosition = currentLine.substr(0, position.column - 1);
409
- const {
410
- pos,
411
- filter
412
- } = getFilters(currentLineTillPosition, position.column - 1);
413
- const lengthOccupiedByFilter = filter ? filter.length + 1 : 0;
414
- const result = expand.extract(currentLine, pos, options);
415
-
356
+ var currentLine = model.getLineContent(position.lineNumber);
357
+ var currentLineTillPosition = currentLine.substr(0, position.column - 1);
358
+ var _getFilters = getFilters(currentLineTillPosition, position.column - 1),
359
+ pos = _getFilters.pos,
360
+ filter = _getFilters.filter;
361
+ var lengthOccupiedByFilter = filter ? filter.length + 1 : 0;
362
+ var result = expand.extract(currentLine, pos, options);
416
363
  if (!result) {
417
364
  return;
418
365
  }
419
-
420
- const rangeToReplace = new _monaco.Range(position.lineNumber, result.location + 1, position.lineNumber, result.location + result.abbreviation.length + lengthOccupiedByFilter + 1);
366
+ var rangeToReplace = new _monaco.Range(position.lineNumber, result.location + 1, position.lineNumber, result.location + result.abbreviation.length + lengthOccupiedByFilter + 1);
421
367
  return {
422
368
  abbreviationRange: rangeToReplace,
423
369
  abbreviation: result.abbreviation,
424
- filter
370
+ filter: filter
425
371
  };
426
372
  }
427
373
  /**
@@ -430,126 +376,113 @@ function extractAbbreviation(_monaco, model, position, options) {
430
376
  * @param syntax string
431
377
  * @param abbreviation string
432
378
  */
433
-
434
379
  function isAbbreviationValid(syntax, abbreviation) {
435
380
  if (!abbreviation) {
436
381
  return false;
437
382
  }
438
-
439
383
  if (isStyleSheet(syntax)) {
440
384
  if (abbreviation.includes('#')) {
441
385
  if (abbreviation.startsWith('#')) {
442
- const hexColorRegex = /^#[\d,a-f,A-F]{1,6}$/;
386
+ var hexColorRegex = /^#[\d,a-f,A-F]{1,6}$/;
443
387
  return hexColorRegex.test(abbreviation);
444
388
  } else if (commonlyUsedTags.includes(abbreviation.substring(0, abbreviation.indexOf('#')))) {
445
389
  return false;
446
390
  }
447
391
  }
448
-
449
392
  return cssAbbreviationRegex.test(abbreviation);
450
393
  }
451
-
452
394
  if (abbreviation.startsWith('!')) {
453
395
  return !/[^!]/.test(abbreviation);
454
- } // Its common for users to type (sometextinsidebrackets), this should not be treated as an abbreviation
396
+ }
397
+ // Its common for users to type (sometextinsidebrackets), this should not be treated as an abbreviation
455
398
  // Grouping in abbreviation is valid only if it's inside a text node or preceeded/succeeded with one of the symbols for nesting, sibling, repeater or climb up
456
-
457
-
458
399
  if ((/\(/.test(abbreviation) || /\)/.test(abbreviation)) && !/\{[^\}\{]*[\(\)]+[^\}\{]*\}(?:[>\+\*\^]|$)/.test(abbreviation) && !/\(.*\)[>\+\*\^]/.test(abbreviation) && !/[>\+\*\^]\(.*\)/.test(abbreviation)) {
459
400
  return false;
460
401
  }
461
-
462
402
  if (syntax === 'jsx') {
463
403
  return jsxAbbreviationStartRegex.test(abbreviation) && htmlAbbreviationRegex.test(abbreviation);
464
404
  }
465
-
466
405
  return htmlAbbreviationStartRegex.test(abbreviation) && htmlAbbreviationRegex.test(abbreviation);
467
406
  }
468
-
469
407
  function isExpandedTextNoise(syntax, abbreviation, expandedText, options) {
470
- var _a, _b; // Unresolved css abbreviations get expanded to a blank property value
408
+ var _a, _b;
409
+ // Unresolved css abbreviations get expanded to a blank property value
471
410
  // Eg: abc -> abc: ; or abc:d -> abc: d; which is noise if it gets suggested for every word typed
472
-
473
-
474
411
  if (isStyleSheet(syntax) && options) {
475
- const between = (_a = options['stylesheet.between']) !== null && _a !== void 0 ? _a : ': ';
476
- const after = (_b = options['stylesheet.after']) !== null && _b !== void 0 ? _b : ';'; // Remove overlapping between `abbreviation` and `between`, if any
477
-
478
- let endPrefixIndex = abbreviation.indexOf(between[0], Math.max(abbreviation.length - between.length, 0));
412
+ var between = (_a = options['stylesheet.between']) !== null && _a !== void 0 ? _a : ': ';
413
+ var after = (_b = options['stylesheet.after']) !== null && _b !== void 0 ? _b : ';';
414
+ // Remove overlapping between `abbreviation` and `between`, if any
415
+ var endPrefixIndex = abbreviation.indexOf(between[0], Math.max(abbreviation.length - between.length, 0));
479
416
  endPrefixIndex = endPrefixIndex >= 0 ? endPrefixIndex : abbreviation.length;
480
- const abbr = abbreviation.substring(0, endPrefixIndex);
481
- return expandedText === `${abbr}${between}\${0}${after}` || expandedText.replace(/\s/g, '') === abbreviation.replace(/\s/g, '') + after;
482
- } // we don't want common html tags suggested for xml
483
-
484
-
485
- if (syntax === 'xml' && commonlyUsedTags.some(tag => tag.startsWith(abbreviation.toLowerCase()))) {
417
+ var abbr = abbreviation.substring(0, endPrefixIndex);
418
+ return expandedText === "".concat(abbr).concat(between, "${0}").concat(after) || expandedText.replace(/\s/g, '') === abbreviation.replace(/\s/g, '') + after;
419
+ }
420
+ // we don't want common html tags suggested for xml
421
+ if (syntax === 'xml' && commonlyUsedTags.some(function (tag) {
422
+ return tag.startsWith(abbreviation.toLowerCase());
423
+ })) {
486
424
  return true;
487
425
  }
488
-
489
426
  if (commonlyUsedTags.includes(abbreviation.toLowerCase()) || markupSnippetKeys.includes(abbreviation)) {
490
427
  return false;
491
- } // Custom tags can have - or :
492
-
493
-
428
+ }
429
+ // Custom tags can have - or :
494
430
  if (/[-,:]/.test(abbreviation) && !/--|::/.test(abbreviation) && !abbreviation.endsWith(':')) {
495
431
  return false;
496
- } // Its common for users to type some text and end it with period, this should not be treated as an abbreviation
432
+ }
433
+ // Its common for users to type some text and end it with period, this should not be treated as an abbreviation
497
434
  // Else it becomes noise.
498
435
  // When user just types '.', return the expansion
499
436
  // Otherwise emmet loses change to participate later
500
437
  // For example in `.foo`. See https://github.com/Microsoft/vscode/issues/66013
501
-
502
-
503
438
  if (abbreviation === '.') {
504
439
  return false;
505
440
  }
506
-
507
- const dotMatches = /^([a-z,A-Z,\d]*)\.$/.exec(abbreviation);
508
-
441
+ var dotMatches = /^([a-z,A-Z,\d]*)\.$/.exec(abbreviation);
509
442
  if (dotMatches) {
510
443
  // Valid html tags such as `div.`
511
444
  if (dotMatches[1] && data.htmlData.tags.includes(dotMatches[1])) {
512
445
  return false;
513
446
  }
514
-
515
447
  return true;
516
- } // Fix for https://github.com/microsoft/vscode/issues/89746
448
+ }
449
+ // Fix for https://github.com/microsoft/vscode/issues/89746
517
450
  // PascalCase tags are common in jsx code, which should not be treated as noise.
518
451
  // Eg: MyAwesomComponent -> <MyAwesomComponent></MyAwesomComponent>
519
-
520
-
521
452
  if (syntax === 'jsx' && /^([A-Z][A-Za-z0-9]*)+$/.test(abbreviation)) {
522
453
  return false;
523
- } // Unresolved html abbreviations get expanded as if it were a tag
454
+ }
455
+ // Unresolved html abbreviations get expanded as if it were a tag
524
456
  // Eg: abc -> <abc></abc> which is noise if it gets suggested for every word typed
525
-
526
-
527
- return expandedText.toLowerCase() === `<${abbreviation.toLowerCase()}>\${1}</${abbreviation.toLowerCase()}>`;
457
+ return expandedText.toLowerCase() === "<".concat(abbreviation.toLowerCase(), ">${1}</").concat(abbreviation.toLowerCase(), ">");
528
458
  }
529
459
  /**
530
460
  * Returns options to be used by emmet
531
461
  */
532
-
533
-
534
462
  function getExpandOptions(syntax, emmetConfig, filter) {
535
463
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
536
-
537
464
  emmetConfig = emmetConfig !== null && emmetConfig !== void 0 ? emmetConfig : {};
538
465
  emmetConfig['preferences'] = (_a = emmetConfig['preferences']) !== null && _a !== void 0 ? _a : {};
539
- const preferences = emmetConfig['preferences'];
540
- const stylesheetSyntax = isStyleSheet(syntax) ? syntax : 'css'; // Fetch Profile
541
-
542
- const profile = getProfile(syntax, (_b = emmetConfig['syntaxProfiles']) !== null && _b !== void 0 ? _b : {});
543
- const filtersFromProfile = profile && profile['filters'] ? profile['filters'].split(',') : [];
544
- const trimmedFilters = filtersFromProfile.map(filterFromProfile => filterFromProfile.trim());
545
- const bemEnabled = filter && filter.split(',').some(x => x.trim() === 'bem') || trimmedFilters.includes('bem');
546
- const commentEnabled = filter && filter.split(',').some(x => x.trim() === 'c') || trimmedFilters.includes('c'); // Fetch formatters
547
-
548
- const formatters = getFormatters(syntax, emmetConfig['preferences']);
549
- const unitAliases = (formatters === null || formatters === void 0 ? void 0 : formatters.stylesheet) && formatters.stylesheet['unitAliases'] || {}; // These options are the default values provided by vscode for
466
+ var preferences = emmetConfig['preferences'];
467
+ var stylesheetSyntax = isStyleSheet(syntax) ? syntax : 'css';
468
+ // Fetch Profile
469
+ var profile = getProfile(syntax, (_b = emmetConfig['syntaxProfiles']) !== null && _b !== void 0 ? _b : {});
470
+ var filtersFromProfile = profile && profile['filters'] ? profile['filters'].split(',') : [];
471
+ var trimmedFilters = filtersFromProfile.map(function (filterFromProfile) {
472
+ return filterFromProfile.trim();
473
+ });
474
+ var bemEnabled = filter && filter.split(',').some(function (x) {
475
+ return x.trim() === 'bem';
476
+ }) || trimmedFilters.includes('bem');
477
+ var commentEnabled = filter && filter.split(',').some(function (x) {
478
+ return x.trim() === 'c';
479
+ }) || trimmedFilters.includes('c');
480
+ // Fetch formatters
481
+ var formatters = getFormatters(syntax, emmetConfig['preferences']);
482
+ var unitAliases = (formatters === null || formatters === void 0 ? void 0 : formatters.stylesheet) && formatters.stylesheet['unitAliases'] || {};
483
+ // These options are the default values provided by vscode for
550
484
  // extension preferences
551
-
552
- const defaultVSCodeOptions = {
485
+ var defaultVSCodeOptions = {
553
486
  // inlineElements: string[],
554
487
  // 'output.indent': string,
555
488
  // 'output.baseIndent': string,
@@ -593,9 +526,9 @@ function getExpandOptions(syntax, emmetConfig, filter) {
593
526
  // 'stylesheet.json': boolean,
594
527
  // 'stylesheet.jsonDoubleQuotes': boolean,
595
528
  'stylesheet.fuzzySearchMinScore': 0.3
596
- }; // These options come from user prefs in the vscode repo
597
-
598
- const userPreferenceOptions = {
529
+ };
530
+ // These options come from user prefs in the vscode repo
531
+ var userPreferenceOptions = {
599
532
  // inlineElements: string[],
600
533
  // 'output.indent': string,
601
534
  // 'output.baseIndent': string,
@@ -626,8 +559,8 @@ function getExpandOptions(syntax, emmetConfig, filter) {
626
559
  // 'stylesheet.keywords': string[],
627
560
  // 'stylesheet.unitless': string[],
628
561
  'stylesheet.shortHex': preferences['css.color.short'],
629
- 'stylesheet.between': preferences[`${stylesheetSyntax}.valueSeparator`],
630
- 'stylesheet.after': preferences[`${stylesheetSyntax}.propertyEnd`],
562
+ 'stylesheet.between': preferences["".concat(stylesheetSyntax, ".valueSeparator")],
563
+ 'stylesheet.after': preferences["".concat(stylesheetSyntax, ".propertyEnd")],
631
564
  'stylesheet.intUnit': preferences['css.intUnit'],
632
565
  'stylesheet.floatUnit': preferences['css.floatUnit'],
633
566
  'stylesheet.unitAliases': unitAliases,
@@ -635,29 +568,28 @@ function getExpandOptions(syntax, emmetConfig, filter) {
635
568
  // 'stylesheet.jsonDoubleQuotes': boolean,
636
569
  'stylesheet.fuzzySearchMinScore': preferences['css.fuzzySearchMinScore']
637
570
  };
638
- const combinedOptions = {};
639
- [...Object.keys(defaultVSCodeOptions), ...Object.keys(userPreferenceOptions)].forEach(key => {
571
+ var combinedOptions = {};
572
+ [].concat(_rollupPluginBabelHelpers.toConsumableArray(Object.keys(defaultVSCodeOptions)), _rollupPluginBabelHelpers.toConsumableArray(Object.keys(userPreferenceOptions))).forEach(function (key) {
640
573
  var _a;
641
-
642
- const castKey = key;
574
+ var castKey = key;
643
575
  combinedOptions[castKey] = (_a = userPreferenceOptions[castKey]) !== null && _a !== void 0 ? _a : defaultVSCodeOptions[castKey];
644
576
  });
645
- const mergedAliases = Object.assign(Object.assign({}, defaultVSCodeOptions['stylesheet.unitAliases']), userPreferenceOptions['stylesheet.unitAliases']);
577
+ var mergedAliases = Object.assign(Object.assign({}, defaultVSCodeOptions['stylesheet.unitAliases']), userPreferenceOptions['stylesheet.unitAliases']);
646
578
  combinedOptions['stylesheet.unitAliases'] = mergedAliases;
647
- const type = getSyntaxType(syntax);
648
- const variables = getVariables(emmetConfig['variables']);
649
- const baseSyntax = getDefaultSyntax(syntax);
650
- const snippets = type === 'stylesheet' ? (_k = customSnippetsRegistry[syntax]) !== null && _k !== void 0 ? _k : customSnippetsRegistry[baseSyntax] : customSnippetsRegistry[syntax];
579
+ var type = getSyntaxType(syntax);
580
+ var variables = getVariables(emmetConfig['variables']);
581
+ var baseSyntax = getDefaultSyntax(syntax);
582
+ var snippets = type === 'stylesheet' ? (_k = customSnippetsRegistry[syntax]) !== null && _k !== void 0 ? _k : customSnippetsRegistry[baseSyntax] : customSnippetsRegistry[syntax];
651
583
  return {
652
- type,
584
+ type: type,
653
585
  options: combinedOptions,
654
- variables,
655
- snippets,
656
- syntax,
586
+ variables: variables,
587
+ snippets: snippets,
588
+ syntax: syntax,
657
589
  // context: null,
658
590
  text: undefined,
659
- maxRepeat: 1000 // cache: null
660
-
591
+ maxRepeat: 1000
592
+ // cache: null
661
593
  };
662
594
  }
663
595
 
@@ -665,16 +597,12 @@ function getClosingStyle(syntax) {
665
597
  switch (syntax) {
666
598
  case 'xhtml':
667
599
  return 'xhtml';
668
-
669
600
  case 'xml':
670
601
  return 'xml';
671
-
672
602
  case 'xsl':
673
603
  return 'xml';
674
-
675
604
  case 'jsx':
676
605
  return 'xhtml';
677
-
678
606
  default:
679
607
  return 'html';
680
608
  }
@@ -683,168 +611,134 @@ function getClosingStyle(syntax) {
683
611
  * Maps and returns syntaxProfiles of previous format to ones compatible with new emmet modules
684
612
  * @param syntax
685
613
  */
686
-
687
614
  function getProfile(syntax, profilesFromSettings) {
688
615
  if (!profilesFromSettings) {
689
616
  profilesFromSettings = {};
690
617
  }
691
-
692
- const profilesConfig = Object.assign({}, profilesFromFile, profilesFromSettings);
693
- const options = profilesConfig[syntax];
694
-
618
+ var profilesConfig = Object.assign({}, profilesFromFile, profilesFromSettings);
619
+ var options = profilesConfig[syntax];
695
620
  if (!options || typeof options === 'string') {
696
621
  if (options === 'xhtml') {
697
622
  return {
698
623
  selfClosingStyle: 'xhtml'
699
624
  };
700
625
  }
701
-
702
626
  return {};
703
627
  }
704
-
705
- const newOptions = {};
706
-
707
- for (const key in options) {
628
+ var newOptions = {};
629
+ for (var key in options) {
708
630
  switch (key) {
709
631
  case 'tag_case':
710
632
  newOptions['tagCase'] = options[key] === 'lower' || options[key] === 'upper' ? options[key] : '';
711
633
  break;
712
-
713
634
  case 'attr_case':
714
635
  newOptions['attributeCase'] = options[key] === 'lower' || options[key] === 'upper' ? options[key] : '';
715
636
  break;
716
-
717
637
  case 'attr_quotes':
718
638
  newOptions['attributeQuotes'] = options[key];
719
639
  break;
720
-
721
640
  case 'tag_nl':
722
641
  newOptions['format'] = options[key] === true || options[key] === false ? options[key] : true;
723
642
  break;
724
-
725
643
  case 'inline_break':
726
644
  newOptions['inlineBreak'] = options[key];
727
645
  break;
728
-
729
646
  case 'self_closing_tag':
730
647
  if (options[key] === true) {
731
648
  newOptions['selfClosingStyle'] = 'xml';
732
649
  break;
733
650
  }
734
-
735
651
  if (options[key] === false) {
736
652
  newOptions['selfClosingStyle'] = 'html';
737
653
  break;
738
654
  }
739
-
740
655
  newOptions['selfClosingStyle'] = options[key];
741
656
  break;
742
-
743
657
  case 'compact_bool':
744
658
  newOptions['compactBooleanAttributes'] = options[key];
745
659
  break;
746
-
747
660
  default:
748
661
  newOptions[key] = options[key];
749
662
  break;
750
663
  }
751
664
  }
752
-
753
665
  return newOptions;
754
666
  }
755
667
  /**
756
668
  * Returns variables to be used while expanding snippets
757
669
  */
758
-
759
-
760
670
  function getVariables(variablesFromSettings) {
761
671
  if (!variablesFromSettings) {
762
672
  return variablesFromFile;
763
673
  }
764
-
765
674
  return Object.assign({}, variablesFromFile, variablesFromSettings);
766
675
  }
767
-
768
676
  function getFormatters(syntax, preferences) {
769
- if (!preferences || typeof preferences !== 'object') {
677
+ if (!preferences || _rollupPluginBabelHelpers["typeof"](preferences) !== 'object') {
770
678
  return {};
771
679
  }
772
-
773
680
  if (!isStyleSheet(syntax)) {
774
- const commentFormatter = {};
775
-
776
- for (const key in preferences) {
681
+ var commentFormatter = {};
682
+ for (var key in preferences) {
777
683
  switch (key) {
778
684
  case 'filter.commentAfter':
779
685
  commentFormatter['after'] = preferences[key];
780
686
  break;
781
-
782
687
  case 'filter.commentBefore':
783
688
  commentFormatter['before'] = preferences[key];
784
689
  break;
785
-
786
690
  case 'filter.commentTrigger':
787
691
  commentFormatter['trigger'] = preferences[key];
788
692
  break;
789
693
  }
790
694
  }
791
-
792
695
  return {
793
696
  comment: commentFormatter
794
697
  };
795
698
  }
796
-
797
- let fuzzySearchMinScore = typeof (preferences === null || preferences === void 0 ? void 0 : preferences['css.fuzzySearchMinScore']) === 'number' ? preferences['css.fuzzySearchMinScore'] : 0.3;
798
-
699
+ var fuzzySearchMinScore = typeof (preferences === null || preferences === void 0 ? void 0 : preferences['css.fuzzySearchMinScore']) === 'number' ? preferences['css.fuzzySearchMinScore'] : 0.3;
799
700
  if (fuzzySearchMinScore > 1) {
800
701
  fuzzySearchMinScore = 1;
801
702
  } else if (fuzzySearchMinScore < 0) {
802
703
  fuzzySearchMinScore = 0;
803
704
  }
804
-
805
- const stylesheetFormatter = {
705
+ var stylesheetFormatter = {
806
706
  'fuzzySearchMinScore': fuzzySearchMinScore
807
707
  };
808
-
809
- for (const key in preferences) {
810
- switch (key) {
708
+ var _loop = function _loop() {
709
+ switch (_key) {
811
710
  case 'css.floatUnit':
812
- stylesheetFormatter['floatUnit'] = preferences[key];
711
+ stylesheetFormatter['floatUnit'] = preferences[_key];
813
712
  break;
814
-
815
713
  case 'css.intUnit':
816
- stylesheetFormatter['intUnit'] = preferences[key];
714
+ stylesheetFormatter['intUnit'] = preferences[_key];
817
715
  break;
818
-
819
716
  case 'css.unitAliases':
820
- const unitAliases = {};
821
- preferences[key].split(',').forEach(alias => {
717
+ var unitAliases = {};
718
+ preferences[_key].split(',').forEach(function (alias) {
822
719
  if (!alias || !alias.trim() || !alias.includes(':')) {
823
720
  return;
824
721
  }
825
-
826
- const aliasName = alias.substr(0, alias.indexOf(':'));
827
- const aliasValue = alias.substr(aliasName.length + 1);
828
-
722
+ var aliasName = alias.substr(0, alias.indexOf(':'));
723
+ var aliasValue = alias.substr(aliasName.length + 1);
829
724
  if (!aliasName.trim() || !aliasValue) {
830
725
  return;
831
726
  }
832
-
833
727
  unitAliases[aliasName.trim()] = aliasValue;
834
728
  });
835
729
  stylesheetFormatter['unitAliases'] = unitAliases;
836
730
  break;
837
-
838
- case `${syntax}.valueSeparator`:
839
- stylesheetFormatter['between'] = preferences[key];
731
+ case "".concat(syntax, ".valueSeparator"):
732
+ stylesheetFormatter['between'] = preferences[_key];
840
733
  break;
841
-
842
- case `${syntax}.propertyEnd`:
843
- stylesheetFormatter['after'] = preferences[key];
734
+ case "".concat(syntax, ".propertyEnd"):
735
+ stylesheetFormatter['after'] = preferences[_key];
844
736
  break;
845
737
  }
738
+ };
739
+ for (var _key in preferences) {
740
+ _loop();
846
741
  }
847
-
848
742
  return {
849
743
  stylesheet: stylesheetFormatter
850
744
  };
@@ -858,27 +752,22 @@ function getFormatters(syntax, preferences) {
858
752
  * @param language
859
753
  * @param exlcudedLanguages Array of language ids that user has chosen to exlcude for emmet
860
754
  */
861
-
862
-
863
- function getEmmetMode(language, excludedLanguages = []) {
755
+ function getEmmetMode(language) {
756
+ var excludedLanguages = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
864
757
  if (!language || excludedLanguages.includes(language)) {
865
758
  return;
866
759
  }
867
-
868
760
  if (/\b(typescriptreact|javascriptreact|jsx-tags)\b/.test(language)) {
869
761
  // treat tsx like jsx
870
762
  return 'jsx';
871
763
  }
872
-
873
764
  if (language === 'sass-indented') {
874
765
  // map sass-indented to sass
875
766
  return 'sass';
876
767
  }
877
-
878
768
  if (language === 'jade') {
879
769
  return 'pug';
880
770
  }
881
-
882
771
  if (configCompat.syntaxes.markup.includes(language) || configCompat.syntaxes.stylesheet.includes(language)) {
883
772
  return language;
884
773
  }