@difizen/libro-jupyter 0.2.31 → 0.2.32

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.
@@ -1 +1 @@
1
- {"version":3,"file":"content-contribution.d.ts","sourceRoot":"","sources":["../../src/contents/content-contribution.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACzE,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAM1D,qBACa,+BAAgC,YAAW,mBAAmB;IACzE,SAAS,eAEP;IACI,WAAW,CAAC,OAAO,EAAE,cAAc,EAAE,KAAK,EAAE,aAAa;CAoBhE"}
1
+ {"version":3,"file":"content-contribution.d.ts","sourceRoot":"","sources":["../../src/contents/content-contribution.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACzE,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAM1D,qBACa,+BAAgC,YAAW,mBAAmB;IACzE,SAAS,eAEP;IACI,WAAW,CAAC,OAAO,EAAE,cAAc,EAAE,KAAK,EAAE,aAAa;CAehE"}
@@ -36,19 +36,15 @@ export var LibroJupyterContentContribution = (_dec = singleton({
36
36
  case 5:
37
37
  currentFileContents = _context.sent;
38
38
  if (!currentFileContents) {
39
- _context.next = 14;
39
+ _context.next = 12;
40
40
  break;
41
41
  }
42
42
  currentFileContents.content.nbformat_minor = 5;
43
43
  jupyterModel.currentFileContents = currentFileContents;
44
44
  jupyterModel.filePath = currentFileContents.path;
45
- jupyterModel.id = currentFileContents.path; // use file path as id, will be passed to editor and lsp
46
45
  jupyterModel.lastModified = jupyterModel.currentFileContents.last_modified;
47
- if (jupyterModel.executable) {
48
- jupyterModel.startKernelConnection();
49
- }
50
46
  return _context.abrupt("return", jupyterModel.currentFileContents.content);
51
- case 14:
47
+ case 12:
52
48
  case "end":
53
49
  return _context.stop();
54
50
  }
@@ -1,3 +1,4 @@
1
+ import type { INotebookContent } from '@difizen/libro-common';
1
2
  import type { VirtualizedManager } from '@difizen/libro-core';
2
3
  import { LibroModel, VirtualizedManagerHelper } from '@difizen/libro-core';
3
4
  import { ContentsManager, LibroKernelConnectionManager, ServerConnection, ServerManager } from '@difizen/libro-kernel';
@@ -39,6 +40,7 @@ export declare class LibroJupyterModel extends LibroModel implements ExecutableN
39
40
  listCheckpoints(): Promise<void>;
40
41
  restoreCheckpoint(checkpointID: string): Promise<void>;
41
42
  deleteCheckpoint(checkpointID: string): Promise<void>;
43
+ loadNotebookContent(): Promise<INotebookContent>;
42
44
  startKernelConnection(): void;
43
45
  canRun(): boolean;
44
46
  interrupt(): Promise<void>;
@@ -1 +1 @@
1
- {"version":3,"file":"libro-jupyter-model.d.ts","sourceRoot":"","sources":["../src/libro-jupyter-model.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAC3E,OAAO,EACL,eAAe,EAEf,4BAA4B,EAC5B,gBAAgB,EAChB,aAAa,EACd,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AACxF,OAAO,KAAK,EAAE,wBAAwB,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACtF,OAAO,EAAa,YAAY,EAAQ,MAAM,mBAAmB,CAAC;AAClE,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAI7C,OAAO,EAGL,gBAAgB,EACjB,MAAM,6BAA6B,CAAC;AAGrC,KAAK,MAAM,GAAG,cAAc,CAAC;AAC7B,qBACa,iBAAkB,SAAQ,UAAW,YAAW,uBAAuB;IAClF,SAAS,CAAC,gBAAgB,EAAE,gBAAgB,CAAC;I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AE,4BAA4B,CAAC;IAChE,SAAS,CAAC,aAAa,EAAE,aAAa,CAAC;IACvC,SAAS,CAAC,gBAAgB,EAAE,gBAAgB,CAAC;IAC7C,SAAS,CAAC,QAAQ,CAAC,eAAe,EAAE,eAAe,CAAC;IACpD,SAAS,CAAC,QAAQ,CAAC,YAAY,EAAE,YAAY,CAAC;gBAGlB,gBAAgB,EAAE,gBAAgB,EAE5D,uBAAuB,EAAE,4BAA4B,EAC9B,aAAa,EAAE,aAAa,EACzB,gBAAgB,EAAE,gBAAgB,EACnC,eAAe,EAAE,eAAe,EACnC,YAAY,EAAE,YAAY,EAEhD,wBAAwB,EAAE,wBAAwB;IA6BpD,IAAI,YAAY,wBAEf;IAED,IAAI,eAAe,IAIQ,MAAM,CAFhC;IAED,IAAI,eAAe,CAAC,KAAK,EAAE,MAAM,EAEhC;IAED,IAAI,mBAAmB,IAIQ,MAAM,CAFpC;IAED,IAAI,mBAAmB,CAAC,KAAK,EAAE,MAAM,EAEpC;IACD,SAAS,CAAC,UAAU,8BAAqC;IACzD,IAAI,OAAO,+BAEV;IAGD,gBAAgB,EAAE,OAAO,GAAG,SAAS,CAAC;IAGtC,QAAQ,SAAM;IAEd,SAAS,CAAC,aAAa,SAAM;IAE7B,IAAI,YAAY,IAIQ,MAAM,CAF7B;IAED,IAAI,YAAY,CAAC,KAAK,EAAE,MAAM,EAE7B;IAED,qBAAqB,EAAE,wBAAwB,CAAC;IAE1C,gBAAgB;IAMhB,eAAe;IAIf,iBAAiB,CAAC,YAAY,EAAE,MAAM;IAItC,gBAAgB,CAAC,YAAY,EAAE,MAAM;IAIlC,mBAAmB,IAAI,OAAO,CAAC,gBAAgB,CAAC;IASzD,qBAAqB;IA2BZ,MAAM;IAcT,SAAS;IAQT,QAAQ;IAUR,OAAO;IAkBP,SAAS;IAQf,eAAe;CAYhB"}
@@ -12,6 +12,8 @@ function _defineProperties(target, props) { for (var i = 0; i < props.length; i+
12
12
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
13
13
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
14
14
  function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
15
+ 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); }
16
+ function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }
15
17
  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); }
16
18
  function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
17
19
  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); }; }
