@difizen/libro-jupyter 0.1.0 → 0.1.2

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 (136) hide show
  1. package/es/add-between-cell/add-between-cell.d.ts.map +1 -1
  2. package/es/add-between-cell/add-between-cell.js +7 -7
  3. package/es/add-between-cell/index.less +6 -0
  4. package/es/cell/jupyter-code-cell-model.d.ts +2 -2
  5. package/es/cell/jupyter-code-cell-model.d.ts.map +1 -1
  6. package/es/cell/jupyter-code-cell-model.js +7 -3
  7. package/es/cell/jupyter-code-cell-view.d.ts +9 -4
  8. package/es/cell/jupyter-code-cell-view.d.ts.map +1 -1
  9. package/es/cell/jupyter-code-cell-view.js +137 -100
  10. package/es/command/command-contribution.d.ts.map +1 -1
  11. package/es/command/command-contribution.js +9 -9
  12. package/es/components/cell-execution-tip.d.ts.map +1 -1
  13. package/es/components/cell-execution-tip.js +14 -1
  14. package/es/components/cell-input-bottom-blank.d.ts.map +1 -1
  15. package/es/components/cell-input-bottom-blank.js +4 -4
  16. package/es/components/icons.d.ts +5 -0
  17. package/es/components/icons.d.ts.map +1 -0
  18. package/es/components/index.less +1 -0
  19. package/es/config/config-contribution.d.ts +2 -2
  20. package/es/config/config-contribution.d.ts.map +1 -1
  21. package/es/config/config-contribution.js +7 -7
  22. package/es/config/config.d.ts +8 -0
  23. package/es/config/config.d.ts.map +1 -0
  24. package/es/config/config.js +15 -1
  25. package/es/config/index.d.ts +1 -0
  26. package/es/config/index.d.ts.map +1 -1
  27. package/es/config/index.js +2 -1
  28. package/es/file/file-command.d.ts +1 -0
  29. package/es/file/file-command.d.ts.map +1 -1
  30. package/es/file/file-command.js +20 -8
  31. package/es/file/file-create-modal.d.ts +5 -1
  32. package/es/file/file-create-modal.d.ts.map +1 -1
  33. package/es/file/file-create-modal.js +178 -56
  34. package/es/file/file-createdir-modal-contribution.d.ts +1 -1
  35. package/es/file/file-createdir-modal.d.ts +4 -3
  36. package/es/file/file-createdir-modal.d.ts.map +1 -1
  37. package/es/file/file-createdir-modal.js +122 -59
  38. package/es/file/file-icon.d.ts +11 -0
  39. package/es/file/file-icon.d.ts.map +1 -0
  40. package/es/file/file-icon.js +475 -0
  41. package/es/file/file-name-alias.d.ts +7 -0
  42. package/es/file/file-name-alias.d.ts.map +1 -0
  43. package/es/file/file-protocol.d.ts +14 -0
  44. package/es/file/file-protocol.d.ts.map +1 -0
  45. package/es/file/file-rename-modal.d.ts +1 -0
  46. package/es/file/file-rename-modal.d.ts.map +1 -1
  47. package/es/file/file-rename-modal.js +100 -25
  48. package/es/file/file-tree-label-provider.d.ts +13 -0
  49. package/es/file/file-tree-label-provider.d.ts.map +1 -0
  50. package/es/file/index.d.ts +3 -0
  51. package/es/file/index.d.ts.map +1 -1
  52. package/es/file/index.js +4 -1
  53. package/es/file/index.less +98 -0
  54. package/es/file/navigatable-view.d.ts +13 -6
  55. package/es/file/navigatable-view.d.ts.map +1 -1
  56. package/es/file/navigatable-view.js +53 -7
  57. package/es/file/open-handler-contribution.js +1 -1
  58. package/es/file/utils.d.ts +2 -0
  59. package/es/file/utils.d.ts.map +1 -0
  60. package/es/index.d.ts +17 -15
  61. package/es/index.d.ts.map +1 -1
  62. package/es/index.js +17 -15
  63. package/es/keybind-instructions/index.less +2 -2
  64. package/es/keybind-instructions/keybind-instructions-contribution.js +2 -2
  65. package/es/keybind-instructions/keybind-instructions-items.d.ts +14 -0
  66. package/es/keybind-instructions/keybind-instructions-items.d.ts.map +1 -0
  67. package/es/libro-jupyter-model.d.ts +8 -4
  68. package/es/libro-jupyter-model.d.ts.map +1 -1
  69. package/es/libro-jupyter-model.js +24 -17
  70. package/es/libro-jupyter-protocol.d.ts +4 -0
  71. package/es/libro-jupyter-protocol.d.ts.map +1 -1
  72. package/es/libro-jupyter-protocol.js +2 -1
  73. package/es/libro-jupyter-server-launch-manager.d.ts +3 -1
  74. package/es/libro-jupyter-server-launch-manager.d.ts.map +1 -1
  75. package/es/libro-jupyter-server-launch-manager.js +9 -2
  76. package/es/libro-jupyter-view.d.ts +2 -1
  77. package/es/libro-jupyter-view.d.ts.map +1 -1
  78. package/es/libro-jupyter-view.js +4 -2
  79. package/es/module.d.ts.map +1 -1
  80. package/es/module.js +12 -10
  81. package/es/output/libro-jupyter-outputarea.d.ts +3 -0
  82. package/es/output/libro-jupyter-outputarea.d.ts.map +1 -1
  83. package/es/output/libro-jupyter-outputarea.js +49 -4
  84. package/es/rendermime/index.less +12 -1
  85. package/es/rendermime/plotly-renderers.d.ts +15 -14
  86. package/es/rendermime/plotly-renderers.d.ts.map +1 -1
  87. package/es/rendermime/plotly-renderers.js +1 -3
  88. package/es/theme/color-registry.d.ts +6 -0
  89. package/es/theme/color-registry.d.ts.map +1 -0
  90. package/es/theme/index.d.ts +2 -0
  91. package/es/theme/index.d.ts.map +1 -0
  92. package/es/toolbar/kernel-selector-dropdown.d.ts.map +1 -1
  93. package/es/toolbar/kernel-selector-dropdown.js +2 -6
  94. package/es/typings/index.d.ts +7 -2
  95. package/package.json +16 -14
  96. package/src/add-between-cell/add-between-cell.tsx +17 -8
  97. package/src/add-between-cell/index.less +6 -0
  98. package/src/cell/jupyter-code-cell-model.ts +6 -4
  99. package/src/cell/jupyter-code-cell-view.tsx +81 -48
  100. package/src/command/command-contribution.ts +13 -9
  101. package/src/components/cell-execution-tip.tsx +8 -2
  102. package/src/components/cell-input-bottom-blank.tsx +10 -5
  103. package/src/components/index.less +1 -0
  104. package/src/config/config-contribution.ts +3 -3
  105. package/src/config/config.ts +17 -2
  106. package/src/config/index.ts +1 -0
  107. package/src/file/file-command.tsx +16 -8
  108. package/src/file/file-create-modal.tsx +129 -26
  109. package/src/file/file-createdir-modal.tsx +64 -32
  110. package/src/file/file-icon.tsx +502 -0
  111. package/src/file/file-rename-modal.tsx +55 -16
  112. package/src/file/index.less +98 -0
  113. package/src/file/index.ts +3 -0
  114. package/src/file/navigatable-view.tsx +60 -5
  115. package/src/file/open-handler-contribution.ts +1 -1
  116. package/src/index.spec.ts +1 -5
  117. package/src/index.ts +17 -16
  118. package/src/keybind-instructions/index.less +2 -2
  119. package/src/keybind-instructions/keybind-instructions-contribution.ts +2 -2
  120. package/src/libro-jupyter-model.ts +34 -20
  121. package/src/libro-jupyter-protocol.ts +5 -0
  122. package/src/libro-jupyter-server-launch-manager.ts +11 -2
  123. package/src/libro-jupyter-view.tsx +4 -1
  124. package/src/module.ts +23 -15
  125. package/src/output/libro-jupyter-outputarea.tsx +31 -3
  126. package/src/rendermime/index.less +12 -1
  127. package/src/rendermime/plotly-render.tsx +1 -1
  128. package/src/rendermime/plotly-renderers.ts +15 -17
  129. package/src/toolbar/kernel-selector-dropdown.tsx +2 -6
  130. package/src/typings/index.d.ts +7 -2
  131. package/es/configuration/index.js +0 -2
  132. package/es/configuration/libro-configuration-contribution.js +0 -24
  133. package/es/configuration/libro-configuration.js +0 -12
  134. package/src/configuration/index.ts +0 -2
  135. package/src/configuration/libro-configuration-contribution.ts +0 -11
  136. 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,EAAa,MAAM,qBAAqB,CAAC;AAU1E,OAAO,cAAc,CAAC;AA0BtB,eAAO,MAAM,6BAA6B,EAAE,mBAwJ3C,CAAC;AAEF,eAAO,MAAM,8BAA8B,EAAE,mBAS5C,CAAC"}
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, _ref) {
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(_nextOpen) {
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: 'fixed',
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.clientY,
201
- left: e.clientX
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);
@@ -101,3 +101,9 @@
101
101
  outline: none;
102
102
  cursor: pointer;
103
103
  }
