@deephaven/console 0.5.2-matplotlib.2 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Console.d.ts +3 -0
- package/dist/Console.d.ts.map +1 -1
- package/dist/Console.js +807 -871
- package/dist/Console.js.map +1 -1
- package/dist/ConsoleInput.d.ts +1 -38
- package/dist/ConsoleInput.d.ts.map +1 -1
- package/dist/ConsoleInput.js +331 -436
- package/dist/ConsoleInput.js.map +1 -1
- package/dist/ConsoleMenu.js +159 -215
- package/dist/ConsoleMenu.js.map +1 -1
- package/dist/ConsolePropTypes.js +1 -1
- package/dist/ConsolePropTypes.js.map +1 -1
- package/dist/ConsoleShortcuts.js +2 -2
- package/dist/ConsoleShortcuts.js.map +1 -1
- package/dist/ConsoleStatusBar.js +85 -125
- package/dist/ConsoleStatusBar.js.map +1 -1
- package/dist/StoragePropTypes.js +2 -2
- package/dist/StoragePropTypes.js.map +1 -1
- package/dist/command-history/CommandHistory.css +5 -2
- package/dist/command-history/CommandHistory.css.map +1 -1
- package/dist/command-history/CommandHistory.d.ts +5 -0
- package/dist/command-history/CommandHistory.d.ts.map +1 -1
- package/dist/command-history/CommandHistory.js +303 -391
- package/dist/command-history/CommandHistory.js.map +1 -1
- package/dist/command-history/CommandHistoryActions.css +4 -0
- package/dist/command-history/CommandHistoryActions.css.map +1 -1
- package/dist/command-history/CommandHistoryActions.d.ts.map +1 -1
- package/dist/command-history/CommandHistoryActions.js +40 -79
- package/dist/command-history/CommandHistoryActions.js.map +1 -1
- package/dist/command-history/CommandHistoryItem.css +1 -1
- package/dist/command-history/CommandHistoryItem.d.ts +5 -0
- package/dist/command-history/CommandHistoryItem.d.ts.map +1 -1
- package/dist/command-history/CommandHistoryItem.js +15 -9
- package/dist/command-history/CommandHistoryItem.js.map +1 -1
- package/dist/command-history/CommandHistoryItemTooltip.d.ts +1 -40
- package/dist/command-history/CommandHistoryItemTooltip.d.ts.map +1 -1
- package/dist/command-history/CommandHistoryItemTooltip.js +139 -189
- package/dist/command-history/CommandHistoryItemTooltip.js.map +1 -1
- package/dist/command-history/CommandHistoryViewportUpdater.js +30 -35
- package/dist/command-history/CommandHistoryViewportUpdater.js.map +1 -1
- package/dist/command-history/index.js +5 -5
- package/dist/command-history/index.js.map +1 -1
- package/dist/common/Code.js +34 -70
- package/dist/common/Code.js.map +1 -1
- package/dist/common/ConsoleConstants.js +3 -24
- package/dist/common/ConsoleConstants.js.map +1 -1
- package/dist/common/ConsoleUtils.d.ts +1 -3
- package/dist/common/ConsoleUtils.d.ts.map +1 -1
- package/dist/common/ConsoleUtils.js +60 -94
- package/dist/common/ConsoleUtils.js.map +1 -1
- package/dist/common/ObjectIcon.js +4 -2
- package/dist/common/ObjectIcon.js.map +1 -1
- package/dist/common/index.d.js +1 -34
- package/dist/common/index.d.js.map +1 -1
- package/dist/common/index.js +4 -4
- package/dist/common/index.js.map +1 -1
- package/dist/console-history/ConsoleHistory.js +27 -63
- package/dist/console-history/ConsoleHistory.js.map +1 -1
- package/dist/console-history/ConsoleHistoryItem.js +116 -154
- package/dist/console-history/ConsoleHistoryItem.js.map +1 -1
- package/dist/console-history/ConsoleHistoryItemResult.js +4 -2
- package/dist/console-history/ConsoleHistoryItemResult.js.map +1 -1
- package/dist/console-history/ConsoleHistoryResultErrorMessage.js +94 -132
- package/dist/console-history/ConsoleHistoryResultErrorMessage.js.map +1 -1
- package/dist/console-history/ConsoleHistoryResultInProgress.js +42 -76
- package/dist/console-history/ConsoleHistoryResultInProgress.js.map +1 -1
- package/dist/console-history/index.js +5 -5
- package/dist/console-history/index.js.map +1 -1
- package/dist/csv/CsvFormats.js +14 -28
- package/dist/csv/CsvFormats.js.map +1 -1
- package/dist/csv/CsvInputBar.css +25 -23
- package/dist/csv/CsvInputBar.css.map +1 -1
- package/dist/csv/CsvInputBar.d.ts +2 -45
- package/dist/csv/CsvInputBar.d.ts.map +1 -1
- package/dist/csv/CsvInputBar.js +298 -372
- package/dist/csv/CsvInputBar.js.map +1 -1
- package/dist/csv/CsvOverlay.js +197 -243
- package/dist/csv/CsvOverlay.js.map +1 -1
- package/dist/csv/CsvParser.js +186 -209
- package/dist/csv/CsvParser.js.map +1 -1
- package/dist/csv/CsvTypeParser.js +185 -210
- package/dist/csv/CsvTypeParser.js.map +1 -1
- package/dist/csv/NewTableColumnTypes.js +1 -5
- package/dist/csv/NewTableColumnTypes.js.map +1 -1
- package/dist/index.js +14 -14
- package/dist/index.js.map +1 -1
- package/dist/log/LogLevelMenuItem.js +24 -58
- package/dist/log/LogLevelMenuItem.js.map +1 -1
- package/dist/log/LogView.js +429 -484
- package/dist/log/LogView.js.map +1 -1
- package/dist/monaco/MonacoCompletionProvider.js +92 -124
- package/dist/monaco/MonacoCompletionProvider.js.map +1 -1
- package/dist/monaco/MonacoUtils.js +315 -331
- package/dist/monaco/MonacoUtils.js.map +1 -1
- package/dist/monaco/index.js +2 -2
- package/dist/monaco/index.js.map +1 -1
- package/dist/monaco/lang/db.js +3 -3
- package/dist/monaco/lang/db.js.map +1 -1
- package/dist/monaco/lang/groovy.js +3 -3
- package/dist/monaco/lang/groovy.js.map +1 -1
- package/dist/monaco/lang/log.js +3 -3
- package/dist/monaco/lang/log.js.map +1 -1
- package/dist/monaco/lang/python.js +3 -3
- package/dist/monaco/lang/python.js.map +1 -1
- package/dist/monaco/lang/scala.js +5 -5
- package/dist/monaco/lang/scala.js.map +1 -1
- package/dist/notebook/Editor.js +101 -141
- package/dist/notebook/Editor.js.map +1 -1
- package/dist/notebook/ScriptEditor.js +261 -301
- package/dist/notebook/ScriptEditor.js.map +1 -1
- package/dist/notebook/ScriptEditorUtils.js +26 -42
- package/dist/notebook/ScriptEditorUtils.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +17 -22
|
@@ -1,37 +1,3 @@
|
|
|
1
|
-
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
2
|
-
|
|
3
|
-
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
4
|
-
|
|
5
|
-
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
6
|
-
|
|
7
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
8
|
-
|
|
9
|
-
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); }
|
|
10
|
-
|
|
11
|
-
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
12
|
-
|
|
13
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
14
|
-
|
|
15
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
16
|
-
|
|
17
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
18
|
-
|
|
19
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
20
|
-
|
|
21
|
-
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
22
|
-
|
|
23
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
24
|
-
|
|
25
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
26
|
-
|
|
27
|
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
28
|
-
|
|
29
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
30
|
-
|
|
31
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
32
|
-
|
|
33
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
34
|
-
|
|
35
1
|
/**
|
|
36
2
|
* Console display for use in the Iris environment.
|
|
37
3
|
*/
|
|
@@ -40,148 +6,144 @@ import PropTypes from 'prop-types';
|
|
|
40
6
|
import { ButtonOld } from '@deephaven/components';
|
|
41
7
|
import { PropTypes as APIPropTypes } from '@deephaven/jsapi-shim';
|
|
42
8
|
import Log from '@deephaven/log';
|
|
43
|
-
import { Code, ObjectIcon } from
|
|
44
|
-
import ConsoleHistoryItemResult from
|
|
45
|
-
import ConsoleHistoryResultInProgress from
|
|
46
|
-
import ConsoleHistoryResultErrorMessage from
|
|
47
|
-
import ConsoleUtils from
|
|
9
|
+
import { Code, ObjectIcon } from "../common/index.js";
|
|
10
|
+
import ConsoleHistoryItemResult from "./ConsoleHistoryItemResult.js";
|
|
11
|
+
import ConsoleHistoryResultInProgress from "./ConsoleHistoryResultInProgress.js";
|
|
12
|
+
import ConsoleHistoryResultErrorMessage from "./ConsoleHistoryResultErrorMessage.js";
|
|
13
|
+
import ConsoleUtils from "../common/ConsoleUtils.js";
|
|
48
14
|
import "./ConsoleHistoryItem.css";
|
|
49
15
|
var log = Log.module('ConsoleHistoryItem');
|
|
50
16
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
17
|
+
class ConsoleHistoryItem extends PureComponent {
|
|
18
|
+
constructor(props) {
|
|
19
|
+
super(props);
|
|
20
|
+
this.handleCancelClick = this.handleCancelClick.bind(this);
|
|
21
|
+
this.handleObjectClick = this.handleObjectClick.bind(this);
|
|
22
|
+
}
|
|
55
23
|
|
|
56
|
-
|
|
57
|
-
|
|
24
|
+
handleObjectClick(object) {
|
|
25
|
+
log.debug('handleObjectClick', object);
|
|
26
|
+
var {
|
|
27
|
+
openObject
|
|
28
|
+
} = this.props;
|
|
29
|
+
openObject(object);
|
|
30
|
+
}
|
|
58
31
|
|
|
59
|
-
|
|
32
|
+
handleCancelClick() {
|
|
33
|
+
var {
|
|
34
|
+
item
|
|
35
|
+
} = this.props;
|
|
60
36
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
37
|
+
if (item && item.cancelResult) {
|
|
38
|
+
log.debug("Cancelling command: ".concat(item.command));
|
|
39
|
+
item.cancelResult();
|
|
40
|
+
}
|
|
65
41
|
}
|
|
66
42
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
43
|
+
render() {
|
|
44
|
+
var {
|
|
45
|
+
item,
|
|
46
|
+
language
|
|
47
|
+
} = this.props;
|
|
48
|
+
var {
|
|
49
|
+
disabledObjects,
|
|
50
|
+
result
|
|
51
|
+
} = item;
|
|
52
|
+
var commandElement = null;
|
|
53
|
+
|
|
54
|
+
if (item.command) {
|
|
55
|
+
commandElement = /*#__PURE__*/React.createElement("div", {
|
|
56
|
+
className: "console-history-item-command"
|
|
57
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
58
|
+
className: "console-history-gutter"
|
|
59
|
+
}, ">"), /*#__PURE__*/React.createElement("div", {
|
|
60
|
+
className: "console-history-content"
|
|
61
|
+
}, /*#__PURE__*/React.createElement(Code, {
|
|
62
|
+
language: language
|
|
63
|
+
}, item.command)));
|
|
73
64
|
}
|
|
74
|
-
}, {
|
|
75
|
-
key: "handleCancelClick",
|
|
76
|
-
value: function handleCancelClick() {
|
|
77
|
-
var item = this.props.item;
|
|
78
|
-
|
|
79
|
-
if (item && item.cancelResult) {
|
|
80
|
-
log.debug("Cancelling command: ".concat(item.command));
|
|
81
|
-
item.cancelResult();
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
}, {
|
|
85
|
-
key: "render",
|
|
86
|
-
value: function render() {
|
|
87
|
-
var _this2 = this;
|
|
88
|
-
|
|
89
|
-
var _this$props = this.props,
|
|
90
|
-
item = _this$props.item,
|
|
91
|
-
language = _this$props.language;
|
|
92
|
-
var disabledObjects = item.disabledObjects,
|
|
93
|
-
result = item.result;
|
|
94
|
-
var commandElement = null;
|
|
95
|
-
|
|
96
|
-
if (item.command) {
|
|
97
|
-
commandElement = /*#__PURE__*/React.createElement("div", {
|
|
98
|
-
className: "console-history-item-command"
|
|
99
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
100
|
-
className: "console-history-gutter"
|
|
101
|
-
}, ">"), /*#__PURE__*/React.createElement("div", {
|
|
102
|
-
className: "console-history-content"
|
|
103
|
-
}, /*#__PURE__*/React.createElement(Code, {
|
|
104
|
-
language: language
|
|
105
|
-
}, item.command)));
|
|
106
|
-
}
|
|
107
65
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
var errorMessage = error.message;
|
|
142
|
-
|
|
143
|
-
if (!errorMessage) {
|
|
144
|
-
errorMessage = error;
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
var element = /*#__PURE__*/React.createElement(ConsoleHistoryResultErrorMessage, {
|
|
148
|
-
key: "result-error",
|
|
149
|
-
message: errorMessage
|
|
150
|
-
});
|
|
66
|
+
var resultElements = [];
|
|
67
|
+
|
|
68
|
+
if (result) {
|
|
69
|
+
var {
|
|
70
|
+
error,
|
|
71
|
+
message,
|
|
72
|
+
changes
|
|
73
|
+
} = result;
|
|
74
|
+
|
|
75
|
+
if (changes) {
|
|
76
|
+
var {
|
|
77
|
+
created,
|
|
78
|
+
updated
|
|
79
|
+
} = changes;
|
|
80
|
+
[...created, ...updated].filter((_ref) => {
|
|
81
|
+
var {
|
|
82
|
+
type
|
|
83
|
+
} = _ref;
|
|
84
|
+
return ConsoleUtils.isOpenableType(type);
|
|
85
|
+
}).forEach(object => {
|
|
86
|
+
var {
|
|
87
|
+
name
|
|
88
|
+
} = object;
|
|
89
|
+
var key = "".concat(name);
|
|
90
|
+
var disabled = (disabledObjects !== null && disabledObjects !== void 0 ? disabledObjects : []).indexOf(name) >= 0;
|
|
91
|
+
var element = /*#__PURE__*/React.createElement(ButtonOld, {
|
|
92
|
+
key: key,
|
|
93
|
+
onClick: () => this.handleObjectClick(object),
|
|
94
|
+
className: "btn-primary btn-console",
|
|
95
|
+
disabled: disabled
|
|
96
|
+
}, /*#__PURE__*/React.createElement(ObjectIcon, {
|
|
97
|
+
type: object.type
|
|
98
|
+
}), " ", name);
|
|
151
99
|
resultElements.push(element);
|
|
152
|
-
}
|
|
100
|
+
});
|
|
101
|
+
} // If the error has an associated command, we'll actually get a separate ERROR item printed out, so only print an error if there isn't an associated command
|
|
153
102
|
|
|
154
|
-
if (message) {
|
|
155
|
-
var _element = /*#__PURE__*/React.createElement("div", {
|
|
156
|
-
key: "log-message",
|
|
157
|
-
className: "log-message"
|
|
158
|
-
}, message);
|
|
159
103
|
|
|
160
|
-
|
|
104
|
+
if (error && !item.command) {
|
|
105
|
+
var errorMessage = error.message;
|
|
106
|
+
|
|
107
|
+
if (!errorMessage) {
|
|
108
|
+
errorMessage = error;
|
|
161
109
|
}
|
|
162
|
-
} else {
|
|
163
|
-
var _element2 = /*#__PURE__*/React.createElement(ConsoleHistoryResultInProgress, {
|
|
164
|
-
key: "in_progress",
|
|
165
|
-
onCancelClick: this.handleCancelClick
|
|
166
|
-
});
|
|
167
110
|
|
|
168
|
-
|
|
111
|
+
var element = /*#__PURE__*/React.createElement(ConsoleHistoryResultErrorMessage, {
|
|
112
|
+
key: "result-error",
|
|
113
|
+
message: errorMessage
|
|
114
|
+
});
|
|
115
|
+
resultElements.push(element);
|
|
169
116
|
}
|
|
170
117
|
|
|
171
|
-
|
|
118
|
+
if (message) {
|
|
119
|
+
var _element = /*#__PURE__*/React.createElement("div", {
|
|
120
|
+
key: "log-message",
|
|
121
|
+
className: "log-message"
|
|
122
|
+
}, message);
|
|
172
123
|
|
|
173
|
-
|
|
174
|
-
resultElement = /*#__PURE__*/React.createElement(ConsoleHistoryItemResult, null, resultElements);
|
|
124
|
+
resultElements.push(_element);
|
|
175
125
|
}
|
|
126
|
+
} else {
|
|
127
|
+
var _element2 = /*#__PURE__*/React.createElement(ConsoleHistoryResultInProgress, {
|
|
128
|
+
key: "in_progress",
|
|
129
|
+
onCancelClick: this.handleCancelClick
|
|
130
|
+
});
|
|
131
|
+
|
|
132
|
+
resultElements.push(_element2);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
var resultElement = null;
|
|
176
136
|
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
}, commandElement, resultElement);
|
|
137
|
+
if (resultElements.length > 0) {
|
|
138
|
+
resultElement = /*#__PURE__*/React.createElement(ConsoleHistoryItemResult, null, resultElements);
|
|
180
139
|
}
|
|
181
|
-
}]);
|
|
182
140
|
|
|
183
|
-
|
|
184
|
-
|
|
141
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
142
|
+
className: "container-fluid"
|
|
143
|
+
}, commandElement, resultElement);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
}
|
|
185
147
|
|
|
186
148
|
ConsoleHistoryItem.propTypes = {
|
|
187
149
|
item: PropTypes.shape({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/console-history/ConsoleHistoryItem.jsx"],"names":["React","PureComponent","PropTypes","ButtonOld","APIPropTypes","Log","Code","ObjectIcon","ConsoleHistoryItemResult","ConsoleHistoryResultInProgress","ConsoleHistoryResultErrorMessage","ConsoleUtils","log","module","ConsoleHistoryItem","props","handleCancelClick","bind","handleObjectClick","object","debug","openObject","item","cancelResult","command","language","disabledObjects","result","commandElement","resultElements","error","message","changes","created","updated","filter","type","isOpenableType","forEach","name","key","disabled","indexOf","element","push","errorMessage","resultElement","length","propTypes","shape","func","string","arrayOf","oneOfType","VariableChanges","startTime","number","endTime","isRequired"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/console-history/ConsoleHistoryItem.jsx"],"names":["React","PureComponent","PropTypes","ButtonOld","APIPropTypes","Log","Code","ObjectIcon","ConsoleHistoryItemResult","ConsoleHistoryResultInProgress","ConsoleHistoryResultErrorMessage","ConsoleUtils","log","module","ConsoleHistoryItem","constructor","props","handleCancelClick","bind","handleObjectClick","object","debug","openObject","item","cancelResult","command","render","language","disabledObjects","result","commandElement","resultElements","error","message","changes","created","updated","filter","type","isOpenableType","forEach","name","key","disabled","indexOf","element","push","errorMessage","resultElement","length","propTypes","shape","func","string","arrayOf","oneOfType","VariableChanges","startTime","number","endTime","isRequired"],"mappings":"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","sourcesContent":["/**\n * Console display for use in the Iris environment.\n */\nimport React, { PureComponent } from 'react';\nimport PropTypes from 'prop-types';\nimport { ButtonOld } from '@deephaven/components';\nimport { PropTypes as APIPropTypes } from '@deephaven/jsapi-shim';\nimport Log from '@deephaven/log';\nimport { Code, ObjectIcon } from '../common';\nimport ConsoleHistoryItemResult from './ConsoleHistoryItemResult';\nimport ConsoleHistoryResultInProgress from './ConsoleHistoryResultInProgress';\nimport ConsoleHistoryResultErrorMessage from './ConsoleHistoryResultErrorMessage';\nimport ConsoleUtils from '../common/ConsoleUtils';\nimport './ConsoleHistoryItem.scss';\n\nconst log = Log.module('ConsoleHistoryItem');\n\nclass ConsoleHistoryItem extends PureComponent {\n constructor(props) {\n super(props);\n\n this.handleCancelClick = this.handleCancelClick.bind(this);\n this.handleObjectClick = this.handleObjectClick.bind(this);\n }\n\n handleObjectClick(object) {\n log.debug('handleObjectClick', object);\n\n const { openObject } = this.props;\n openObject(object);\n }\n\n handleCancelClick() {\n const { item } = this.props;\n if (item && item.cancelResult) {\n log.debug(`Cancelling command: ${item.command}`);\n item.cancelResult();\n }\n }\n\n render() {\n const { item, language } = this.props;\n const { disabledObjects, result } = item;\n\n let commandElement = null;\n if (item.command) {\n commandElement = (\n <div className=\"console-history-item-command\">\n <div className=\"console-history-gutter\">></div>\n <div className=\"console-history-content\">\n <Code language={language}>{item.command}</Code>\n </div>\n </div>\n );\n }\n\n const resultElements = [];\n\n if (result) {\n const { error, message, changes } = result;\n\n if (changes) {\n const { created, updated } = changes;\n [...created, ...updated]\n .filter(({ type }) => ConsoleUtils.isOpenableType(type))\n .forEach(object => {\n const { name } = object;\n const key = `${name}`;\n const disabled = (disabledObjects ?? []).indexOf(name) >= 0;\n const element = (\n <ButtonOld\n key={key}\n onClick={() => this.handleObjectClick(object)}\n className=\"btn-primary btn-console\"\n disabled={disabled}\n >\n <ObjectIcon type={object.type} /> {name}\n </ButtonOld>\n );\n resultElements.push(element);\n });\n }\n\n // If the error has an associated command, we'll actually get a separate ERROR item printed out, so only print an error if there isn't an associated command\n if (error && !item.command) {\n let errorMessage = error.message;\n if (!errorMessage) {\n errorMessage = error;\n }\n const element = (\n <ConsoleHistoryResultErrorMessage\n key=\"result-error\"\n message={errorMessage}\n />\n );\n resultElements.push(element);\n }\n\n if (message) {\n const element = (\n <div key=\"log-message\" className=\"log-message\">\n {message}\n </div>\n );\n resultElements.push(element);\n }\n } else {\n const element = (\n <ConsoleHistoryResultInProgress\n key=\"in_progress\"\n onCancelClick={this.handleCancelClick}\n />\n );\n resultElements.push(element);\n }\n\n let resultElement = null;\n if (resultElements.length > 0) {\n resultElement = (\n <ConsoleHistoryItemResult>{resultElements}</ConsoleHistoryItemResult>\n );\n }\n\n return (\n <div className=\"container-fluid\">\n {commandElement}\n {resultElement}\n </div>\n );\n }\n}\n\nConsoleHistoryItem.propTypes = {\n item: PropTypes.shape({\n cancelResult: PropTypes.func,\n command: PropTypes.string,\n disabledObjects: PropTypes.arrayOf(PropTypes.string),\n result: PropTypes.shape({\n error: PropTypes.oneOfType([\n PropTypes.string,\n PropTypes.shape({ message: PropTypes.string }),\n ]),\n message: PropTypes.string,\n changes: APIPropTypes.VariableChanges,\n }),\n startTime: PropTypes.number,\n endTime: PropTypes.number,\n }).isRequired,\n language: PropTypes.string.isRequired,\n openObject: PropTypes.func.isRequired,\n};\n\nexport default ConsoleHistoryItem;\n"],"file":"ConsoleHistoryItem.js"}
|
|
@@ -4,8 +4,10 @@
|
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
|
|
7
|
-
var ConsoleHistoryItemResult =
|
|
8
|
-
var
|
|
7
|
+
var ConsoleHistoryItemResult = (_ref) => {
|
|
8
|
+
var {
|
|
9
|
+
children
|
|
10
|
+
} = _ref;
|
|
9
11
|
return /*#__PURE__*/React.createElement("div", {
|
|
10
12
|
className: "console-history-item-result"
|
|
11
13
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/console-history/ConsoleHistoryItemResult.jsx"],"names":["React","PropTypes","ConsoleHistoryItemResult","children","propTypes","node","isRequired"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;;AAEA,IAAMC,wBAAwB,GAAG
|
|
1
|
+
{"version":3,"sources":["../../src/console-history/ConsoleHistoryItemResult.jsx"],"names":["React","PropTypes","ConsoleHistoryItemResult","children","propTypes","node","isRequired"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;;AAEA,IAAMC,wBAAwB,GAAG;AAAA,MAAC;AAAEC,IAAAA;AAAF,GAAD;AAAA,sBAC/B;AAAK,IAAA,SAAS,EAAC;AAAf,kBACE;AAAK,IAAA,SAAS,EAAC;AAAf,SADF,eAEE;AAAK,IAAA,SAAS,EAAC;AAAf,KAA0CA,QAA1C,CAFF,CAD+B;AAAA,CAAjC;;AAOAD,wBAAwB,CAACE,SAAzB,GAAqC;AACnCD,EAAAA,QAAQ,EAAEF,SAAS,CAACI,IAAV,CAAeC;AADU,CAArC;AAIA,eAAeJ,wBAAf","sourcesContent":["/**\n * Console display for use in the Iris environment.\n */\nimport React from 'react';\nimport PropTypes from 'prop-types';\n\nconst ConsoleHistoryItemResult = ({ children }) => (\n <div className=\"console-history-item-result\">\n <div className=\"console-history-gutter\">-</div>\n <div className=\"console-history-content\">{children}</div>\n </div>\n);\n\nConsoleHistoryItemResult.propTypes = {\n children: PropTypes.node.isRequired,\n};\n\nexport default ConsoleHistoryItemResult;\n"],"file":"ConsoleHistoryItemResult.js"}
|
|
@@ -1,25 +1,3 @@
|
|
|
1
|
-
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
2
|
-
|
|
3
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
4
|
-
|
|
5
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
6
|
-
|
|
7
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
8
|
-
|
|
9
|
-
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
10
|
-
|
|
11
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
12
|
-
|
|
13
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
14
|
-
|
|
15
|
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
16
|
-
|
|
17
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
18
|
-
|
|
19
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
20
|
-
|
|
21
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
22
|
-
|
|
23
1
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
24
2
|
|
|
25
3
|
/**
|
|
@@ -31,131 +9,115 @@ import PropTypes from 'prop-types';
|
|
|
31
9
|
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
32
10
|
import { vsTriangleRight, vsTriangleDown } from '@deephaven/icons';
|
|
33
11
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
_this.handleMouseDown = _this.handleMouseDown.bind(_assertThisInitialized(_this));
|
|
47
|
-
_this.handleMouseMove = _this.handleMouseMove.bind(_assertThisInitialized(_this));
|
|
48
|
-
_this.handleMouseUp = _this.handleMouseUp.bind(_assertThisInitialized(_this));
|
|
49
|
-
_this.handleToggleError = _this.handleToggleError.bind(_assertThisInitialized(_this));
|
|
50
|
-
_this.mouseX = null;
|
|
51
|
-
_this.mouseY = null;
|
|
52
|
-
_this.isClicking = false;
|
|
53
|
-
_this.state = {
|
|
12
|
+
class ConsoleHistoryResultErrorMessage extends PureComponent {
|
|
13
|
+
constructor(props) {
|
|
14
|
+
super(props);
|
|
15
|
+
this.handleKeyPress = this.handleKeyPress.bind(this);
|
|
16
|
+
this.handleMouseDown = this.handleMouseDown.bind(this);
|
|
17
|
+
this.handleMouseMove = this.handleMouseMove.bind(this);
|
|
18
|
+
this.handleMouseUp = this.handleMouseUp.bind(this);
|
|
19
|
+
this.handleToggleError = this.handleToggleError.bind(this);
|
|
20
|
+
this.mouseX = null;
|
|
21
|
+
this.mouseY = null;
|
|
22
|
+
this.isClicking = false;
|
|
23
|
+
this.state = {
|
|
54
24
|
isExpanded: false
|
|
55
25
|
};
|
|
56
|
-
return _this;
|
|
57
26
|
}
|
|
58
27
|
|
|
59
|
-
|
|
60
|
-
key
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
event.preventDefault();
|
|
69
|
-
break;
|
|
28
|
+
handleKeyPress(event) {
|
|
29
|
+
switch (event.key) {
|
|
30
|
+
case 'Enter':
|
|
31
|
+
case ' ':
|
|
32
|
+
// Toggle the error open/closed
|
|
33
|
+
this.handleToggleError();
|
|
34
|
+
event.stopPropagation();
|
|
35
|
+
event.preventDefault();
|
|
36
|
+
break;
|
|
70
37
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
}
|
|
38
|
+
default:
|
|
39
|
+
break;
|
|
74
40
|
}
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
if (this.mouseX
|
|
86
|
-
if (Math.abs(event.clientX - this.mouseX) >= ConsoleHistoryResultErrorMessage.mouseDragThreshold || Math.abs(event.clientY - this.mouseY) >= ConsoleHistoryResultErrorMessage.mouseDragThreshold) {
|
|
87
|
-
this.isClicking = false;
|
|
88
|
-
}
|
|
89
|
-
} else if (this.isClicking) {
|
|
90
|
-
// Rare case - could happen if you mouse down, switch window focus, release the mouse, then come back, mouse down outside of the error, drag into the error, then release the mouse
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
handleMouseDown(event) {
|
|
44
|
+
this.mouseX = event.clientX;
|
|
45
|
+
this.mouseY = event.clientY;
|
|
46
|
+
this.isClicking = true;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
handleMouseMove(event) {
|
|
50
|
+
if (this.mouseX != null && this.mouseY != null) {
|
|
51
|
+
if (Math.abs(event.clientX - this.mouseX) >= ConsoleHistoryResultErrorMessage.mouseDragThreshold || Math.abs(event.clientY - this.mouseY) >= ConsoleHistoryResultErrorMessage.mouseDragThreshold) {
|
|
91
52
|
this.isClicking = false;
|
|
92
53
|
}
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
key: "handleMouseUp",
|
|
96
|
-
value: function handleMouseUp(event) {
|
|
97
|
-
// We don't want to expand/collapse the error if user is holding shift or an alt key
|
|
98
|
-
// They may be trying to adjust their selection
|
|
99
|
-
if (this.isClicking && !event.shiftKey && !event.metaKey && !event.altKey) {
|
|
100
|
-
this.handleToggleError();
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
this.mouseX = null;
|
|
104
|
-
this.mouseY = null;
|
|
54
|
+
} else if (this.isClicking) {
|
|
55
|
+
// Rare case - could happen if you mouse down, switch window focus, release the mouse, then come back, mouse down outside of the error, drag into the error, then release the mouse
|
|
105
56
|
this.isClicking = false;
|
|
106
57
|
}
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
});
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
handleMouseUp(event) {
|
|
61
|
+
// We don't want to expand/collapse the error if user is holding shift or an alt key
|
|
62
|
+
// They may be trying to adjust their selection
|
|
63
|
+
if (this.isClicking && !event.shiftKey && !event.metaKey && !event.altKey) {
|
|
64
|
+
this.handleToggleError();
|
|
115
65
|
}
|
|
116
|
-
}, {
|
|
117
|
-
key: "render",
|
|
118
|
-
value: function render() {
|
|
119
|
-
var isExpanded = this.state.isExpanded;
|
|
120
|
-
var messageProp = this.props.message;
|
|
121
|
-
var lineBreakIndex = messageProp.indexOf('\n');
|
|
122
|
-
var isMultiline = lineBreakIndex > -1;
|
|
123
|
-
var message = '';
|
|
124
66
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
}
|
|
67
|
+
this.mouseX = null;
|
|
68
|
+
this.mouseY = null;
|
|
69
|
+
this.isClicking = false;
|
|
70
|
+
}
|
|
130
71
|
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
onMouseUp: this.handleMouseUp
|
|
153
|
-
}, message));
|
|
72
|
+
handleToggleError() {
|
|
73
|
+
this.setState(state => ({
|
|
74
|
+
isExpanded: !state.isExpanded
|
|
75
|
+
}));
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
render() {
|
|
79
|
+
var {
|
|
80
|
+
isExpanded
|
|
81
|
+
} = this.state;
|
|
82
|
+
var {
|
|
83
|
+
message: messageProp
|
|
84
|
+
} = this.props;
|
|
85
|
+
var lineBreakIndex = messageProp.indexOf('\n');
|
|
86
|
+
var isMultiline = lineBreakIndex > -1;
|
|
87
|
+
var message = '';
|
|
88
|
+
|
|
89
|
+
if (isMultiline && !isExpanded) {
|
|
90
|
+
message = messageProp.slice(0, lineBreakIndex);
|
|
91
|
+
} else {
|
|
92
|
+
message = messageProp;
|
|
154
93
|
}
|
|
155
|
-
}]);
|
|
156
94
|
|
|
157
|
-
|
|
158
|
-
|
|
95
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
96
|
+
key: "error",
|
|
97
|
+
className: classNames('error-message', {
|
|
98
|
+
expanded: isExpanded
|
|
99
|
+
})
|
|
100
|
+
}, isMultiline && /*#__PURE__*/React.createElement("div", {
|
|
101
|
+
className: "error-gutter"
|
|
102
|
+
}, /*#__PURE__*/React.createElement("button", {
|
|
103
|
+
type: "button",
|
|
104
|
+
onClick: this.handleToggleError,
|
|
105
|
+
className: "error-btn-link"
|
|
106
|
+
}, /*#__PURE__*/React.createElement(FontAwesomeIcon, {
|
|
107
|
+
icon: isExpanded ? vsTriangleDown : vsTriangleRight,
|
|
108
|
+
transform: "left-3"
|
|
109
|
+
}))), /*#__PURE__*/React.createElement("div", {
|
|
110
|
+
role: "button",
|
|
111
|
+
tabIndex: "0",
|
|
112
|
+
className: "error-content",
|
|
113
|
+
onKeyPress: this.handleKeyPress,
|
|
114
|
+
onMouseDown: this.handleMouseDown,
|
|
115
|
+
onMouseMove: this.handleMouseMove,
|
|
116
|
+
onMouseUp: this.handleMouseUp
|
|
117
|
+
}, message));
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
}
|
|
159
121
|
|
|
160
122
|
_defineProperty(ConsoleHistoryResultErrorMessage, "mouseDragThreshold", 5);
|
|
161
123
|
|