@difizen/libro-lab 0.2.44 → 0.3.0
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/config/config.d.ts +8 -0
- package/es/config/config.d.ts.map +1 -0
- package/es/config/config.js +25 -0
- package/es/config/index.d.ts +1 -0
- package/es/config/index.d.ts.map +1 -1
- package/es/config/index.js +2 -1
- package/es/editor-viewer/code-editor-open-handler.d.ts.map +1 -1
- package/es/editor-viewer/code-editor-open-handler.js +4 -2
- package/es/editor-viewer/code-editor-viewer.js +1 -1
- package/es/editor-viewer/julia-language.d.ts +6 -0
- package/es/editor-viewer/julia-language.d.ts.map +1 -0
- package/es/editor-viewer/julia-language.js +22 -0
- package/es/editor-viewer/libro-default-open-handler.d.ts.map +1 -1
- package/es/editor-viewer/module.d.ts.map +1 -1
- package/es/editor-viewer/module.js +3 -1
- package/es/editor-viewer/protocol.d.ts.map +1 -1
- package/es/editor-viewer/protocol.js +1 -1
- package/es/editor-viewer/r-language.d.ts +6 -0
- package/es/editor-viewer/r-language.d.ts.map +1 -0
- package/es/editor-viewer/r-language.js +22 -0
- package/es/index.less +3 -3
- package/es/kernel-and-terminal-panel/module.d.ts.map +1 -1
- package/es/kernel-and-terminal-panel/module.js +2 -11
- package/es/lab-app.d.ts.map +1 -1
- package/es/lab-app.js +39 -1
- package/es/module.d.ts.map +1 -1
- package/es/module.js +2 -1
- package/es/toc/module.d.ts.map +1 -1
- package/es/toc/module.js +2 -11
- package/package.json +14 -13
- package/src/config/config.ts +29 -0
- package/src/config/index.ts +1 -0
- package/src/editor-viewer/code-editor-open-handler.ts +2 -1
- package/src/editor-viewer/code-editor-viewer.tsx +1 -1
- package/src/editor-viewer/julia-language.ts +15 -0
- package/src/editor-viewer/libro-default-open-handler.ts +2 -1
- package/src/editor-viewer/module.ts +4 -0
- package/src/editor-viewer/protocol.ts +2 -0
- package/src/editor-viewer/r-language.ts +15 -0
- package/src/index.less +3 -3
- package/src/kernel-and-terminal-panel/module.ts +1 -12
- package/src/lab-app.ts +24 -0
- package/src/module.tsx +2 -0
- package/src/toc/module.ts +2 -15
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ConfigurationNode } from '@difizen/mana-app';
|
|
2
|
+
export declare const LibroLabKernelAndTerminalPanelEnabled: ConfigurationNode<boolean>;
|
|
3
|
+
export declare const LibroLabTocPanelEnabled: ConfigurationNode<boolean>;
|
|
4
|
+
export declare const LibroLabConfiguration: {
|
|
5
|
+
LibroLabKernelAndTerminalPanelEnabled: ConfigurationNode<boolean>;
|
|
6
|
+
LibroLabTocPanelEnabled: ConfigurationNode<boolean>;
|
|
7
|
+
};
|
|
8
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/config/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAG3D,eAAO,MAAM,qCAAqC,EAAE,iBAAiB,CAAC,OAAO,CAS5E,CAAC;AAEF,eAAO,MAAM,uBAAuB,EAAE,iBAAiB,CAAC,OAAO,CAS9D,CAAC;AAEF,eAAO,MAAM,qBAAqB;;;CAGjC,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { l10n } from '@difizen/mana-l10n';
|
|
2
|
+
export var LibroLabKernelAndTerminalPanelEnabled = {
|
|
3
|
+
id: 'libro.lab.kernel.termianl.panel.enabled',
|
|
4
|
+
description: 'whether enable kernel and terminal panel ',
|
|
5
|
+
title: l10n.t('是否激活 kernel 与终端功能面板'),
|
|
6
|
+
type: 'checkbox',
|
|
7
|
+
defaultValue: true,
|
|
8
|
+
schema: {
|
|
9
|
+
type: 'boolean'
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
export var LibroLabTocPanelEnabled = {
|
|
13
|
+
id: 'libro.lab.toc.panel.enabled',
|
|
14
|
+
description: 'whether enable toc panel ',
|
|
15
|
+
title: l10n.t('是否激活 toc 功能面板'),
|
|
16
|
+
type: 'checkbox',
|
|
17
|
+
defaultValue: true,
|
|
18
|
+
schema: {
|
|
19
|
+
type: 'boolean'
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
export var LibroLabConfiguration = {
|
|
23
|
+
LibroLabKernelAndTerminalPanelEnabled: LibroLabKernelAndTerminalPanelEnabled,
|
|
24
|
+
LibroLabTocPanelEnabled: LibroLabTocPanelEnabled
|
|
25
|
+
};
|
package/es/config/index.d.ts
CHANGED
package/es/config/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/config/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/config/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,cAAc,aAAa,CAAC"}
|
package/es/config/index.js
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export * from "./config-contribution.js";
|
|
1
|
+
export * from "./config-contribution.js";
|
|
2
|
+
export * from "./config.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"code-editor-open-handler.d.ts","sourceRoot":"","sources":["../../src/editor-viewer/code-editor-open-handler.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,GAAG,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AACrE,OAAO,EAAE,oBAAoB,EAAU,MAAM,mBAAmB,CAAC;AACjE,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,0BAA0B,EAA0B,MAAM,mBAAmB,CAAC;AAEvF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAGhE,qBACa,2BAA4B,SAAQ,0BAA0B,CAAC,gBAAgB,CAAC;IAC7D,SAAS,CAAC,oBAAoB,EAAE,oBAAoB,CAAC;IAEnF,EAAE,SAA2B;
|
|
1
|
+
{"version":3,"file":"code-editor-open-handler.d.ts","sourceRoot":"","sources":["../../src/editor-viewer/code-editor-open-handler.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,GAAG,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AACrE,OAAO,EAAE,oBAAoB,EAAU,MAAM,mBAAmB,CAAC;AACjE,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,0BAA0B,EAA0B,MAAM,mBAAmB,CAAC;AAEvF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAGhE,qBACa,2BAA4B,SAAQ,0BAA0B,CAAC,gBAAgB,CAAC;IAC7D,SAAS,CAAC,oBAAoB,EAAE,oBAAoB,CAAC;IAEnF,EAAE,SAA2B;IAG7B,SAAS,CAAC,GAAG,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,sBAAsB;IAOrC,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,OAAO,GAAE,sBAA2B;CAgBnE"}
|
|
@@ -49,8 +49,10 @@ export var CodeEditorViewerOpenHandler = (_dec = singleton({
|
|
|
49
49
|
}
|
|
50
50
|
_createClass(CodeEditorViewerOpenHandler, [{
|
|
51
51
|
key: "canHandle",
|
|
52
|
-
value:
|
|
53
|
-
|
|
52
|
+
value:
|
|
53
|
+
// TODO: 支持打开的文件扩展
|
|
54
|
+
function canHandle(uri, options) {
|
|
55
|
+
if (uri.scheme === 'file' && textFileTypes.includes(uri.path.ext.toLowerCase())) {
|
|
54
56
|
return 100;
|
|
55
57
|
}
|
|
56
58
|
return Priority.IDLE;
|
|
@@ -110,7 +110,7 @@ export var CodeEditorViewer = (_dec = transient(), _dec2 = view(CodeEditorViewer
|
|
|
110
110
|
_this.title.label = uri.path.base;
|
|
111
111
|
_this.languageSpecRegistry = languageSpecRegistry;
|
|
112
112
|
_this.languageSpec = _this.languageSpecRegistry.languageSpecs.find(function (item) {
|
|
113
|
-
return item.ext.includes(uri.path.ext);
|
|
113
|
+
return item.ext.includes(uri.path.ext.toLowerCase());
|
|
114
114
|
});
|
|
115
115
|
configurationService.get(LibroConfigAutoSave).then(function (value) {
|
|
116
116
|
if (value) {
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { LanguageSpecRegistry } from '@difizen/libro-jupyter';
|
|
2
|
+
import { LanguageSpecContribution } from '@difizen/libro-jupyter';
|
|
3
|
+
export declare class JuliaLanguageSpecs implements LanguageSpecContribution {
|
|
4
|
+
registerLanguageSpec: (register: LanguageSpecRegistry) => void;
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=julia-language.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"julia-language.d.ts","sourceRoot":"","sources":["../../src/editor-viewer/julia-language.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AACnE,OAAO,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAGlE,qBACa,kBAAmB,YAAW,wBAAwB;IACjE,oBAAoB,aAAc,oBAAoB,UAOpD;CACH"}
|
|
@@ -0,0 +1,22 @@
|
|
|
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, _class;
|
|
3
|
+
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); } }
|
|
4
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
|
+
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); }
|
|
7
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
8
|
+
import { LanguageSpecContribution } from '@difizen/libro-jupyter';
|
|
9
|
+
import { singleton } from '@difizen/mana-app';
|
|
10
|
+
export var JuliaLanguageSpecs = (_dec = singleton({
|
|
11
|
+
contrib: [LanguageSpecContribution]
|
|
12
|
+
}), _dec(_class = /*#__PURE__*/_createClass(function JuliaLanguageSpecs() {
|
|
13
|
+
_classCallCheck(this, JuliaLanguageSpecs);
|
|
14
|
+
this.registerLanguageSpec = function (register) {
|
|
15
|
+
register.registerLanguageSpec({
|
|
16
|
+
name: 'JULIA',
|
|
17
|
+
language: 'julia',
|
|
18
|
+
mime: 'text/x-julia',
|
|
19
|
+
ext: ['.jl', '.JL']
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
})) || _class);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"libro-default-open-handler.d.ts","sourceRoot":"","sources":["../../src/editor-viewer/libro-default-open-handler.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,GAAG,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AACrE,OAAO,EAAE,oBAAoB,EAAU,MAAM,mBAAmB,CAAC;AACjE,OAAO,EAAE,0BAA0B,EAA0B,MAAM,mBAAmB,CAAC;AAEvF,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"libro-default-open-handler.d.ts","sourceRoot":"","sources":["../../src/editor-viewer/libro-default-open-handler.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,GAAG,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AACrE,OAAO,EAAE,oBAAoB,EAAU,MAAM,mBAAmB,CAAC;AACjE,OAAO,EAAE,0BAA0B,EAA0B,MAAM,mBAAmB,CAAC;AAEvF,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAGpE,qBACa,6BAA8B,SAAQ,0BAA0B,CAAC,kBAAkB,CAAC;IACjE,SAAS,CAAC,oBAAoB,EAAE,oBAAoB,CAAC;IAEnF,EAAE,SAA6B;IAE/B,SAAS;IAIM,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,OAAO,GAAE,sBAA2B;CAgBnE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../src/editor-viewer/module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../src/editor-viewer/module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAU/C,eAAO,MAAM,sBAAsB,YAUlC,CAAC"}
|
|
@@ -2,6 +2,8 @@ import { ManaModule } from '@difizen/mana-app';
|
|
|
2
2
|
import { CodeEditorViewerOpenHandler } from "./code-editor-open-handler.js";
|
|
3
3
|
import { CodeEditorViewer } from "./code-editor-viewer.js";
|
|
4
4
|
import { JSONLanguageSpecs } from "./json-langauge.js";
|
|
5
|
+
import { JuliaLanguageSpecs } from "./julia-language.js";
|
|
5
6
|
import { LibroDefaultViewerOpenHandler } from "./libro-default-open-handler.js";
|
|
6
7
|
import { LibroDefaultViewer } from "./libro-default-viewer.js";
|
|
7
|
-
|
|
8
|
+
import { RLanguageSpecs } from "./r-language.js";
|
|
9
|
+
export var CodeEditorViewerModule = ManaModule.create('CodeEditorViewerModule').register(CodeEditorViewer, LibroDefaultViewer, CodeEditorViewerOpenHandler, LibroDefaultViewerOpenHandler, JSONLanguageSpecs, RLanguageSpecs, JuliaLanguageSpecs);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../../src/editor-viewer/protocol.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,uBAAuB,4BAA4B,CAAC;AAEjE,eAAO,MAAM,yBAAyB,6BAA6B,CAAC;AAEpE,eAAO,MAAM,aAAa,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../../src/editor-viewer/protocol.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,uBAAuB,4BAA4B,CAAC;AAEjE,eAAO,MAAM,yBAAyB,6BAA6B,CAAC;AAEpE,eAAO,MAAM,aAAa,EAAE,MAAM,EAuBjC,CAAC;AAEF,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export var CodeEditorViewerFactory = 'libro-lab-editor-viewer';
|
|
2
2
|
export var LibroDefaultViewerFactory = 'libro-lab-default-viewer';
|
|
3
|
-
export var textFileTypes = ['.py', '.txt', '.sh', '.tex', '.html', '.xml', '.log', '.ini', '.yaml', '.yml', '.js', '.ts', '.csv', '.css', '.conf', '.bat', '.json', '.jsonl', '.md', ''];
|
|
3
|
+
export var textFileTypes = ['.py', '.txt', '.sh', '.tex', '.html', '.xml', '.log', '.ini', '.yaml', '.yml', '.js', '.ts', '.csv', '.css', '.conf', '.bat', '.json', '.jsonl', '.md', '.r', '.jl', ''];
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { LanguageSpecRegistry } from '@difizen/libro-jupyter';
|
|
2
|
+
import { LanguageSpecContribution } from '@difizen/libro-jupyter';
|
|
3
|
+
export declare class RLanguageSpecs implements LanguageSpecContribution {
|
|
4
|
+
registerLanguageSpec: (register: LanguageSpecRegistry) => void;
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=r-language.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"r-language.d.ts","sourceRoot":"","sources":["../../src/editor-viewer/r-language.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AACnE,OAAO,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAGlE,qBACa,cAAe,YAAW,wBAAwB;IAC7D,oBAAoB,aAAc,oBAAoB,UAOpD;CACH"}
|
|
@@ -0,0 +1,22 @@
|
|
|
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, _class;
|
|
3
|
+
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); } }
|
|
4
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
|
+
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); }
|
|
7
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
8
|
+
import { LanguageSpecContribution } from '@difizen/libro-jupyter';
|
|
9
|
+
import { singleton } from '@difizen/mana-app';
|
|
10
|
+
export var RLanguageSpecs = (_dec = singleton({
|
|
11
|
+
contrib: [LanguageSpecContribution]
|
|
12
|
+
}), _dec(_class = /*#__PURE__*/_createClass(function RLanguageSpecs() {
|
|
13
|
+
_classCallCheck(this, RLanguageSpecs);
|
|
14
|
+
this.registerLanguageSpec = function (register) {
|
|
15
|
+
register.registerLanguageSpec({
|
|
16
|
+
name: 'R',
|
|
17
|
+
language: 'r',
|
|
18
|
+
mime: 'text/x-r-source',
|
|
19
|
+
ext: ['.r', '.R']
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
})) || _class);
|
package/es/index.less
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../src/kernel-and-terminal-panel/module.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../src/kernel-and-terminal-panel/module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAM/C,eAAO,MAAM,iCAAiC,YAI7C,CAAC"}
|
|
@@ -1,14 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { LibroLabLayoutSlots } from "../layout/protocol.js";
|
|
1
|
+
import { ManaModule } from '@difizen/mana-app';
|
|
3
2
|
import { KernelAndTerminalPanelView } from "./kernel-and-terminal-panel-view.js";
|
|
4
3
|
import { KernelPanelColorContribution } from "./kernel-color-registry.js";
|
|
5
4
|
import { PanelCommandContribution } from "./panel-command.js";
|
|
6
|
-
export var LibroKernelAndTerminalPanelModule = ManaModule.create().register(PanelCommandContribution, KernelAndTerminalPanelView, KernelPanelColorContribution
|
|
7
|
-
view: KernelAndTerminalPanelView,
|
|
8
|
-
slot: LibroLabLayoutSlots.navigator,
|
|
9
|
-
autoCreate: true,
|
|
10
|
-
openOptions: {
|
|
11
|
-
reveal: true,
|
|
12
|
-
order: 'kernel'
|
|
13
|
-
}
|
|
14
|
-
}));
|
|
5
|
+
export var LibroKernelAndTerminalPanelModule = ManaModule.create().register(PanelCommandContribution, KernelAndTerminalPanelView, KernelPanelColorContribution);
|
package/es/lab-app.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lab-app.d.ts","sourceRoot":"","sources":["../src/lab-app.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAEZ,gBAAgB,EAChB,aAAa,EACd,MAAM,wBAAwB,CAAC;AAGhC,OAAO,EACL,oBAAoB,EAGpB,uBAAuB,EACvB,eAAe,EACf,WAAW,EAGZ,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"lab-app.d.ts","sourceRoot":"","sources":["../src/lab-app.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAEZ,gBAAgB,EAChB,aAAa,EACd,MAAM,wBAAwB,CAAC;AAGhC,OAAO,EACL,oBAAoB,EAGpB,uBAAuB,EACvB,eAAe,EACf,WAAW,EAGZ,MAAM,mBAAmB,CAAC;AAK3B,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAgB3D,qBACa,WAAY,YAAW,uBAAuB;IAC/B,gBAAgB,EAAE,gBAAgB,CAAC;IACvC,YAAY,EAAE,YAAY,CAAC;IACxB,eAAe,EAAE,eAAe,CAAC;IACrC,WAAW,EAAE,WAAW,CAAC;IAChB,oBAAoB,EAAE,oBAAoB,CAAC;IAClD,aAAa,EAAE,aAAa,CAAC;IAC7B,aAAa,EAAE,aAAa,CAAC;IAE9C,OAAO;cA+BG,gBAAgB;CAQjC"}
|
package/es/lab-app.js
CHANGED
|
@@ -14,9 +14,21 @@ function _initializerWarningHelper(descriptor, context) { throw new Error('Decor
|
|
|
14
14
|
import { LibroService, LibroJupyterConfiguration, ServerConnection, ServerManager } from '@difizen/libro-jupyter';
|
|
15
15
|
import { terminalDefaultSlot } from '@difizen/libro-terminal';
|
|
16
16
|
import { ConfigurationService, FileTreeViewFactory, URI, ApplicationContribution, SlotViewManager, ViewManager, inject, singleton } from '@difizen/mana-app';
|
|
17
|
+
import { LibroLabConfiguration } from "./config/index.js";
|
|
18
|
+
import { KernelAndTerminalPanelView } from "./kernel-and-terminal-panel/index.js";
|
|
17
19
|
import { LibroLabLayoutSlots } from "./layout/index.js";
|
|
18
20
|
import { LayoutService } from "./layout/layout-service.js";
|
|
21
|
+
import { TocPanelView } from "./toc/libro-toc-panel-view.js";
|
|
19
22
|
var ShouldPreventStoreViewKey = 'mana-should-prevent-store-view';
|
|
23
|
+
var leftPanelConfigs = [{
|
|
24
|
+
configKey: 'LibroLabKernelAndTerminalPanelEnabled',
|
|
25
|
+
viewClass: KernelAndTerminalPanelView
|
|
26
|
+
}, {
|
|
27
|
+
configKey: 'LibroLabTocPanelEnabled',
|
|
28
|
+
viewClass: TocPanelView
|
|
29
|
+
}
|
|
30
|
+
// 可以在此处添加更多配置项
|
|
31
|
+
];
|
|
20
32
|
export var LibroLabApp = (_dec = singleton({
|
|
21
33
|
contrib: ApplicationContribution
|
|
22
34
|
}), _dec2 = inject(ServerConnection), _dec3 = inject(LibroService), _dec4 = inject(SlotViewManager), _dec5 = inject(ViewManager), _dec6 = inject(ConfigurationService), _dec7 = inject(ServerManager), _dec8 = inject(LayoutService), _dec(_class = (_class2 = /*#__PURE__*/function () {
|
|
@@ -35,12 +47,38 @@ export var LibroLabApp = (_dec = singleton({
|
|
|
35
47
|
value: function () {
|
|
36
48
|
var _onStart = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
37
49
|
var _this = this;
|
|
50
|
+
var _i, _leftPanelConfigs, _leftPanelConfigs$_i, configKey, viewClass, isEnabled, view;
|
|
38
51
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
39
52
|
while (1) switch (_context.prev = _context.next) {
|
|
40
53
|
case 0:
|
|
41
54
|
localStorage.setItem(ShouldPreventStoreViewKey, 'true');
|
|
42
55
|
this.configurationService.set(LibroJupyterConfiguration['OpenSlot'], LibroLabLayoutSlots.content);
|
|
43
56
|
this.configurationService.set(terminalDefaultSlot, LibroLabLayoutSlots.contentBottom);
|
|
57
|
+
_i = 0, _leftPanelConfigs = leftPanelConfigs;
|
|
58
|
+
case 4:
|
|
59
|
+
if (!(_i < _leftPanelConfigs.length)) {
|
|
60
|
+
_context.next = 17;
|
|
61
|
+
break;
|
|
62
|
+
}
|
|
63
|
+
_leftPanelConfigs$_i = _leftPanelConfigs[_i], configKey = _leftPanelConfigs$_i.configKey, viewClass = _leftPanelConfigs$_i.viewClass;
|
|
64
|
+
_context.next = 8;
|
|
65
|
+
return this.configurationService.get(LibroLabConfiguration[configKey]);
|
|
66
|
+
case 8:
|
|
67
|
+
isEnabled = _context.sent;
|
|
68
|
+
if (!isEnabled) {
|
|
69
|
+
_context.next = 14;
|
|
70
|
+
break;
|
|
71
|
+
}
|
|
72
|
+
_context.next = 12;
|
|
73
|
+
return this.viewManager.getOrCreateView(viewClass);
|
|
74
|
+
case 12:
|
|
75
|
+
view = _context.sent;
|
|
76
|
+
this.slotViewManager.addView(view, LibroLabLayoutSlots.navigator);
|
|
77
|
+
case 14:
|
|
78
|
+
_i++;
|
|
79
|
+
_context.next = 4;
|
|
80
|
+
break;
|
|
81
|
+
case 17:
|
|
44
82
|
this.serverManager.ready.then(function () {
|
|
45
83
|
_this.layoutService.setAreaVisible(LibroLabLayoutSlots.navigator, true);
|
|
46
84
|
_this.layoutService.setAreaVisible(LibroLabLayoutSlots.alert, false);
|
|
@@ -48,7 +86,7 @@ export var LibroLabApp = (_dec = singleton({
|
|
|
48
86
|
_this.initialWorkspace();
|
|
49
87
|
return;
|
|
50
88
|
}).catch(console.error);
|
|
51
|
-
case
|
|
89
|
+
case 18:
|
|
52
90
|
case "end":
|
|
53
91
|
return _context.stop();
|
|
54
92
|
}
|
package/es/module.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../src/module.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../src/module.tsx"],"names":[],"mappings":"AAQA,OAAO,EACL,UAAU,EAKX,MAAM,mBAAmB,CAAC;AAoB3B,OAAO,cAAc,CAAC;AAMtB,eAAO,MAAM,cAAc,YA+FxB,CAAC"}
|
package/es/module.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { LibroAINativeModule } from '@difizen/libro-ai-native';
|
|
2
|
+
import { LibroAppModule } from '@difizen/libro-app';
|
|
2
3
|
import { FileView, LibroJupyterModule } from '@difizen/libro-jupyter';
|
|
3
4
|
import { langBundles } from '@difizen/libro-l10n';
|
|
4
5
|
import { LibroPromptCellModule } from '@difizen/libro-prompt-cell';
|
|
@@ -85,4 +86,4 @@ createSlotPreference({
|
|
|
85
86
|
reveal: true,
|
|
86
87
|
order: 'welcome'
|
|
87
88
|
}
|
|
88
|
-
}), EntryPointView).dependOn(LibroJupyterModule, CommonWidgetsModule, LibroLabLayoutModule, LibroLabHeaderMenuModule, LibroLabTocModule, LibroKernelAndTerminalPanelModule, LibroPromptCellModule, LibroSqlCellModule, TerminalModule, ImageViewerModule, CodeEditorViewerModule, LibroAINativeModule);
|
|
89
|
+
}), EntryPointView).dependOn(LibroJupyterModule, CommonWidgetsModule, LibroLabLayoutModule, LibroLabHeaderMenuModule, LibroLabTocModule, LibroKernelAndTerminalPanelModule, LibroPromptCellModule, LibroSqlCellModule, TerminalModule, ImageViewerModule, CodeEditorViewerModule, LibroAINativeModule, LibroAppModule);
|
package/es/toc/module.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../src/toc/module.ts"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../src/toc/module.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAI/C,eAAO,MAAM,iBAAiB,YAEH,CAAC"}
|
package/es/toc/module.js
CHANGED
|
@@ -1,13 +1,4 @@
|
|
|
1
1
|
import { LibroTOCModule } from '@difizen/libro-toc';
|
|
2
|
-
import {
|
|
3
|
-
import { LibroLabLayoutSlots } from "../layout/protocol.js";
|
|
2
|
+
import { ManaModule } from '@difizen/mana-app';
|
|
4
3
|
import { TocPanelView } from "./libro-toc-panel-view.js";
|
|
5
|
-
export var LibroLabTocModule = ManaModule.create().register(TocPanelView
|
|
6
|
-
view: TocPanelView,
|
|
7
|
-
slot: LibroLabLayoutSlots.navigator,
|
|
8
|
-
autoCreate: true,
|
|
9
|
-
openOptions: {
|
|
10
|
-
reveal: true,
|
|
11
|
-
order: 'toc'
|
|
12
|
-
}
|
|
13
|
-
})).dependOn(LibroTOCModule);
|
|
4
|
+
export var LibroLabTocModule = ManaModule.create().register(TocPanelView).dependOn(LibroTOCModule);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@difizen/libro-lab",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"libro",
|
|
@@ -34,18 +34,19 @@
|
|
|
34
34
|
],
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@ant-design/icons": "^5.1.0",
|
|
37
|
-
"@difizen/libro-core": "^0.
|
|
38
|
-
"@difizen/libro-jupyter": "^0.
|
|
39
|
-
"@difizen/libro-kernel": "^0.
|
|
40
|
-
"@difizen/libro-prompt-cell": "^0.
|
|
41
|
-
"@difizen/libro-sql-cell": "^0.
|
|
42
|
-
"@difizen/libro-terminal": "^0.
|
|
43
|
-
"@difizen/libro-toc": "^0.
|
|
44
|
-
"@difizen/libro-
|
|
45
|
-
"@difizen/libro-
|
|
46
|
-
"@difizen/libro-
|
|
47
|
-
"@difizen/libro-
|
|
48
|
-
"@difizen/libro-
|
|
37
|
+
"@difizen/libro-core": "^0.3.0",
|
|
38
|
+
"@difizen/libro-jupyter": "^0.3.0",
|
|
39
|
+
"@difizen/libro-kernel": "^0.3.0",
|
|
40
|
+
"@difizen/libro-prompt-cell": "^0.3.0",
|
|
41
|
+
"@difizen/libro-sql-cell": "^0.3.0",
|
|
42
|
+
"@difizen/libro-terminal": "^0.3.0",
|
|
43
|
+
"@difizen/libro-toc": "^0.3.0",
|
|
44
|
+
"@difizen/libro-app": "^0.3.0",
|
|
45
|
+
"@difizen/libro-cofine-editor-core": "^0.3.0",
|
|
46
|
+
"@difizen/libro-language-client": "^0.3.0",
|
|
47
|
+
"@difizen/libro-widget": "^0.3.0",
|
|
48
|
+
"@difizen/libro-l10n": "^0.3.0",
|
|
49
|
+
"@difizen/libro-ai-native": "^0.3.0",
|
|
49
50
|
"@difizen/mana-app": "latest",
|
|
50
51
|
"@difizen/mana-l10n": "latest",
|
|
51
52
|
"@difizen/mana-common": "latest",
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { ConfigurationNode } from '@difizen/mana-app';
|
|
2
|
+
import { l10n } from '@difizen/mana-l10n';
|
|
3
|
+
|
|
4
|
+
export const LibroLabKernelAndTerminalPanelEnabled: ConfigurationNode<boolean> = {
|
|
5
|
+
id: 'libro.lab.kernel.termianl.panel.enabled',
|
|
6
|
+
description: 'whether enable kernel and terminal panel ',
|
|
7
|
+
title: l10n.t('是否激活 kernel 与终端功能面板'),
|
|
8
|
+
type: 'checkbox',
|
|
9
|
+
defaultValue: true,
|
|
10
|
+
schema: {
|
|
11
|
+
type: 'boolean',
|
|
12
|
+
},
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export const LibroLabTocPanelEnabled: ConfigurationNode<boolean> = {
|
|
16
|
+
id: 'libro.lab.toc.panel.enabled',
|
|
17
|
+
description: 'whether enable toc panel ',
|
|
18
|
+
title: l10n.t('是否激活 toc 功能面板'),
|
|
19
|
+
type: 'checkbox',
|
|
20
|
+
defaultValue: true,
|
|
21
|
+
schema: {
|
|
22
|
+
type: 'boolean',
|
|
23
|
+
},
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export const LibroLabConfiguration = {
|
|
27
|
+
LibroLabKernelAndTerminalPanelEnabled: LibroLabKernelAndTerminalPanelEnabled,
|
|
28
|
+
LibroLabTocPanelEnabled: LibroLabTocPanelEnabled,
|
|
29
|
+
};
|
package/src/config/index.ts
CHANGED
|
@@ -13,8 +13,9 @@ export class CodeEditorViewerOpenHandler extends NavigatableViewOpenHandler<Code
|
|
|
13
13
|
|
|
14
14
|
id = CodeEditorViewerFactory;
|
|
15
15
|
|
|
16
|
+
// TODO: 支持打开的文件扩展
|
|
16
17
|
canHandle(uri: URI, options?: ViewOpenHandlerOptions) {
|
|
17
|
-
if (uri.scheme === 'file' && textFileTypes.includes(uri.path.ext)) {
|
|
18
|
+
if (uri.scheme === 'file' && textFileTypes.includes(uri.path.ext.toLowerCase())) {
|
|
18
19
|
return 100;
|
|
19
20
|
}
|
|
20
21
|
return Priority.IDLE;
|
|
@@ -88,7 +88,7 @@ export class CodeEditorViewer extends BaseView implements NavigatableView, Savea
|
|
|
88
88
|
this.title.label = uri.path.base;
|
|
89
89
|
this.languageSpecRegistry = languageSpecRegistry;
|
|
90
90
|
this.languageSpec = this.languageSpecRegistry.languageSpecs.find((item) =>
|
|
91
|
-
item.ext.includes(uri.path.ext),
|
|
91
|
+
item.ext.includes(uri.path.ext.toLowerCase()),
|
|
92
92
|
);
|
|
93
93
|
configurationService
|
|
94
94
|
.get(LibroConfigAutoSave)
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { LanguageSpecRegistry } from '@difizen/libro-jupyter';
|
|
2
|
+
import { LanguageSpecContribution } from '@difizen/libro-jupyter';
|
|
3
|
+
import { singleton } from '@difizen/mana-app';
|
|
4
|
+
|
|
5
|
+
@singleton({ contrib: [LanguageSpecContribution] })
|
|
6
|
+
export class JuliaLanguageSpecs implements LanguageSpecContribution {
|
|
7
|
+
registerLanguageSpec = (register: LanguageSpecRegistry) => {
|
|
8
|
+
register.registerLanguageSpec({
|
|
9
|
+
name: 'JULIA',
|
|
10
|
+
language: 'julia',
|
|
11
|
+
mime: 'text/x-julia',
|
|
12
|
+
ext: ['.jl', '.JL'],
|
|
13
|
+
});
|
|
14
|
+
};
|
|
15
|
+
}
|
|
@@ -2,8 +2,9 @@ import { LibroJupyterConfiguration } from '@difizen/libro-jupyter';
|
|
|
2
2
|
import type { URI, ViewOpenHandlerOptions } from '@difizen/mana-app';
|
|
3
3
|
import { ConfigurationService, inject } from '@difizen/mana-app';
|
|
4
4
|
import { NavigatableViewOpenHandler, OpenHandler, singleton } from '@difizen/mana-app';
|
|
5
|
-
|
|
5
|
+
|
|
6
6
|
import type { LibroDefaultViewer } from './libro-default-viewer.js';
|
|
7
|
+
import { LibroDefaultViewerFactory } from './protocol.js';
|
|
7
8
|
|
|
8
9
|
@singleton({ contrib: OpenHandler })
|
|
9
10
|
export class LibroDefaultViewerOpenHandler extends NavigatableViewOpenHandler<LibroDefaultViewer> {
|
|
@@ -3,8 +3,10 @@ import { ManaModule } from '@difizen/mana-app';
|
|
|
3
3
|
import { CodeEditorViewerOpenHandler } from './code-editor-open-handler.js';
|
|
4
4
|
import { CodeEditorViewer } from './code-editor-viewer.js';
|
|
5
5
|
import { JSONLanguageSpecs } from './json-langauge.js';
|
|
6
|
+
import { JuliaLanguageSpecs } from './julia-language.js';
|
|
6
7
|
import { LibroDefaultViewerOpenHandler } from './libro-default-open-handler.js';
|
|
7
8
|
import { LibroDefaultViewer } from './libro-default-viewer.js';
|
|
9
|
+
import { RLanguageSpecs } from './r-language.js';
|
|
8
10
|
|
|
9
11
|
export const CodeEditorViewerModule = ManaModule.create(
|
|
10
12
|
'CodeEditorViewerModule',
|
|
@@ -14,4 +16,6 @@ export const CodeEditorViewerModule = ManaModule.create(
|
|
|
14
16
|
CodeEditorViewerOpenHandler,
|
|
15
17
|
LibroDefaultViewerOpenHandler,
|
|
16
18
|
JSONLanguageSpecs,
|
|
19
|
+
RLanguageSpecs,
|
|
20
|
+
JuliaLanguageSpecs,
|
|
17
21
|
);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { LanguageSpecRegistry } from '@difizen/libro-jupyter';
|
|
2
|
+
import { LanguageSpecContribution } from '@difizen/libro-jupyter';
|
|
3
|
+
import { singleton } from '@difizen/mana-app';
|
|
4
|
+
|
|
5
|
+
@singleton({ contrib: [LanguageSpecContribution] })
|
|
6
|
+
export class RLanguageSpecs implements LanguageSpecContribution {
|
|
7
|
+
registerLanguageSpec = (register: LanguageSpecRegistry) => {
|
|
8
|
+
register.registerLanguageSpec({
|
|
9
|
+
name: 'R',
|
|
10
|
+
language: 'r',
|
|
11
|
+
mime: 'text/x-r-source',
|
|
12
|
+
ext: ['.r', '.R'],
|
|
13
|
+
});
|
|
14
|
+
};
|
|
15
|
+
}
|
package/src/index.less
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import { LibroLabLayoutSlots } from '../layout/protocol.js';
|
|
1
|
+
import { ManaModule } from '@difizen/mana-app';
|
|
4
2
|
|
|
5
3
|
import { KernelAndTerminalPanelView } from './kernel-and-terminal-panel-view.js';
|
|
6
4
|
import { KernelPanelColorContribution } from './kernel-color-registry.js';
|
|
@@ -10,13 +8,4 @@ export const LibroKernelAndTerminalPanelModule = ManaModule.create().register(
|
|
|
10
8
|
PanelCommandContribution,
|
|
11
9
|
KernelAndTerminalPanelView,
|
|
12
10
|
KernelPanelColorContribution,
|
|
13
|
-
createViewPreference({
|
|
14
|
-
view: KernelAndTerminalPanelView,
|
|
15
|
-
slot: LibroLabLayoutSlots.navigator,
|
|
16
|
-
autoCreate: true,
|
|
17
|
-
openOptions: {
|
|
18
|
-
reveal: true,
|
|
19
|
-
order: 'kernel',
|
|
20
|
-
},
|
|
21
|
-
}),
|
|
22
11
|
);
|
package/src/lab-app.ts
CHANGED
|
@@ -17,11 +17,25 @@ import {
|
|
|
17
17
|
singleton,
|
|
18
18
|
} from '@difizen/mana-app';
|
|
19
19
|
|
|
20
|
+
import { LibroLabConfiguration } from './config/index.js';
|
|
21
|
+
import { KernelAndTerminalPanelView } from './kernel-and-terminal-panel/index.js';
|
|
20
22
|
import { LibroLabLayoutSlots } from './layout/index.js';
|
|
21
23
|
import { LayoutService } from './layout/layout-service.js';
|
|
24
|
+
import { TocPanelView } from './toc/libro-toc-panel-view.js';
|
|
22
25
|
|
|
23
26
|
const ShouldPreventStoreViewKey = 'mana-should-prevent-store-view';
|
|
24
27
|
|
|
28
|
+
const leftPanelConfigs: Array<{
|
|
29
|
+
configKey: keyof typeof LibroLabConfiguration;
|
|
30
|
+
viewClass: any;
|
|
31
|
+
}> = [
|
|
32
|
+
{
|
|
33
|
+
configKey: 'LibroLabKernelAndTerminalPanelEnabled',
|
|
34
|
+
viewClass: KernelAndTerminalPanelView,
|
|
35
|
+
},
|
|
36
|
+
{ configKey: 'LibroLabTocPanelEnabled', viewClass: TocPanelView },
|
|
37
|
+
// 可以在此处添加更多配置项
|
|
38
|
+
];
|
|
25
39
|
@singleton({ contrib: ApplicationContribution })
|
|
26
40
|
export class LibroLabApp implements ApplicationContribution {
|
|
27
41
|
@inject(ServerConnection) serverConnection: ServerConnection;
|
|
@@ -42,6 +56,16 @@ export class LibroLabApp implements ApplicationContribution {
|
|
|
42
56
|
terminalDefaultSlot,
|
|
43
57
|
LibroLabLayoutSlots.contentBottom,
|
|
44
58
|
);
|
|
59
|
+
|
|
60
|
+
for (const { configKey, viewClass } of leftPanelConfigs) {
|
|
61
|
+
const isEnabled = await this.configurationService.get(
|
|
62
|
+
LibroLabConfiguration[configKey],
|
|
63
|
+
);
|
|
64
|
+
if (isEnabled) {
|
|
65
|
+
const view = await this.viewManager.getOrCreateView(viewClass);
|
|
66
|
+
this.slotViewManager.addView(view, LibroLabLayoutSlots.navigator);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
45
69
|
this.serverManager.ready
|
|
46
70
|
.then(() => {
|
|
47
71
|
this.layoutService.setAreaVisible(LibroLabLayoutSlots.navigator, true);
|
package/src/module.tsx
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { LibroAINativeModule } from '@difizen/libro-ai-native';
|
|
2
|
+
import { LibroAppModule } from '@difizen/libro-app';
|
|
2
3
|
import { FileView, LibroJupyterModule } from '@difizen/libro-jupyter';
|
|
3
4
|
import { langBundles } from '@difizen/libro-l10n';
|
|
4
5
|
import { LibroPromptCellModule } from '@difizen/libro-prompt-cell';
|
|
@@ -131,4 +132,5 @@ export const LibroLabModule = ManaModule.create()
|
|
|
131
132
|
ImageViewerModule,
|
|
132
133
|
CodeEditorViewerModule,
|
|
133
134
|
LibroAINativeModule,
|
|
135
|
+
LibroAppModule,
|
|
134
136
|
);
|
package/src/toc/module.ts
CHANGED
|
@@ -1,21 +1,8 @@
|
|
|
1
1
|
import { LibroTOCModule } from '@difizen/libro-toc';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
import { LibroLabLayoutSlots } from '../layout/protocol.js';
|
|
2
|
+
import { ManaModule } from '@difizen/mana-app';
|
|
5
3
|
|
|
6
4
|
import { TocPanelView } from './libro-toc-panel-view.js';
|
|
7
5
|
|
|
8
6
|
export const LibroLabTocModule = ManaModule.create()
|
|
9
|
-
.register(
|
|
10
|
-
TocPanelView,
|
|
11
|
-
createViewPreference({
|
|
12
|
-
view: TocPanelView,
|
|
13
|
-
slot: LibroLabLayoutSlots.navigator,
|
|
14
|
-
autoCreate: true,
|
|
15
|
-
openOptions: {
|
|
16
|
-
reveal: true,
|
|
17
|
-
order: 'toc',
|
|
18
|
-
},
|
|
19
|
-
}),
|
|
20
|
-
)
|
|
7
|
+
.register(TocPanelView)
|
|
21
8
|
.dependOn(LibroTOCModule);
|