@difizen/libro-jupyter 0.2.13 → 0.2.15
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/command/command-contribution.d.ts.map +1 -1
- package/es/command/command-contribution.js +3 -6
- package/es/module.d.ts +4 -0
- package/es/module.d.ts.map +1 -1
- package/es/module.js +8 -3
- package/package.json +17 -17
- package/src/command/command-contribution.ts +3 -11
- package/src/module.ts +11 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command-contribution.d.ts","sourceRoot":"","sources":["../../src/command/command-contribution.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,oBAAoB,EACpB,YAAY,
|
|
1
|
+
{"version":3,"file":"command-contribution.d.ts","sourceRoot":"","sources":["../../src/command/command-contribution.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,oBAAoB,EACpB,YAAY,EAKb,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EACL,mBAAmB,EAEnB,YAAY,EAEb,MAAM,mBAAmB,CAAC;AAK3B,qBACa,+BAAgC,YAAW,mBAAmB;IACnD,SAAS,CAAC,QAAQ,CAAC,YAAY,EAAE,YAAY,CAAC;IACtC,SAAS,CAAC,QAAQ,CAAC,YAAY,EAAE,oBAAoB,CAAC;IAC9D,SAAS,CAAC,QAAQ,CAAC,YAAY,EAAE,YAAY,CAAC;IAEpE,gBAAgB,CAAC,OAAO,EAAE,eAAe,GAAG,IAAI;CAoIjD"}
|
|
@@ -11,7 +11,7 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
|
|
|
11
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
12
|
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; }
|
|
13
13
|
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.'); }
|
|
14
|
-
import { KernelCommands, LibroCommandRegister, LibroService, LibroToolbarArea, LibroView, NotebookCommands,
|
|
14
|
+
import { KernelCommands, LibroCommandRegister, LibroService, LibroToolbarArea, LibroView, NotebookCommands, ExecutableCellView } from '@difizen/libro-core';
|
|
15
15
|
import { CommandContribution, inject, ModalService, singleton } from '@difizen/mana-app';
|
|
16
16
|
import { LibroJupyterModel } from "../libro-jupyter-model.js";
|
|
17
17
|
import { ExecutedWithKernelCellModel } from "../libro-jupyter-protocol.js";
|
|
@@ -67,13 +67,10 @@ export var LibroJupyterCommandContribution = (_dec = singleton({
|
|
|
67
67
|
//
|
|
68
68
|
},
|
|
69
69
|
isVisible: function isVisible(cell, libro, path) {
|
|
70
|
-
if (!
|
|
70
|
+
if (!libro || !(libro instanceof LibroView) || path !== LibroToolbarArea.HeaderCenter) {
|
|
71
71
|
return false;
|
|
72
72
|
}
|
|
73
|
-
|
|
74
|
-
return false;
|
|
75
|
-
}
|
|
76
|
-
return !!cell;
|
|
73
|
+
return (libro === null || libro === void 0 ? void 0 : libro.model).executable;
|
|
77
74
|
},
|
|
78
75
|
isEnabled: function isEnabled(cell, libro) {
|
|
79
76
|
if (!libro || !(libro instanceof LibroView)) {
|
package/es/module.d.ts
CHANGED
package/es/module.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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,
|
|
1
|
+
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../src/module.ts"],"names":[],"mappings":"AA2BA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAiC/C;;GAEG;AACH,eAAO,MAAM,0BAA0B,YAwDpC,CAAC;AAEJ,eAAO,MAAM,kBAAkB,YAI9B,CAAC"}
|
package/es/module.js
CHANGED
|
@@ -30,7 +30,11 @@ import { PlotlyModule } from "./rendermime/index.js";
|
|
|
30
30
|
import { LibroJupyterColorContribution } from "./theme/index.js";
|
|
31
31
|
import { KernelStatusSelector, LibroJupyterToolbarContribution, SaveFileErrorContribution } from "./toolbar/index.js";
|
|
32
32
|
import { WidgetModule } from "./widget/index.js";
|
|
33
|
-
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* 去除editor和lsp依赖的jupyter module,在opensumi场景使用
|
|
36
|
+
*/
|
|
37
|
+
export var LibroJupyterNoEditorModule = ManaModule.create().register(JupyterWorkspaceService, LibroJupyterFileService, LibroJupyterCommandContribution, LibroJupyterKeybindingContribution, LibroJupyterToolbarContribution, ConfigAppContribution, SaveFileErrorContribution, LibroKeybindRegistry, LibroJupyterContentContribution, LibroJupyterContentSaveContribution, LibroJupyterOutputArea, LibroJupyterColorContribution, LibroJupyterSettingContribution, JupyterServerLaunchManager, LibroJupyterView, {
|
|
34
38
|
token: CellExecutionTimeProvider,
|
|
35
39
|
useValue: CellExecutionTip
|
|
36
40
|
}, {
|
|
@@ -48,6 +52,7 @@ export var LibroJupyterModule = ManaModule.create().register(JupyterWorkspaceSer
|
|
|
48
52
|
}, {
|
|
49
53
|
token: LibroCodeCellView,
|
|
50
54
|
useClass: JupyterCodeCellView
|
|
51
|
-
}).dependOn(LibroModule, CodeCellModule, MarkdownCellModule, RawCellModule, StreamOutputModule, ErrorOutputModule, DisplayDataOutputModule, LibroToolbarModule, LibroKernelManageModule, LibroSearchModule, SearchCodeCellModule, LibroAddCellModule,
|
|
55
|
+
}).dependOn(LibroModule, CodeCellModule, MarkdownCellModule, RawCellModule, StreamOutputModule, ErrorOutputModule, DisplayDataOutputModule, LibroToolbarModule, LibroKernelManageModule, LibroSearchModule, SearchCodeCellModule, LibroAddCellModule,
|
|
52
56
|
// custom module
|
|
53
|
-
LibroBetweenCellModule, KeybindInstructionsModule, PlotlyModule, LibroJupyterFileModule,
|
|
57
|
+
LibroBetweenCellModule, KeybindInstructionsModule, PlotlyModule, LibroJupyterFileModule, WidgetModule);
|
|
58
|
+
export var LibroJupyterModule = ManaModule.create().dependOn(LibroE2EditorModule, CodeMirrorEditorModule, LibroLanguageClientModule);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@difizen/libro-jupyter",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.15",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"libro"
|
|
@@ -31,22 +31,22 @@
|
|
|
31
31
|
"src"
|
|
32
32
|
],
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@difizen/libro-cofine-editor": "^0.2.
|
|
35
|
-
"@difizen/libro-code-editor": "^0.2.
|
|
36
|
-
"@difizen/libro-code-cell": "^0.2.
|
|
37
|
-
"@difizen/libro-codemirror": "^0.2.
|
|
38
|
-
"@difizen/libro-rendermime": "^0.2.
|
|
39
|
-
"@difizen/libro-common": "^0.2.
|
|
40
|
-
"@difizen/libro-core": "^0.2.
|
|
41
|
-
"@difizen/libro-kernel": "^0.2.
|
|
42
|
-
"@difizen/libro-l10n": "^0.2.
|
|
43
|
-
"@difizen/libro-output": "^0.2.
|
|
44
|
-
"@difizen/libro-search": "^0.2.
|
|
45
|
-
"@difizen/libro-search-code-cell": "^0.2.
|
|
46
|
-
"@difizen/libro-lsp": "^0.2.
|
|
47
|
-
"@difizen/libro-markdown-cell": "^0.2.
|
|
48
|
-
"@difizen/libro-raw-cell": "^0.2.
|
|
49
|
-
"@difizen/libro-language-client": "^0.2.
|
|
34
|
+
"@difizen/libro-cofine-editor": "^0.2.15",
|
|
35
|
+
"@difizen/libro-code-editor": "^0.2.15",
|
|
36
|
+
"@difizen/libro-code-cell": "^0.2.15",
|
|
37
|
+
"@difizen/libro-codemirror": "^0.2.15",
|
|
38
|
+
"@difizen/libro-rendermime": "^0.2.15",
|
|
39
|
+
"@difizen/libro-common": "^0.2.15",
|
|
40
|
+
"@difizen/libro-core": "^0.2.15",
|
|
41
|
+
"@difizen/libro-kernel": "^0.2.15",
|
|
42
|
+
"@difizen/libro-l10n": "^0.2.15",
|
|
43
|
+
"@difizen/libro-output": "^0.2.15",
|
|
44
|
+
"@difizen/libro-search": "^0.2.15",
|
|
45
|
+
"@difizen/libro-search-code-cell": "^0.2.15",
|
|
46
|
+
"@difizen/libro-lsp": "^0.2.15",
|
|
47
|
+
"@difizen/libro-markdown-cell": "^0.2.15",
|
|
48
|
+
"@difizen/libro-raw-cell": "^0.2.15",
|
|
49
|
+
"@difizen/libro-language-client": "^0.2.15",
|
|
50
50
|
"@difizen/mana-app": "latest",
|
|
51
51
|
"@difizen/mana-l10n": "latest",
|
|
52
52
|
"@ant-design/colors": "^7.0.0",
|
|
@@ -6,7 +6,6 @@ import {
|
|
|
6
6
|
LibroToolbarArea,
|
|
7
7
|
LibroView,
|
|
8
8
|
NotebookCommands,
|
|
9
|
-
LibroCellView,
|
|
10
9
|
ExecutableCellView,
|
|
11
10
|
} from '@difizen/libro-core';
|
|
12
11
|
import type { CommandRegistry } from '@difizen/mana-app';
|
|
@@ -63,20 +62,13 @@ export class LibroJupyterCommandContribution implements CommandContribution {
|
|
|
63
62
|
},
|
|
64
63
|
isVisible: (cell, libro, path) => {
|
|
65
64
|
if (
|
|
66
|
-
!cell ||
|
|
67
65
|
!libro ||
|
|
68
|
-
!(
|
|
69
|
-
|
|
70
|
-
) {
|
|
71
|
-
return false;
|
|
72
|
-
}
|
|
73
|
-
if (
|
|
74
|
-
path !== LibroToolbarArea.HeaderCenter ||
|
|
75
|
-
!(libro?.model as LibroModel).executable
|
|
66
|
+
!(libro instanceof LibroView) ||
|
|
67
|
+
path !== LibroToolbarArea.HeaderCenter
|
|
76
68
|
) {
|
|
77
69
|
return false;
|
|
78
70
|
}
|
|
79
|
-
return
|
|
71
|
+
return (libro?.model as LibroModel).executable;
|
|
80
72
|
},
|
|
81
73
|
isEnabled: (cell, libro) => {
|
|
82
74
|
if (!libro || !(libro instanceof LibroView)) {
|
package/src/module.ts
CHANGED
|
@@ -58,7 +58,10 @@ import {
|
|
|
58
58
|
} from './toolbar/index.js';
|
|
59
59
|
import { WidgetModule } from './widget/index.js';
|
|
60
60
|
|
|
61
|
-
|
|
61
|
+
/**
|
|
62
|
+
* 去除editor和lsp依赖的jupyter module,在opensumi场景使用
|
|
63
|
+
*/
|
|
64
|
+
export const LibroJupyterNoEditorModule = ManaModule.create()
|
|
62
65
|
.register(
|
|
63
66
|
JupyterWorkspaceService,
|
|
64
67
|
LibroJupyterFileService,
|
|
@@ -107,13 +110,17 @@ export const LibroJupyterModule = ManaModule.create()
|
|
|
107
110
|
LibroSearchModule,
|
|
108
111
|
SearchCodeCellModule,
|
|
109
112
|
LibroAddCellModule,
|
|
110
|
-
|
|
111
|
-
CodeMirrorEditorModule,
|
|
113
|
+
|
|
112
114
|
// custom module
|
|
113
115
|
LibroBetweenCellModule,
|
|
114
116
|
KeybindInstructionsModule,
|
|
115
117
|
PlotlyModule,
|
|
116
118
|
LibroJupyterFileModule,
|
|
117
|
-
LibroLanguageClientModule,
|
|
118
119
|
WidgetModule,
|
|
119
120
|
);
|
|
121
|
+
|
|
122
|
+
export const LibroJupyterModule = ManaModule.create().dependOn(
|
|
123
|
+
LibroE2EditorModule,
|
|
124
|
+
CodeMirrorEditorModule,
|
|
125
|
+
LibroLanguageClientModule,
|
|
126
|
+
);
|