@difizen/libro-jupyter 0.2.31 → 0.2.33

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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{ 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,48 +207,76 @@ export var LibroJupyterModel = (_dec = transient(), _dec2 = prop(), _dec3 = prop
205
207
  }
206
208
  return deleteCheckpoint;
207
209
  }()
210
+ }, {
211
+ key: "loadNotebookContent",
212
+ value: function () {
213
+ var _loadNotebookContent = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
214
+ var content;
215
+ return _regeneratorRuntime().wrap(function _callee5$(_context5) {
216
+ while (1) switch (_context5.prev = _context5.next) {
217
+ case 0:
218
+ _context5.next = 2;
219
+ return _get(_getPrototypeOf(LibroJupyterModel.prototype), "loadNotebookContent", this).call(this);
220
+ case 2:
221
+ content = _context5.sent;
222
+ this.id = this.currentFileContents.path; // use file path as id, will be passed to editor and lsp
223
+ if (this.executable && !this.kernelConnecting) {
224
+ this.startKernelConnection();
225
+ }
226
+ return _context5.abrupt("return", content);
227
+ case 6:
228
+ case "end":
229
+ return _context5.stop();
230
+ }
231
+ }, _callee5, this);
232
+ }));
233
+ function loadNotebookContent() {
234
+ return _loadNotebookContent.apply(this, arguments);
235
+ }
236
+ return loadNotebookContent;
237
+ }()
208
238
  }, {
209
239
  key: "startKernelConnection",
210
240
  value: function startKernelConnection() {
211
241
  var _this2 = this;
212
242
  this.kernelConnecting = true;
213
243
  var fileInfo = this.currentFileContents;
214
- this.serverManager.ready.then( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
244
+ this.serverManager.ready.then( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
215
245
  var kernelConnection, kc;
216
- return _regeneratorRuntime().wrap(function _callee5$(_context5) {
217
- while (1) switch (_context5.prev = _context5.next) {
246
+ return _regeneratorRuntime().wrap(function _callee6$(_context6) {
247
+ while (1) switch (_context6.prev = _context6.next) {
218
248
  case 0:
219
249
  kernelConnection = _this2.kernelConnectionManager.getKernelConnection(fileInfo);
220
250
  if (!kernelConnection) {
221
- _context5.next = 7;
251
+ _context6.next = 7;
222
252
  break;
223
253
  }
224
254
  _this2.kernelConnection = kernelConnection;
225
255
  _this2.kcDeferred.resolve(_this2.kernelConnection);
226
256
  _this2.kernelConnecting = false;
227
- _context5.next = 15;
257
+ _context6.next = 15;
228
258
  break;
229
259
  case 7:
230
- _context5.next = 9;
260
+ _context6.next = 9;
231
261
  return _this2.kernelConnectionManager.startNew(_this2.currentFileContents);
232
262
  case 9:
233
- kc = _context5.sent;
263
+ kc = _context6.sent;
234
264
  if (kc) {
235
- _context5.next = 12;
265
+ _context6.next = 12;
236
266
  break;
237
267
  }
238
- return _context5.abrupt("return");
268
+ return _context6.abrupt("return");
239
269
  case 12:
240
270
  _this2.kernelConnection = kc;
241
271
  _this2.kcDeferred.resolve(kc);
242
272
  _this2.kernelConnecting = false;
243
273
  case 15:
244
- return _context5.abrupt("return");
274
+ return _context6.abrupt("return");
245
275
  case 16:
246
276
  case "end":
247
- return _context5.stop();
277
+ return _context6.stop();
248
278
  }
249
- }, _callee5);
279
+ }, _callee6);
250
280
  }))).catch(console.error);
251
281
  }