104
+
105
+ .ReactVirtualized__List {
106
+ .libro-add-between-cell-area {
107
+ width: calc(100% - 45px);
108
+ }
109
+ }
@@ -1,8 +1,8 @@
1
- import { LibroCodeCellModel } from '@difizen/libro-codemirror-code-cell';
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 { ExecutedWithKernelCellModel, CodeCellMetadata } from '../libro-jupyter-protocol.js';
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,qCAAqC,CAAC;AACzE,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,2BAA2B,EAC3B,gBAAgB,EACjB,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;IAMtC,cAAc,aAKrB;CACH"}
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-codemirror-code-cell';
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 type { CompletionProvider, TooltipProvider } from '@difizen/libro-code-editor';
3
- import { LibroCodeCellView } from '@difizen/libro-codemirror-code-cell';
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
- constructor(options: CellViewOptions, cellService: CellService, viewManager: ViewManager);
14
+ protected readonly lspDocumentConnectionManager: ILSPDocumentConnectionManager;
15
+ constructor(options: CellViewOptions, cellService: CellService, viewManager: ViewManager, lspDocumentConnectionManager: ILSPDocumentConnectionManager, codeEditorManager: CodeEditorManager, codeEditorSettings: CodeEditorSettings);
12
16
  clearExecution: () => void;
