@difizen/libro-lab 0.1.6 → 0.1.7
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/layout/side-tab-view.d.ts +5 -0
- package/es/layout/side-tab-view.d.ts.map +1 -0
- package/es/layout/side-tab-view.js +35 -0
- package/es/module.d.ts.map +1 -1
- package/es/module.js +17 -13
- package/es/welcome/entry-point-view.d.ts.map +1 -1
- package/es/welcome/entry-point-view.js +6 -1
- package/package.json +8 -8
- package/src/layout/side-tab-view.tsx +11 -0
- package/src/module.tsx +14 -13
- package/src/welcome/entry-point-view.tsx +9 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"side-tab-view.d.ts","sourceRoot":"","sources":["../../src/layout/side-tab-view.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAiB,MAAM,mBAAmB,CAAC;AAI/D,qBAEa,mBAAoB,SAAQ,WAAW;IACzC,gBAAgB,IAAI,GAAG,CAAC,OAAO;CAGzC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
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;
|
|
3
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
4
|
+
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); } }
|
|
5
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
6
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
7
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
8
|
+
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); }
|
|
9
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
10
|
+
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); }; }
|
|
11
|
+
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); }
|
|
12
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
13
|
+
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; } }
|
|
14
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
15
|
+
import { SideTabView, ToolbarRender } from '@difizen/mana-app';
|
|
16
|
+
import { view } from '@difizen/mana-app';
|
|
17
|
+
import { transient } from '@difizen/mana-app';
|
|
18
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
19
|
+
export var LibroLabSideTabView = (_dec = transient(), _dec2 = view('libro-lab-side-tab'), _dec(_class = _dec2(_class = /*#__PURE__*/function (_SideTabView) {
|
|
20
|
+
_inherits(LibroLabSideTabView, _SideTabView);
|
|
21
|
+
var _super = _createSuper(LibroLabSideTabView);
|
|
22
|
+
function LibroLabSideTabView() {
|
|
23
|
+
_classCallCheck(this, LibroLabSideTabView);
|
|
24
|
+
return _super.apply(this, arguments);
|
|
25
|
+
}
|
|
26
|
+
_createClass(LibroLabSideTabView, [{
|
|
27
|
+
key: "renderTabToolbar",
|
|
28
|
+
value: function renderTabToolbar() {
|
|
29
|
+
return /*#__PURE__*/_jsx(ToolbarRender, {
|
|
30
|
+
data: [this]
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
}]);
|
|
34
|
+
return LibroLabSideTabView;
|
|
35
|
+
}(SideTabView)) || _class) || _class);
|
package/es/module.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../src/module.tsx"],"names":[],"mappings":"AAGA,OAAO,EACL,UAAU,
|
|
1
|
+
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../src/module.tsx"],"names":[],"mappings":"AAGA,OAAO,EACL,UAAU,EAKX,MAAM,mBAAmB,CAAC;AAe3B,OAAO,cAAc,CAAC;AAOtB,eAAO,MAAM,cAAc,YA0ExB,CAAC"}
|
package/es/module.js
CHANGED
|
@@ -1,37 +1,41 @@
|
|
|
1
1
|
import { FileView, LibroJupyterModule } from '@difizen/libro-jupyter';
|
|
2
2
|
import { LibroPromptCellModule } from '@difizen/libro-prompt-cell';
|
|
3
3
|
import { TerminalModule } from '@difizen/libro-terminal';
|
|
4
|
-
import { ManaModule, createSlotPreference, RootSlotId,
|
|
4
|
+
import { ManaModule, createSlotPreference, RootSlotId, createViewPreference, HeaderArea } from '@difizen/mana-app';
|
|
5
5
|
import { LabConfigAppContribution } from "./config/config-contribution.js";
|
|
6
6
|
import { CodeEditorViewerModule } from "./editor-viewer/index.js";
|
|
7
7
|
import { GithubLinkView } from "./github-link/index.js";
|
|
8
8
|
import { ImageViewerModule } from "./image-viewer/index.js";
|
|
9
|
-
import { KernelManagerView } from
|
|
9
|
+
// import { KernelManagerView } from './kernel-manager/index.js';
|
|
10
10
|
import { LibroLabApp } from "./lab-app.js";
|
|
11
11
|
import { ContentBottomTabView } from "./layout/content-bottom-tab-view.js";
|
|
12
12
|
import { LibroLabLayoutModule, LibroLabLayoutSlots, LibroLabLayoutView } from "./layout/index.js";
|
|
13
13
|
import { SaveableTabView } from "./layout/saveable-tab-view.js";
|
|
14
14
|
import "./index.less";
|
|
15
|
+
import { LibroLabSideTabView } from "./layout/side-tab-view.js";
|
|
15
16
|
import { LibroLabHeaderMenuModule } from "./menu/module.js";
|
|
16
17
|
import { LibroLabTocModule } from "./toc/module.js";
|
|
17
18
|
import { EntryPointView } from "./welcome/entry-point-view.js";
|
|
18
19
|
import { WelcomeView } from "./welcome/index.js";
|
|
19
|
-
export var LibroLabModule = ManaModule.create().register(LibroLabApp, LibroLabLayoutView, GithubLinkView, LabConfigAppContribution, createViewPreference({
|
|
20
|
+
export var LibroLabModule = ManaModule.create().register(LibroLabApp, LibroLabLayoutView, GithubLinkView, LabConfigAppContribution, LibroLabSideTabView, createViewPreference({
|
|
20
21
|
view: GithubLinkView,
|
|
21
22
|
slot: HeaderArea.right,
|
|
22
23
|
openOptions: {
|
|
23
24
|
order: 'github'
|
|
24
25
|
},
|
|
25
26
|
autoCreate: true
|
|
26
|
-
}),
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}
|
|
27
|
+
}),
|
|
28
|
+
// KernelManagerView,
|
|
29
|
+
// createViewPreference({
|
|
30
|
+
// view: KernelManagerView,
|
|
31
|
+
// slot: LibroLabLayoutSlots.navigator,
|
|
32
|
+
// openOptions: {
|
|
33
|
+
// reveal: false,
|
|
34
|
+
// order: 'kernel-manager',
|
|
35
|
+
// },
|
|
36
|
+
// autoCreate: true,
|
|
37
|
+
// }),
|
|
38
|
+
createSlotPreference({
|
|
35
39
|
view: LibroLabLayoutView,
|
|
36
40
|
slot: RootSlotId
|
|
37
41
|
}), createSlotPreference({
|
|
@@ -41,7 +45,7 @@ export var LibroLabModule = ManaModule.create().register(LibroLabApp, LibroLabLa
|
|
|
41
45
|
view: ContentBottomTabView,
|
|
42
46
|
slot: LibroLabLayoutSlots.contentBottom
|
|
43
47
|
}), createSlotPreference({
|
|
44
|
-
view:
|
|
48
|
+
view: LibroLabSideTabView,
|
|
45
49
|
slot: LibroLabLayoutSlots.navigator,
|
|
46
50
|
options: {
|
|
47
51
|
sort: true
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entry-point-view.d.ts","sourceRoot":"","sources":["../../src/welcome/entry-point-view.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"entry-point-view.d.ts","sourceRoot":"","sources":["../../src/welcome/entry-point-view.tsx"],"names":[],"mappings":";AAgBA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAO7C,OAAO,cAAc,CAAC;AAEtB,eAAO,MAAM,mBAAmB,mFAiJ9B,CAAC;AAEH,qBAEa,cAAe,SAAQ,QAAQ;IACjC,IAAI,oFAAuB;CACrC"}
|
|
@@ -19,17 +19,19 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
19
19
|
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
20
20
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
21
21
|
import { NotebookIcon, PythonIcon, JSONIcon, MoreIcon, FileCreateModal, FileView } from '@difizen/libro-jupyter';
|
|
22
|
-
import { ModalService, singleton, useInject, view, ViewManager } from '@difizen/mana-app';
|
|
22
|
+
import { CommandRegistry, ModalService, singleton, useInject, view, ViewManager } from '@difizen/mana-app';
|
|
23
23
|
import { BaseView } from '@difizen/mana-app';
|
|
24
24
|
import { Col, Row } from 'antd';
|
|
25
25
|
import { forwardRef, useEffect, useState } from 'react';
|
|
26
26
|
import { KeybindIcon, PreferenceIcon, TerminalIcon } from "../common/icon.js";
|
|
27
|
+
import { MenuCommands } from "../menu/index.js";
|
|
27
28
|
import "./index.less";
|
|
28
29
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
29
30
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
30
31
|
export var EntryPointComponent = /*#__PURE__*/forwardRef(function EntryPointComponent() {
|
|
31
32
|
var modalService = useInject(ModalService);
|
|
32
33
|
var viewManager = useInject(ViewManager);
|
|
34
|
+
var commandRegistry = useInject(CommandRegistry);
|
|
33
35
|
var _useState = useState(),
|
|
34
36
|
_useState2 = _slicedToArray(_useState, 2),
|
|
35
37
|
fileView = _useState2[0],
|
|
@@ -143,6 +145,9 @@ export var EntryPointComponent = /*#__PURE__*/forwardRef(function EntryPointComp
|
|
|
143
145
|
},
|
|
144
146
|
children: /*#__PURE__*/_jsxs("div", {
|
|
145
147
|
className: "libro-lab-entry-point-item",
|
|
148
|
+
onClick: function onClick() {
|
|
149
|
+
commandRegistry.executeCommand(MenuCommands.OpenTerminal.id);
|
|
150
|
+
},
|
|
146
151
|
children: [/*#__PURE__*/_jsx(TerminalIcon, {}), /*#__PURE__*/_jsx("span", {
|
|
147
152
|
className: "libro-lab-entry-point-item-text",
|
|
148
153
|
children: "Terminal"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@difizen/libro-lab",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.7",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"libro",
|
|
@@ -34,13 +34,13 @@
|
|
|
34
34
|
],
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@ant-design/icons": "^5.1.0",
|
|
37
|
-
"@difizen/libro-core": "^0.1.
|
|
38
|
-
"@difizen/libro-jupyter": "^0.1.
|
|
39
|
-
"@difizen/libro-kernel": "^0.1.
|
|
40
|
-
"@difizen/libro-prompt-cell": "^0.1.
|
|
41
|
-
"@difizen/libro-terminal": "^0.1.
|
|
42
|
-
"@difizen/libro-toc": "^0.1.
|
|
43
|
-
"@difizen/libro-cofine-editor-core": "^0.1.
|
|
37
|
+
"@difizen/libro-core": "^0.1.7",
|
|
38
|
+
"@difizen/libro-jupyter": "^0.1.7",
|
|
39
|
+
"@difizen/libro-kernel": "^0.1.7",
|
|
40
|
+
"@difizen/libro-prompt-cell": "^0.1.7",
|
|
41
|
+
"@difizen/libro-terminal": "^0.1.7",
|
|
42
|
+
"@difizen/libro-toc": "^0.1.7",
|
|
43
|
+
"@difizen/libro-cofine-editor-core": "^0.1.7",
|
|
44
44
|
"@difizen/mana-app": "latest",
|
|
45
45
|
"@difizen/mana-react": "latest",
|
|
46
46
|
"classnames": "^2.3.2",
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { SideTabView, ToolbarRender } from '@difizen/mana-app';
|
|
2
|
+
import { view } from '@difizen/mana-app';
|
|
3
|
+
import { transient } from '@difizen/mana-app';
|
|
4
|
+
|
|
5
|
+
@transient()
|
|
6
|
+
@view('libro-lab-side-tab')
|
|
7
|
+
export class LibroLabSideTabView extends SideTabView {
|
|
8
|
+
override renderTabToolbar(): JSX.Element {
|
|
9
|
+
return <ToolbarRender data={[this]} />;
|
|
10
|
+
}
|
|
11
|
+
}
|
package/src/module.tsx
CHANGED
|
@@ -5,7 +5,6 @@ import {
|
|
|
5
5
|
ManaModule,
|
|
6
6
|
createSlotPreference,
|
|
7
7
|
RootSlotId,
|
|
8
|
-
SideTabView,
|
|
9
8
|
createViewPreference,
|
|
10
9
|
HeaderArea,
|
|
11
10
|
} from '@difizen/mana-app';
|
|
@@ -14,7 +13,7 @@ import { LabConfigAppContribution } from './config/config-contribution.js';
|
|
|
14
13
|
import { CodeEditorViewerModule } from './editor-viewer/index.js';
|
|
15
14
|
import { GithubLinkView } from './github-link/index.js';
|
|
16
15
|
import { ImageViewerModule } from './image-viewer/index.js';
|
|
17
|
-
import { KernelManagerView } from './kernel-manager/index.js';
|
|
16
|
+
// import { KernelManagerView } from './kernel-manager/index.js';
|
|
18
17
|
import { LibroLabApp } from './lab-app.js';
|
|
19
18
|
import { ContentBottomTabView } from './layout/content-bottom-tab-view.js';
|
|
20
19
|
import {
|
|
@@ -24,6 +23,7 @@ import {
|
|
|
24
23
|
} from './layout/index.js';
|
|
25
24
|
import { SaveableTabView } from './layout/saveable-tab-view.js';
|
|
26
25
|
import './index.less';
|
|
26
|
+
import { LibroLabSideTabView } from './layout/side-tab-view.js';
|
|
27
27
|
import { LibroLabHeaderMenuModule } from './menu/module.js';
|
|
28
28
|
import { LibroLabTocModule } from './toc/module.js';
|
|
29
29
|
import { EntryPointView } from './welcome/entry-point-view.js';
|
|
@@ -35,6 +35,7 @@ export const LibroLabModule = ManaModule.create()
|
|
|
35
35
|
LibroLabLayoutView,
|
|
36
36
|
GithubLinkView,
|
|
37
37
|
LabConfigAppContribution,
|
|
38
|
+
LibroLabSideTabView,
|
|
38
39
|
createViewPreference({
|
|
39
40
|
view: GithubLinkView,
|
|
40
41
|
slot: HeaderArea.right,
|
|
@@ -43,16 +44,16 @@ export const LibroLabModule = ManaModule.create()
|
|
|
43
44
|
},
|
|
44
45
|
autoCreate: true,
|
|
45
46
|
}),
|
|
46
|
-
KernelManagerView,
|
|
47
|
-
createViewPreference({
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
}),
|
|
47
|
+
// KernelManagerView,
|
|
48
|
+
// createViewPreference({
|
|
49
|
+
// view: KernelManagerView,
|
|
50
|
+
// slot: LibroLabLayoutSlots.navigator,
|
|
51
|
+
// openOptions: {
|
|
52
|
+
// reveal: false,
|
|
53
|
+
// order: 'kernel-manager',
|
|
54
|
+
// },
|
|
55
|
+
// autoCreate: true,
|
|
56
|
+
// }),
|
|
56
57
|
createSlotPreference({
|
|
57
58
|
view: LibroLabLayoutView,
|
|
58
59
|
slot: RootSlotId,
|
|
@@ -66,7 +67,7 @@ export const LibroLabModule = ManaModule.create()
|
|
|
66
67
|
slot: LibroLabLayoutSlots.contentBottom,
|
|
67
68
|
}),
|
|
68
69
|
createSlotPreference({
|
|
69
|
-
view:
|
|
70
|
+
view: LibroLabSideTabView,
|
|
70
71
|
slot: LibroLabLayoutSlots.navigator,
|
|
71
72
|
options: {
|
|
72
73
|
sort: true,
|
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
FileView,
|
|
8
8
|
} from '@difizen/libro-jupyter';
|
|
9
9
|
import {
|
|
10
|
+
CommandRegistry,
|
|
10
11
|
ModalService,
|
|
11
12
|
singleton,
|
|
12
13
|
useInject,
|
|
@@ -18,12 +19,14 @@ import { Col, Row } from 'antd';
|
|
|
18
19
|
import { forwardRef, useEffect, useState } from 'react';
|
|
19
20
|
|
|
20
21
|
import { KeybindIcon, PreferenceIcon, TerminalIcon } from '../common/icon.js';
|
|
22
|
+
import { MenuCommands } from '../menu/index.js';
|
|
21
23
|
|
|
22
24
|
import './index.less';
|
|
23
25
|
|
|
24
26
|
export const EntryPointComponent = forwardRef(function EntryPointComponent() {
|
|
25
27
|
const modalService = useInject(ModalService);
|
|
26
28
|
const viewManager = useInject(ViewManager);
|
|
29
|
+
const commandRegistry = useInject(CommandRegistry);
|
|
27
30
|
const [fileView, setFileView] = useState<FileView>();
|
|
28
31
|
|
|
29
32
|
useEffect(() => {
|
|
@@ -117,7 +120,12 @@ export const EntryPointComponent = forwardRef(function EntryPointComponent() {
|
|
|
117
120
|
className="gutter-row"
|
|
118
121
|
style={{ paddingLeft: 'unset', paddingRight: '32px' }}
|
|
119
122
|
>
|
|
120
|
-
<div
|
|
123
|
+
<div
|
|
124
|
+
className="libro-lab-entry-point-item"
|
|
125
|
+
onClick={() => {
|
|
126
|
+
commandRegistry.executeCommand(MenuCommands.OpenTerminal.id);
|
|
127
|
+
}}
|
|
128
|
+
>
|
|
121
129
|
<TerminalIcon />
|
|
122
130
|
<span className="libro-lab-entry-point-item-text">Terminal</span>
|
|
123
131
|
</div>
|