252
282
  }, {
@@ -265,24 +295,24 @@ export var LibroJupyterModel = (_dec = transient(), _dec2 = prop(), _dec3 = prop
265
295
  }, {
266
296
  key: "interrupt",
267
297
  value: function () {
268
- var _interrupt = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
269
- return _regeneratorRuntime().wrap(function _callee6$(_context6) {
270
- while (1) switch (_context6.prev = _context6.next) {
298
+ var _interrupt = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7() {
299
+ return _regeneratorRuntime().wrap(function _callee7$(_context7) {
300
+ while (1) switch (_context7.prev = _context7.next) {
271
301
  case 0:
272
302
  if (this.kernelConnection) {
273
- _context6.next = 3;
303
+ _context7.next = 3;
274
304
  break;
275
305
  }
276
306
  alert(l10n.t('Kernel Connection 还没有建立'));
277
- return _context6.abrupt("return");
307
+ return _context7.abrupt("return");
278
308
  case 3:
279
- _context6.next = 5;
309
+ _context7.next = 5;
280
310
  return this.kernelConnection.interrupt();
281
311
  case 5:
282
312
  case "end":
283
- return _context6.stop();
313
+ return _context7.stop();
284
314
  }
285
- }, _callee6, this);
315
+ }, _callee7, this);
286
316
  }));
287
317
  function interrupt() {
288
318
  return _interrupt.apply(this, arguments);
@@ -292,26 +322,26 @@ export var LibroJupyterModel = (_dec = transient(), _dec2 = prop(), _dec3 = prop
292
322
  }, {
293
323
  key: "shutdown",
294
324
  value: function () {
295
- var _shutdown = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7() {
296
- return _regeneratorRuntime().wrap(function _callee7$(_context7) {
297
- while (1) switch (_context7.prev = _context7.next) {
325
+ var _shutdown = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8() {
326
+ return _regeneratorRuntime().wrap(function _callee8$(_context8) {
327
+ while (1) switch (_context8.prev = _context8.next) {
298
328
  case 0:
299
329
  if (this.kernelConnection) {
300
- _context7.next = 3;
330
+ _context8.next = 3;
301
331
  break;
302
332
  }
303
333
  alert(l10n.t('Kernel Connection 还没有建立'));
304
- return _context7.abrupt("return");
334
+ return _context8.abrupt("return");
305
335
  case 3:
306
- _context7.next = 5;
336
+ _context8.next = 5;
307
337
  return this.kernelConnectionManager.shutdownKC(this.currentFileContents);
308
338
  case 5:
309
339
  this.kernelConnection = undefined;
310
340
  case 6:
311
341
  case "end":
312
- return _context7.stop();
342
+ return _context8.stop();
313
343
  }
314
- }, _callee7, this);
344
+ }, _callee8, this);
315
345
  }));
316
346
  function shutdown() {
317
347
  return _shutdown.apply(this, arguments);
@@ -321,13 +351,13 @@ export var LibroJupyterModel = (_dec = transient(), _dec2 = prop(), _dec3 = prop
321
351
  }, {
322
352
  key: "restart",
323
353
  value: function () {
324
- var _restart = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8() {
354
+ var _restart = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9() {
325
355
  var _this3 = this;
326
- return _regeneratorRuntime().wrap(function _callee8$(_context8) {
327
- while (1) switch (_context8.prev = _context8.next) {
356
+ return _regeneratorRuntime().wrap(function _callee9$(_context9) {
357
+ while (1) switch (_context9.prev = _context9.next) {
328
358
  case 0:
329
359
  if (!(!this.kernelConnection || this.kernelConnection.isDisposed)) {
330
- _context8.next = 4;
360
+ _context9.next = 4;
331
361
  break;
332
362
  }
333
363
  this.startKernelConnection();
@@ -338,14 +368,14 @@ export var LibroJupyterModel = (_dec = transient(), _dec2 = prop(), _dec3 = prop
338
368
  }
339
369
  return;
340
370
  }).catch(console.error);
341
- return _context8.abrupt("return");
371
+ return _context9.abrupt("return");
342
372
  case 4:
343
373
  this.kernelConnection.restart();
344
374
  case 5:
345
375
  case "end":
346
- return _context8.stop();
376
+ return _context9.stop();
347
377
  }
348
- }, _callee8, this);
378
+ }, _callee9, this);
349
379
  }));
350
380
  function restart() {
351
381
  return _restart.apply(this, arguments);
@@ -355,24 +385,24 @@ export var LibroJupyterModel = (_dec = transient(), _dec2 = prop(), _dec3 = prop
355
385
  }, {
356
386
  key: "reconnect",
357
387
  value: function () {
358
- var _reconnect = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9() {
359
- return _regeneratorRuntime().wrap(function _callee9$(_context9) {
360
- while (1) switch (_context9.prev = _context9.next) {
388
+ var _reconnect = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10() {
389
+ return _regeneratorRuntime().wrap(function _callee10$(_context10) {
390
+ while (1) switch (_context10.prev = _context10.next) {
361
391
  case 0:
362
392
  if (this.kernelConnection) {
363
- _context9.next = 3;
393
+ _context10.next = 3;
364
394
  break;
365
395
  }
366
396
  alert(l10n.t('Kernel Connection 还没有建立'));
367
- return _context9.abrupt("return");
397
+ return _context10.abrupt("return");
368
398
  case 3:
369
- _context9.next = 5;
399
+ _context10.next = 5;
370
400
  return this.kernelConnection.reconnect();
371
401
  case 5:
372
402
  case "end":
373
- return _context9.stop();
403
+ return _context10.stop();
374
404
  }
375
- }, _callee9, this);
405
+ }, _callee10, this);
376
406
  }));
377
407
  function reconnect() {
378
408
  return _reconnect.apply(this, arguments);
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.33",
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.33",
37
+ "@difizen/libro-code-editor": "^0.2.33",
38
+ "@difizen/libro-codemirror": "^0.2.33",
39
+ "@difizen/libro-cofine-editor": "^0.2.33",
40
+ "@difizen/libro-common": "^0.2.33",
41
+ "@difizen/libro-core": "^0.2.33",
42
+ "@difizen/libro-kernel": "^0.2.33",
43
+ "@difizen/libro-l10n": "^0.2.33",
44
+ "@difizen/libro-language-client": "^0.2.33",
45
+ "@difizen/libro-lsp": "^0.2.33",
46
+ "@difizen/libro-markdown-cell": "^0.2.33",
47
+ "@difizen/libro-output": "^0.2.33",
48
+ "@difizen/libro-raw-cell": "^0.2.33",
49
+ "@difizen/libro-rendermime": "^0.2.33",
50
+ "@difizen/libro-search": "^0.2.33",
51
+ "@difizen/libro-search-code-cell": "^0.2.33",
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 async loadNotebookContent(): Promise<INotebookContent> {
152
+ const content = await 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;