@difizen/libro-jupyter 0.1.1 → 0.1.3
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/es/add-between-cell/add-between-cell.d.ts.map +1 -1
- package/es/add-between-cell/add-between-cell.js +7 -7
- package/es/add-between-cell/index.less +6 -0
- package/es/cell/jupyter-code-cell-model.d.ts +2 -2
- package/es/cell/jupyter-code-cell-model.d.ts.map +1 -1
- package/es/cell/jupyter-code-cell-model.js +7 -3
- package/es/cell/jupyter-code-cell-view.d.ts +9 -4
- package/es/cell/jupyter-code-cell-view.d.ts.map +1 -1
- package/es/cell/jupyter-code-cell-view.js +137 -100
- package/es/command/command-contribution.d.ts.map +1 -1
- package/es/command/command-contribution.js +9 -9
- package/es/components/cell-execution-tip.d.ts.map +1 -1
- package/es/components/cell-execution-tip.js +14 -1
- package/es/components/cell-input-bottom-blank.d.ts.map +1 -1
- package/es/components/cell-input-bottom-blank.js +4 -4
- package/es/config/config-contribution.d.ts +2 -2
- package/es/config/config-contribution.d.ts.map +1 -1
- package/es/config/config-contribution.js +7 -7
- package/es/config/config.d.ts +6 -1
- package/es/config/config.d.ts.map +1 -1
- package/es/config/config.js +15 -1
- package/es/config/index.d.ts +1 -0
- package/es/config/index.d.ts.map +1 -1
- package/es/config/index.js +2 -1
- package/es/file/file-command.d.ts.map +1 -1
- package/es/file/file-command.js +6 -2
- package/es/file/navigatable-view.d.ts +7 -2
- package/es/file/navigatable-view.d.ts.map +1 -1
- package/es/file/navigatable-view.js +41 -6
- package/es/file/open-handler-contribution.js +1 -1
- package/es/index.d.ts +17 -15
- package/es/index.d.ts.map +1 -1
- package/es/index.js +17 -15
- package/es/keybind-instructions/index.less +2 -2
- package/es/keybind-instructions/keybind-instructions-contribution.js +2 -2
- package/es/libro-jupyter-model.d.ts +8 -4
- package/es/libro-jupyter-model.d.ts.map +1 -1
- package/es/libro-jupyter-model.js +24 -17
- package/es/libro-jupyter-protocol.d.ts +4 -0
- package/es/libro-jupyter-protocol.d.ts.map +1 -1
- package/es/libro-jupyter-protocol.js +2 -1
- package/es/libro-jupyter-server-launch-manager.d.ts +3 -1
- package/es/libro-jupyter-server-launch-manager.d.ts.map +1 -1
- package/es/libro-jupyter-server-launch-manager.js +9 -2
- package/es/libro-jupyter-view.d.ts +2 -1
- package/es/libro-jupyter-view.d.ts.map +1 -1
- package/es/libro-jupyter-view.js +4 -2
- package/es/module.d.ts.map +1 -1
- package/es/module.js +12 -10
- package/es/output/libro-jupyter-outputarea.d.ts +3 -0
- package/es/output/libro-jupyter-outputarea.d.ts.map +1 -1
- package/es/output/libro-jupyter-outputarea.js +49 -4
- package/es/rendermime/index.less +12 -1
- package/es/rendermime/plotly-renderers.d.ts +15 -14
- package/es/rendermime/plotly-renderers.d.ts.map +1 -1
- package/es/rendermime/plotly-renderers.js +1 -3
- package/es/toolbar/kernel-selector-dropdown.d.ts.map +1 -1
- package/es/toolbar/kernel-selector-dropdown.js +2 -6
- package/es/typings/index.d.ts +7 -2
- package/package.json +16 -14
- package/src/add-between-cell/add-between-cell.tsx +17 -8
- package/src/add-between-cell/index.less +6 -0
- package/src/cell/jupyter-code-cell-model.ts +6 -4
- package/src/cell/jupyter-code-cell-view.tsx +81 -48
- package/src/command/command-contribution.ts +13 -9
- package/src/components/cell-execution-tip.tsx +8 -2
- package/src/components/cell-input-bottom-blank.tsx +10 -5
- package/src/config/config-contribution.ts +3 -3
- package/src/config/config.ts +17 -2
- package/src/config/index.ts +1 -0
- package/src/file/file-command.tsx +5 -2
- package/src/file/navigatable-view.tsx +39 -1
- package/src/file/open-handler-contribution.ts +1 -1
- package/src/index.spec.ts +1 -5
- package/src/index.ts +17 -16
- package/src/keybind-instructions/index.less +2 -2
- package/src/keybind-instructions/keybind-instructions-contribution.ts +2 -2
- package/src/libro-jupyter-model.ts +34 -20
- package/src/libro-jupyter-protocol.ts +5 -0
- package/src/libro-jupyter-server-launch-manager.ts +11 -2
- package/src/libro-jupyter-view.tsx +4 -1
- package/src/module.ts +23 -15
- package/src/output/libro-jupyter-outputarea.tsx +31 -3
- package/src/rendermime/index.less +12 -1
- package/src/rendermime/plotly-render.tsx +1 -1
- package/src/rendermime/plotly-renderers.ts +15 -17
- package/src/toolbar/kernel-selector-dropdown.tsx +2 -6
- package/src/typings/index.d.ts +7 -2
- package/es/configuration/index.d.ts +0 -3
- package/es/configuration/index.d.ts.map +0 -1
- package/es/configuration/index.js +0 -2
- package/es/configuration/libro-configuration-contribution.d.ts +0 -5
- package/es/configuration/libro-configuration-contribution.d.ts.map +0 -1
- package/es/configuration/libro-configuration-contribution.js +0 -24
- package/es/configuration/libro-configuration.d.ts +0 -3
- package/es/configuration/libro-configuration.d.ts.map +0 -1
- package/es/configuration/libro-configuration.js +0 -12
- package/src/configuration/index.ts +0 -2
- package/src/configuration/libro-configuration-contribution.ts +0 -11
- package/src/configuration/libro-configuration.ts +0 -14
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add-between-cell.d.ts","sourceRoot":"","sources":["../../src/add-between-cell/add-between-cell.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,
|
|
1
|
+
{"version":3,"file":"add-between-cell.d.ts","sourceRoot":"","sources":["../../src/add-between-cell/add-between-cell.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAA0B,MAAM,qBAAqB,CAAC;AAUvF,OAAO,cAAc,CAAC;AA0BtB,eAAO,MAAM,6BAA6B,EAAE,mBA+J3C,CAAC;AAEF,eAAO,MAAM,8BAA8B,EAAE,mBAW5C,CAAC"}
|
|
@@ -51,8 +51,7 @@ var AddCellOutlined = function AddCellOutlined() {
|
|
|
51
51
|
};
|
|
52
52
|
|
|
53
53
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
54
|
-
export var LibroCommonBetweenCellContent = /*#__PURE__*/forwardRef(function LibroCommonBetweenCellContent(props,
|
|
55
|
-
// eslint-disable-next-line react/prop-types
|
|
54
|
+
export var LibroCommonBetweenCellContent = /*#__PURE__*/forwardRef(function LibroCommonBetweenCellContent(props, ref) {
|
|
56
55
|
var addCell = props.addCell,
|
|
57
56
|
index = props.index;
|
|
58
57
|
var _useInject = useInject(CellService),
|
|
@@ -91,7 +90,7 @@ export var LibroCommonBetweenCellContent = /*#__PURE__*/forwardRef(function Libr
|
|
|
91
90
|
var clearDelay = function clearDelay() {
|
|
92
91
|
clearTimeout(delayRef.current);
|
|
93
92
|
};
|
|
94
|
-
var openTooltip = function openTooltip(
|
|
93
|
+
var openTooltip = function openTooltip(nextOpen) {
|
|
95
94
|
var delay = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0.5;
|
|
96
95
|
clearDelay();
|
|
97
96
|
if (delay === 0) {
|
|
@@ -160,7 +159,7 @@ export var LibroCommonBetweenCellContent = /*#__PURE__*/forwardRef(function Libr
|
|
|
160
159
|
tabIndex: 10,
|
|
161
160
|
className: "libro-add-between-cell-anchor",
|
|
162
161
|
style: {
|
|
163
|
-
position: '
|
|
162
|
+
position: 'absolute',
|
|
164
163
|
top: position.top + 5,
|
|
165
164
|
left: position.left + 5,
|
|
166
165
|
width: 1,
|
|
@@ -196,9 +195,11 @@ export var LibroCommonBetweenCellContent = /*#__PURE__*/forwardRef(function Libr
|
|
|
196
195
|
closeTooltip();
|
|
197
196
|
setGutterVisible(true);
|
|
198
197
|
setMenuVisible(true);
|
|
198
|
+
|
|
199
|
+
// TODO: 位置不准确
|
|
199
200
|
setPosition({
|
|
200
|
-
top: e.
|
|
201
|
-
left: e.
|
|
201
|
+
top: e.nativeEvent.offsetY,
|
|
202
|
+
left: e.nativeEvent.offsetX
|
|
202
203
|
});
|
|
203
204
|
(_anchorRef$current4 = anchorRef.current) === null || _anchorRef$current4 === void 0 || _anchorRef$current4.focus();
|
|
204
205
|
},
|
|
@@ -229,7 +230,6 @@ export var LibroCommonBetweenCellContent = /*#__PURE__*/forwardRef(function Libr
|
|
|
229
230
|
});
|
|
230
231
|
});
|
|
231
232
|
export var LibroWrappedBetweenCellContent = function LibroWrappedBetweenCellContent(props) {
|
|
232
|
-
// eslint-disable-next-line react/prop-types
|
|
233
233
|
var index = props.index,
|
|
234
234
|
addCell = props.addCell;
|
|
235
235
|
var instance = useInject(ViewInstance);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { LibroCodeCellModel } from '@difizen/libro-
|
|
1
|
+
import { LibroCodeCellModel } from '@difizen/libro-code-cell';
|
|
2
2
|
import type { ICellMetadata } from '@difizen/libro-common';
|
|
3
3
|
import { CellOptions } from '@difizen/libro-core';
|
|
4
4
|
import { ViewManager } from '@difizen/mana-app';
|
|
5
|
-
import type {
|
|
5
|
+
import type { CodeCellMetadata, ExecutedWithKernelCellModel } from '../libro-jupyter-protocol.js';
|
|
6
6
|
export declare class JupyterCodeCellModel extends LibroCodeCellModel implements ExecutedWithKernelCellModel {
|
|
7
7
|
metadata: Partial<CodeCellMetadata | ICellMetadata>;
|
|
8
8
|
kernelExecuting: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jupyter-code-cell-model.d.ts","sourceRoot":"","sources":["../../src/cell/jupyter-code-cell-model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"jupyter-code-cell-model.d.ts","sourceRoot":"","sources":["../../src/cell/jupyter-code-cell-model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAElD,OAAO,EAAQ,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEtD,OAAO,KAAK,EACV,gBAAgB,EAChB,2BAA2B,EAC5B,MAAM,8BAA8B,CAAC;AAEtC,qBACa,oBACX,SAAQ,kBACR,YAAW,2BAA2B;IAG7B,QAAQ,EAAE,OAAO,CAAC,gBAAgB,GAAG,aAAa,CAAC,CAAC;IAE7D,eAAe,UAAS;gBAGD,OAAO,EAAE,WAAW,EACpB,WAAW,EAAE,WAAW;IAStC,cAAc,aAIrB;CACH"}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
2
|
var _dec, _dec2, _dec3, _class, _class2, _descriptor, _descriptor2;
|
|
3
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
3
6
|
function _initializerDefineProperty(target, property, descriptor, context) { if (!descriptor) return; Object.defineProperty(target, property, { enumerable: descriptor.enumerable, configurable: descriptor.configurable, writable: descriptor.writable, value: descriptor.initializer ? descriptor.initializer.call(context) : void 0 }); }
|
|
4
7
|
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, _toPropertyKey(descriptor.key), descriptor); } }
|
|
5
8
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
@@ -15,7 +18,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
|
|
|
15
18
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
16
19
|
function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object.keys(descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object.defineProperty(target, property, desc); desc = null; } return desc; }
|
|
17
20
|
function _initializerWarningHelper(descriptor, context) { throw new Error('Decorating class property failed. Please ensure that ' + 'transform-class-properties is enabled and runs after the decorators transform.'); }
|
|
18
|
-
import { LibroCodeCellModel } from '@difizen/libro-
|
|
21
|
+
import { LibroCodeCellModel } from '@difizen/libro-code-cell';
|
|
19
22
|
import { CellOptions } from '@difizen/libro-core';
|
|
20
23
|
import { inject, transient } from '@difizen/mana-app';
|
|
21
24
|
import { prop, ViewManager } from '@difizen/mana-app';
|
|
@@ -31,11 +34,12 @@ export var JupyterCodeCellModel = (_dec = transient(), _dec2 = prop(), _dec3 = p
|
|
|
31
34
|
_initializerDefineProperty(_this, "kernelExecuting", _descriptor2, _assertThisInitialized(_this));
|
|
32
35
|
_this.clearExecution = function () {
|
|
33
36
|
_this.executeCount = null;
|
|
34
|
-
_this.executing = false;
|
|
35
37
|
_this.kernelExecuting = false;
|
|
36
38
|
_this.metadata.execution = {};
|
|
37
39
|
};
|
|
38
|
-
_this.metadata = ((_options$cell = options.cell) === null || _options$cell === void 0 ? void 0 : _options$cell.metadata)
|
|
40
|
+
_this.metadata = _objectSpread(_objectSpread({}, options === null || options === void 0 || (_options$cell = options.cell) === null || _options$cell === void 0 ? void 0 : _options$cell.metadata), {}, {
|
|
41
|
+
libroFormatter: _this.libroFormatType
|
|
42
|
+
});
|
|
39
43
|
return _this;
|
|
40
44
|
}
|
|
41
45
|
JupyterCodeCellModel = inject(ViewManager)(JupyterCodeCellModel, undefined, 1) || JupyterCodeCellModel;
|
|
@@ -1,16 +1,21 @@
|
|
|
1
1
|
/// <reference types="react" resolution-mode="require"/>
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
2
|
+
import { LibroCodeCellView } from '@difizen/libro-code-cell';
|
|
3
|
+
import { CodeEditorManager, CodeEditorSettings } from '@difizen/libro-code-editor';
|
|
4
|
+
import type { CodeEditorViewOptions, CompletionProvider, TooltipProvider } from '@difizen/libro-code-editor';
|
|
4
5
|
import type { CellViewOptions } from '@difizen/libro-core';
|
|
5
6
|
import { CellService } from '@difizen/libro-core';
|
|
7
|
+
import type { LSPProvider } from '@difizen/libro-lsp';
|
|
8
|
+
import { ILSPDocumentConnectionManager } from '@difizen/libro-lsp';
|
|
6
9
|
import { ViewManager } from '@difizen/mana-app';
|
|
7
10
|
import type { JupyterCodeCellModel } from './jupyter-code-cell-model.js';
|
|
8
11
|
export declare class JupyterCodeCellView extends LibroCodeCellView {
|
|
9
12
|
view: import("react").ForwardRefExoticComponent<import("react").RefAttributes<HTMLDivElement>>;
|
|
10
13
|
model: JupyterCodeCellModel;
|
|
11
|
-
|
|
14
|
+
protected readonly lspDocumentConnectionManager: ILSPDocumentConnectionManager;
|
|
15
|
+
constructor(options: CellViewOptions, cellService: CellService, viewManager: ViewManager, lspDocumentConnectionManager: ILSPDocumentConnectionManager, codeEditorManager: CodeEditorManager, codeEditorSettings: CodeEditorSettings);
|
|
12
16
|
clearExecution: () => void;
|
|
13
|
-
|
|
17
|
+
protected getEditorOption(): CodeEditorViewOptions;
|
|
18
|
+
lspProvider: LSPProvider;
|
|
14
19
|
tooltipProvider: TooltipProvider;
|
|
15
20
|
completionProvider: CompletionProvider;
|
|
16
21
|
run(): Promise<boolean>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jupyter-code-cell-view.d.ts","sourceRoot":"","sources":["../../src/cell/jupyter-code-cell-view.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"jupyter-code-cell-view.d.ts","sourceRoot":"","sources":["../../src/cell/jupyter-code-cell-view.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAkB,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7E,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AACnF,OAAO,KAAK,EACV,qBAAqB,EACrB,kBAAkB,EAElB,eAAe,EAEhB,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAElD,OAAO,KAAK,EAAiB,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACrE,OAAO,EAAE,6BAA6B,EAAE,MAAM,oBAAoB,CAAC;AAEnE,OAAO,EAAsB,WAAW,EAAc,MAAM,mBAAmB,CAAC;AAQhF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAkBzE,qBAEa,mBAAoB,SAAQ,iBAAiB;IAC/C,IAAI,2FAA4B;IACjC,KAAK,EAAE,oBAAoB,CAAC;IAEpC,SAAS,CAAC,QAAQ,CAAC,4BAA4B,EAAE,6BAA6B,CAAC;gBAGzD,OAAO,EAAE,eAAe,EACvB,WAAW,EAAE,WAAW,EACxB,WAAW,EAAE,WAAW,EAE7C,4BAA4B,EAAE,6BAA6B,EAChC,iBAAiB,EAAE,iBAAiB,EACnC,kBAAkB,EAAE,kBAAkB;IAM3D,cAAc,aAQrB;cAEiB,eAAe,IAAI,qBAAqB;IAY3D,WAAW,EAAE,WAAW,CAkCtB;IAEF,eAAe,EAAE,eAAe,CAqB9B;IAEF,kBAAkB,EAAE,kBAAkB,CA8BpC;IAEa,GAAG;CA8EnB"}
|
|
@@ -11,6 +11,8 @@ function _defineProperties(target, props) { for (var i = 0; i < props.length; i+
|
|
|
11
11
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
12
12
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
13
13
|
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
14
|
+
function _get() { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get.bind(); } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return _get.apply(this, arguments); }
|
|
15
|
+
function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }
|
|
14
16
|
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 } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
15
17
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
16
18
|
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); }; }
|
|
@@ -18,19 +20,19 @@ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) ===
|
|
|
18
20
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
19
21
|
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
22
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import { CellEditorMemo, LibroCodeCellView } from '@difizen/libro-codemirror-code-cell';
|
|
23
|
+
import { CellEditorMemo, LibroCodeCellView } from '@difizen/libro-code-cell';
|
|
24
|
+
import { CodeEditorManager, CodeEditorSettings } from '@difizen/libro-code-editor';
|
|
24
25
|
import { CellService } from '@difizen/libro-core';
|
|
25
26
|
import { KernelError } from '@difizen/libro-kernel';
|
|
27
|
+
import { ILSPDocumentConnectionManager } from '@difizen/libro-lsp';
|
|
26
28
|
import { inject, transient } from '@difizen/mana-app';
|
|
27
29
|
import { view, ViewInstance, ViewManager, ViewOption } from '@difizen/mana-app';
|
|
28
|
-
import { getOrigin, useInject
|
|
30
|
+
import { getOrigin, useInject } from '@difizen/mana-app';
|
|
29
31
|
import { l10n } from '@difizen/mana-l10n';
|
|
30
32
|
import { forwardRef } from 'react';
|
|
31
33
|
import { LibroJupyterModel } from "../libro-jupyter-model.js";
|
|
32
34
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
33
|
-
var JupyterCodeCellComponent = /*#__PURE__*/forwardRef(function JupyterCodeCellComponent(
|
|
35
|
+
var JupyterCodeCellComponent = /*#__PURE__*/forwardRef(function JupyterCodeCellComponent(props, ref) {
|
|
34
36
|
var instance = useInject(ViewInstance);
|
|
35
37
|
return /*#__PURE__*/_jsx("div", {
|
|
36
38
|
className: instance.className,
|
|
@@ -43,92 +45,142 @@ var JupyterCodeCellComponent = /*#__PURE__*/forwardRef(function JupyterCodeCellC
|
|
|
43
45
|
export var JupyterCodeCellView = (_dec = transient(), _dec2 = view('jupyter-code-cell-view'), _dec(_class = _dec2(_class = /*#__PURE__*/function (_LibroCodeCellView) {
|
|
44
46
|
_inherits(JupyterCodeCellView, _LibroCodeCellView);
|
|
45
47
|
var _super = _createSuper(JupyterCodeCellView);
|
|
46
|
-
function JupyterCodeCellView(options, cellService, viewManager) {
|
|
48
|
+
function JupyterCodeCellView(options, cellService, viewManager, lspDocumentConnectionManager, codeEditorManager, codeEditorSettings) {
|
|
47
49
|
var _this;
|
|
48
50
|
_classCallCheck(this, JupyterCodeCellView);
|
|
49
|
-
_this = _super.call(this, options, cellService, viewManager);
|
|
51
|
+
_this = _super.call(this, options, cellService, viewManager, codeEditorManager, codeEditorSettings);
|
|
50
52
|
_this.view = JupyterCodeCellComponent;
|
|
53
|
+
_this.lspDocumentConnectionManager = void 0;
|
|
51
54
|
_this.clearExecution = function () {
|
|
52
55
|
_this.model.clearExecution();
|
|
53
|
-
|
|
56
|
+
Promise.resolve().then(function () {
|
|
57
|
+
_this.outputArea.clear();
|
|
58
|
+
return;
|
|
59
|
+
}).catch(console.error);
|
|
54
60
|
};
|
|
61
|
+
_this.lspProvider = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
62
|
+
var adapter, virtualEditor, virtualDocument, lspConnection;
|
|
63
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
64
|
+
while (1) switch (_context.prev = _context.next) {
|
|
65
|
+
case 0:
|
|
66
|
+
_context.next = 2;
|
|
67
|
+
return _this.lspDocumentConnectionManager.ready;
|
|
68
|
+
case 2:
|
|
69
|
+
adapter = _this.lspDocumentConnectionManager.adapters.get(_this.parent.model.id);
|
|
70
|
+
if (adapter) {
|
|
71
|
+
_context.next = 5;
|
|
72
|
+
break;
|
|
73
|
+
}
|
|
74
|
+
throw new Error('no adapter');
|
|
75
|
+
case 5:
|
|
76
|
+
_context.next = 7;
|
|
77
|
+
return adapter.ready;
|
|
78
|
+
case 7:
|
|
79
|
+
virtualEditor = adapter.getCellEditor(_assertThisInitialized(_this));
|
|
80
|
+
if (virtualEditor) {
|
|
81
|
+
_context.next = 10;
|
|
82
|
+
break;
|
|
83
|
+
}
|
|
84
|
+
throw new Error('no virtual editor');
|
|
85
|
+
case 10:
|
|
86
|
+
// Get the associated virtual document of the opened document
|
|
87
|
+
virtualDocument = adapter.virtualDocument;
|
|
88
|
+
if (virtualDocument) {
|
|
89
|
+
_context.next = 13;
|
|
90
|
+
break;
|
|
91
|
+
}
|
|
92
|
+
throw new Error('no virtualDocument');
|
|
93
|
+
case 13:
|
|
94
|
+
// Get the LSP connection of the virtual document.
|
|
95
|
+
lspConnection = _this.lspDocumentConnectionManager.connections.get(virtualDocument.uri);
|
|
96
|
+
return _context.abrupt("return", {
|
|
97
|
+
virtualDocument: virtualDocument,
|
|
98
|
+
lspConnection: lspConnection,
|
|
99
|
+
editor: virtualEditor
|
|
100
|
+
});
|
|
101
|
+
case 15:
|
|
102
|
+
case "end":
|
|
103
|
+
return _context.stop();
|
|
104
|
+
}
|
|
105
|
+
}, _callee);
|
|
106
|
+
}));
|
|
55
107
|
_this.tooltipProvider = /*#__PURE__*/function () {
|
|
56
|
-
var
|
|
108
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(option) {
|
|
57
109
|
var cellContent, kernelConnection, reply, value;
|
|
58
|
-
return _regeneratorRuntime().wrap(function
|
|
59
|
-
while (1) switch (
|
|
110
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
111
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
60
112
|
case 0:
|
|
61
113
|
cellContent = _this.model.value;
|
|
62
114
|
kernelConnection = getOrigin(_this.parent.model.kernelConnection);
|
|
63
115
|
if (kernelConnection) {
|
|
64
|
-
|
|
116
|
+
_context2.next = 5;
|
|
65
117
|
break;
|
|
66
118
|
}
|
|
67
119
|
alert(l10n.t('Kernel Connection 还没有建立'));
|
|
68
|
-
return
|
|
120
|
+
return _context2.abrupt("return", null);
|
|
69
121
|
case 5:
|
|
70
|
-
|
|
122
|
+
_context2.next = 7;
|
|
71
123
|
return kernelConnection.requestInspect({
|
|
72
124
|
code: cellContent,
|
|
73
125
|
cursor_pos: option.cursorPosition,
|
|
74
126
|
detail_level: 1
|
|
75
127
|
});
|
|
76
128
|
case 7:
|
|
77
|
-
reply =
|
|
129
|
+
reply = _context2.sent;
|
|
78
130
|
value = reply.content;
|
|
79
131
|
if (!(value.status !== 'ok' || !value.found)) {
|
|
80
|
-
|
|
132
|
+
_context2.next = 11;
|
|
81
133
|
break;
|
|
82
134
|
}
|
|
83
|
-
return
|
|
135
|
+
return _context2.abrupt("return", null);
|
|
84
136
|
case 11:
|
|
85
|
-
return
|
|
137
|
+
return _context2.abrupt("return", value.data['text/plain']);
|
|
86
138
|
case 12:
|
|
87
139
|
case "end":
|
|
88
|
-
return
|
|
140
|
+
return _context2.stop();
|
|
89
141
|
}
|
|
90
|
-
},
|
|
142
|
+
}, _callee2);
|
|
91
143
|
}));
|
|
92
144
|
return function (_x) {
|
|
93
|
-
return
|
|
145
|
+
return _ref2.apply(this, arguments);
|
|
94
146
|
};
|
|
95
147
|
}();
|
|
96
148
|
_this.completionProvider = /*#__PURE__*/function () {
|
|
97
|
-
var
|
|
149
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(option) {
|
|
98
150
|
var cellContent, kernelConnection, reply, value;
|
|
99
|
-
return _regeneratorRuntime().wrap(function
|
|
100
|
-
while (1) switch (
|
|
151
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
152
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
101
153
|
case 0:
|
|
102
|
-
cellContent = _this.model.
|
|
154
|
+
cellContent = _this.model.source;
|
|
103
155
|
kernelConnection = getOrigin(_this.parent.model.kernelConnection);
|
|
104
156
|
if (kernelConnection) {
|
|
105
|
-
|
|
157
|
+
_context3.next = 5;
|
|
106
158
|
break;
|
|
107
159
|
}
|
|
108
160
|
alert(l10n.t('Kernel Connection 还没有建立'));
|
|
109
161
|
throw new Error(l10n.t('Kernel Connection 还没有建立'));
|
|
110
162
|
case 5:
|
|
111
|
-
|
|
163
|
+
_context3.next = 7;
|
|
112
164
|
return kernelConnection.requestComplete({
|
|
113
165
|
code: cellContent,
|
|
114
166
|
cursor_pos: option.cursorPosition
|
|
115
167
|
});
|
|
116
168
|
case 7:
|
|
117
|
-
reply =
|
|
169
|
+
reply = _context3.sent;
|
|
118
170
|
value = reply.content;
|
|
119
171
|
if (!(value.status === 'abort')) {
|
|
120
|
-
|
|
172
|
+
_context3.next = 11;
|
|
121
173
|
break;
|
|
122
174
|
}
|
|
123
175
|
throw new Error('abort');
|
|
124
176
|
case 11:
|
|
125
177
|
if (!(value.status === 'error')) {
|
|
126
|
-
|
|
178
|
+
_context3.next = 13;
|
|
127
179
|
break;
|
|
128
180
|
}
|
|
129
181
|
throw new Error(value.ename);
|
|
130
182
|
case 13:
|
|
131
|
-
return
|
|
183
|
+
return _context3.abrupt("return", {
|
|
132
184
|
matches: value.matches,
|
|
133
185
|
cursor_start: value.cursor_start,
|
|
134
186
|
cursor_end: value.cursor_end,
|
|
@@ -136,139 +188,124 @@ export var JupyterCodeCellView = (_dec = transient(), _dec2 = view('jupyter-code
|
|
|
136
188
|
});
|
|
137
189
|
case 14:
|
|
138
190
|
case "end":
|
|
139
|
-
return
|
|
191
|
+
return _context3.stop();
|
|
140
192
|
}
|
|
141
|
-
},
|
|
193
|
+
}, _callee3);
|
|
142
194
|
}));
|
|
143
195
|
return function (_x2) {
|
|
144
|
-
return
|
|
196
|
+
return _ref3.apply(this, arguments);
|
|
145
197
|
};
|
|
146
198
|
}();
|
|
199
|
+
_this.lspDocumentConnectionManager = lspDocumentConnectionManager;
|
|
147
200
|
return _this;
|
|
148
201
|
}
|
|
202
|
+
JupyterCodeCellView = inject(CodeEditorSettings)(JupyterCodeCellView, undefined, 5) || JupyterCodeCellView;
|
|
203
|
+
JupyterCodeCellView = inject(CodeEditorManager)(JupyterCodeCellView, undefined, 4) || JupyterCodeCellView;
|
|
204
|
+
JupyterCodeCellView = inject(ILSPDocumentConnectionManager)(JupyterCodeCellView, undefined, 3) || JupyterCodeCellView;
|
|
149
205
|
JupyterCodeCellView = inject(ViewManager)(JupyterCodeCellView, undefined, 2) || JupyterCodeCellView;
|
|
150
206
|
JupyterCodeCellView = inject(CellService)(JupyterCodeCellView, undefined, 1) || JupyterCodeCellView;
|
|
151
207
|
JupyterCodeCellView = inject(ViewOption)(JupyterCodeCellView, undefined, 0) || JupyterCodeCellView;
|
|
152
208
|
_createClass(JupyterCodeCellView, [{
|
|
153
|
-
key: "
|
|
154
|
-
value: function
|
|
155
|
-
var
|
|
156
|
-
|
|
157
|
-
factory: function factory(editorOption) {
|
|
158
|
-
return codeMirrorEditorFactory(_objectSpread(_objectSpread({}, editorOption), {}, {
|
|
159
|
-
config: _objectSpread(_objectSpread({}, editorOption.config), {
|
|
160
|
-
readOnly: _this2.parent.model.readOnly
|
|
161
|
-
})
|
|
162
|
-
}));
|
|
163
|
-
},
|
|
164
|
-
model: this.model,
|
|
209
|
+
key: "getEditorOption",
|
|
210
|
+
value: function getEditorOption() {
|
|
211
|
+
var options = _get(_getPrototypeOf(JupyterCodeCellView.prototype), "getEditorOption", this).call(this);
|
|
212
|
+
return _objectSpread(_objectSpread({}, options), {}, {
|
|
165
213
|
tooltipProvider: this.tooltipProvider,
|
|
166
214
|
completionProvider: this.completionProvider,
|
|
167
|
-
lspProvider: undefined
|
|
168
|
-
});
|
|
169
|
-
this.viewManager.getOrCreateView(CodeEditorView, option).then(function (editorView) {
|
|
170
|
-
_this2.editorView = editorView;
|
|
171
|
-
_this2.editorViewReadyDeferred.resolve();
|
|
172
|
-
watch(_this2.parent.model, 'readOnly', function () {
|
|
173
|
-
var _this2$editorView;
|
|
174
|
-
(_this2$editorView = _this2.editorView) === null || _this2$editorView === void 0 || (_this2$editorView = _this2$editorView.editor) === null || _this2$editorView === void 0 || _this2$editorView.setOption('readOnly', _this2.parent.model.readOnly);
|
|
175
|
-
});
|
|
176
|
-
_this2.editorView.onModalChange(function (val) {
|
|
177
|
-
return _this2.hasModal = val;
|
|
178
|
-
});
|
|
179
|
-
return;
|
|
180
|
-
}).catch(function () {
|
|
181
|
-
//
|
|
215
|
+
lspProvider: this.parent.model.lspEnabled ? this.lspProvider : undefined
|
|
182
216
|
});
|
|
183
217
|
}
|
|
184
218
|
}, {
|
|
185
219
|
key: "run",
|
|
186
220
|
value: function () {
|
|
187
|
-
var _run = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
221
|
+
var _run = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
|
|
188
222
|
var libroModel, kernelConnection, cellContent, cellModel, future, startTimeStr, msgPromise, endTimeStr;
|
|
189
|
-
return _regeneratorRuntime().wrap(function
|
|
190
|
-
while (1) switch (
|
|
223
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
224
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
191
225
|
case 0:
|
|
192
226
|
libroModel = this.parent.model;
|
|
193
227
|
if (!(!libroModel || !(libroModel instanceof LibroJupyterModel) || !libroModel.kernelConnection || libroModel.kernelConnection.isDisposed)) {
|
|
194
|
-
|
|
228
|
+
_context4.next = 3;
|
|
195
229
|
break;
|
|
196
230
|
}
|
|
197
|
-
return
|
|
231
|
+
return _context4.abrupt("return", false);
|
|
198
232
|
case 3:
|
|
199
233
|
kernelConnection = getOrigin(libroModel.kernelConnection);
|
|
200
|
-
cellContent = this.model.
|
|
234
|
+
cellContent = this.model.source;
|
|
201
235
|
cellModel = this.model;
|
|
202
|
-
|
|
203
|
-
this.
|
|
236
|
+
_context4.prev = 6;
|
|
237
|
+
// if (this.outputArea instanceof LibroOutputArea)
|
|
238
|
+
// this.outputArea.lastOutputContainerHeight =
|
|
239
|
+
// this.outputArea.container?.current?.clientHeight;
|
|
240
|
+
cellModel.executing = true;
|
|
204
241
|
future = kernelConnection.requestExecute({
|
|
205
242
|
code: cellContent
|
|
206
243
|
});
|
|
207
244
|
startTimeStr = '';
|
|
208
|
-
|
|
209
|
-
cellModel.metadata['execution'] = {
|
|
210
|
-
'shell.execute_reply.started': '',
|
|
211
|
-
'shell.execute_reply.end': '',
|
|
212
|
-
to_execute: new Date().toISOString()
|
|
213
|
-
};
|
|
245
|
+
this.clearExecution();
|
|
214
246
|
|
|
215
247
|
// Handle iopub messages
|
|
216
248
|
future.onIOPub = function (msg) {
|
|
217
|
-
cellModel.msgChangeEmitter.fire(msg);
|
|
218
249
|
if (msg.header.msg_type === 'execute_input') {
|
|
250
|
+
cellModel.metadata.execution = {
|
|
251
|
+
'shell.execute_reply.started': '',
|
|
252
|
+
'shell.execute_reply.end': '',
|
|
253
|
+
to_execute: new Date().toISOString()
|
|
254
|
+
};
|
|
219
255
|
cellModel.kernelExecuting = true;
|
|
220
256
|
startTimeStr = msg.header.date;
|
|
221
|
-
var meta = cellModel.metadata
|
|
257
|
+
var meta = cellModel.metadata.execution;
|
|
222
258
|
if (meta) {
|
|
223
259
|
meta['shell.execute_reply.started'] = startTimeStr;
|
|
224
260
|
}
|
|
225
261
|
}
|
|
262
|
+
cellModel.msgChangeEmitter.fire(msg);
|
|
226
263
|
};
|
|
227
264
|
// Handle the execute reply.
|
|
228
265
|
future.onReply = function (msg) {
|
|
229
266
|
cellModel.msgChangeEmitter.fire(msg);
|
|
230
267
|
};
|
|
231
|
-
|
|
268
|
+
_context4.next = 15;
|
|
232
269
|
return future.done;
|
|
233
|
-
case
|
|
234
|
-
msgPromise =
|
|
270
|
+
case 15:
|
|
271
|
+
msgPromise = _context4.sent;
|
|
235
272
|
cellModel.executing = false;
|
|
236
273
|
cellModel.kernelExecuting = false;
|
|
237
274
|
startTimeStr = msgPromise.metadata['started'];
|
|
238
275
|
endTimeStr = msgPromise.header.date;
|
|
239
|
-
cellModel.metadata
|
|
240
|
-
cellModel.metadata
|
|
276
|
+
cellModel.metadata.execution['shell.execute_reply.started'] = startTimeStr;
|
|
277
|
+
cellModel.metadata.execution['shell.execute_reply.end'] = endTimeStr;
|
|
241
278
|
if (msgPromise) {
|
|
242
|
-
|
|
279
|
+
_context4.next = 24;
|
|
243
280
|
break;
|
|
244
281
|
}
|
|
245
|
-
return
|
|
246
|
-
case
|
|
282
|
+
return _context4.abrupt("return", true);
|
|
283
|
+
case 24:
|
|
247
284
|
if (!(msgPromise.content.status === 'ok')) {
|
|
248
|
-
|
|
285
|
+
_context4.next = 28;
|
|
249
286
|
break;
|
|
250
287
|
}
|
|
251
|
-
return
|
|
252
|
-
case
|
|
288
|
+
return _context4.abrupt("return", true);
|
|
289
|
+
case 28:
|
|
253
290
|
throw new KernelError(msgPromise.content);
|
|
254
|
-
case
|
|
255
|
-
|
|
291
|
+
case 29:
|
|
292
|
+
_context4.next = 36;
|
|
256
293
|
break;
|
|
257
|
-
case
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
if (!
|
|
261
|
-
|
|
294
|
+
case 31:
|
|
295
|
+
_context4.prev = 31;
|
|
296
|
+
_context4.t0 = _context4["catch"](6);
|
|
297
|
+
if (!_context4.t0.message.startsWith('Canceled')) {
|
|
298
|
+
_context4.next = 35;
|
|
262
299
|
break;
|
|
263
300
|
}
|
|
264
|
-
return
|
|
301
|
+
return _context4.abrupt("return", false);
|
|
302
|
+
case 35:
|
|
303
|
+
throw _context4.t0;
|
|
265
304
|
case 36:
|
|
266
|
-
throw _context3.t0;
|
|
267
|
-
case 37:
|
|
268
305
|
case "end":
|
|
269
|
-
return
|
|
306
|
+
return _context4.stop();
|
|
270
307
|
}
|
|
271
|
-
},
|
|
308
|
+
}, _callee4, this, [[6, 31]]);
|
|
272
309
|
}));
|
|
273
310
|
function run() {
|
|
274
311
|
return _run.apply(this, arguments);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command-contribution.d.ts","sourceRoot":"","sources":["../../src/command/command-contribution.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,oBAAoB,EACpB,YAAY,EAMb,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EACL,mBAAmB,EAEnB,YAAY,EAEb,MAAM,mBAAmB,CAAC;AAK3B,qBACa,+BAAgC,YAAW,mBAAmB;IACnD,SAAS,CAAC,QAAQ,CAAC,YAAY,EAAE,YAAY,CAAC;IACtC,SAAS,CAAC,QAAQ,CAAC,YAAY,EAAE,oBAAoB,CAAC;IAC9D,SAAS,CAAC,QAAQ,CAAC,YAAY,EAAE,YAAY,CAAC;IAEpE,gBAAgB,CAAC,OAAO,EAAE,eAAe,GAAG,IAAI;
|
|
1
|
+
{"version":3,"file":"command-contribution.d.ts","sourceRoot":"","sources":["../../src/command/command-contribution.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,oBAAoB,EACpB,YAAY,EAMb,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EACL,mBAAmB,EAEnB,YAAY,EAEb,MAAM,mBAAmB,CAAC;AAK3B,qBACa,+BAAgC,YAAW,mBAAmB;IACnD,SAAS,CAAC,QAAQ,CAAC,YAAY,EAAE,YAAY,CAAC;IACtC,SAAS,CAAC,QAAQ,CAAC,YAAY,EAAE,oBAAoB,CAAC;IAC9D,SAAS,CAAC,QAAQ,CAAC,YAAY,EAAE,YAAY,CAAC;IAEpE,gBAAgB,CAAC,OAAO,EAAE,eAAe,GAAG,IAAI;CA2IjD"}
|
|
@@ -29,7 +29,7 @@ export var LibroJupyterCommandContribution = (_dec = singleton({
|
|
|
29
29
|
value: function registerCommands(command) {
|
|
30
30
|
this.libroCommand.registerLibroCommand(command, KernelCommands['ShowKernelStatusAndSelector'], {
|
|
31
31
|
execute: function () {
|
|
32
|
-
var _execute = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(
|
|
32
|
+
var _execute = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(cell, libro) {
|
|
33
33
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
34
34
|
while (1) switch (_context.prev = _context.next) {
|
|
35
35
|
case 0:
|
|
@@ -49,13 +49,13 @@ export var LibroJupyterCommandContribution = (_dec = singleton({
|
|
|
49
49
|
}
|
|
50
50
|
return execute;
|
|
51
51
|
}(),
|
|
52
|
-
isVisible: function isVisible(
|
|
52
|
+
isVisible: function isVisible(cell, libro, path) {
|
|
53
53
|
if (!libro || !(libro instanceof LibroView)) {
|
|
54
54
|
return false;
|
|
55
55
|
}
|
|
56
56
|
return !(libro !== null && libro !== void 0 && libro.model.quickEditMode) && !(libro !== null && libro !== void 0 && libro.model.readOnly) && path === LibroToolbarArea.HeaderLeft;
|
|
57
57
|
},
|
|
58
|
-
isEnabled: function isEnabled(
|
|
58
|
+
isEnabled: function isEnabled(cell, libro) {
|
|
59
59
|
if (!libro || !(libro instanceof LibroView)) {
|
|
60
60
|
return false;
|
|
61
61
|
}
|
|
@@ -75,7 +75,7 @@ export var LibroJupyterCommandContribution = (_dec = singleton({
|
|
|
75
75
|
}
|
|
76
76
|
return !!cell;
|
|
77
77
|
},
|
|
78
|
-
isEnabled: function isEnabled(
|
|
78
|
+
isEnabled: function isEnabled(cell, libro) {
|
|
79
79
|
if (!libro || !(libro instanceof LibroView)) {
|
|
80
80
|
return false;
|
|
81
81
|
}
|
|
@@ -92,7 +92,7 @@ export var LibroJupyterCommandContribution = (_dec = singleton({
|
|
|
92
92
|
}
|
|
93
93
|
return !(libro !== null && libro !== void 0 && libro.model.quickEditMode) && !(libro !== null && libro !== void 0 && libro.model.readOnly) && path === LibroToolbarArea.CellRight;
|
|
94
94
|
},
|
|
95
|
-
isEnabled: function isEnabled(
|
|
95
|
+
isEnabled: function isEnabled(cell, libro) {
|
|
96
96
|
if (!libro || !(libro instanceof LibroView)) {
|
|
97
97
|
return false;
|
|
98
98
|
}
|
|
@@ -101,7 +101,7 @@ export var LibroJupyterCommandContribution = (_dec = singleton({
|
|
|
101
101
|
});
|
|
102
102
|
this.libroCommand.registerLibroCommand(command, NotebookCommands['SelectLastRunCell'], {
|
|
103
103
|
execute: function () {
|
|
104
|
-
var _execute2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(
|
|
104
|
+
var _execute2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(cell, libro) {
|
|
105
105
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
106
106
|
while (1) switch (_context2.prev = _context2.next) {
|
|
107
107
|
case 0:
|
|
@@ -125,13 +125,13 @@ export var LibroJupyterCommandContribution = (_dec = singleton({
|
|
|
125
125
|
}
|
|
126
126
|
return execute;
|
|
127
127
|
}(),
|
|
128
|
-
isVisible: function isVisible(
|
|
128
|
+
isVisible: function isVisible(cell, libro, path) {
|
|
129
129
|
if (!libro || !(libro instanceof LibroView)) {
|
|
130
130
|
return false;
|
|
131
131
|
}
|
|
132
|
-
return path === LibroToolbarArea.HeaderCenter && !libro.model.readOnly;
|
|
132
|
+
return !(libro !== null && libro !== void 0 && libro.model.quickEditMode) && path === LibroToolbarArea.HeaderCenter && !libro.model.readOnly;
|
|
133
133
|
},
|
|
134
|
-
isEnabled: function isEnabled(
|
|
134
|
+
isEnabled: function isEnabled(cell, libro) {
|
|
135
135
|
if (!libro || !(libro instanceof LibroView) || libro.model.readOnly) {
|
|
136
136
|
return false;
|
|
137
137
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cell-execution-tip.d.ts","sourceRoot":"","sources":["../../src/components/cell-execution-tip.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"cell-execution-tip.d.ts","sourceRoot":"","sources":["../../src/components/cell-execution-tip.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAoBpD,OAAO,cAAc,CAAC;AAEtB,wBAAgB,gBAAgB,CAAC,EAAE,IAAI,EAAE,EAAE;IAAE,IAAI,EAAE,QAAQ,CAAA;CAAE,kDAyF5D"}
|