13
- onViewMount(): void;
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":";AACA,OAAO,KAAK,EAEV,kBAAkB,EAElB,eAAe,EAEhB,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EAAkB,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AACxF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAGlD,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;gBAGd,OAAO,EAAE,eAAe,EACvB,WAAW,EAAE,WAAW,EACxB,WAAW,EAAE,WAAW;IAKtC,cAAc,aAGrB;IAEO,WAAW;IAgCpB,eAAe,EAAE,eAAe,CAqB9B;IAEF,kBAAkB,EAAE,kBAAkB,CA8BpC;IAEa,GAAG;CA0EnB"}
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 { CodeEditorView } from '@difizen/libro-code-editor';
22
- import { codeMirrorEditorFactory } from '@difizen/libro-codemirror';
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, watch } from '@difizen/mana-app';
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(_props, ref) {
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
- _this.outputArea.clear();
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 _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(option) {
108
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(option) {
57
109
  var cellContent, kernelConnection, reply, value;
58
- return _regeneratorRuntime().wrap(function _callee$(_context) {
59
- while (1) switch (_context.prev = _context.next) {
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
- _context.next = 5;
116
+ _context2.next = 5;
65
117
  break;
66
118
  }
67
119
  alert(l10n.t('Kernel Connection 还没有建立'));
68
- return _context.abrupt("return", null);
120
+ return _context2.abrupt("return", null);
69
121
  case 5:
70
- _context.next = 7;
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 = _context.sent;
129
+ reply = _context2.sent;
78
130
  value = reply.content;
79
131
  if (!(value.status !== 'ok' || !value.found)) {
80
- _context.next = 11;
132
+ _context2.next = 11;
81
133
  break;
82
134
  }
83
- return _context.abrupt("return", null);
135
+ return _context2.abrupt("return", null);
84
136
  case 11:
85
- return _context.abrupt("return", value.data['text/plain']);
137
+ return _context2.abrupt("return", value.data['text/plain']);
86
138
  case 12:
87
139
  case "end":
88
- return _context.stop();
140
+ return _context2.stop();
89
141
  }
90
- }, _callee);
142
+ }, _callee2);
91
143
  }));
92
144
  return function (_x) {
93
- return _ref.apply(this, arguments);
145
+ return _ref2.apply(this, arguments);
94
146
  };
