@deephaven/console 0.15.1-beta.2 → 0.15.1-beta.4

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 (166) hide show
  1. package/dist/Console.d.ts +129 -121
  2. package/dist/Console.d.ts.map +1 -1
  3. package/dist/Console.js +98 -99
  4. package/dist/Console.js.map +1 -1
  5. package/dist/ConsoleInput.d.ts +47 -43
  6. package/dist/ConsoleInput.d.ts.map +1 -1
  7. package/dist/ConsoleInput.js +111 -73
  8. package/dist/ConsoleInput.js.map +1 -1
  9. package/dist/ConsoleMenu.d.ts +24 -22
  10. package/dist/ConsoleMenu.d.ts.map +1 -1
  11. package/dist/ConsoleMenu.js +7 -12
  12. package/dist/ConsoleMenu.js.map +1 -1
  13. package/dist/ConsolePropTypes.d.ts +2 -2
  14. package/dist/ConsolePropTypes.d.ts.map +1 -1
  15. package/dist/ConsolePropTypes.js.map +1 -1
  16. package/dist/ConsoleStatusBar.d.ts +26 -29
  17. package/dist/ConsoleStatusBar.d.ts.map +1 -1
  18. package/dist/ConsoleStatusBar.js +11 -12
  19. package/dist/ConsoleStatusBar.js.map +1 -1
  20. package/dist/StoragePropTypes.d.ts +2 -2
  21. package/dist/StoragePropTypes.d.ts.map +1 -1
  22. package/dist/StoragePropTypes.js.map +1 -1
  23. package/dist/command-history/CommandHistory.d.ts +52 -77
  24. package/dist/command-history/CommandHistory.d.ts.map +1 -1
  25. package/dist/command-history/CommandHistory.js +12 -14
  26. package/dist/command-history/CommandHistory.js.map +1 -1
  27. package/dist/command-history/CommandHistoryActions.d.ts +11 -19
  28. package/dist/command-history/CommandHistoryActions.d.ts.map +1 -1
  29. package/dist/command-history/CommandHistoryActions.js +4 -19
  30. package/dist/command-history/CommandHistoryActions.js.map +1 -1
  31. package/dist/command-history/CommandHistoryItem.d.ts +15 -21
  32. package/dist/command-history/CommandHistoryItem.d.ts.map +1 -1
  33. package/dist/command-history/CommandHistoryItem.js +1 -10
  34. package/dist/command-history/CommandHistoryItem.js.map +1 -1
  35. package/dist/command-history/CommandHistoryItemTooltip.d.ts +34 -31
  36. package/dist/command-history/CommandHistoryItemTooltip.d.ts.map +1 -1
  37. package/dist/command-history/CommandHistoryItemTooltip.js +28 -36
  38. package/dist/command-history/CommandHistoryItemTooltip.js.map +1 -1
  39. package/dist/command-history/CommandHistoryTypes.d.ts +19 -0
  40. package/dist/command-history/CommandHistoryTypes.d.ts.map +1 -0
  41. package/dist/command-history/CommandHistoryTypes.js +2 -0
  42. package/dist/command-history/CommandHistoryTypes.js.map +1 -0
  43. package/dist/command-history/index.d.ts +5 -5
  44. package/dist/command-history/index.d.ts.map +1 -1
  45. package/dist/command-history/index.js.map +1 -1
  46. package/dist/common/Code.d.ts +10 -11
  47. package/dist/common/Code.d.ts.map +1 -1
  48. package/dist/common/Code.js +5 -5
  49. package/dist/common/Code.js.map +1 -1
  50. package/dist/common/ConsoleUtils.d.ts +20 -8
  51. package/dist/common/ConsoleUtils.d.ts.map +1 -1
  52. package/dist/common/ConsoleUtils.js +34 -10
  53. package/dist/common/ConsoleUtils.js.map +1 -1
  54. package/dist/console-history/ConsoleHistory.d.ts +19 -18
  55. package/dist/console-history/ConsoleHistory.d.ts.map +1 -1
  56. package/dist/console-history/ConsoleHistory.js +5 -9
  57. package/dist/console-history/ConsoleHistory.js.map +1 -1
  58. package/dist/console-history/ConsoleHistoryItem.d.ts +21 -44
  59. package/dist/console-history/ConsoleHistoryItem.d.ts.map +1 -1
  60. package/dist/console-history/ConsoleHistoryItem.js +12 -28
  61. package/dist/console-history/ConsoleHistoryItem.js.map +1 -1
  62. package/dist/console-history/ConsoleHistoryItemResult.d.ts +13 -9
  63. package/dist/console-history/ConsoleHistoryItemResult.d.ts.map +1 -1
  64. package/dist/console-history/ConsoleHistoryItemResult.js.map +1 -1
  65. package/dist/console-history/ConsoleHistoryResultErrorMessage.d.ts +25 -21
  66. package/dist/console-history/ConsoleHistoryResultErrorMessage.d.ts.map +1 -1
  67. package/dist/console-history/ConsoleHistoryResultErrorMessage.js +15 -9
  68. package/dist/console-history/ConsoleHistoryResultErrorMessage.js.map +1 -1
  69. package/dist/console-history/ConsoleHistoryResultInProgress.d.ts +21 -17
  70. package/dist/console-history/ConsoleHistoryResultInProgress.d.ts.map +1 -1
  71. package/dist/console-history/ConsoleHistoryResultInProgress.js +12 -10
  72. package/dist/console-history/ConsoleHistoryResultInProgress.js.map +1 -1
  73. package/dist/console-history/ConsoleHistoryTypes.d.ts +19 -0
  74. package/dist/console-history/ConsoleHistoryTypes.d.ts.map +1 -0
  75. package/dist/console-history/ConsoleHistoryTypes.js +2 -0
  76. package/dist/console-history/ConsoleHistoryTypes.js.map +1 -0
  77. package/dist/console-history/index.d.ts +5 -5
  78. package/dist/console-history/index.d.ts.map +1 -1
  79. package/dist/console-history/index.js.map +1 -1
  80. package/dist/csv/CsvFormats.d.ts +13 -12
  81. package/dist/csv/CsvFormats.d.ts.map +1 -1
  82. package/dist/csv/CsvFormats.js +8 -8
  83. package/dist/csv/CsvFormats.js.map +1 -1
  84. package/dist/csv/CsvInputBar.d.ts +46 -38
  85. package/dist/csv/CsvInputBar.d.ts.map +1 -1
  86. package/dist/csv/CsvInputBar.js +15 -23
  87. package/dist/csv/CsvInputBar.js.map +1 -1
  88. package/dist/csv/CsvOverlay.d.ts +40 -40
  89. package/dist/csv/CsvOverlay.d.ts.map +1 -1
  90. package/dist/csv/CsvOverlay.js +38 -29
  91. package/dist/csv/CsvOverlay.js.map +1 -1
  92. package/dist/csv/CsvParser.d.ts +44 -46
  93. package/dist/csv/CsvParser.d.ts.map +1 -1
  94. package/dist/csv/CsvParser.js +53 -8
  95. package/dist/csv/CsvParser.js.map +1 -1
  96. package/dist/csv/CsvTypeParser.d.ts +32 -27
  97. package/dist/csv/CsvTypeParser.d.ts.map +1 -1
  98. package/dist/csv/CsvTypeParser.js +42 -8
  99. package/dist/csv/CsvTypeParser.js.map +1 -1
  100. package/dist/csv/NewTableColumnTypes.d.ts +1 -1
  101. package/dist/csv/NewTableColumnTypes.d.ts.map +1 -1
  102. package/dist/csv/NewTableColumnTypes.js.map +1 -1
  103. package/dist/declaration.d.js +2 -0
  104. package/dist/declaration.d.js.map +1 -0
  105. package/dist/index.d.ts +14 -13
  106. package/dist/index.d.ts.map +1 -1
  107. package/dist/index.js.map +1 -1
  108. package/dist/log/LogLevel.d.ts +1 -1
  109. package/dist/log/LogLevel.d.ts.map +1 -1
  110. package/dist/log/LogLevel.js.map +1 -1
  111. package/dist/log/LogLevelMenuItem.d.ts +11 -12
  112. package/dist/log/LogLevelMenuItem.d.ts.map +1 -1
  113. package/dist/log/LogLevelMenuItem.js +0 -6
  114. package/dist/log/LogLevelMenuItem.js.map +1 -1
  115. package/dist/log/LogView.d.ts +40 -47
  116. package/dist/log/LogView.d.ts.map +1 -1
  117. package/dist/log/LogView.js +65 -29
  118. package/dist/log/LogView.js.map +1 -1
  119. package/dist/monaco/MonacoCompletionProvider.d.ts +19 -19
  120. package/dist/monaco/MonacoCompletionProvider.d.ts.map +1 -1
  121. package/dist/monaco/MonacoCompletionProvider.js +11 -15
  122. package/dist/monaco/MonacoCompletionProvider.js.map +1 -1
  123. package/dist/monaco/MonacoUtils.d.ts +77 -20
  124. package/dist/monaco/MonacoUtils.d.ts.map +1 -1
  125. package/dist/monaco/MonacoUtils.js +32 -24
  126. package/dist/monaco/MonacoUtils.js.map +1 -1
  127. package/dist/monaco/index.d.ts +3 -2
  128. package/dist/monaco/index.d.ts.map +1 -1
  129. package/dist/monaco/index.js.map +1 -1
  130. package/dist/monaco/lang/Language.d.ts +7 -0
  131. package/dist/monaco/lang/Language.d.ts.map +1 -0
  132. package/dist/monaco/lang/Language.js +2 -0
  133. package/dist/monaco/lang/Language.js.map +1 -0
  134. package/dist/monaco/lang/db.d.ts +3 -93
  135. package/dist/monaco/lang/db.d.ts.map +1 -1
  136. package/dist/monaco/lang/db.js +18 -3
  137. package/dist/monaco/lang/db.js.map +1 -1
  138. package/dist/monaco/lang/groovy.d.ts +3 -146
  139. package/dist/monaco/lang/groovy.d.ts.map +1 -1
  140. package/dist/monaco/lang/groovy.js +15 -2
  141. package/dist/monaco/lang/groovy.js.map +1 -1
  142. package/dist/monaco/lang/log.d.ts +3 -40
  143. package/dist/monaco/lang/log.d.ts.map +1 -1
  144. package/dist/monaco/lang/log.js +2 -1
  145. package/dist/monaco/lang/log.js.map +1 -1
  146. package/dist/monaco/lang/python.d.ts +3 -154
  147. package/dist/monaco/lang/python.d.ts.map +1 -1
  148. package/dist/monaco/lang/python.js +15 -2
  149. package/dist/monaco/lang/python.js.map +1 -1
  150. package/dist/monaco/lang/scala.d.ts +3 -140
  151. package/dist/monaco/lang/scala.d.ts.map +1 -1
  152. package/dist/monaco/lang/scala.js +10 -3
  153. package/dist/monaco/lang/scala.js.map +1 -1
  154. package/dist/notebook/Editor.d.ts +26 -27
  155. package/dist/notebook/Editor.d.ts.map +1 -1
  156. package/dist/notebook/Editor.js +23 -19
  157. package/dist/notebook/Editor.js.map +1 -1
  158. package/dist/notebook/ScriptEditor.d.ts +54 -51
  159. package/dist/notebook/ScriptEditor.d.ts.map +1 -1
  160. package/dist/notebook/ScriptEditor.js +45 -48
  161. package/dist/notebook/ScriptEditor.js.map +1 -1
  162. package/dist/notebook/ScriptEditorUtils.d.ts +15 -10
  163. package/dist/notebook/ScriptEditorUtils.d.ts.map +1 -1
  164. package/dist/notebook/ScriptEditorUtils.js +7 -7
  165. package/dist/notebook/ScriptEditorUtils.js.map +1 -1
  166. package/package.json +12 -11
