@difizen/libro-jupyter 0.2.40 → 0.2.41-next.1

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.
@@ -37,9 +37,6 @@
37
37
  }
38
38
 
39
39
  .libro-cell-bottom-blank {
40
- height: 20px;
41
- border-top: 1px solid var(--mana-color-border);
42
-
43
40
  > div {
44
41
  margin: 0;
45
42
  }
@@ -0,0 +1,34 @@
1
+ export * from '@difizen/libro-code-cell';
2
+ export * from '@difizen/libro-code-editor';
3
+ export * from '@difizen/libro-common';
4
+ export * from '@difizen/libro-core';
5
+ export * from '@difizen/libro-kernel';
6
+ export * from '@difizen/libro-l10n';
7
+ export * from '@difizen/libro-lsp';
8
+ export * from '@difizen/libro-markdown-cell';
9
+ export * from '@difizen/libro-output';
10
+ export * from '@difizen/libro-raw-cell';
11
+ export * from '@difizen/libro-rendermime';
12
+ export * from '@difizen/libro-search';
13
+ export * from '@difizen/libro-search-code-cell';
14
+ export * from './add-between-cell/index.js';
15
+ export * from './cell/index.js';
16
+ export * from './command/index.js';
17
+ export * from './components/index.js';
18
+ export * from './config/index.js';
19
+ export * from './contents/index.js';
20
+ export * from './keybind-instructions/index.js';
21
+ export * from './libro-jupyter-file-service.js';
22
+ export * from './libro-jupyter-model.js';
23
+ export * from './libro-jupyter-protocol.js';
24
+ export * from './libro-jupyter-server-launch-manager.js';
25
+ export * from './module-noeditor.js';
26
+ export * from './output/index.js';
27
+ export * from './rendermime/index.js';
28
+ export * from './theme/index.js';
29
+ export * from './toolbar/index.js';
30
+ export * from './file/index.js';
31
+ export * from './libro-jupyter-view.js';
32
+ export * from './config/index.js';
33
+ export * from './widget/index.js';
34
+ //# sourceMappingURL=index-noeditor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-noeditor.d.ts","sourceRoot":"","sources":["../src/index-noeditor.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AACxC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uBAAuB,CAAC;AACtC,cAAc,iCAAiC,CAAC;AAChD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,iCAAiC,CAAC;AAChD,cAAc,iCAAiC,CAAC;AAChD,cAAc,0BAA0B,CAAC;AACzC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,0CAA0C,CAAC;AACzD,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,yBAAyB,CAAC;AACxC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC"}
@@ -0,0 +1,33 @@
1
+ export * from '@difizen/libro-code-cell';
2
+ export * from '@difizen/libro-code-editor';
3
+ export * from '@difizen/libro-common';
4
+ export * from '@difizen/libro-core';
5
+ export * from '@difizen/libro-kernel';
6
+ export * from '@difizen/libro-l10n';
7
+ export * from '@difizen/libro-lsp';
8
+ export * from '@difizen/libro-markdown-cell';
9
+ export * from '@difizen/libro-output';
10
+ export * from '@difizen/libro-raw-cell';
11
+ export * from '@difizen/libro-rendermime';
12
+ export * from '@difizen/libro-search';
13
+ export * from '@difizen/libro-search-code-cell';
14
+ export * from "./add-between-cell/index.js";
15
+ export * from "./cell/index.js";
16
+ export * from "./command/index.js";
17
+ export * from "./components/index.js";
18
+ export * from "./config/index.js";
19
+ export * from "./contents/index.js";
20
+ export * from "./keybind-instructions/index.js";
21
+ export * from "./libro-jupyter-file-service.js";
22
+ export * from "./libro-jupyter-model.js";
23
+ export * from "./libro-jupyter-protocol.js";
24
+ export * from "./libro-jupyter-server-launch-manager.js";
25
+ export * from "./module-noeditor.js";
26
+ export * from "./output/index.js";
27
+ export * from "./rendermime/index.js";
28
+ export * from "./theme/index.js";
29
+ export * from "./toolbar/index.js";
30
+ export * from "./file/index.js";
31
+ export * from "./libro-jupyter-view.js";
32
+ export * from "./config/index.js";
33
+ export * from "./widget/index.js";
@@ -1 +1 @@
1
- {"version":3,"file":"libro-jupyter-model.d.ts","sourceRoot":"","sources":["../src/libro-jupyter-model.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,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;IAC7C,SAAS,C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= prop(), _dec3 = prop
371
371
  return _context9.abrupt("return");
372
372
  case 4:
373
373
  this.kernelConnection.restart();
374
- case 5:
374
+ _get(_getPrototypeOf(LibroJupyterModel.prototype), "restart", this).call(this);
375
+ case 6:
375
376
  case "end":
376
377
  return _context9.stop();
377
378
  }
@@ -0,0 +1,6 @@
1
+ import { ManaModule } from '@difizen/mana-app';
2
+ /**
3
+ * 去除editor和lsp依赖的jupyter module,在opensumi场景使用
4
+ */
5
+ export declare const LibroJupyterNoEditorModule: ManaModule;
6
+ //# sourceMappingURL=module-noeditor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"module-noeditor.d.ts","sourceRoot":"","sources":["../src/module-noeditor.ts"],"names":[],"mappings":"AAwBA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAiC/C;;GAEG;AACH,eAAO,MAAM,0BAA0B,YAuDpC,CAAC"}
@@ -0,0 +1,54 @@
1
+ import { CodeCellModule, LibroCodeCellModel, LibroCodeCellView } from '@difizen/libro-code-cell';
2
+ import { CellExecutionTimeProvider, CellOutputBottomBlankProvider, LibroAddCellModule, LibroKeybindRegistry, LibroModel, LibroModule, LibroToolbarModule } from '@difizen/libro-core';
3
+ import { LibroKernelManageModule } from '@difizen/libro-kernel';
4
+ import { MarkdownCellModule } from '@difizen/libro-markdown-cell';
5
+ import { DisplayDataOutputModule, ErrorOutputModule, StreamOutputModule } from '@difizen/libro-output';
6
+ import { RawCellModule } from '@difizen/libro-raw-cell';
7
+ import { LibroSearchModule } from '@difizen/libro-search';
8
+ import { SearchCodeCellModule } from '@difizen/libro-search-code-cell';
9
+ import { ManaModule } from '@difizen/mana-app';
10
+ import { LibroBetweenCellModule } from "./add-between-cell/index.js";
11
+ import { JupyterCodeCellModel, JupyterCodeCellView } from "./cell/index.js";
12
+ import { LibroJupyterCommandContribution, LibroJupyterKeybindingContribution } from "./command/index.js";
13
+ import { CellOutputBottomBlank } from "./components/cell-output-bottom-blank.js";
14
+ import { CellExecutionTip } from "./components/index.js";
15
+ import { ConfigAppContribution, LibroJupyterSettingContribution } from "./config/index.js";
16
+ import { LibroJupyterContentContribution } from "./contents/index.js";
17
+ import { LibroJupyterContentSaveContribution } from "./contents/save-content-contribution.js";
18
+ import { LibroJupyterFileModule } from "./file/index.js";
19
+ import { KeybindInstructionsModule } from "./keybind-instructions/index.js";
20
+ import { LibroJupyterFileService } from "./libro-jupyter-file-service.js";
21
+ import { LibroJupyterModel } from "./libro-jupyter-model.js";
22
+ import { KernelStatusAndSelectorProvider } from "./libro-jupyter-protocol.js";
23
+ import { JupyterServerLaunchManager } from "./libro-jupyter-server-launch-manager.js";
24
+ import { LibroJupyterView } from "./libro-jupyter-view.js";
25
+ import { LibroJupyterOutputArea } from "./output/index.js";
26
+ import { PlotlyModule } from "./rendermime/index.js";
27
+ import { LibroJupyterColorContribution } from "./theme/index.js";
28
+ import { KernelStatusSelector, LibroJupyterToolbarContribution, SaveFileErrorContribution } from "./toolbar/index.js";
29
+ import { WidgetModule } from "./widget/index.js";
30
+
31
+ /**
32
+ * 去除editor和lsp依赖的jupyter module,在opensumi场景使用
33
+ */
34
+ export var LibroJupyterNoEditorModule = ManaModule.create().register(LibroJupyterFileService, LibroJupyterCommandContribution, LibroJupyterKeybindingContribution, LibroJupyterToolbarContribution, ConfigAppContribution, SaveFileErrorContribution, LibroKeybindRegistry, LibroJupyterContentContribution, LibroJupyterContentSaveContribution, LibroJupyterOutputArea, LibroJupyterColorContribution, LibroJupyterSettingContribution, JupyterServerLaunchManager, LibroJupyterView, {
35
+ token: CellExecutionTimeProvider,
36
+ useValue: CellExecutionTip
37
+ }, {
38
+ token: CellOutputBottomBlankProvider,
39
+ useValue: CellOutputBottomBlank
40
+ }, {
41
+ token: KernelStatusAndSelectorProvider,
42
+ useValue: KernelStatusSelector
43
+ }, {
44
+ token: LibroModel,
45
+ useClass: LibroJupyterModel
46
+ }, {
47
+ token: LibroCodeCellModel,
48
+ useClass: JupyterCodeCellModel
49
+ }, {
50
+ token: LibroCodeCellView,
51
+ useClass: JupyterCodeCellView
52
+ }).dependOn(LibroModule, CodeCellModule, MarkdownCellModule, RawCellModule, StreamOutputModule, ErrorOutputModule, DisplayDataOutputModule, LibroToolbarModule, LibroKernelManageModule, LibroSearchModule, SearchCodeCellModule, LibroAddCellModule,
53
+ // custom module
54
+ LibroBetweenCellModule, KeybindInstructionsModule, PlotlyModule, LibroJupyterFileModule, WidgetModule);
@@ -1 +1 @@
1
- {"version":3,"file":"run-selector.d.ts","sourceRoot":"","sources":["../../src/toolbar/run-selector.tsx"],"names":[],"mappings":";AAqBA,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAiH/B,CAAC"}
1
+ {"version":3,"file":"run-selector.d.ts","sourceRoot":"","sources":["../../src/toolbar/run-selector.tsx"],"names":[],"mappings":";AAsBA,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAiH/B,CAAC"}
@@ -10,11 +10,12 @@ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" !=
10
10
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
11
11
  import { PlayCircleOutlined } from '@ant-design/icons';
12
12
  import { NotebookCommands, ExecutableCellModel } from '@difizen/libro-core';
13
+ import { ServerManager } from '@difizen/libro-kernel';
13
14
  import { useInject, ToolbarInstance, getOrigin, CommandRegistry, ViewInstance, ConfigurationService } from '@difizen/mana-app';
14
15
  import { l10n } from '@difizen/mana-l10n';
15
16
  import { Menu, Dropdown, Tooltip } from 'antd';
16
17
  import { useEffect, useState } from 'react';
17
- import { LibroJupyterConfiguration, ServerManager } from "../index.js";
18
+ import { LibroJupyterConfiguration } from "../config/config.js";
18
19
  import { kernelPrepared } from "../utils/index.js";
19
20
  import { jsx as _jsx } from "react/jsx-runtime";
20
21
  import { Fragment as _Fragment } from "react/jsx-runtime";
@@ -11,7 +11,7 @@ import { ConfigurationService, useInject, ViewInstance } from '@difizen/mana-app
11
11
  import { l10n } from '@difizen/mana-l10n';
12
12
  import { Popover, Tooltip } from 'antd';
13
13
  import { useEffect, useState } from 'react';
14
- import { LibroJupyterConfiguration } from "../index.js";
14
+ import { LibroJupyterConfiguration } from "../config/index.js";
15
15
  import { kernelPrepared } from "../utils/index.js";
16
16
  import { jsx as _jsx } from "react/jsx-runtime";
17
17
  import { Fragment as _Fragment } from "react/jsx-runtime";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@difizen/libro-jupyter",
3
- "version": "0.2.40",
3
+ "version": "0.2.41-next.1",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "libro"
@@ -13,6 +13,10 @@
13
13
  "typings": "./es/index.d.ts",
14
14
  "default": "./es/index.js"
15
15
  },
16
+ "./noeditor": {
17
+ "typings": "./es/index-noeditor.d.ts",
18
+ "default": "./es/index-noeditor.js"
19
+ },
16
20
  "./mock": {
17
21
  "typings": "./es/mock/index.d.ts",
18
22
  "default": "./es/mock/index.js"
@@ -33,22 +37,22 @@
33
37
  "dependencies": {
34
38
  "@ant-design/colors": "^7.0.0",
35
39
  "@ant-design/icons": "^5.1.0",
36
- "@difizen/libro-code-cell": "^0.2.40",
37
- "@difizen/libro-code-editor": "^0.2.40",
38
- "@difizen/libro-codemirror": "^0.2.40",
39
- "@difizen/libro-cofine-editor": "^0.2.40",
40
- "@difizen/libro-common": "^0.2.40",
41
- "@difizen/libro-core": "^0.2.40",
42
- "@difizen/libro-kernel": "^0.2.40",
43
- "@difizen/libro-l10n": "^0.2.40",
44
- "@difizen/libro-language-client": "^0.2.40",
45
- "@difizen/libro-lsp": "^0.2.40",
46
- "@difizen/libro-markdown-cell": "^0.2.40",
47
- "@difizen/libro-output": "^0.2.40",
48
- "@difizen/libro-raw-cell": "^0.2.40",
49
- "@difizen/libro-rendermime": "^0.2.40",
50
- "@difizen/libro-search": "^0.2.40",
51
- "@difizen/libro-search-code-cell": "^0.2.40",
40
+ "@difizen/libro-code-cell": "^0.2.41-next.1",
41
+ "@difizen/libro-code-editor": "^0.2.41-next.1",
42
+ "@difizen/libro-codemirror": "^0.2.41-next.1",
43
+ "@difizen/libro-cofine-editor": "^0.2.41-next.1",
44
+ "@difizen/libro-common": "^0.2.41-next.1",
45
+ "@difizen/libro-core": "^0.2.41-next.1",
46
+ "@difizen/libro-kernel": "^0.2.41-next.1",
47
+ "@difizen/libro-l10n": "^0.2.41-next.1",
48
+ "@difizen/libro-language-client": "^0.2.41-next.1",
49
+ "@difizen/libro-lsp": "^0.2.41-next.1",
50
+ "@difizen/libro-markdown-cell": "^0.2.41-next.1",
51
+ "@difizen/libro-output": "^0.2.41-next.1",
52
+ "@difizen/libro-raw-cell": "^0.2.41-next.1",
53
+ "@difizen/libro-rendermime": "^0.2.41-next.1",
54
+ "@difizen/libro-search": "^0.2.41-next.1",
55
+ "@difizen/libro-search-code-cell": "^0.2.41-next.1",
52
56
  "@difizen/mana-app": "latest",
53
57
  "@difizen/mana-l10n": "latest",
54
58
  "classnames": "^2.3.2",
@@ -38,13 +38,12 @@
38
38
 
39
39
  .libro-cell-bottom-blank {
40
40
  height: 20px;
41
- border-top: 1px solid var(--mana-color-border);
41
+ border-radius: 4px;
42
+ background: var(--mana-libro-output-background);
42
43
 
43
44
  > div {
44
45
  margin: 0;
45
46
  }
46
-
47
- background: var(--mana-libro-output-background);
48
47
  }
49
48
 
50
49
  .libro-cell-execution-tip-hide-output {
@@ -0,0 +1,33 @@
1
+ export * from '@difizen/libro-code-cell';
2
+ export * from '@difizen/libro-code-editor';
3
+ export * from '@difizen/libro-common';
4
+ export * from '@difizen/libro-core';
5
+ export * from '@difizen/libro-kernel';
6
+ export * from '@difizen/libro-l10n';
7
+ export * from '@difizen/libro-lsp';
8
+ export * from '@difizen/libro-markdown-cell';
9
+ export * from '@difizen/libro-output';
10
+ export * from '@difizen/libro-raw-cell';
11
+ export * from '@difizen/libro-rendermime';
12
+ export * from '@difizen/libro-search';
13
+ export * from '@difizen/libro-search-code-cell';
14
+ export * from './add-between-cell/index.js';
15
+ export * from './cell/index.js';
16
+ export * from './command/index.js';
17
+ export * from './components/index.js';
18
+ export * from './config/index.js';
19
+ export * from './contents/index.js';
20
+ export * from './keybind-instructions/index.js';
21
+ export * from './libro-jupyter-file-service.js';
22
+ export * from './libro-jupyter-model.js';
23
+ export * from './libro-jupyter-protocol.js';
24
+ export * from './libro-jupyter-server-launch-manager.js';
25
+ export * from './module-noeditor.js';
26
+ export * from './output/index.js';
27
+ export * from './rendermime/index.js';
28
+ export * from './theme/index.js';
29
+ export * from './toolbar/index.js';
30
+ export * from './file/index.js';
31
+ export * from './libro-jupyter-view.js';
32
+ export * from './config/index.js';
33
+ export * from './widget/index.js';
@@ -216,7 +216,7 @@ export class LibroJupyterModel extends LibroModel implements ExecutableNotebookM
216
216
  this.kernelConnection = undefined;
217
217
  }
218
218
 
219
- async restart() {
219
+ override async restart() {
220
220
  if (!this.kernelConnection || this.kernelConnection.isDisposed) {
221
221
  this.startKernelConnection();
222
222
  getOrigin(this.kcReady)
@@ -232,6 +232,7 @@ export class LibroJupyterModel extends LibroModel implements ExecutableNotebookM
232
232
  }
233
233
 
234
234
  this.kernelConnection.restart();
235
+ super.restart();
235
236
  }
236
237
 
237
238
  async reconnect() {
@@ -0,0 +1,116 @@
1
+ import {
2
+ CodeCellModule,
3
+ LibroCodeCellModel,
4
+ LibroCodeCellView,
5
+ } from '@difizen/libro-code-cell';
6
+ import {
7
+ CellExecutionTimeProvider,
8
+ CellOutputBottomBlankProvider,
9
+ LibroAddCellModule,
10
+ LibroKeybindRegistry,
11
+ LibroModel,
12
+ LibroModule,
13
+ LibroToolbarModule,
14
+ } from '@difizen/libro-core';
15
+ import { LibroKernelManageModule } from '@difizen/libro-kernel';
16
+ import { MarkdownCellModule } from '@difizen/libro-markdown-cell';
17
+ import {
18
+ DisplayDataOutputModule,
19
+ ErrorOutputModule,
20
+ StreamOutputModule,
21
+ } from '@difizen/libro-output';
22
+ import { RawCellModule } from '@difizen/libro-raw-cell';
23
+ import { LibroSearchModule } from '@difizen/libro-search';
24
+ import { SearchCodeCellModule } from '@difizen/libro-search-code-cell';
25
+ import { ManaModule } from '@difizen/mana-app';
26
+
27
+ import { LibroBetweenCellModule } from './add-between-cell/index.js';
28
+ import { JupyterCodeCellModel, JupyterCodeCellView } from './cell/index.js';
29
+ import {
30
+ LibroJupyterCommandContribution,
31
+ LibroJupyterKeybindingContribution,
32
+ } from './command/index.js';
33
+ import { CellOutputBottomBlank } from './components/cell-output-bottom-blank.js';
34
+ import { CellExecutionTip } from './components/index.js';
35
+ import {
36
+ ConfigAppContribution,
37
+ LibroJupyterSettingContribution,
38
+ } from './config/index.js';
39
+ import { LibroJupyterContentContribution } from './contents/index.js';
40
+ import { LibroJupyterContentSaveContribution } from './contents/save-content-contribution.js';
41
+ import { LibroJupyterFileModule } from './file/index.js';
42
+ import { KeybindInstructionsModule } from './keybind-instructions/index.js';
43
+ import { LibroJupyterFileService } from './libro-jupyter-file-service.js';
44
+ import { LibroJupyterModel } from './libro-jupyter-model.js';
45
+ import { KernelStatusAndSelectorProvider } from './libro-jupyter-protocol.js';
46
+ import { JupyterServerLaunchManager } from './libro-jupyter-server-launch-manager.js';
47
+ import { LibroJupyterView } from './libro-jupyter-view.js';
48
+ import { LibroJupyterOutputArea } from './output/index.js';
49
+ import { PlotlyModule } from './rendermime/index.js';
50
+ import { LibroJupyterColorContribution } from './theme/index.js';
51
+ import {
52
+ KernelStatusSelector,
53
+ LibroJupyterToolbarContribution,
54
+ SaveFileErrorContribution,
55
+ } from './toolbar/index.js';
56
+ import { WidgetModule } from './widget/index.js';
57
+
58
+ /**
59
+ * 去除editor和lsp依赖的jupyter module,在opensumi场景使用
60
+ */
61
+ export const LibroJupyterNoEditorModule = ManaModule.create()
62
+ .register(
63
+ LibroJupyterFileService,
64
+ LibroJupyterCommandContribution,
65
+ LibroJupyterKeybindingContribution,
66
+ LibroJupyterToolbarContribution,
67
+ ConfigAppContribution,
68
+ SaveFileErrorContribution,
69
+ LibroKeybindRegistry,
70
+ LibroJupyterContentContribution,
71
+ LibroJupyterContentSaveContribution,
72
+ LibroJupyterOutputArea,
73
+ LibroJupyterColorContribution,
74
+ LibroJupyterSettingContribution,
75
+ JupyterServerLaunchManager,
76
+ LibroJupyterView,
77
+ {
78
+ token: CellExecutionTimeProvider,
79
+ useValue: CellExecutionTip,
80
+ },
81
+ {
82
+ token: CellOutputBottomBlankProvider,
83
+ useValue: CellOutputBottomBlank,
84
+ },
85
+ {
86
+ token: KernelStatusAndSelectorProvider,
87
+ useValue: KernelStatusSelector,
88
+ },
89
+ {
90
+ token: LibroModel,
91
+ useClass: LibroJupyterModel,
92
+ },
93
+ { token: LibroCodeCellModel, useClass: JupyterCodeCellModel },
94
+ { token: LibroCodeCellView, useClass: JupyterCodeCellView },
95
+ )
96
+ .dependOn(
97
+ LibroModule,
98
+ CodeCellModule,
99
+ MarkdownCellModule,
100
+ RawCellModule,
101
+ StreamOutputModule,
102
+ ErrorOutputModule,
103
+ DisplayDataOutputModule,
104
+ LibroToolbarModule,
105
+ LibroKernelManageModule,
106
+ LibroSearchModule,
107
+ SearchCodeCellModule,
108
+ LibroAddCellModule,
109
+
110
+ // custom module
111
+ LibroBetweenCellModule,
112
+ KeybindInstructionsModule,
113
+ PlotlyModule,
114
+ LibroJupyterFileModule,
115
+ WidgetModule,
116
+ );
@@ -1,6 +1,7 @@
1
1
  import { PlayCircleOutlined } from '@ant-design/icons';
2
2
  import type { LibroToolbarArags, LibroView } from '@difizen/libro-core';
3
3
  import { NotebookCommands, ExecutableCellModel } from '@difizen/libro-core';
4
+ import { ServerManager } from '@difizen/libro-kernel';
4
5
  import {
5
6
  useInject,
6
7
  ToolbarInstance,
@@ -15,7 +16,7 @@ import { Menu, Dropdown, Tooltip } from 'antd';
15
16
  import type { MenuProps } from 'antd';
16
17
  import { useEffect, useState } from 'react';
17
18
 
18
- import { LibroJupyterConfiguration, ServerManager } from '../index.js';
19
+ import { LibroJupyterConfiguration } from '../config/config.js';
19
20
  import type { LibroJupyterModel } from '../libro-jupyter-model.js';
20
21
  import { kernelPrepared } from '../utils/index.js';
21
22
 
@@ -7,7 +7,7 @@ import { l10n } from '@difizen/mana-l10n';
7
7
  import { Popover, Tooltip } from 'antd';
8
8
  import { useEffect, useState } from 'react';
9
9
 
10
- import { LibroJupyterConfiguration } from '../index.js';
10
+ import { LibroJupyterConfiguration } from '../config/index.js';
11
11
  import type { LibroJupyterModel } from '../libro-jupyter-model.js';
12
12
  import { kernelPrepared } from '../utils/index.js';
13
13
 
@@ -1,13 +1,36 @@
1
1
  import type { BaseOutputView, LibroOutputView } from '@difizen/libro-core';
2
2
  import { RenderMimeRegistry } from '@difizen/libro-rendermime';
3
3
  import type { IRenderMimeRegistry } from '@difizen/libro-rendermime';
4
- import { getOrigin, useInject, ViewInstance, ViewRender } from '@difizen/mana-app';
4
+ import {
5
+ getOrigin,
6
+ useInject,
7
+ useObserve,
8
+ ViewInstance,
9
+ ViewRender,
10
+ } from '@difizen/mana-app';
5
11
  import React from 'react';
6
12
 
7
13
  import './index.less';
8
14
  import { LibroJupyterModel } from '../libro-jupyter-model.js';
9
15
 
10
16
  import { LibroWidgetManager } from './widget-manager.js';
17
+ import type { WidgetView } from './widget-view.js';
18
+
19
+ const WidgetViewRender: React.FC<{ view: WidgetView }> = (props: {
20
+ view: WidgetView;
21
+ }) => {
22
+ const widgetView = useObserve(props.view);
23
+ if (widgetView.isCommClosed) {
24
+ return null;
25
+ }
26
+ return (
27
+ <div className="libro-widget-render-container">
28
+ <div className="libro-widget-render">
29
+ <ViewRender view={widgetView} />
30
+ </div>
31
+ </div>
32
+ );
33
+ };
11
34
 
12
35
  export const WidgetRender: React.FC<{ model: BaseOutputView }> = (props: {
13
36
  model: BaseOutputView;
@@ -26,22 +49,14 @@ export const WidgetRender: React.FC<{ model: BaseOutputView }> = (props: {
26
49
  const widgets = widgetManager.getOrCreateWidgets(
27
50
  getOrigin(libro.model.kernelConnection),
28
51
  );
52
+ let widgetView = undefined;
29
53
  const mimeType = defaultRenderMime.preferredMimeType(model);
30
54
  if (mimeType) {
31
55
  const model_id = JSON.parse(JSON.stringify(model.data[mimeType])).model_id;
32
56
  if (model_id) {
33
- const widgetView = widgets.getModel(model_id);
57
+ widgetView = widgets.getModel(model_id);
34
58
  widgetView.setCell(getOrigin(output.cell));
35
- if (widgetView.isCommClosed) {
36
- return null;
37
- }
38
- return (
39
- <div className="libro-widget-render-container">
40
- <div className="libro-widget-render">
41
- <ViewRender view={widgetView} />
42
- </div>
43
- </div>
44
- );
59
+ return <WidgetViewRender view={widgetView} />;
45
60
  }
46
61
  }
47
62
  return (
@@ -31,6 +31,6 @@ export class LibroWidgetMimeContribution implements RenderMimeContribution {
31
31
  renderType = 'widgetRenderer';
32
32
  safe = true;
33
33
  mimeTypes = ['application/vnd.jupyter.widget-view+json'];
34
- allowClear = false;
34
+ allowClear = true;
35
35
  render = WidgetRender;
36
36
  }
@@ -247,6 +247,7 @@ export class WidgetView extends BaseView implements IWidgetView {
247
247
  state_change: Promise<any>;
248
248
  name: string;
249
249
  module: string;
250
+ @prop()
250
251
  isCommClosed = false;
251
252
 
252
253
  model_module: string;