@difizen/libro-jupyter 0.1.33 → 0.1.34
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/cell/jupyter-code-cell-view.d.ts +3 -1
- package/es/cell/jupyter-code-cell-view.d.ts.map +1 -1
- package/es/cell/jupyter-code-cell-view.js +9 -0
- package/es/index.d.ts +1 -0
- package/es/index.d.ts.map +1 -1
- package/es/index.js +2 -1
- package/es/module.d.ts.map +1 -1
- package/es/module.js +2 -3
- package/es/output/libro-jupyter-outputarea.d.ts.map +1 -1
- package/es/output/libro-jupyter-outputarea.js +60 -56
- package/es/widget/box/contribution.d.ts +10 -0
- package/es/widget/box/contribution.d.ts.map +1 -0
- package/es/widget/box/contribution.js +48 -0
- package/es/widget/box/index.d.ts +3 -0
- package/es/widget/box/index.d.ts.map +1 -0
- package/es/widget/box/index.js +2 -0
- package/es/widget/box/index.less +3 -0
- package/es/widget/box/view.d.ts +19 -0
- package/es/widget/box/view.d.ts.map +1 -0
- package/es/widget/box/view.js +114 -0
- package/es/widget/comm.d.ts +65 -0
- package/es/widget/comm.d.ts.map +1 -0
- package/es/widget/comm.js +153 -0
- package/es/widget/index.d.ts +7 -0
- package/es/widget/index.d.ts.map +1 -1
- package/es/widget/index.js +8 -1
- package/es/widget/instance-progress/contribution.d.ts +10 -0
- package/es/widget/instance-progress/contribution.d.ts.map +1 -0
- package/es/widget/instance-progress/contribution.js +39 -0
- package/es/widget/instance-progress/index.d.ts +3 -0
- package/es/widget/instance-progress/index.d.ts.map +1 -0
- package/es/widget/instance-progress/index.js +2 -0
- package/es/widget/instance-progress/view.d.ts +30 -0
- package/es/widget/instance-progress/view.d.ts.map +1 -0
- package/es/widget/instance-progress/view.js +180 -0
- package/es/widget/libro-widgets.d.ts +84 -0
- package/es/widget/libro-widgets.d.ts.map +1 -0
- package/es/widget/libro-widgets.js +307 -0
- package/es/widget/module.d.ts +4 -0
- package/es/widget/module.d.ts.map +1 -0
- package/es/widget/module.js +38 -0
- package/es/widget/progress/contribution.d.ts +10 -0
- package/es/widget/progress/contribution.d.ts.map +1 -0
- package/es/widget/progress/contribution.js +39 -0
- package/es/widget/progress/index.d.ts +3 -0
- package/es/widget/progress/index.d.ts.map +1 -0
- package/es/widget/progress/index.js +2 -0
- package/es/widget/progress/progressBar.d.ts +15 -0
- package/es/widget/progress/progressBar.d.ts.map +1 -0
- package/es/widget/progress/progressBar.js +20 -0
- package/es/widget/progress/view.d.ts +19 -0
- package/es/widget/progress/view.d.ts.map +1 -0
- package/es/widget/progress/view.js +74 -0
- package/es/widget/protocol.d.ts +193 -0
- package/es/widget/protocol.d.ts.map +1 -0
- package/es/widget/protocol.js +33 -0
- package/es/widget/utils.d.ts +27 -0
- package/es/widget/utils.d.ts.map +1 -0
- package/es/widget/utils.js +59 -0
- package/es/widget/version.d.ts +3 -0
- package/es/widget/version.d.ts.map +1 -0
- package/es/widget/version.js +2 -0
- package/es/widget/widget-manager.d.ts +19 -0
- package/es/widget/widget-manager.d.ts.map +1 -0
- package/es/widget/widget-manager.js +77 -0
- package/es/widget/widget-render.d.ts.map +1 -1
- package/es/widget/widget-render.js +7 -3
- package/es/widget/widget-rendermime-contribution.d.ts +2 -1
- package/es/widget/widget-rendermime-contribution.d.ts.map +1 -1
- package/es/widget/widget-rendermime-contribution.js +2 -1
- package/es/widget/widget-view-contribution.d.ts +10 -0
- package/es/widget/widget-view-contribution.d.ts.map +1 -0
- package/es/widget/widget-view-contribution.js +36 -0
- package/es/widget/widget-view.d.ts +71 -0
- package/es/widget/widget-view.d.ts.map +1 -0
- package/es/widget/widget-view.js +273 -0
- package/package.json +17 -18
- package/src/cell/jupyter-code-cell-view.tsx +10 -1
- package/src/index.ts +1 -0
- package/src/module.ts +1 -3
- package/src/output/libro-jupyter-outputarea.tsx +56 -49
- package/src/widget/box/contribution.ts +29 -0
- package/src/widget/box/index.less +3 -0
- package/src/widget/box/index.ts +2 -0
- package/src/widget/box/view.tsx +112 -0
- package/src/widget/comm.ts +152 -0
- package/src/widget/index.ts +7 -0
- package/src/widget/instance-progress/contribution.ts +20 -0
- package/src/widget/instance-progress/index.ts +2 -0
- package/src/widget/instance-progress/view.tsx +155 -0
- package/src/widget/libro-widgets.ts +223 -0
- package/src/widget/module.ts +73 -0
- package/src/widget/progress/contribution.ts +24 -0
- package/src/widget/progress/index.ts +2 -0
- package/src/widget/progress/progressBar.tsx +29 -0
- package/src/widget/progress/view.tsx +70 -0
- package/src/widget/protocol.ts +255 -0
- package/src/widget/utils.ts +67 -0
- package/src/widget/version.ts +2 -0
- package/src/widget/widget-manager.ts +45 -0
- package/src/widget/widget-render.tsx +10 -5
- package/src/widget/widget-rendermime-contribution.ts +2 -1
- package/src/widget/widget-view-contribution.ts +14 -0
- package/src/widget/widget-view.tsx +259 -0
|
@@ -4,7 +4,9 @@ import type { CodeEditorViewOptions, CompletionProvider, TooltipProvider } from
|
|
|
4
4
|
import type { LibroJupyterView } from '../libro-jupyter-view.js';
|
|
5
5
|
import type { JupyterCodeCellModel } from './jupyter-code-cell-model.js';
|
|
6
6
|
export declare class JupyterCodeCellView extends LibroCodeCellView {
|
|
7
|
-
|
|
7
|
+
protected _parent: LibroJupyterView;
|
|
8
|
+
get parent(): LibroJupyterView;
|
|
9
|
+
set parent(value: LibroJupyterView);
|
|
8
10
|
view: import("react").ForwardRefExoticComponent<import("react").RefAttributes<HTMLDivElement>>;
|
|
9
11
|
model: JupyterCodeCellModel;
|
|
10
12
|
clearExecution: () => void;
|
|
@@ -1 +1 @@
|
|
|
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,KAAK,EACV,qBAAqB,EACrB,kBAAkB,EAElB,eAAe,EAEhB,MAAM,4BAA4B,CAAC;AAWpC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAEjE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAkBzE,qBAEa,mBAAoB,SAAQ,iBAAiB;
|
|
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,KAAK,EACV,qBAAqB,EACrB,kBAAkB,EAElB,eAAe,EAEhB,MAAM,4BAA4B,CAAC;AAWpC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAEjE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAkBzE,qBAEa,mBAAoB,SAAQ,iBAAiB;IACxD,UAAkB,OAAO,EAAE,gBAAgB,CAAC;IAE5C,IAAa,MAAM,IAGQ,gBAAgB,CAD1C;IACD,IAAa,MAAM,CAAC,KAAK,EAAE,gBAAgB,EAG1C;IAEQ,IAAI,2FAA4B;IACjC,KAAK,EAAE,oBAAoB,CAAC;IAE3B,cAAc,aAQrB;cAEiB,eAAe,IAAI,qBAAqB;IAe3D,eAAe,EAAE,eAAe,CAqB9B;IAEF,kBAAkB,EAAE,kBAAkB,CA8BpC;IAEa,GAAG;CA8EnB"}
|
|
@@ -153,6 +153,15 @@ export var JupyterCodeCellView = (_dec = transient(), _dec2 = view('jupyter-code
|
|
|
153
153
|
return _this;
|
|
154
154
|
}
|
|
155
155
|
_createClass(JupyterCodeCellView, [{
|
|
156
|
+
key: "parent",
|
|
157
|
+
get: function get() {
|
|
158
|
+
return this._parent;
|
|
159
|
+
},
|
|
160
|
+
set: function set(value) {
|
|
161
|
+
this._parent = value;
|
|
162
|
+
this.parentDefer.resolve(this.parent);
|
|
163
|
+
}
|
|
164
|
+
}, {
|
|
156
165
|
key: "getEditorOption",
|
|
157
166
|
value: function getEditorOption() {
|
|
158
167
|
var options = _get(_getPrototypeOf(JupyterCodeCellView.prototype), "getEditorOption", this).call(this);
|
package/es/index.d.ts
CHANGED
package/es/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,8BAA8B,CAAC;AAC7C,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,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,aAAa,CAAC;AAC5B,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"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,8BAA8B,CAAC;AAC7C,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,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,aAAa,CAAC;AAC5B,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"}
|
package/es/index.js
CHANGED
package/es/module.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../src/module.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../src/module.ts"],"names":[],"mappings":"AA2BA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAiC/C,eAAO,MAAM,kBAAkB,YA0D5B,CAAC"}
|
package/es/module.js
CHANGED
|
@@ -9,7 +9,6 @@ import { DisplayDataOutputModule, ErrorOutputModule, StreamOutputModule } from '
|
|
|
9
9
|
import { RawCellModule } from '@difizen/libro-raw-cell';
|
|
10
10
|
import { LibroSearchModule } from '@difizen/libro-search';
|
|
11
11
|
import { SearchCodeCellModule } from '@difizen/libro-search-code-cell';
|
|
12
|
-
import { WidgetModule } from '@difizen/libro-widget';
|
|
13
12
|
import { ManaModule } from '@difizen/mana-app';
|
|
14
13
|
import { LibroBetweenCellModule } from "./add-between-cell/index.js";
|
|
15
14
|
import { JupyterCodeCellModel, JupyterCodeCellView } from "./cell/index.js";
|
|
@@ -30,8 +29,8 @@ import { LibroJupyterOutputArea } from "./output/index.js";
|
|
|
30
29
|
import { PlotlyModule } from "./rendermime/index.js";
|
|
31
30
|
import { LibroJupyterColorContribution } from "./theme/index.js";
|
|
32
31
|
import { KernelStatusSelector, LibroJupyterToolbarContribution, SaveFileErrorContribution } from "./toolbar/index.js";
|
|
33
|
-
import {
|
|
34
|
-
export var LibroJupyterModule = ManaModule.create().register(JupyterWorkspaceService, LibroJupyterFileService, LibroJupyterCommandContribution, LibroJupyterKeybindingContribution, LibroJupyterToolbarContribution, ConfigAppContribution, SaveFileErrorContribution, LibroKeybindRegistry, LibroJupyterContentContribution, LibroJupyterContentSaveContribution, LibroJupyterOutputArea, LibroJupyterColorContribution, LibroJupyterSettingContribution, JupyterServerLaunchManager, LibroJupyterView,
|
|
32
|
+
import { WidgetModule } from "./widget/index.js";
|
|
33
|
+
export var LibroJupyterModule = ManaModule.create().register(JupyterWorkspaceService, LibroJupyterFileService, LibroJupyterCommandContribution, LibroJupyterKeybindingContribution, LibroJupyterToolbarContribution, ConfigAppContribution, SaveFileErrorContribution, LibroKeybindRegistry, LibroJupyterContentContribution, LibroJupyterContentSaveContribution, LibroJupyterOutputArea, LibroJupyterColorContribution, LibroJupyterSettingContribution, JupyterServerLaunchManager, LibroJupyterView, {
|
|
35
34
|
token: CellExecutionTimeProvider,
|
|
36
35
|
useValue: CellExecutionTip
|
|
37
36
|
}, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"libro-jupyter-outputarea.d.ts","sourceRoot":"","sources":["../../src/output/libro-jupyter-outputarea.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,uBAAuB,EAEvB,iBAAiB,EAClB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"libro-jupyter-outputarea.d.ts","sourceRoot":"","sources":["../../src/output/libro-jupyter-outputarea.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,uBAAuB,EAEvB,iBAAiB,EAClB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAatD,qBAEa,sBAAuB,SAAQ,eAAe;IACjD,IAAI,EAAE,uBAAuB,CAAC;IACtC,SAAS,CAAC,YAAY,wBAA+B;gBAErB,MAAM,EAAE,iBAAiB;IAKzD,SAAS;IAgEA,OAAO,IAAI,IAAI;IAKf,KAAK,CAAC,IAAI,CAAC,EAAE,OAAO,GAAG,SAAS,GAAG,IAAI;CAMjD"}
|
|
@@ -21,7 +21,7 @@ function _assertThisInitialized(self) { if (self === void 0) { throw new Referen
|
|
|
21
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; } }
|
|
22
22
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
23
23
|
import { LibroOutputArea } from '@difizen/libro-core';
|
|
24
|
-
import { isDisplayDataMsg, isErrorMsg, isExecuteReplyMsg, isExecuteResultMsg, isStreamMsg, isUpdateDisplayDataMsg } from '@difizen/libro-kernel';
|
|
24
|
+
import { isClearOutputMsg, isDisplayDataMsg, isErrorMsg, isExecuteInputMsg, isExecuteReplyMsg, isExecuteResultMsg, isStreamMsg, isUpdateDisplayDataMsg } from '@difizen/libro-kernel';
|
|
25
25
|
import { inject, transient, view, ViewOption } from '@difizen/mana-app';
|
|
26
26
|
export var LibroJupyterOutputArea = (_dec = transient(), _dec2 = view('libro-output-area'), _dec(_class = _dec2(_class = /*#__PURE__*/function (_LibroOutputArea) {
|
|
27
27
|
_inherits(LibroJupyterOutputArea, _LibroOutputArea);
|
|
@@ -43,65 +43,67 @@ export var LibroJupyterOutputArea = (_dec = transient(), _dec2 = view('libro-out
|
|
|
43
43
|
cellModel.msgChangeEmitter.event(function (msg) {
|
|
44
44
|
var transientMsg = msg.content.transient || {};
|
|
45
45
|
var displayId = transientMsg['display_id'];
|
|
46
|
-
if (msg
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
_this2.set(index, _output);
|
|
68
|
-
}
|
|
69
|
-
} catch (err) {
|
|
70
|
-
_iterator.e(err);
|
|
71
|
-
} finally {
|
|
72
|
-
_iterator.f();
|
|
46
|
+
if (isExecuteInputMsg(msg)) {
|
|
47
|
+
cellModel.executeCount = msg.content.execution_count;
|
|
48
|
+
}
|
|
49
|
+
if (isDisplayDataMsg(msg) || isStreamMsg(msg) || isErrorMsg(msg) || isExecuteResultMsg(msg)) {
|
|
50
|
+
var output = _objectSpread(_objectSpread({}, msg.content), {}, {
|
|
51
|
+
output_type: msg.header.msg_type
|
|
52
|
+
});
|
|
53
|
+
_this2.add(output);
|
|
54
|
+
}
|
|
55
|
+
if (isUpdateDisplayDataMsg(msg)) {
|
|
56
|
+
var _output = _objectSpread(_objectSpread({}, msg.content), {}, {
|
|
57
|
+
output_type: 'display_data'
|
|
58
|
+
});
|
|
59
|
+
var targets = _this2.displayIdMap.get(displayId);
|
|
60
|
+
if (targets) {
|
|
61
|
+
var _iterator = _createForOfIteratorHelper(targets),
|
|
62
|
+
_step;
|
|
63
|
+
try {
|
|
64
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
65
|
+
var index = _step.value;
|
|
66
|
+
_this2.set(index, _output);
|
|
73
67
|
}
|
|
68
|
+
} catch (err) {
|
|
69
|
+
_iterator.e(err);
|
|
70
|
+
} finally {
|
|
71
|
+
_iterator.f();
|
|
74
72
|
}
|
|
75
73
|
}
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
74
|
+
}
|
|
75
|
+
if (displayId && isDisplayDataMsg(msg)) {
|
|
76
|
+
var _targets = _this2.displayIdMap.get(displayId) || [];
|
|
77
|
+
_targets.push(_this2.outputs.length);
|
|
78
|
+
_this2.displayIdMap.set(displayId, _targets);
|
|
79
|
+
}
|
|
80
|
+
//Handle an execute reply message.
|
|
81
|
+
if (isExecuteReplyMsg(msg)) {
|
|
82
|
+
var content = msg.content;
|
|
83
|
+
if (content.status !== 'ok') {
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
var payload = content && content.payload;
|
|
87
|
+
if (!payload || !payload.length) {
|
|
88
|
+
return;
|
|
80
89
|
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
}
|
|
87
|
-
var payload = content && content.payload;
|
|
88
|
-
if (!payload || !payload.length) {
|
|
89
|
-
return;
|
|
90
|
-
}
|
|
91
|
-
var pages = payload.filter(function (i) {
|
|
92
|
-
return i.source === 'page';
|
|
93
|
-
});
|
|
94
|
-
if (!pages.length) {
|
|
95
|
-
return;
|
|
96
|
-
}
|
|
97
|
-
var page = JSON.parse(JSON.stringify(pages[0]));
|
|
98
|
-
var _output2 = {
|
|
99
|
-
output_type: 'display_data',
|
|
100
|
-
data: page.data,
|
|
101
|
-
metadata: {}
|
|
102
|
-
};
|
|
103
|
-
_this2.add(_output2);
|
|
90
|
+
var pages = payload.filter(function (i) {
|
|
91
|
+
return i.source === 'page';
|
|
92
|
+
});
|
|
93
|
+
if (!pages.length) {
|
|
94
|
+
return;
|
|
104
95
|
}
|
|
96
|
+
var page = JSON.parse(JSON.stringify(pages[0]));
|
|
97
|
+
var _output2 = {
|
|
98
|
+
output_type: 'display_data',
|
|
99
|
+
data: page.data,
|
|
100
|
+
metadata: {}
|
|
101
|
+
};
|
|
102
|
+
_this2.add(_output2);
|
|
103
|
+
}
|
|
104
|
+
if (isClearOutputMsg(msg)) {
|
|
105
|
+
var wait = msg.content.wait;
|
|
106
|
+
_this2.clear(wait);
|
|
105
107
|
}
|
|
106
108
|
});
|
|
107
109
|
}
|
|
@@ -115,7 +117,9 @@ export var LibroJupyterOutputArea = (_dec = transient(), _dec2 = view('libro-out
|
|
|
115
117
|
key: "clear",
|
|
116
118
|
value: function clear(wait) {
|
|
117
119
|
_get(_getPrototypeOf(LibroJupyterOutputArea.prototype), "clear", this).call(this, wait);
|
|
118
|
-
|
|
120
|
+
if (!wait) {
|
|
121
|
+
this.displayIdMap.clear();
|
|
122
|
+
}
|
|
119
123
|
}
|
|
120
124
|
}]);
|
|
121
125
|
return LibroJupyterOutputArea;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ViewManager } from '@difizen/mana-app';
|
|
2
|
+
import type { IWidgetViewProps } from '../protocol.js';
|
|
3
|
+
import { WidgetViewContribution } from '../protocol.js';
|
|
4
|
+
import { VBoxWidget } from './view.js';
|
|
5
|
+
export declare class VBoxWidgetContribution implements WidgetViewContribution {
|
|
6
|
+
viewManager: ViewManager;
|
|
7
|
+
canHandle: (attributes: any) => 1 | 100;
|
|
8
|
+
factory(props: IWidgetViewProps): Promise<VBoxWidget>;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=contribution.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contribution.d.ts","sourceRoot":"","sources":["../../../src/widget/box/contribution.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAqB,MAAM,mBAAmB,CAAC;AAEnE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AACvD,OAAO,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAExD,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAEvC,qBACa,sBAAuB,YAAW,sBAAsB;IAC9C,WAAW,EAAE,WAAW,CAAC;IAC9C,SAAS,eAAgB,GAAG,aAc1B;IACF,OAAO,CAAC,KAAK,EAAE,gBAAgB;CAGhC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
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, _class, _class2, _descriptor;
|
|
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
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
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); } }
|
|
6
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
7
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
8
|
+
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); }
|
|
9
|
+
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; }
|
|
10
|
+
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.'); }
|
|
11
|
+
import { ViewManager, inject, singleton } from '@difizen/mana-app';
|
|
12
|
+
import { WidgetViewContribution } from "../protocol.js";
|
|
13
|
+
import { VBoxWidget } from "./view.js";
|
|
14
|
+
export var VBoxWidgetContribution = (_dec = singleton({
|
|
15
|
+
contrib: WidgetViewContribution
|
|
16
|
+
}), _dec2 = inject(ViewManager), _dec(_class = (_class2 = /*#__PURE__*/function () {
|
|
17
|
+
function VBoxWidgetContribution() {
|
|
18
|
+
_classCallCheck(this, VBoxWidgetContribution);
|
|
19
|
+
_initializerDefineProperty(this, "viewManager", _descriptor, this);
|
|
20
|
+
this.canHandle = function (attributes) {
|
|
21
|
+
if (attributes._model_name === 'VBoxModel') {
|
|
22
|
+
return 100;
|
|
23
|
+
}
|
|
24
|
+
if (attributes.__view_name === 'VBoxView') {
|
|
25
|
+
return 100;
|
|
26
|
+
}
|
|
27
|
+
if (attributes._model_name === 'HBoxModel') {
|
|
28
|
+
return 100;
|
|
29
|
+
}
|
|
30
|
+
if (attributes.__view_name === 'HBoxView') {
|
|
31
|
+
return 100;
|
|
32
|
+
}
|
|
33
|
+
return 1;
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
_createClass(VBoxWidgetContribution, [{
|
|
37
|
+
key: "factory",
|
|
38
|
+
value: function factory(props) {
|
|
39
|
+
return this.viewManager.getOrCreateView(VBoxWidget, props);
|
|
40
|
+
}
|
|
41
|
+
}]);
|
|
42
|
+
return VBoxWidgetContribution;
|
|
43
|
+
}(), (_descriptor = _applyDecoratedDescriptor(_class2.prototype, "viewManager", [_dec2], {
|
|
44
|
+
configurable: true,
|
|
45
|
+
enumerable: true,
|
|
46
|
+
writable: true,
|
|
47
|
+
initializer: null
|
|
48
|
+
})), _class2)) || _class);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/widget/box/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,WAAW,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/// <reference types="react" resolution-mode="require"/>
|
|
2
|
+
import { LibroContextKey } from '@difizen/libro-core';
|
|
3
|
+
import type { IWidgetViewProps, WidgetState } from '../protocol.js';
|
|
4
|
+
import { WidgetView } from '../widget-view.js';
|
|
5
|
+
import './index.less';
|
|
6
|
+
export declare const LibroWidgetBoxComponent: import("react").ForwardRefExoticComponent<import("react").RefAttributes<HTMLDivElement>>;
|
|
7
|
+
interface BoxState extends WidgetState {
|
|
8
|
+
children: string[];
|
|
9
|
+
box_style?: string;
|
|
10
|
+
}
|
|
11
|
+
export declare class VBoxWidget extends WidgetView {
|
|
12
|
+
view: import("react").ForwardRefExoticComponent<import("react").RefAttributes<HTMLDivElement>>;
|
|
13
|
+
state: BoxState;
|
|
14
|
+
constructor(props: IWidgetViewProps, libroContextKey: LibroContextKey);
|
|
15
|
+
protected initialize(props: IWidgetViewProps): void;
|
|
16
|
+
getCls: () => "" | "libro-widget-hbox" | "libro-widget-vbox";
|
|
17
|
+
}
|
|
18
|
+
export {};
|
|
19
|
+
//# sourceMappingURL=view.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"view.d.ts","sourceRoot":"","sources":["../../../src/widget/box/view.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AActD,OAAO,KAAK,EAAY,gBAAgB,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE9E,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C,OAAO,cAAc,CAAC;AAmCtB,eAAO,MAAM,uBAAuB,0FAiBnC,CAAC;AAEF,UAAU,QAAS,SAAQ,WAAW;IACpC,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,qBAEa,UAAW,SAAQ,UAAU;IAC/B,IAAI,2FAA2B;IAG/B,KAAK,EAAE,QAAQ,CAGtB;gBAGoB,KAAK,EAAE,gBAAgB,EAClB,eAAe,EAAE,eAAe;IAM3D,SAAS,CAAC,UAAU,CAAC,KAAK,EAAE,gBAAgB,GAAG,IAAI;IAKnD,MAAM,uDAQJ;CACH"}
|
|
@@ -0,0 +1,114 @@
|
|
|
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, _class, _class2, _descriptor;
|
|
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; }
|
|
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 }); }
|
|
7
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
8
|
+
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); } }
|
|
9
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
10
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
11
|
+
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); }
|
|
12
|
+
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); }
|
|
13
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
14
|
+
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); }; }
|
|
15
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
16
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
17
|
+
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; } }
|
|
18
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
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; }
|
|
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.'); }
|
|
21
|
+
import { LibroContextKey } from '@difizen/libro-core';
|
|
22
|
+
import { view, transient, useInject, ViewInstance, prop, inject, ViewOption, ViewRender, getOrigin } from '@difizen/mana-app';
|
|
23
|
+
import { forwardRef } from 'react';
|
|
24
|
+
import { defaultWidgetState } from "../protocol.js";
|
|
25
|
+
import { WidgetView } from "../widget-view.js";
|
|
26
|
+
import "./index.less";
|
|
27
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
28
|
+
var WidgetRender = function WidgetRender(props) {
|
|
29
|
+
var widgets = props.widgets,
|
|
30
|
+
modelId = props.modelId,
|
|
31
|
+
cell = props.cell;
|
|
32
|
+
if (!widgets) {
|
|
33
|
+
return null;
|
|
34
|
+
}
|
|
35
|
+
var widgetView;
|
|
36
|
+
try {
|
|
37
|
+
widgetView = widgets.getModel(modelId);
|
|
38
|
+
} catch (ex) {
|
|
39
|
+
//
|
|
40
|
+
}
|
|
41
|
+
if (!widgetView) {
|
|
42
|
+
return null;
|
|
43
|
+
}
|
|
44
|
+
if (cell) {
|
|
45
|
+
widgetView.setCell(getOrigin(cell));
|
|
46
|
+
}
|
|
47
|
+
if (widgetView.isCommClosed) {
|
|
48
|
+
return null;
|
|
49
|
+
}
|
|
50
|
+
return /*#__PURE__*/_jsx("div", {
|
|
51
|
+
className: "libro-widget-render-container",
|
|
52
|
+
children: /*#__PURE__*/_jsx("div", {
|
|
53
|
+
className: "libro-widget-render",
|
|
54
|
+
children: /*#__PURE__*/_jsx(ViewRender, {
|
|
55
|
+
view: widgetView
|
|
56
|
+
})
|
|
57
|
+
})
|
|
58
|
+
});
|
|
59
|
+
};
|
|
60
|
+
export var LibroWidgetBoxComponent = /*#__PURE__*/forwardRef(function LibroWidgetBoxComponent(props, ref) {
|
|
61
|
+
var widget = useInject(ViewInstance);
|
|
62
|
+
return /*#__PURE__*/_jsx("div", {
|
|
63
|
+
className: "libro-widget-box ".concat(widget.getCls()),
|
|
64
|
+
ref: ref,
|
|
65
|
+
children: widget.state.children.map(function (modelId) {
|
|
66
|
+
return /*#__PURE__*/_jsx(WidgetRender, {
|
|
67
|
+
cell: widget.cell,
|
|
68
|
+
widgets: widget.widgets,
|
|
69
|
+
modelId: modelId
|
|
70
|
+
}, modelId);
|
|
71
|
+
})
|
|
72
|
+
});
|
|
73
|
+
});
|
|
74
|
+
export var VBoxWidget = (_dec = transient(), _dec2 = view('libro-widget-box-view'), _dec3 = prop(), _dec(_class = _dec2(_class = (_class2 = /*#__PURE__*/function (_WidgetView) {
|
|
75
|
+
_inherits(VBoxWidget, _WidgetView);
|
|
76
|
+
var _super = _createSuper(VBoxWidget);
|
|
77
|
+
function VBoxWidget(props, libroContextKey) {
|
|
78
|
+
var _this;
|
|
79
|
+
_classCallCheck(this, VBoxWidget);
|
|
80
|
+
_this = _super.call(this, props, libroContextKey);
|
|
81
|
+
_this.view = LibroWidgetBoxComponent;
|
|
82
|
+
_initializerDefineProperty(_this, "state", _descriptor, _assertThisInitialized(_this));
|
|
83
|
+
_this.getCls = function () {
|
|
84
|
+
if (_this.model_name === 'HBoxModel') {
|
|
85
|
+
return 'libro-widget-hbox';
|
|
86
|
+
}
|
|
87
|
+
if (_this.model_name === 'VBoxModel') {
|
|
88
|
+
return 'libro-widget-vbox';
|
|
89
|
+
}
|
|
90
|
+
return '';
|
|
91
|
+
};
|
|
92
|
+
_this.initialize(props);
|
|
93
|
+
return _this;
|
|
94
|
+
}
|
|
95
|
+
VBoxWidget = inject(LibroContextKey)(VBoxWidget, undefined, 1) || VBoxWidget;
|
|
96
|
+
VBoxWidget = inject(ViewOption)(VBoxWidget, undefined, 0) || VBoxWidget;
|
|
97
|
+
_createClass(VBoxWidget, [{
|
|
98
|
+
key: "initialize",
|
|
99
|
+
value: function initialize(props) {
|
|
100
|
+
var attributes = props.attributes;
|
|
101
|
+
this.setState(attributes);
|
|
102
|
+
}
|
|
103
|
+
}]);
|
|
104
|
+
return VBoxWidget;
|
|
105
|
+
}(WidgetView), (_descriptor = _applyDecoratedDescriptor(_class2.prototype, "state", [_dec3], {
|
|
106
|
+
configurable: true,
|
|
107
|
+
enumerable: true,
|
|
108
|
+
writable: true,
|
|
109
|
+
initializer: function initializer() {
|
|
110
|
+
return _objectSpread(_objectSpread({}, defaultWidgetState), {}, {
|
|
111
|
+
children: []
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
})), _class2)) || _class) || _class);
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import type { JSONObject } from '@difizen/libro-common';
|
|
2
|
+
import type { IComm, IKernelConnection, IShellFuture } from '@difizen/libro-kernel';
|
|
3
|
+
import type { ICallbacks, IClassicComm } from './protocol.js';
|
|
4
|
+
import { WidgetCommOption } from './protocol.js';
|
|
5
|
+
/**
|
|
6
|
+
* Public constructor
|
|
7
|
+
* @param {IComm} jsServicesComm - @jupyterlab/services IComm instance
|
|
8
|
+
*/
|
|
9
|
+
export declare class Comm implements IClassicComm {
|
|
10
|
+
constructor(options: WidgetCommOption);
|
|
11
|
+
/**
|
|
12
|
+
* Comm id
|
|
13
|
+
* @return {string}
|
|
14
|
+
*/
|
|
15
|
+
get comm_id(): string;
|
|
16
|
+
/**
|
|
17
|
+
* Target name
|
|
18
|
+
* @return {string}
|
|
19
|
+
*/
|
|
20
|
+
get target_name(): string;
|
|
21
|
+
/**
|
|
22
|
+
* Opens a sibling comm in the backend
|
|
23
|
+
* @param data
|
|
24
|
+
* @param callbacks
|
|
25
|
+
* @param metadata
|
|
26
|
+
* @return msg id
|
|
27
|
+
*/
|
|
28
|
+
open(data: JSONObject, callbacks?: ICallbacks, metadata?: JSONObject, buffers?: ArrayBuffer[] | ArrayBufferView[]): string;
|
|
29
|
+
/**
|
|
30
|
+
* Sends a message to the sibling comm in the backend
|
|
31
|
+
* @param data
|
|
32
|
+
* @param callbacks
|
|
33
|
+
* @param metadata
|
|
34
|
+
* @param buffers
|
|
35
|
+
* @return message id
|
|
36
|
+
*/
|
|
37
|
+
send(data: JSONObject, callbacks?: ICallbacks, metadata?: JSONObject, buffers?: ArrayBuffer[] | ArrayBufferView[]): string;
|
|
38
|
+
/**
|
|
39
|
+
* Closes the sibling comm in the backend
|
|
40
|
+
* @param data
|
|
41
|
+
* @param callbacks
|
|
42
|
+
* @param metadata
|
|
43
|
+
* @return msg id
|
|
44
|
+
*/
|
|
45
|
+
close(data?: JSONObject, callbacks?: ICallbacks, metadata?: JSONObject, buffers?: ArrayBuffer[] | ArrayBufferView[]): string;
|
|
46
|
+
/**
|
|
47
|
+
* Register a message handler
|
|
48
|
+
* @param callback, which is given a message
|
|
49
|
+
*/
|
|
50
|
+
onMsg(callback: (x: any) => void): void;
|
|
51
|
+
/**
|
|
52
|
+
* Register a handler for when the comm is closed by the backend
|
|
53
|
+
* @param callback, which is given a message
|
|
54
|
+
*/
|
|
55
|
+
onClose(callback: (x: any) => void): void;
|
|
56
|
+
/**
|
|
57
|
+
* Hooks callback object up with @jupyterlab/services IKernelFuture
|
|
58
|
+
* @param @jupyterlab/services IKernelFuture instance
|
|
59
|
+
* @param callbacks
|
|
60
|
+
*/
|
|
61
|
+
_hookupCallbacks(future: IShellFuture, callbacks?: ICallbacks): void;
|
|
62
|
+
jsServicesComm: IComm;
|
|
63
|
+
kernel: IKernelConnection;
|
|
64
|
+
}
|
|
65
|
+
//# sourceMappingURL=comm.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"comm.d.ts","sourceRoot":"","sources":["../../src/widget/comm.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,KAAK,EAAE,KAAK,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAGpF,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAEjD;;;GAGG;AACH,qBACa,IAAK,YAAW,YAAY;gBACD,OAAO,EAAE,gBAAgB;IAI/D;;;OAGG;IACH,IAAI,OAAO,IAAI,MAAM,CAEpB;IAED;;;OAGG;IACH,IAAI,WAAW,IAAI,MAAM,CAExB;IAED;;;;;;OAMG;IACH,IAAI,CACF,IAAI,EAAE,UAAU,EAChB,SAAS,CAAC,EAAE,UAAU,EACtB,QAAQ,CAAC,EAAE,UAAU,EACrB,OAAO,CAAC,EAAE,WAAW,EAAE,GAAG,eAAe,EAAE,GAC1C,MAAM;IAMT;;;;;;;OAOG;IACH,IAAI,CACF,IAAI,EAAE,UAAU,EAChB,SAAS,CAAC,EAAE,UAAU,EACtB,QAAQ,CAAC,EAAE,UAAU,EACrB,OAAO,CAAC,EAAE,WAAW,EAAE,GAAG,eAAe,EAAE,GAC1C,MAAM;IAMT;;;;;;OAMG;IACH,KAAK,CACH,IAAI,CAAC,EAAE,UAAU,EACjB,SAAS,CAAC,EAAE,UAAU,EACtB,QAAQ,CAAC,EAAE,UAAU,EACrB,OAAO,CAAC,EAAE,WAAW,EAAE,GAAG,eAAe,EAAE,GAC1C,MAAM;IAMT;;;OAGG;IACH,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC,EAAE,GAAG,KAAK,IAAI,GAAG,IAAI;IAIvC;;;OAGG;IACH,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC,EAAE,GAAG,KAAK,IAAI,GAAG,IAAI;IAIzC;;;;OAIG;IACH,gBAAgB,CAAC,MAAM,EAAE,YAAY,EAAE,SAAS,CAAC,EAAE,UAAU,GAAG,IAAI;IAwCpE,cAAc,EAAE,KAAK,CAAC;IACtB,MAAM,EAAE,iBAAiB,CAAC;CAC3B"}
|