package/dist/Console.js CHANGED
@@ -8,15 +8,14 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
8
8
  * Console display for use in the Iris environment.
9
9
  */
10
10
  import React, { PureComponent } from 'react';
11
- import PropTypes from 'prop-types';
12
11
  import { ContextActions } from '@deephaven/components';
13
12
  import { vsCheck } from '@deephaven/icons';
14
13
  import classNames from 'classnames';
15
14
  import memoize from 'memoize-one';
16
15
  import throttle from 'lodash.throttle';
17
- import dh, { PropTypes as APIPropTypes } from '@deephaven/jsapi-shim';
16
+ import dh from '@deephaven/jsapi-shim';
18
17
  import Log from '@deephaven/log';
19
- import { Pending } from '@deephaven/utils';
18
+ import { assertNotNull, Pending, PromiseUtils } from '@deephaven/utils';
20
19
  import ConsoleHistory from "./console-history/ConsoleHistory.js";
21
20
  import SHORTCUTS from "./ConsoleShortcuts.js";
22
21
  import LogLevel from "./log/LogLevel.js";
@@ -25,7 +24,6 @@ import CsvOverlay from "./csv/CsvOverlay.js";
25
24
  import CsvInputBar from "./csv/CsvInputBar.js";
26
25
  import "./Console.css";