@@ -205,6 +207,16 @@ export var LibroJupyterModel = (_dec = transient(), _dec2 = prop(), _dec3 = prop
205
207
  }
206
208
  return deleteCheckpoint;
207
209
  }()
210
+ }, {
211
+ key: "loadNotebookContent",
212
+ value: function loadNotebookContent() {
213
+ var content = _get(_getPrototypeOf(LibroJupyterModel.prototype), "loadNotebookContent", this).call(this);
214
+ this.id = this.currentFileContents.path; // use file path as id, will be passed to editor and lsp
215
+ if (this.executable && !this.kernelConnecting) {
216
+ this.startKernelConnection();
217
+ }
218
+ return content;
219
+ }
208
220
  }, {
209
221
  key: "startKernelConnection",
210
222
  value: function startKernelConnection() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@difizen/libro-jupyter",
3
- "version": "0.2.31",
3
+ "version": "0.2.32",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "libro"
@@ -33,27 +33,27 @@
33
33
  "dependencies": {
34
34
  "@ant-design/colors": "^7.0.0",
35
35
  "@ant-design/icons": "^5.1.0",
36
- "@difizen/libro-code-cell": "^0.2.31",
37
- "@difizen/libro-code-editor": "^0.2.31",
38
- "@difizen/libro-codemirror": "^0.2.31",
39
- "@difizen/libro-cofine-editor": "^0.2.31",
40
- "@difizen/libro-common": "^0.2.31",
41
- "@difizen/libro-core": "^0.2.31",
42
- "@difizen/libro-kernel": "^0.2.31",
43
- "@difizen/libro-l10n": "^0.2.31",
44
- "@difizen/libro-language-client": "^0.2.31",
45
- "@difizen/libro-lsp": "^0.2.31",
46
- "@difizen/libro-markdown-cell": "^0.2.31",
47
- "@difizen/libro-output": "^0.2.31",
48
- "@difizen/libro-raw-cell": "^0.2.31",
49
- "@difizen/libro-rendermime": "^0.2.31",
50
- "@difizen/libro-search": "^0.2.31",
51
- "@difizen/libro-search-code-cell": "^0.2.31",
36
+ "@difizen/libro-code-cell": "^0.2.32",
37
+ "@difizen/libro-code-editor": "^0.2.32",
38
+ "@difizen/libro-codemirror": "^0.2.32",
39
+ "@difizen/libro-cofine-editor": "^0.2.32",
40
+ "@difizen/libro-common": "^0.2.32",
41
+ "@difizen/libro-core": "^0.2.32",
42
+ "@difizen/libro-kernel": "^0.2.32",
43
+ "@difizen/libro-l10n": "^0.2.32",
44
+ "@difizen/libro-language-client": "^0.2.32",
45
+ "@difizen/libro-lsp": "^0.2.32",
46
+ "@difizen/libro-markdown-cell": "^0.2.32",
47
+ "@difizen/libro-output": "^0.2.32",
48
+ "@difizen/libro-raw-cell": "^0.2.32",
49
+ "@difizen/libro-rendermime": "^0.2.32",
50
+ "@difizen/libro-search": "^0.2.32",
51
+ "@difizen/libro-search-code-cell": "^0.2.32",
52
52
  "@difizen/mana-app": "latest",
53
53
  "@difizen/mana-l10n": "latest",
54
54
  "classnames": "^2.3.2",
55
55
  "moment": "^2.29.4",
56
- "plotly.js": "2.35.0"
56
+ "plotly.js": "^2.35.0"
57
57
  },
58
58
  "peerDependencies": {
59
59
  "antd": "^5.8.6",
@@ -20,13 +20,8 @@ export class LibroJupyterContentContribution implements ContentContribution {
20
20
  currentFileContents.content.nbformat_minor = 5;
21
21
  jupyterModel.currentFileContents = currentFileContents;
22
22
  jupyterModel.filePath = currentFileContents.path;
23
- jupyterModel.id = currentFileContents.path; // use file path as id, will be passed to editor and lsp
24
23
  jupyterModel.lastModified = jupyterModel.currentFileContents.last_modified;
25
24
 
26
- if (jupyterModel.executable) {
27
- jupyterModel.startKernelConnection();
28
- }
29
-
30
25
  return jupyterModel.currentFileContents.content;
31
26
  }
32
27
  }
@@ -1,3 +1,4 @@
1
+ import type { INotebookContent } from '@difizen/libro-common';
1
2
  import type { VirtualizedManager } from '@difizen/libro-core';
2
3
  import { LibroModel, VirtualizedManagerHelper } from '@difizen/libro-core';
3
4
  import {
@@ -147,6 +148,15 @@ export class LibroJupyterModel extends LibroModel implements ExecutableNotebookM
147
148
  await this.contentsManager.deleteCheckpoint(this.filePath, checkpointID);
148
149
  }
149
150
 
151
+ override loadNotebookContent(): Promise<INotebookContent> {
152
+ const content = super.loadNotebookContent();
153
+ this.id = this.currentFileContents.path; // use file path as id, will be passed to editor and lsp
154
+ if (this.executable && !this.kernelConnecting) {
155
+ this.startKernelConnection();
156
+ }
157
+ return content;
158
+ }
159
+
150
160
  startKernelConnection() {
151
161
  this.kernelConnecting = true;
152
162
  const fileInfo = this.currentFileContents;