95
147
  }();
96
148
  _this.completionProvider = /*#__PURE__*/function () {
97
- var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(option) {
149
+ var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(option) {
98
150
  var cellContent, kernelConnection, reply, value;
99
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
100
- while (1) switch (_context2.prev = _context2.next) {
151
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
152
+ while (1) switch (_context3.prev = _context3.next) {
101
153
  case 0:
102
- cellContent = _this.model.value;
154
+ cellContent = _this.model.source;
103
155
  kernelConnection = getOrigin(_this.parent.model.kernelConnection);
104
156
  if (kernelConnection) {
105
- _context2.next = 5;
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
- _context2.next = 7;
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 = _context2.sent;
169
+ reply = _context3.sent;
118
170
  value = reply.content;
119
171
  if (!(value.status === 'abort')) {
120
- _context2.next = 11;
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
- _context2.next = 13;
178
+ _context3.next = 13;
127
179
  break;
128
180
  }
129
181
  throw new Error(value.ename);
130
182
  case 13:
131
- return _context2.abrupt("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 _context2.stop();
191
+ return _context3.stop();
140
192
  }
141
- }, _callee2);
193
+ }, _callee3);
142
194
  }));
143
195
  return function (_x2) {
144
- return _ref2.apply(this, arguments);
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: "onViewMount",
154
- value: function onViewMount() {
155
- var _this2 = this;
156
- var option = _objectSpread(_objectSpread({}, this.options), {}, {
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 _callee3() {
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 _callee3$(_context3) {
190
- while (1) switch (_context3.prev = _context3.next) {
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
- _context3.next = 3;
228
+ _context4.next = 3;
195
229
  break;
196
230
  }
197
- return _context3.abrupt("return", false);
231
+ return _context4.abrupt("return", false);
198
232
  case 3:
199
233
  kernelConnection = getOrigin(libroModel.kernelConnection);
200
- cellContent = this.model.value;
234
+ cellContent = this.model.source;
201
235
  cellModel = this.model;
202
- _context3.prev = 6;
203
- this.clearExecution();
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
- cellModel.executing = true;
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['execution'];
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
- _context3.next = 16;
268
+ _context4.next = 15;
232
269
  return future.done;
233
- case 16:
234
- msgPromise = _context3.sent;
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['execution']['shell.execute_reply.started'] = startTimeStr;
240
- cellModel.metadata['execution']['shell.execute_reply.end'] = endTimeStr;
276
+ cellModel.metadata.execution['shell.execute_reply.started'] = startTimeStr;
277
+ cellModel.metadata.execution['shell.execute_reply.end'] = endTimeStr;
241
278
  if (msgPromise) {
242
- _context3.next = 25;
279
+ _context4.next = 24;
243
280
  break;
244
281
  }
245
- return _context3.abrupt("return", true);
246
- case 25:
282
+ return _context4.abrupt("return", true);
283
+ case 24:
247
284
  if (!(msgPromise.content.status === 'ok')) {
248
- _context3.next = 29;
285
+ _context4.next = 28;
249
286
  break;
250
287
  }
251
- return _context3.abrupt("return", true);
252
- case 29:
288
+ return _context4.abrupt("return", true);
289
+ case 28:
253
290
  throw new KernelError(msgPromise.content);
254
- case 30:
255
- _context3.next = 37;
291
+ case 29:
292
+ _context4.next = 36;
256
293
  break;
257
- case 32:
258
- _context3.prev = 32;
259
- _context3.t0 = _context3["catch"](6);
260
- if (!_context3.t0.message.startsWith('Canceled')) {
261
- _context3.next = 36;
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 _context3.abrupt("return", false);
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 _context3.stop();
306
+ return _context4.stop();
270
307
  }
271
- }, _callee3, this, [[6, 32]]);
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;CAuIjD"}
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(_cell, libro) {
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(_cell, libro, path) {
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(_cell, libro) {
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(_cell, libro) {
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(_cell, libro) {
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(_cell, libro) {
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(_cell, libro, path) {
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(_cell, libro) {
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;AAmBpD,OAAO,cAAc,CAAC;AAEtB,wBAAgB,gBAAgB,CAAC,EAAE,IAAI,EAAE,EAAE;IAAE,IAAI,EAAE,QAAQ,CAAA;CAAE,kDAoF5D"}
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"}