27
26
  import ConsoleStatusBar from "./ConsoleStatusBar.js";
28
- import StoragePropTypes from "./StoragePropTypes.js";
29
27
  var log = Log.module('Console');
30
28
  var DEFAULT_SETTINGS = {
31
29
  isAutoLaunchPanelsEnabled: true,
@@ -35,16 +33,16 @@ var DEFAULT_SETTINGS = {
35
33
  export class Console extends PureComponent {
36
34
  /**
37
35
  * Check if the provided log level is an error type
38
- * @param {LogLevel} logLevel The LogLevel being checked
39
- * @returns {boolean} true if the log level is an error level log
36
+ * @param logLevel The LogLevel being checked
37
+ * @returns true if the log level is an error level log
40
38
  */
41
39
  static isErrorLevel(logLevel) {
42
40
  return logLevel === LogLevel.STDERR || logLevel === LogLevel.ERROR || logLevel === LogLevel.FATAL;
43
41
  }
44
42
  /**
45
43
  * Check if the provided log level is output level
46
- * @param {LogLevel} logLevel The LogLevel being checked
47
- * @returns {boolean} true if the log level should be output to the console
44
+ * @param logLevel The LogLevel being checked
45
+ * @return true if the log level should be output to the console
48
46
  */
49
47
 
50
48
 
@@ -57,6 +55,33 @@ export class Console extends PureComponent {
57
55
  constructor(props) {
58
56
  super(props);
59
57
 
58
+ _defineProperty(this, "cancelListener", void 0);
59
+
60
+ _defineProperty(this, "consolePane", void 0);
61
+
62
+ _defineProperty(this, "consoleInput", void 0);
63
+
64
+ _defineProperty(this, "consoleHistoryScrollPane", void 0);
65
+
66
+ _defineProperty(this, "pending", void 0);
67
+
68
+ _defineProperty(this, "queuedLogMessages", void 0);
69
+
70
+ _defineProperty(this, "processLogMessageQueue", throttle(() => {
71
+ this.scrollConsoleHistoryToBottom();
72
+ this.setState(state => {
73
+ log.debug2('processLogMessageQueue', this.queuedLogMessages.length, ' items');
74
+ var {
75
+ consoleHistory
76
+ } = state;
77
+ consoleHistory = consoleHistory.concat(this.queuedLogMessages);
78
+ this.queuedLogMessages = [];
79
+ return {
80
+ consoleHistory
81
+ };
82
+ });
83
+ }, Console.LOG_THROTTLE));
84
+
60
85
  _defineProperty(this, "getObjects", memoize(objectMap => [...objectMap.values()]));
61
86
 
62
87
  _defineProperty(this, "getContextActions", memoize(actions => [...actions, {
@@ -78,9 +103,9 @@ export class Console extends PureComponent {
78
103
  this.handleToggleAutoLaunchPanels = this.handleToggleAutoLaunchPanels.bind(this);
79
104
  this.handleToggleClosePanelsOnDisconnect = this.handleToggleClosePanelsOnDisconnect.bind(this);
80
105
  this.handleTogglePrintStdout = this.handleTogglePrintStdout.bind(this);
81
- this.processLogMessageQueue = throttle(this.processLogMessageQueue.bind(this), Console.LOG_THROTTLE);
82
106
  this.handleUploadCsv = this.handleUploadCsv.bind(this);
83
107
  this.handleHideCsv = this.handleHideCsv.bind(this);
108
+ this.handleCsvFileCanceled = this.handleCsvFileCanceled.bind(this);
84
109
  this.handleCsvFileOpened = this.handleCsvFileOpened.bind(this);
85
110
  this.handleCsvPaste = this.handleCsvPaste.bind(this);
86
111
  this.handleDragEnter = this.handleDragEnter.bind(this);
@@ -90,7 +115,6 @@ export class Console extends PureComponent {
90
115
  this.handleCsvUpdate = this.handleCsvUpdate.bind(this);
91
116
  this.handleCsvError = this.handleCsvError.bind(this);
92
117
  this.handleCsvInProgress = this.handleCsvInProgress.bind(this);
93
- this.cancelListener = null;
94
118
  this.consolePane = /*#__PURE__*/React.createRef();
95
119
  this.consoleInput = /*#__PURE__*/React.createRef();
96
120
  this.consoleHistoryScrollPane = /*#__PURE__*/React.createRef();
@@ -159,14 +183,16 @@ export class Console extends PureComponent {
159
183
  deinitConsoleLogging() {
160
184
  if (this.cancelListener != null) {
161
185
  this.cancelListener();
162
- this.cancelListener = null;
186
+ this.cancelListener = undefined;
163
187
  }
164
188
  }
165
189
 
166
190
  handleClearShortcut(event) {
191
+ var _this$consoleInput$cu;
192
+
167
193
  event.preventDefault();
168
194
  event.stopPropagation();
169
- this.consoleInput.current.clear();
195
+ (_this$consoleInput$cu = this.consoleInput.current) === null || _this$consoleInput$cu === void 0 ? void 0 : _this$consoleInput$cu.clear();
170
196
  }
171
197
 
172
198
  handleCommandStarted(event) {
@@ -177,10 +203,8 @@ export class Console extends PureComponent {
177
203
  var wrappedResult = this.pending.add(result);
178
204
  var historyItem = {
179
205
  command: code,
180
- result: null,
181
206
  disabledObjects: [],
182
207
  startTime: Date.now(),
183
- endTime: null,
184
208
  cancelResult: () => {
185
209
  result.cancel();
186
210
  },
@@ -193,9 +217,7 @@ export class Console extends PureComponent {
193
217
  } = this.props;
194
218
  var workspaceItemPromise = commandHistoryStorage.addItem(language, scope, code, {
195
219
  command: code,
196
- startTime: new Date().toJSON(),
197
- endTime: null,
198
- result: null
220
+ startTime: new Date().toJSON()
199
221
  });
200
222
  workspaceItemPromise.catch(err => {
201
223
  log.debug('Error adding workspace item', err);
@@ -214,8 +236,8 @@ export class Console extends PureComponent {
214
236
 
215
237
  handleCommandResult(result, historyItemParam, workspaceItemPromise) {
216
238
  var historyItem = historyItemParam;
217
- historyItem.wrappedResult = null;
218
- historyItem.cancelResult = null;
239
+ historyItem.wrappedResult = undefined;
240
+ historyItem.cancelResult = undefined;
219
241
 
220
242
  if (!result) {
221
243
  return;
@@ -233,10 +255,10 @@ export class Console extends PureComponent {
233
255
 
234
256
  handleCommandError(error, historyItemParam, workspaceItemPromise) {
235
257
  var historyItem = historyItemParam;
236
- historyItem.wrappedResult = null;
237
- historyItem.cancelResult = null;
258
+ historyItem.wrappedResult = undefined;
259
+ historyItem.cancelResult = undefined;
238
260
 
239
- if (error && error.isCanceled) {
261
+ if (PromiseUtils.isCanceled(error)) {
240
262
  log.debug('Called handleCommandError on a cancelled promise result');
241
263
  return;
242
264
  }
@@ -291,28 +313,13 @@ export class Console extends PureComponent {
291
313
  }
292
314
 
293
315
  var historyItem = {
294
- command: null,
316
+ command: undefined,
295
317
  result
296
318
  };
297
319
  this.queuedLogMessages.push(historyItem);
298
320
  this.processLogMessageQueue();
299
321
  }
300
322
 
301
- processLogMessageQueue() {
302
- this.scrollConsoleHistoryToBottom();
303
- this.setState(state => {
304
- log.debug2('processLogMessageQueue', this.queuedLogMessages.length, ' items');
305
- var {
306
- consoleHistory
307
- } = state;
308
- consoleHistory = consoleHistory.concat(this.queuedLogMessages);
309
- this.queuedLogMessages = [];
310
- return {
311
- consoleHistory
312
- };
313
- });
314
- }
315
-
316
323
  openUpdatedItems(changes) {
317
324
  var {
318
325
  isAutoLaunchPanelsEnabled
@@ -361,9 +368,11 @@ export class Console extends PureComponent {
361
368
  }
362
369
 
363
370
  updateKnownObjects(historyItem) {
364
- var {
365
- changes
366
- } = historyItem.result;
371
+ var changes;
372
+
373
+ if (historyItem.result) {
374
+ changes = historyItem.result.changes;
375
+ }
367
376
 
368
377
  if (!changes || (!changes.created || changes.created.length === 0) && (!changes.updated || changes.updated.length === 0) && (!changes.removed || changes.removed.length === 0)) {
369
378
  log.debug2('updateKnownObjects no changes');
@@ -371,6 +380,8 @@ export class Console extends PureComponent {
371
380
  }
372
381
 
373
382
  this.setState(state => {
383
+ var _changes, _changes2, _changes3;
384
+
374
385
  var history = state.consoleHistory.concat();
375
386
  var itemIndex = history.lastIndexOf(historyItem);
376
387
 
@@ -385,36 +396,39 @@ export class Console extends PureComponent {
385
396
  var disableOldObject = function disableOldObject(object) {
386
397
  var isRemoved = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
387
398
  var {
388
- name
399
+ title
389
400
  } = object;
390
- var oldIndex = objectHistoryMap.get(name); // oldIndex can be -1 if a object is active but doesn't have a command in consoleHistory
401
+ assertNotNull(title);
402
+ var oldIndex = objectHistoryMap.get(title); // oldIndex can be -1 if a object is active but doesn't have a command in consoleHistory
391
403
  // this can happen after clearing the console using 'clear' or 'cls' command
392
404
 
393
- if (oldIndex >= 0) {
405
+ if (oldIndex != null && oldIndex >= 0) {
406
+ var _history$oldIndex$dis;
407
+
394
408
  // disable outdated object variable in the old consoleHistory item
395
- history[oldIndex].disabledObjects = history[oldIndex].disabledObjects.concat(name);
396
- history[oldIndex] = _objectSpread({}, history[oldIndex]);
409
+ history[oldIndex].disabledObjects = [...((_history$oldIndex$dis = history[oldIndex].disabledObjects) !== null && _history$oldIndex$dis !== void 0 ? _history$oldIndex$dis : []), title];
397
410
  }
398
411
 
399
- objectHistoryMap.set(name, itemIndex);
412
+ objectHistoryMap.set(title, itemIndex);
400
413
 
401
414
  if (isRemoved) {
402
- objectMap.delete(name);
415
+ objectMap.delete(title);
403
416
  } else {
404
- objectMap.set(name, object);
417
+ objectMap.set(title, object);
405
418
  }
406
419
  };
407
420
 
408
- changes.updated.forEach(object => disableOldObject(object));
409
- changes.removed.forEach(object => disableOldObject(object, true)); // Created objects have to be processed after removed
421
+ (_changes = changes) === null || _changes === void 0 ? void 0 : _changes.updated.forEach(object => disableOldObject(object));
422
+ (_changes2 = changes) === null || _changes2 === void 0 ? void 0 : _changes2.removed.forEach(object => disableOldObject(object, true)); // Created objects have to be processed after removed
410
423
  // in case the same object name is present in both removed and created
411
424
 
412
- changes.created.forEach(object => {
425
+ (_changes3 = changes) === null || _changes3 === void 0 ? void 0 : _changes3.created.forEach(object => {
413
426
  var {
414
- name
427
+ title
415
428
  } = object;
416
- objectHistoryMap.set(name, itemIndex);
417
- objectMap.set(name, object);
429
+ assertNotNull(title);
430
+ objectHistoryMap.set(title, itemIndex);
431
+ objectMap.set(title, object);
418
432
  });
419
433
  return {
420
434
  objectHistoryMap,
@@ -434,8 +448,8 @@ export class Console extends PureComponent {
434
448
  }
435
449
  /**
436
450
  * Updates an existing workspace CommandHistoryItem
437
- * @param {object} result The result to store with the history item. Could be empty object for success
438
- * @param {Promise<object>} workspaceItemPromise The workspace data row promise for the workspace item to be updated
451
+ * @param result The result to store with the history item. Could be empty object for success
452
+ * @param workspaceItemPromise The workspace data row promise for the workspace item to be updated
439
453
  */
440
454
 
441
455
 
@@ -465,6 +479,7 @@ export class Console extends PureComponent {
465
479
  scrollConsoleHistoryToBottom() {
466
480
  var force = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
467
481
  var pane = this.consoleHistoryScrollPane.current;
482
+ assertNotNull(pane);
468
483
 
469
484
  if (!force && pane.scrollTop < pane.scrollHeight - pane.offsetHeight) {
470
485
  return;
@@ -477,6 +492,7 @@ export class Console extends PureComponent {
477
492
 
478
493
  handleScrollPaneScroll() {
479
494
  var scrollPane = this.consoleHistoryScrollPane.current;
495
+ assertNotNull(scrollPane);
480
496
 
481
497
  if (scrollPane.scrollTop > 0 && scrollPane.scrollHeight > scrollPane.clientHeight) {
482
498
  this.setState({
@@ -525,6 +541,13 @@ export class Console extends PureComponent {
525
541
  });
526
542
  }
527
543
 
544
+ handleCsvFileCanceled() {
545
+ this.setState({
546
+ csvFile: null,
547
+ csvPaste: null
548
+ });
549
+ }
550
+
528
551
  handleCsvFileOpened(file) {
529
552
  this.setState({
530
553
  csvFile: file,
@@ -575,7 +598,7 @@ export class Console extends PureComponent {
575
598
 
576
599
  handleDragLeave(e) {
577
600
  // DragLeave gets fired for every child element, so make sure we're actually leaving the drop zone
578
- if (!e.currentTarget || e.currentTarget.contains(e.relatedTarget)) {
601
+ if (!e.currentTarget || e.currentTarget instanceof Element && e.relatedTarget instanceof Element && e.currentTarget.contains(e.relatedTarget)) {
579
602
  return;
580
603
  }
581
604
 
@@ -635,8 +658,7 @@ export class Console extends PureComponent {
635
658
  commandHistoryStorage.addItem(language, scope, name, {
636
659
  command: name,
637
660
  startTime: new Date().toJSON(),
638
- endTime: new Date().toJSON(),
639
- result: null
661
+ endTime: new Date().toJSON()
640
662
  });
641
663
  }
642
664
 
@@ -664,7 +686,7 @@ export class Console extends PureComponent {
664
686
  }
665
687
 
666
688
  handleCsvError(error) {
667
- this.addConsoleHistoryMessage(null, error);
689
+ this.addConsoleHistoryMessage(undefined, error ? "".concat(error) : undefined);
668
690
  }
669
691
 
670
692
  handleCsvInProgress(csvUploadInProgress) {
@@ -686,19 +708,19 @@ export class Console extends PureComponent {
686
708
  title: 'Print Stdout',
687
709
  action: this.handleTogglePrintStdout,
688
710
  group: ContextActions.groups.high,
689
- icon: isPrintStdOutEnabled ? vsCheck : null,
711
+ icon: isPrintStdOutEnabled ? vsCheck : undefined,
690
712
  order: 10
691
713
  }, {
692
714
  title: 'Auto Launch Panels',
693
715
  action: this.handleToggleAutoLaunchPanels,
694
716
  group: ContextActions.groups.high,
695
- icon: isAutoLaunchPanelsEnabled ? vsCheck : null,
717
+ icon: isAutoLaunchPanelsEnabled ? vsCheck : undefined,
696
718
  order: 20
697
719
  }, {
698
720
  title: 'Close Panels on Disconnect',
699
721
  action: this.handleToggleClosePanelsOnDisconnect,
700
722
  group: ContextActions.groups.high,
701
- icon: isClosePanelsOnDisconnectEnabled ? vsCheck : null,
723
+ icon: isClosePanelsOnDisconnectEnabled ? vsCheck : undefined,
702
724
  order: 30
703
725
  }, {
704
726
  title: 'Upload Table from File',
@@ -763,9 +785,9 @@ export class Console extends PureComponent {
763
785
  }
764
786
 
765
787
  focus() {
766
- var _this$consoleInput$cu;
788
+ var _this$consoleInput$cu2;
767
789
 
768
- (_this$consoleInput$cu = this.consoleInput.current) === null || _this$consoleInput$cu === void 0 ? void 0 : _this$consoleInput$cu.focus();
790
+ (_this$consoleInput$cu2 = this.consoleInput.current) === null || _this$consoleInput$cu2 === void 0 ? void 0 : _this$consoleInput$cu2.focus();
769
791
  }
770
792
 
771
793
  sendSettingsChange(prevState, state) {
@@ -850,7 +872,7 @@ export class Console extends PureComponent {
850
872
  ref: this.consolePane
851
873
  }, /*#__PURE__*/React.createElement(ConsoleStatusBar, {
852
874
  session: session,
853
- overflowActions: this.handleOverflowActions,
875
+ overflowActions: this.handleOverflowActions(),
854
876
  openObject: openObject,
855
877
  objects: consoleMenuObjects
856
878
  }, statusBarChildren), /*#__PURE__*/React.createElement("div", {
@@ -859,6 +881,7 @@ export class Console extends PureComponent {
859
881
  onDragEnter: this.handleDragEnter,
860
882
  onDragLeave: this.handleDragLeave
861
883
  }, showCsvOverlay && /*#__PURE__*/React.createElement(CsvOverlay, {
884
+ onCancel: this.handleCsvFileCanceled,
862
885
  onFileOpened: this.handleCsvFileOpened,
863
886
  onPaste: this.handleCsvPaste,
864
887
  clearDragError: this.handleClearDragError,
@@ -892,8 +915,8 @@ export class Console extends PureComponent {
892
915
  onClose: this.handleHideCsv,
893
916
  onUpdate: this.handleCsvUpdate,
894
917
  onError: this.handleCsvError,
895
- file: csvFile,
896
- paste: csvPaste,
918
+ file: csvFile !== null && csvFile !== void 0 ? csvFile : undefined,
919
+ paste: csvPaste !== null && csvPaste !== void 0 ? csvPaste : undefined,
897
920
  onInProgress: this.handleCsvInProgress,
898
921
  timeZone: timeZone,
899
922
  unzip: unzip
@@ -905,37 +928,10 @@ export class Console extends PureComponent {
905
928
 
906
929
  }
907
930
 
908
- _defineProperty(Console, "LOG_THROTTLE", 500);
909
-
910
- Console.propTypes = {
911
- statusBarChildren: PropTypes.node,
912
- settings: PropTypes.shape({}),
913
- focusCommandHistory: PropTypes.func.isRequired,
914
- openObject: PropTypes.func.isRequired,
915
- closeObject: PropTypes.func.isRequired,
916
- session: APIPropTypes.IdeSession.isRequired,
917
- language: PropTypes.string.isRequired,
918
- commandHistoryStorage: StoragePropTypes.CommandHistoryStorage.isRequired,
919
- onSettingsChange: PropTypes.func,
920
- scope: PropTypes.string,
921
- actions: PropTypes.arrayOf(PropTypes.shape({})),
922
- timeZone: PropTypes.string,
923
- // Children shown at the bottom of the console history
924
- historyChildren: PropTypes.node,
925
- // Known object map
926
- objectMap: PropTypes.instanceOf(Map),
927
- disabled: PropTypes.bool,
928
-
929
- /**
930
- * Function to unzip a zip file. If not provided, zip files will not be accepted
931
- * (file:File) => Promise<File[]>
932
- */
933
- unzip: PropTypes.func
934
- };
935
- Console.defaultProps = {
931
+ _defineProperty(Console, "defaultProps", {
936
932
  statusBarChildren: null,
937
933
  settings: {},
938
- onSettingsChange: () => {},
934
+ onSettingsChange: () => undefined,
939
935
  scope: null,
940
936
  actions: [],
941
937
  historyChildren: null,
@@ -943,6 +939,9 @@ Console.defaultProps = {
943
939
  objectMap: new Map(),
944
940
  disabled: false,
945
941
  unzip: null
946
- };
942
+ });
943
+
944
+ _defineProperty(Console, "LOG_THROTTLE", 500);
945
+
947
946
  export default Console;
948
947
  //# sourceMappingURL=Console.js.map