@difizen/libro-jupyter 0.2.41 → 0.2.43
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/components/index.less +2 -3
- package/es/index-noeditor.d.ts +34 -0
- package/es/index-noeditor.d.ts.map +1 -0
- package/es/index-noeditor.js +33 -0
- package/es/module-noeditor.d.ts +6 -0
- package/es/module-noeditor.d.ts.map +1 -0
- package/es/module-noeditor.js +54 -0
- package/es/toolbar/run-selector.d.ts.map +1 -1
- package/es/toolbar/run-selector.js +2 -1
- package/es/toolbar/side-toolbar-run-selector.js +1 -1
- package/es/widget/widget-render.d.ts.map +1 -1
- package/es/widget/widget-render.js +20 -13
- package/es/widget/widget-rendermime-contribution.d.ts.map +1 -1
- package/es/widget/widget-rendermime-contribution.js +1 -1
- package/es/widget/widget-view.d.ts.map +1 -1
- package/es/widget/widget-view.js +10 -3
- package/package.json +21 -17
- package/src/components/index.less +2 -3
- package/src/index-noeditor.ts +33 -0
- package/src/module-noeditor.ts +116 -0
- package/src/toolbar/run-selector.tsx +2 -1
- package/src/toolbar/side-toolbar-run-selector.tsx +1 -1
- package/src/widget/widget-render.tsx +27 -12
- package/src/widget/widget-rendermime-contribution.ts +1 -1
- package/src/widget/widget-view.tsx +1 -0
package/es/components/index.less
CHANGED
|
@@ -38,13 +38,12 @@
|
|
|
38
38
|
|
|
39
39
|
.libro-cell-bottom-blank {
|
|
40
40
|
height: 20px;
|
|
41
|
-
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,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";
|
|
@@ -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":";
|
|
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
|
|
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";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"widget-render.d.ts","sourceRoot":"","sources":["../../src/widget/widget-render.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAmB,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"widget-render.d.ts","sourceRoot":"","sources":["../../src/widget/widget-render.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAmB,MAAM,qBAAqB,CAAC;AAU3E,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,cAAc,CAAC;AAsBtB,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC;IAAE,KAAK,EAAE,cAAc,CAAA;CAAE,CAgC5D,CAAC"}
|
|
@@ -1,10 +1,25 @@
|
|
|
1
1
|
import { RenderMimeRegistry } from '@difizen/libro-rendermime';
|
|
2
|
-
import { getOrigin, useInject, ViewInstance, ViewRender } from '@difizen/mana-app';
|
|
2
|
+
import { getOrigin, useInject, useObserve, ViewInstance, ViewRender } from '@difizen/mana-app';
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import "./index.less";
|
|
5
5
|
import { LibroJupyterModel } from "../libro-jupyter-model.js";
|
|
6
6
|
import { LibroWidgetManager } from "./widget-manager.js";
|
|
7
7
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
|
+
var WidgetViewRender = function WidgetViewRender(props) {
|
|
9
|
+
var widgetView = useObserve(props.view);
|
|
10
|
+
if (widgetView.isCommClosed) {
|
|
11
|
+
return null;
|
|
12
|
+
}
|
|
13
|
+
return /*#__PURE__*/_jsx("div", {
|
|
14
|
+
className: "libro-widget-render-container",
|
|
15
|
+
children: /*#__PURE__*/_jsx("div", {
|
|
16
|
+
className: "libro-widget-render",
|
|
17
|
+
children: /*#__PURE__*/_jsx(ViewRender, {
|
|
18
|
+
view: widgetView
|
|
19
|
+
})
|
|
20
|
+
})
|
|
21
|
+
});
|
|
22
|
+
};
|
|
8
23
|
export var WidgetRender = function WidgetRender(props) {
|
|
9
24
|
var model = props.model;
|
|
10
25
|
|
|
@@ -17,23 +32,15 @@ export var WidgetRender = function WidgetRender(props) {
|
|
|
17
32
|
return null;
|
|
18
33
|
}
|
|
19
34
|
var widgets = widgetManager.getOrCreateWidgets(getOrigin(libro.model.kernelConnection));
|
|
35
|
+
var widgetView = undefined;
|
|
20
36
|
var mimeType = defaultRenderMime.preferredMimeType(model);
|
|
21
37
|
if (mimeType) {
|
|
22
38
|
var model_id = JSON.parse(JSON.stringify(model.data[mimeType])).model_id;
|
|
23
39
|
if (model_id) {
|
|
24
|
-
|
|
40
|
+
widgetView = widgets.getModel(model_id);
|
|
25
41
|
widgetView.setCell(getOrigin(output.cell));
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}
|
|
29
|
-
return /*#__PURE__*/_jsx("div", {
|
|
30
|
-
className: "libro-widget-render-container",
|
|
31
|
-
children: /*#__PURE__*/_jsx("div", {
|
|
32
|
-
className: "libro-widget-render",
|
|
33
|
-
children: /*#__PURE__*/_jsx(ViewRender, {
|
|
34
|
-
view: widgetView
|
|
35
|
-
})
|
|
36
|
-
})
|
|
42
|
+
return /*#__PURE__*/_jsx(WidgetViewRender, {
|
|
43
|
+
view: widgetView
|
|
37
44
|
});
|
|
38
45
|
}
|
|
39
46
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"widget-rendermime-contribution.d.ts","sourceRoot":"","sources":["../../src/widget/widget-rendermime-contribution.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AAKnE,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAGzD,qBACa,2BAA4B,YAAW,sBAAsB;IAC5C,kBAAkB,EAAE,kBAAkB,CAAC;IACnE,SAAS,UAAW,cAAc,YAiBhC;IACF,UAAU,SAAoB;IAC9B,IAAI,UAAQ;IACZ,SAAS,WAAgD;IACzD,UAAU,
|
|
1
|
+
{"version":3,"file":"widget-rendermime-contribution.d.ts","sourceRoot":"","sources":["../../src/widget/widget-rendermime-contribution.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AAKnE,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAGzD,qBACa,2BAA4B,YAAW,sBAAsB;IAC5C,kBAAkB,EAAE,kBAAkB,CAAC;IACnE,SAAS,UAAW,cAAc,YAiBhC;IACF,UAAU,SAAoB;IAC9B,IAAI,UAAQ;IACZ,SAAS,WAAgD;IACzD,UAAU,UAAQ;IAClB,MAAM;;OAAgB;CACvB"}
|
|
@@ -40,7 +40,7 @@ export var LibroWidgetMimeContribution = (_dec = singleton({
|
|
|
40
40
|
this.renderType = 'widgetRenderer';
|
|
41
41
|
this.safe = true;
|
|
42
42
|
this.mimeTypes = ['application/vnd.jupyter.widget-view+json'];
|
|
43
|
-
this.allowClear =
|
|
43
|
+
this.allowClear = true;
|
|
44
44
|
this.render = WidgetRender;
|
|
45
45
|
}), (_descriptor = _applyDecoratedDescriptor(_class2.prototype, "libroWidgetManager", [_dec2], {
|
|
46
46
|
configurable: true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"widget-view.d.ts","sourceRoot":"","sources":["../../src/widget/widget-view.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAuB,MAAM,uBAAuB,CAAC;AACxF,OAAO,KAAK,EAAE,QAAQ,EAAE,+BAA+B,EAAE,MAAM,qBAAqB,CAAC;AAErF,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAKL,QAAQ,EAGT,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAMnE,OAAO,KAAK,EACV,IAAI,EACJ,QAAQ,EACR,WAAW,EACX,YAAY,EACZ,UAAU,EACV,gBAAgB,EAChB,WAAW,EACZ,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAEzD,eAAO,MAAM,oBAAoB,0FAIhC,CAAC;AAEF,qBAEa,UAAW,SAAQ,QAAS,YAAW,WAAW;IACpD,IAAI,EAAE,aAAa,CAAwB;IACpD,eAAe,EAAE,eAAe,CAAC;IACjC,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,QAAQ,EAAE,CAAC,GAAG,EAAE,aAAa,CAAC,aAAa,KAAK,OAAO,CAAC;IAEtC,kBAAkB,EAAE,kBAAkB,CAAC;IAGnE,KAAK,EAAE,UAAU,GAAG,WAAW,CAAsB;IAErD,IAAI,CAAC,EAAE,+BAA+B,CAAC;IAEvC,IAAI,OAAO,6DAKV;IAED,kBAAkB,UAAQ;IAE1B,qBAAqB,CAAC,EAAE,UAAU,CAAC;gBAGb,KAAK,EAAE,gBAAgB,EAClB,eAAe,EAAE,eAAe;IAqC3D,OAAO,CAAC,IAAI,EAAE,QAAQ;IAiBtB;;OAEG;IACH,mBAAmB,QAAO,IAAI,CAE5B;IAEF;;OAEG;IACH,UAAU,IAAI,IAAI;IAelB,cAAc,CAAC,GAAG,EAAE,aAAa,CAAC,aAAa;IAoB/C,WAAW,CAAC,IAAI,UAAQ,GAAG,IAAI;IAItB,WAAW;IAiBpB;;OAEG;IACH,aAAa,CAAC,GAAG,EAAE,aAAa,CAAC,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAW5D,gBAAgB,aAEd;IACF;;;;OAIG;IACH,QAAQ,CAAC,KAAK,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,IAAI;IAUhC;;;OAGG;IACH,MAAM,IAAI,MAAM;IAIhB,UAAU,IAAI,MAAM;IAIpB;;OAEG;IACH,IAAI,SACI,SAAS,cACH,UAAU,YACZ,WAAW,EAAE,GAAG,eAAe,EAAE,wBAM3C;IAEF,IAAI,EAAE,YAAY,CAAC;IACX,OAAO,CAAC,EAAE,QAAQ,CAAC;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"widget-view.d.ts","sourceRoot":"","sources":["../../src/widget/widget-view.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAuB,MAAM,uBAAuB,CAAC;AACxF,OAAO,KAAK,EAAE,QAAQ,EAAE,+BAA+B,EAAE,MAAM,qBAAqB,CAAC;AAErF,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAKL,QAAQ,EAGT,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAMnE,OAAO,KAAK,EACV,IAAI,EACJ,QAAQ,EACR,WAAW,EACX,YAAY,EACZ,UAAU,EACV,gBAAgB,EAChB,WAAW,EACZ,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAEzD,eAAO,MAAM,oBAAoB,0FAIhC,CAAC;AAEF,qBAEa,UAAW,SAAQ,QAAS,YAAW,WAAW;IACpD,IAAI,EAAE,aAAa,CAAwB;IACpD,eAAe,EAAE,eAAe,CAAC;IACjC,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,QAAQ,EAAE,CAAC,GAAG,EAAE,aAAa,CAAC,aAAa,KAAK,OAAO,CAAC;IAEtC,kBAAkB,EAAE,kBAAkB,CAAC;IAGnE,KAAK,EAAE,UAAU,GAAG,WAAW,CAAsB;IAErD,IAAI,CAAC,EAAE,+BAA+B,CAAC;IAEvC,IAAI,OAAO,6DAKV;IAED,kBAAkB,UAAQ;IAE1B,qBAAqB,CAAC,EAAE,UAAU,CAAC;gBAGb,KAAK,EAAE,gBAAgB,EAClB,eAAe,EAAE,eAAe;IAqC3D,OAAO,CAAC,IAAI,EAAE,QAAQ;IAiBtB;;OAEG;IACH,mBAAmB,QAAO,IAAI,CAE5B;IAEF;;OAEG;IACH,UAAU,IAAI,IAAI;IAelB,cAAc,CAAC,GAAG,EAAE,aAAa,CAAC,aAAa;IAoB/C,WAAW,CAAC,IAAI,UAAQ,GAAG,IAAI;IAItB,WAAW;IAiBpB;;OAEG;IACH,aAAa,CAAC,GAAG,EAAE,aAAa,CAAC,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAW5D,gBAAgB,aAEd;IACF;;;;OAIG;IACH,QAAQ,CAAC,KAAK,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,IAAI;IAUhC;;;OAGG;IACH,MAAM,IAAI,MAAM;IAIhB,UAAU,IAAI,MAAM;IAIpB;;OAEG;IACH,IAAI,SACI,SAAS,cACH,UAAU,YACZ,WAAW,EAAE,GAAG,eAAe,EAAE,wBAM3C;IAEF,IAAI,EAAE,YAAY,CAAC;IACX,OAAO,CAAC,EAAE,QAAQ,CAAC;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IAEf,YAAY,UAAS;IAErB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B"}
|
package/es/widget/widget-view.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
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
|
-
var _dec, _dec2, _dec3, _dec4, _dec5, _class, _class2, _descriptor, _descriptor2, _descriptor3;
|
|
2
|
+
var _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _class, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4;
|
|
3
3
|
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
4
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
5
5
|
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); } }
|
|
@@ -27,7 +27,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
27
27
|
export var LibroWidgetComponent = /*#__PURE__*/forwardRef(function LibroWidgetComponent() {
|
|
28
28
|
return /*#__PURE__*/_jsx(_Fragment, {});
|
|
29
29
|
});
|
|
30
|
-
export var WidgetView = (_dec = transient(), _dec2 = view('libro-widget-view'), _dec3 = inject(LibroWidgetManager), _dec4 = prop(), _dec5 = prop(), _dec(_class = _dec2(_class = (_class2 = /*#__PURE__*/function (_BaseView) {
|
|
30
|
+
export var WidgetView = (_dec = transient(), _dec2 = view('libro-widget-view'), _dec3 = inject(LibroWidgetManager), _dec4 = prop(), _dec5 = prop(), _dec6 = prop(), _dec(_class = _dec2(_class = (_class2 = /*#__PURE__*/function (_BaseView) {
|
|
31
31
|
_inherits(WidgetView, _BaseView);
|
|
32
32
|
var _super = _createSuper(WidgetView);
|
|
33
33
|
function WidgetView(props, libroContextKey) {
|
|
@@ -69,7 +69,7 @@ export var WidgetView = (_dec = transient(), _dec2 = view('libro-widget-view'),
|
|
|
69
69
|
_this.state_change = void 0;
|
|
70
70
|
_this.name = void 0;
|
|
71
71
|
_this.module = void 0;
|
|
72
|
-
_this
|
|
72
|
+
_initializerDefineProperty(_this, "isCommClosed", _descriptor4, _assertThisInitialized(_this));
|
|
73
73
|
_this.model_module = void 0;
|
|
74
74
|
_this.model_name = void 0;
|
|
75
75
|
_this.model_module_version = void 0;
|
|
@@ -270,4 +270,11 @@ export var WidgetView = (_dec = transient(), _dec2 = view('libro-widget-view'),
|
|
|
270
270
|
enumerable: true,
|
|
271
271
|
writable: true,
|
|
272
272
|
initializer: null
|
|
273
|
+
}), _descriptor4 = _applyDecoratedDescriptor(_class2.prototype, "isCommClosed", [_dec6], {
|
|
274
|
+
configurable: true,
|
|
275
|
+
enumerable: true,
|
|
276
|
+
writable: true,
|
|
277
|
+
initializer: function initializer() {
|
|
278
|
+
return false;
|
|
279
|
+
}
|
|
273
280
|
})), _class2)) || _class) || _class);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@difizen/libro-jupyter",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.43",
|
|
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.
|
|
37
|
-
"@difizen/libro-code-editor": "^0.2.
|
|
38
|
-
"@difizen/libro-codemirror": "^0.2.
|
|
39
|
-
"@difizen/libro-cofine-editor": "^0.2.
|
|
40
|
-
"@difizen/libro-common": "^0.2.
|
|
41
|
-
"@difizen/libro-core": "^0.2.
|
|
42
|
-
"@difizen/libro-kernel": "^0.2.
|
|
43
|
-
"@difizen/libro-l10n": "^0.2.
|
|
44
|
-
"@difizen/libro-language-client": "^0.2.
|
|
45
|
-
"@difizen/libro-lsp": "^0.2.
|
|
46
|
-
"@difizen/libro-markdown-cell": "^0.2.
|
|
47
|
-
"@difizen/libro-output": "^0.2.
|
|
48
|
-
"@difizen/libro-raw-cell": "^0.2.
|
|
49
|
-
"@difizen/libro-rendermime": "^0.2.
|
|
50
|
-
"@difizen/libro-search": "^0.2.
|
|
51
|
-
"@difizen/libro-search-code-cell": "^0.2.
|
|
40
|
+
"@difizen/libro-code-cell": "^0.2.43",
|
|
41
|
+
"@difizen/libro-code-editor": "^0.2.43",
|
|
42
|
+
"@difizen/libro-codemirror": "^0.2.43",
|
|
43
|
+
"@difizen/libro-cofine-editor": "^0.2.43",
|
|
44
|
+
"@difizen/libro-common": "^0.2.43",
|
|
45
|
+
"@difizen/libro-core": "^0.2.43",
|
|
46
|
+
"@difizen/libro-kernel": "^0.2.43",
|
|
47
|
+
"@difizen/libro-l10n": "^0.2.43",
|
|
48
|
+
"@difizen/libro-language-client": "^0.2.43",
|
|
49
|
+
"@difizen/libro-lsp": "^0.2.43",
|
|
50
|
+
"@difizen/libro-markdown-cell": "^0.2.43",
|
|
51
|
+
"@difizen/libro-output": "^0.2.43",
|
|
52
|
+
"@difizen/libro-raw-cell": "^0.2.43",
|
|
53
|
+
"@difizen/libro-rendermime": "^0.2.43",
|
|
54
|
+
"@difizen/libro-search": "^0.2.43",
|
|
55
|
+
"@difizen/libro-search-code-cell": "^0.2.43",
|
|
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-
|
|
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';
|
|
@@ -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
|
|
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 {
|
|
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
|
-
|
|
57
|
+
widgetView = widgets.getModel(model_id);
|
|
34
58
|
widgetView.setCell(getOrigin(output.cell));
|
|
35
|
-
|
|
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 =
|
|
34
|
+
allowClear = true;
|
|
35
35
|
render = WidgetRender;
|
|
36
36
|
}
|