@elice/material-exercise 1.230328.0 → 1.230418.1

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