@difizen/libro-lab 0.0.2-alpha.0 → 0.1.1
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/common/icon.d.ts +14 -0
- package/es/common/icon.d.ts.map +1 -0
- package/es/common/icon.js +368 -0
- package/es/common/index.d.ts +2 -0
- package/es/common/index.d.ts.map +1 -0
- package/es/common/index.js +1 -0
- package/es/common/index.less +8 -0
- package/es/github-link/index.d.ts +9 -0
- package/es/github-link/index.d.ts.map +1 -0
- package/es/github-link/index.js +43 -0
- package/es/index.d.ts +1 -1
- package/es/index.d.ts.map +1 -1
- package/es/index.js +1 -0
- package/es/index.less +78 -0
- package/es/kernel-manager/index.d.ts +8 -0
- package/es/kernel-manager/index.d.ts.map +1 -0
- package/es/kernel-manager/index.js +40 -0
- package/es/lab-app.d.ts +15 -0
- package/es/lab-app.d.ts.map +1 -0
- package/es/lab-app.js +126 -0
- package/es/layout/brand/index.d.ts +8 -0
- package/es/layout/brand/index.d.ts.map +1 -0
- package/es/layout/brand/index.js +46 -0
- package/es/layout/brand/index.less +16 -0
- package/es/layout/container.d.ts +8 -0
- package/es/layout/container.d.ts.map +1 -0
- package/es/layout/container.js +54 -0
- package/es/layout/footer/current-file-footer-view.d.ts +10 -0
- package/es/layout/footer/current-file-footer-view.d.ts.map +1 -0
- package/es/layout/footer/current-file-footer-view.js +62 -0
- package/es/layout/footer/footer-view.d.ts +11 -0
- package/es/layout/footer/footer-view.d.ts.map +1 -0
- package/es/layout/footer/footer-view.js +60 -0
- package/es/layout/footer/index.less +20 -0
- package/es/layout/footer/status-footer-view.d.ts +10 -0
- package/es/layout/footer/status-footer-view.d.ts.map +1 -0
- package/es/layout/footer/status-footer-view.js +73 -0
- package/es/layout/index.d.ts +5 -0
- package/es/layout/index.d.ts.map +1 -0
- package/es/layout/index.js +4 -0
- package/es/layout/index.less +59 -0
- package/es/layout/layout-service.d.ts +15 -0
- package/es/layout/layout-service.d.ts.map +1 -0
- package/es/layout/layout-service.js +104 -0
- package/es/layout/layout.d.ts +12 -0
- package/es/layout/layout.d.ts.map +1 -0
- package/es/layout/layout.js +92 -0
- package/es/layout/main.d.ts +8 -0
- package/es/layout/main.d.ts.map +1 -0
- package/es/layout/main.js +79 -0
- package/es/layout/module.d.ts +3 -0
- package/es/layout/module.d.ts.map +1 -0
- package/es/layout/module.js +45 -0
- package/es/layout/protocol.d.ts +18 -0
- package/es/layout/protocol.d.ts.map +1 -0
- package/es/layout/protocol.js +10 -0
- package/es/layout/saveable-tab-view.d.ts +7 -0
- package/es/layout/saveable-tab-view.d.ts.map +1 -0
- package/es/layout/saveable-tab-view.js +77 -0
- package/es/menu/menu-bar-view.d.ts +9 -0
- package/es/menu/menu-bar-view.d.ts.map +1 -0
- package/es/menu/menu-bar-view.js +49 -0
- package/es/menu/menu-command.d.ts +139 -0
- package/es/menu/menu-command.d.ts.map +1 -0
- package/es/menu/menu-command.js +138 -0
- package/es/menu/menu-contribution.d.ts +18 -0
- package/es/menu/menu-contribution.d.ts.map +1 -0
- package/es/menu/menu-contribution.js +991 -0
- package/es/menu/module.d.ts +3 -0
- package/es/menu/module.d.ts.map +1 -0
- package/es/menu/module.js +7 -0
- package/es/module.d.ts +4 -0
- package/es/module.d.ts.map +1 -0
- package/es/module.js +57 -0
- package/es/toc/index.less +25 -0
- package/es/toc/libro-toc-panel-view.d.ts +18 -0
- package/es/toc/libro-toc-panel-view.d.ts.map +1 -0
- package/es/toc/libro-toc-panel-view.js +104 -0
- package/es/toc/module.d.ts +3 -0
- package/es/toc/module.d.ts.map +1 -0
- package/es/toc/module.js +13 -0
- package/es/welcome/entry-point-view.d.ts +8 -0
- package/es/welcome/entry-point-view.d.ts.map +1 -0
- package/es/welcome/entry-point-view.js +200 -0
- package/es/welcome/index.d.ts +13 -0
- package/es/welcome/index.d.ts.map +1 -0
- package/es/welcome/index.js +75 -0
- package/es/welcome/index.less +122 -0
- package/package.json +10 -3
- package/src/common/icon.tsx +300 -0
- package/src/common/index.less +8 -0
- package/src/common/index.tsx +1 -0
- package/src/github-link/index.tsx +27 -0
- package/src/index.less +78 -0
- package/src/index.spec.ts +10 -0
- package/src/index.ts +1 -0
- package/src/kernel-manager/index.tsx +22 -0
- package/src/lab-app.ts +61 -0
- package/src/layout/brand/index.less +16 -0
- package/src/layout/brand/index.tsx +22 -0
- package/src/layout/container.tsx +28 -0
- package/src/layout/footer/current-file-footer-view.tsx +40 -0
- package/src/layout/footer/footer-view.tsx +30 -0
- package/src/layout/footer/index.less +20 -0
- package/src/layout/footer/status-footer-view.tsx +45 -0
- package/src/layout/index.less +59 -0
- package/src/layout/index.tsx +4 -0
- package/src/layout/layout-service.ts +66 -0
- package/src/layout/layout.tsx +61 -0
- package/src/layout/main.tsx +67 -0
- package/src/layout/module.ts +68 -0
- package/src/layout/protocol.tsx +20 -0
- package/src/layout/saveable-tab-view.tsx +66 -0
- package/src/menu/menu-bar-view.tsx +28 -0
- package/src/menu/menu-command.ts +138 -0
- package/src/menu/menu-contribution.ts +658 -0
- package/src/menu/module.ts +13 -0
- package/src/module.tsx +92 -0
- package/src/toc/index.less +25 -0
- package/src/toc/libro-toc-panel-view.tsx +88 -0
- package/src/toc/module.ts +21 -0
- package/src/welcome/entry-point-view.tsx +169 -0
- package/src/welcome/index.less +122 -0
- package/src/welcome/index.tsx +68 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../src/menu/module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoC,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAKjF,eAAO,MAAM,wBAAwB,YAOpC,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { createSlotPreference, HeaderArea, ManaModule } from '@difizen/mana-app';
|
|
2
|
+
import { MenuBarView } from "./menu-bar-view.js";
|
|
3
|
+
import { HeaderMenu } from "./menu-contribution.js";
|
|
4
|
+
export var LibroLabHeaderMenuModule = ManaModule.create().register(HeaderMenu, MenuBarView, createSlotPreference({
|
|
5
|
+
slot: HeaderArea.middle,
|
|
6
|
+
view: MenuBarView
|
|
7
|
+
}));
|
package/es/module.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../src/module.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,UAAU,EAMX,MAAM,mBAAmB,CAAC;AAW3B,OAAO,cAAc,CAAC;AAMtB,eAAO,MAAM,cAAc,YAiExB,CAAC"}
|
package/es/module.js
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { FileView, LibroJupyterModule } from '@difizen/libro-jupyter';
|
|
2
|
+
import { LibroPromptCellModule } from '@difizen/libro-prompt-cell';
|
|
3
|
+
import { ManaModule, createSlotPreference, RootSlotId, SideTabView, createViewPreference, HeaderArea } from '@difizen/mana-app';
|
|
4
|
+
import { GithubLinkView } from "./github-link/index.js";
|
|
5
|
+
import { KernelManagerView } from "./kernel-manager/index.js";
|
|
6
|
+
import { LibroLabApp } from "./lab-app.js";
|
|
7
|
+
import { LibroLabLayoutModule, LibroLabLayoutSlots, LibroLabLayoutView } from "./layout/index.js";
|
|
8
|
+
import { SaveableTabView } from "./layout/saveable-tab-view.js";
|
|
9
|
+
import "./index.less";
|
|
10
|
+
import { LibroLabHeaderMenuModule } from "./menu/module.js";
|
|
11
|
+
import { LibroLabTocModule } from "./toc/module.js";
|
|
12
|
+
import { EntryPointView } from "./welcome/entry-point-view.js";
|
|
13
|
+
import { WelcomeView } from "./welcome/index.js";
|
|
14
|
+
export var LibroLabModule = ManaModule.create().register(LibroLabApp, LibroLabLayoutView, GithubLinkView, createViewPreference({
|
|
15
|
+
view: GithubLinkView,
|
|
16
|
+
slot: HeaderArea.right,
|
|
17
|
+
openOptions: {
|
|
18
|
+
order: 'github'
|
|
19
|
+
},
|
|
20
|
+
autoCreate: true
|
|
21
|
+
}), KernelManagerView, createViewPreference({
|
|
22
|
+
view: KernelManagerView,
|
|
23
|
+
slot: LibroLabLayoutSlots.navigator,
|
|
24
|
+
openOptions: {
|
|
25
|
+
reveal: false,
|
|
26
|
+
order: 'kernel-manager'
|
|
27
|
+
},
|
|
28
|
+
autoCreate: true
|
|
29
|
+
}), createSlotPreference({
|
|
30
|
+
view: LibroLabLayoutView,
|
|
31
|
+
slot: RootSlotId
|
|
32
|
+
}), createSlotPreference({
|
|
33
|
+
view: SaveableTabView,
|
|
34
|
+
slot: LibroLabLayoutSlots.content
|
|
35
|
+
}), createSlotPreference({
|
|
36
|
+
view: SideTabView,
|
|
37
|
+
slot: LibroLabLayoutSlots.navigator,
|
|
38
|
+
options: {
|
|
39
|
+
sort: true
|
|
40
|
+
}
|
|
41
|
+
}), createViewPreference({
|
|
42
|
+
view: FileView,
|
|
43
|
+
slot: LibroLabLayoutSlots.navigator,
|
|
44
|
+
autoCreate: true,
|
|
45
|
+
openOptions: {
|
|
46
|
+
reveal: true,
|
|
47
|
+
order: 'file-tree'
|
|
48
|
+
}
|
|
49
|
+
}), WelcomeView, createViewPreference({
|
|
50
|
+
view: WelcomeView,
|
|
51
|
+
slot: LibroLabLayoutSlots.content,
|
|
52
|
+
autoCreate: true,
|
|
53
|
+
openOptions: {
|
|
54
|
+
reveal: true,
|
|
55
|
+
order: 'welcome'
|
|
56
|
+
}
|
|
57
|
+
}), EntryPointView).dependOn(LibroJupyterModule, LibroLabLayoutModule, LibroLabHeaderMenuModule, LibroLabTocModule, LibroPromptCellModule);
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
.libro-lab-toc-panel {
|
|
2
|
+
height: 100%;
|
|
3
|
+
|
|
4
|
+
.markdown-toc-container-title {
|
|
5
|
+
display: none;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.mana-tab-side-pane-content {
|
|
9
|
+
height: calc(100% - 32px);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.markdown-toc-container {
|
|
13
|
+
width: unset;
|
|
14
|
+
padding: 12px;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.libro-lab-toc-empty {
|
|
19
|
+
display: flex;
|
|
20
|
+
flex-direction: column;
|
|
21
|
+
align-items: center;
|
|
22
|
+
justify-content: center;
|
|
23
|
+
height: 100%;
|
|
24
|
+
margin: unset;
|
|
25
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/// <reference types="react" resolution-mode="require"/>
|
|
2
|
+
import { LibroNavigatableView } from '@difizen/libro-jupyter';
|
|
3
|
+
import { TOCView } from '@difizen/libro-toc';
|
|
4
|
+
import { BaseView, ViewManager } from '@difizen/mana-app';
|
|
5
|
+
import { LayoutService } from '../layout/layout-service.js';
|
|
6
|
+
import './index.less';
|
|
7
|
+
export declare const TocViewFactoryId = "libro-lab-toc-view";
|
|
8
|
+
export declare class TocPanelView extends BaseView {
|
|
9
|
+
view: import("react").FC<{}>;
|
|
10
|
+
protected viewManager: ViewManager;
|
|
11
|
+
protected layoutService: LayoutService;
|
|
12
|
+
libroTocView: TOCView | undefined;
|
|
13
|
+
constructor();
|
|
14
|
+
onViewMount(): void;
|
|
15
|
+
get libroNavigatableView(): LibroNavigatableView | undefined;
|
|
16
|
+
handleEditTabChange: () => void;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=libro-toc-panel-view.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"libro-toc-panel-view.d.ts","sourceRoot":"","sources":["../../src/toc/libro-toc-panel-view.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EACL,QAAQ,EAOR,WAAW,EAEZ,MAAM,mBAAmB,CAAC;AAI3B,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAG5D,OAAO,cAAc,CAAC;AAmBtB,eAAO,MAAM,gBAAgB,uBAAuB,CAAC;AACrD,qBAEa,YAAa,SAAQ,QAAQ;IAC/B,IAAI,yBAAiB;IACT,SAAS,CAAC,WAAW,EAAE,WAAW,CAAC;IACjC,SAAS,CAAC,aAAa,EAAE,aAAa,CAAC;IACtD,YAAY,EAAE,OAAO,GAAG,SAAS,CAAC;;IAQjC,WAAW,IAAI,IAAI;IAQ5B,IAAI,oBAAoB,qCAMvB;IAED,mBAAmB,aAiBjB;CACH"}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
var _dec, _dec2, _dec3, _dec4, _dec5, _class, _class2, _descriptor, _descriptor2, _descriptor3;
|
|
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(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
8
|
+
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); }
|
|
9
|
+
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); }
|
|
10
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
11
|
+
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); }; }
|
|
12
|
+
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); }
|
|
13
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
14
|
+
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; } }
|
|
15
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
16
|
+
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; }
|
|
17
|
+
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.'); }
|
|
18
|
+
import { LibroNavigatableView } from '@difizen/libro-jupyter';
|
|
19
|
+
import { TOCView } from '@difizen/libro-toc';
|
|
20
|
+
import { BaseView, inject, prop, singleton, useInject, view, ViewInstance, ViewManager, ViewRender } from '@difizen/mana-app';
|
|
21
|
+
import { Empty } from 'antd';
|
|
22
|
+
import { TocIcon } from "../common/index.js";
|
|
23
|
+
import { LayoutService } from "../layout/layout-service.js";
|
|
24
|
+
import { LibroLabLayoutSlots } from "../layout/protocol.js";
|
|
25
|
+
import "./index.less";
|
|
26
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
27
|
+
var TocViewRender = function TocViewRender() {
|
|
28
|
+
var tocPanelView = useInject(ViewInstance);
|
|
29
|
+
return /*#__PURE__*/_jsx("div", {
|
|
30
|
+
className: "libro-lab-toc-panel",
|
|
31
|
+
children: tocPanelView.libroTocView ? /*#__PURE__*/_jsx(ViewRender, {
|
|
32
|
+
view: tocPanelView.libroTocView
|
|
33
|
+
}) : /*#__PURE__*/_jsx(Empty, {
|
|
34
|
+
image: Empty.PRESENTED_IMAGE_SIMPLE,
|
|
35
|
+
description: "\u8BE5\u6587\u4EF6\u683C\u5F0F\u6682\u4E0D\u652F\u6301\u5927\u7EB2",
|
|
36
|
+
className: "libro-lab-toc-empty"
|
|
37
|
+
})
|
|
38
|
+
});
|
|
39
|
+
};
|
|
40
|
+
export var TocViewFactoryId = 'libro-lab-toc-view';
|
|
41
|
+
export var TocPanelView = (_dec = singleton(), _dec2 = view(TocViewFactoryId), _dec3 = inject(ViewManager), _dec4 = inject(LayoutService), _dec5 = prop(), _dec(_class = _dec2(_class = (_class2 = /*#__PURE__*/function (_BaseView) {
|
|
42
|
+
_inherits(TocPanelView, _BaseView);
|
|
43
|
+
var _super = _createSuper(TocPanelView);
|
|
44
|
+
function TocPanelView() {
|
|
45
|
+
var _this;
|
|
46
|
+
_classCallCheck(this, TocPanelView);
|
|
47
|
+
_this = _super.call(this);
|
|
48
|
+
_this.view = TocViewRender;
|
|
49
|
+
_initializerDefineProperty(_this, "viewManager", _descriptor, _assertThisInitialized(_this));
|
|
50
|
+
_initializerDefineProperty(_this, "layoutService", _descriptor2, _assertThisInitialized(_this));
|
|
51
|
+
_initializerDefineProperty(_this, "libroTocView", _descriptor3, _assertThisInitialized(_this));
|
|
52
|
+
_this.handleEditTabChange = function () {
|
|
53
|
+
if (!_this.libroNavigatableView) {
|
|
54
|
+
_this.libroTocView = undefined;
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
_this.viewManager.getOrCreateView(TOCView, {
|
|
58
|
+
id: _this.libroNavigatableView.filePath
|
|
59
|
+
}).then(function (libroTocView) {
|
|
60
|
+
var _this$libroNavigatabl;
|
|
61
|
+
_this.libroTocView = libroTocView;
|
|
62
|
+
_this.libroTocView.parent = (_this$libroNavigatabl = _this.libroNavigatableView) === null || _this$libroNavigatabl === void 0 ? void 0 : _this$libroNavigatabl.libroView;
|
|
63
|
+
return;
|
|
64
|
+
}).catch(function () {
|
|
65
|
+
//
|
|
66
|
+
});
|
|
67
|
+
};
|
|
68
|
+
_this.title.icon = /*#__PURE__*/_jsx(TocIcon, {});
|
|
69
|
+
_this.title.label = '大纲';
|
|
70
|
+
return _this;
|
|
71
|
+
}
|
|
72
|
+
_createClass(TocPanelView, [{
|
|
73
|
+
key: "onViewMount",
|
|
74
|
+
value: function onViewMount() {
|
|
75
|
+
this.handleEditTabChange();
|
|
76
|
+
this.layoutService.onSlotActiveChange(LibroLabLayoutSlots.content, this.handleEditTabChange);
|
|
77
|
+
}
|
|
78
|
+
}, {
|
|
79
|
+
key: "libroNavigatableView",
|
|
80
|
+
get: function get() {
|
|
81
|
+
var contentView = this.layoutService.getActiveView(LibroLabLayoutSlots.content);
|
|
82
|
+
if (contentView instanceof LibroNavigatableView) {
|
|
83
|
+
return contentView;
|
|
84
|
+
}
|
|
85
|
+
return undefined;
|
|
86
|
+
}
|
|
87
|
+
}]);
|
|
88
|
+
return TocPanelView;
|
|
89
|
+
}(BaseView), (_descriptor = _applyDecoratedDescriptor(_class2.prototype, "viewManager", [_dec3], {
|
|
90
|
+
configurable: true,
|
|
91
|
+
enumerable: true,
|
|
92
|
+
writable: true,
|
|
93
|
+
initializer: null
|
|
94
|
+
}), _descriptor2 = _applyDecoratedDescriptor(_class2.prototype, "layoutService", [_dec4], {
|
|
95
|
+
configurable: true,
|
|
96
|
+
enumerable: true,
|
|
97
|
+
writable: true,
|
|
98
|
+
initializer: null
|
|
99
|
+
}), _descriptor3 = _applyDecoratedDescriptor(_class2.prototype, "libroTocView", [_dec5], {
|
|
100
|
+
configurable: true,
|
|
101
|
+
enumerable: true,
|
|
102
|
+
writable: true,
|
|
103
|
+
initializer: null
|
|
104
|
+
})), _class2)) || _class) || _class);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../src/toc/module.ts"],"names":[],"mappings":"AACA,OAAO,EAAwB,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAMrE,eAAO,MAAM,iBAAiB,YAaH,CAAC"}
|
package/es/toc/module.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { LibroTOCModule } from '@difizen/libro-toc';
|
|
2
|
+
import { createViewPreference, ManaModule } from '@difizen/mana-app';
|
|
3
|
+
import { LibroLabLayoutSlots } from "../layout/protocol.js";
|
|
4
|
+
import { TocPanelView } from "./libro-toc-panel-view.js";
|
|
5
|
+
export var LibroLabTocModule = ManaModule.create().register(TocPanelView, createViewPreference({
|
|
6
|
+
view: TocPanelView,
|
|
7
|
+
slot: LibroLabLayoutSlots.navigator,
|
|
8
|
+
autoCreate: true,
|
|
9
|
+
openOptions: {
|
|
10
|
+
reveal: true,
|
|
11
|
+
order: 'toc'
|
|
12
|
+
}
|
|
13
|
+
})).dependOn(LibroTOCModule);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" resolution-mode="require"/>
|
|
2
|
+
import { BaseView } from '@difizen/mana-app';
|
|
3
|
+
import './index.less';
|
|
4
|
+
export declare const EntryPointComponent: import("react").ForwardRefExoticComponent<import("react").RefAttributes<unknown>>;
|
|
5
|
+
export declare class EntryPointView extends BaseView {
|
|
6
|
+
view: import("react").ForwardRefExoticComponent<import("react").RefAttributes<unknown>>;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=entry-point-view.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entry-point-view.d.ts","sourceRoot":"","sources":["../../src/welcome/entry-point-view.tsx"],"names":[],"mappings":";AAeA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAM7C,OAAO,cAAc,CAAC;AAEtB,eAAO,MAAM,mBAAmB,mFA2I9B,CAAC;AAEH,qBAEa,cAAe,SAAQ,QAAQ;IACjC,IAAI,oFAAuB;CACrC"}
|
|
@@ -0,0 +1,200 @@
|
|
|
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 _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(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
6
|
+
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); }
|
|
7
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
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
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
16
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
17
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
18
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
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
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
21
|
+
import { NotebookIcon, PythonIcon, JSONIcon, MoreIcon, FileCreateModal, FileView } from '@difizen/libro-jupyter';
|
|
22
|
+
import { ModalService, singleton, useInject, view, ViewManager } from '@difizen/mana-app';
|
|
23
|
+
import { BaseView } from '@difizen/mana-app';
|
|
24
|
+
import { Col, Row } from 'antd';
|
|
25
|
+
import { forwardRef, useEffect, useState } from 'react';
|
|
26
|
+
import { KeybindIcon, PreferenceIcon, TerminalIcon } from "../common/icon.js";
|
|
27
|
+
import "./index.less";
|
|
28
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
29
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
30
|
+
export var EntryPointComponent = /*#__PURE__*/forwardRef(function EntryPointComponent() {
|
|
31
|
+
var modalService = useInject(ModalService);
|
|
32
|
+
var viewManager = useInject(ViewManager);
|
|
33
|
+
var _useState = useState(),
|
|
34
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
35
|
+
fileView = _useState2[0],
|
|
36
|
+
setFileView = _useState2[1];
|
|
37
|
+
useEffect(function () {
|
|
38
|
+
viewManager.getOrCreateView(FileView).then(function (curfileView) {
|
|
39
|
+
setFileView(curfileView);
|
|
40
|
+
return;
|
|
41
|
+
}).catch(function () {
|
|
42
|
+
//
|
|
43
|
+
});
|
|
44
|
+
}, [viewManager]);
|
|
45
|
+
return /*#__PURE__*/_jsxs("div", {
|
|
46
|
+
className: "libro-lab-entry-point",
|
|
47
|
+
children: [/*#__PURE__*/_jsx("div", {
|
|
48
|
+
className: "libro-lab-entry-point-title",
|
|
49
|
+
children: "\u8BF7\u9009\u62E9\u4F60\u8981\u521B\u5EFA\u7684\u6587\u4EF6\u7C7B\u578B\uFF1A"
|
|
50
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
51
|
+
className: "libro-lab-entry-point-item-title",
|
|
52
|
+
children: "\u6587\u4EF6"
|
|
53
|
+
}), /*#__PURE__*/_jsxs(Row, {
|
|
54
|
+
children: [/*#__PURE__*/_jsx(Col, {
|
|
55
|
+
className: "gutter-row",
|
|
56
|
+
style: {
|
|
57
|
+
paddingLeft: 'unset',
|
|
58
|
+
paddingRight: '32px'
|
|
59
|
+
},
|
|
60
|
+
children: /*#__PURE__*/_jsxs("div", {
|
|
61
|
+
className: "libro-lab-entry-point-item",
|
|
62
|
+
onClick: function onClick() {
|
|
63
|
+
var _fileView$model$locat;
|
|
64
|
+
modalService.openModal(FileCreateModal, {
|
|
65
|
+
path: (fileView === null || fileView === void 0 || (_fileView$model$locat = fileView.model.location) === null || _fileView$model$locat === void 0 ? void 0 : _fileView$model$locat.path.toString()) || '/',
|
|
66
|
+
fileType: '.ipynb'
|
|
67
|
+
});
|
|
68
|
+
},
|
|
69
|
+
children: [/*#__PURE__*/_jsx(NotebookIcon, {}), /*#__PURE__*/_jsx("span", {
|
|
70
|
+
className: "libro-lab-entry-point-item-text",
|
|
71
|
+
children: "Notebook"
|
|
72
|
+
})]
|
|
73
|
+
})
|
|
74
|
+
}), /*#__PURE__*/_jsx(Col, {
|
|
75
|
+
className: "gutter-row",
|
|
76
|
+
style: {
|
|
77
|
+
paddingLeft: 'unset',
|
|
78
|
+
paddingRight: '32px'
|
|
79
|
+
},
|
|
80
|
+
children: /*#__PURE__*/_jsxs("div", {
|
|
81
|
+
className: "libro-lab-entry-point-item",
|
|
82
|
+
onClick: function onClick() {
|
|
83
|
+
var _fileView$model$locat2;
|
|
84
|
+
modalService.openModal(FileCreateModal, {
|
|
85
|
+
path: (fileView === null || fileView === void 0 || (_fileView$model$locat2 = fileView.model.location) === null || _fileView$model$locat2 === void 0 ? void 0 : _fileView$model$locat2.path.toString()) || '/',
|
|
86
|
+
fileType: '.py'
|
|
87
|
+
});
|
|
88
|
+
},
|
|
89
|
+
children: [/*#__PURE__*/_jsx(PythonIcon, {}), /*#__PURE__*/_jsx("span", {
|
|
90
|
+
className: "libro-lab-entry-point-item-text",
|
|
91
|
+
children: "Python"
|
|
92
|
+
})]
|
|
93
|
+
})
|
|
94
|
+
}), /*#__PURE__*/_jsx(Col, {
|
|
95
|
+
className: "gutter-row",
|
|
96
|
+
style: {
|
|
97
|
+
paddingLeft: 'unset',
|
|
98
|
+
paddingRight: '32px'
|
|
99
|
+
},
|
|
100
|
+
children: /*#__PURE__*/_jsxs("div", {
|
|
101
|
+
className: "libro-lab-entry-point-item",
|
|
102
|
+
onClick: function onClick() {
|
|
103
|
+
var _fileView$model$locat3;
|
|
104
|
+
modalService.openModal(FileCreateModal, {
|
|
105
|
+
path: (fileView === null || fileView === void 0 || (_fileView$model$locat3 = fileView.model.location) === null || _fileView$model$locat3 === void 0 ? void 0 : _fileView$model$locat3.path.toString()) || '/',
|
|
106
|
+
fileType: '.json'
|
|
107
|
+
});
|
|
108
|
+
},
|
|
109
|
+
children: [/*#__PURE__*/_jsx(JSONIcon, {}), /*#__PURE__*/_jsx("span", {
|
|
110
|
+
className: "libro-lab-entry-point-item-text",
|
|
111
|
+
children: "JSON"
|
|
112
|
+
})]
|
|
113
|
+
})
|
|
114
|
+
}), /*#__PURE__*/_jsx(Col, {
|
|
115
|
+
className: "gutter-row",
|
|
116
|
+
style: {
|
|
117
|
+
paddingLeft: 'unset',
|
|
118
|
+
paddingRight: '32px'
|
|
119
|
+
},
|
|
120
|
+
children: /*#__PURE__*/_jsxs("div", {
|
|
121
|
+
className: "libro-lab-entry-point-item",
|
|
122
|
+
onClick: function onClick() {
|
|
123
|
+
var _fileView$model$locat4;
|
|
124
|
+
modalService.openModal(FileCreateModal, {
|
|
125
|
+
path: (fileView === null || fileView === void 0 || (_fileView$model$locat4 = fileView.model.location) === null || _fileView$model$locat4 === void 0 ? void 0 : _fileView$model$locat4.path.toString()) || '/'
|
|
126
|
+
});
|
|
127
|
+
},
|
|
128
|
+
children: [/*#__PURE__*/_jsx(MoreIcon, {}), /*#__PURE__*/_jsx("span", {
|
|
129
|
+
className: "libro-lab-entry-point-item-text",
|
|
130
|
+
children: "\u5176\u4ED6"
|
|
131
|
+
})]
|
|
132
|
+
})
|
|
133
|
+
})]
|
|
134
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
135
|
+
className: "libro-lab-entry-point-item-title",
|
|
136
|
+
children: "\u5176\u4ED6"
|
|
137
|
+
}), /*#__PURE__*/_jsx(Row, {
|
|
138
|
+
children: /*#__PURE__*/_jsx(Col, {
|
|
139
|
+
className: "gutter-row",
|
|
140
|
+
style: {
|
|
141
|
+
paddingLeft: 'unset',
|
|
142
|
+
paddingRight: '32px'
|
|
143
|
+
},
|
|
144
|
+
children: /*#__PURE__*/_jsxs("div", {
|
|
145
|
+
className: "libro-lab-entry-point-item",
|
|
146
|
+
children: [/*#__PURE__*/_jsx(TerminalIcon, {}), /*#__PURE__*/_jsx("span", {
|
|
147
|
+
className: "libro-lab-entry-point-item-text",
|
|
148
|
+
children: "Terminal"
|
|
149
|
+
})]
|
|
150
|
+
})
|
|
151
|
+
})
|
|
152
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
153
|
+
className: "libro-lab-entry-point-item-title",
|
|
154
|
+
children: "\u7CFB\u7EDF\u8BBE\u7F6E"
|
|
155
|
+
}), /*#__PURE__*/_jsxs(Row, {
|
|
156
|
+
children: [/*#__PURE__*/_jsx(Col, {
|
|
157
|
+
className: "gutter-row",
|
|
158
|
+
style: {
|
|
159
|
+
paddingLeft: 'unset',
|
|
160
|
+
paddingRight: '24px'
|
|
161
|
+
},
|
|
162
|
+
children: /*#__PURE__*/_jsxs("div", {
|
|
163
|
+
className: "libro-lab-entry-point-item-config",
|
|
164
|
+
children: [/*#__PURE__*/_jsx(PreferenceIcon, {}), /*#__PURE__*/_jsx("span", {
|
|
165
|
+
className: "libro-lab-entry-point-item-config-text",
|
|
166
|
+
children: "\u504F\u597D\u8BBE\u7F6E"
|
|
167
|
+
})]
|
|
168
|
+
})
|
|
169
|
+
}), /*#__PURE__*/_jsx(Col, {
|
|
170
|
+
className: "gutter-row",
|
|
171
|
+
style: {
|
|
172
|
+
paddingLeft: 'unset',
|
|
173
|
+
paddingRight: '24px'
|
|
174
|
+
},
|
|
175
|
+
children: /*#__PURE__*/_jsxs("div", {
|
|
176
|
+
className: "libro-lab-entry-point-item-config",
|
|
177
|
+
children: [/*#__PURE__*/_jsx(KeybindIcon, {}), /*#__PURE__*/_jsx("span", {
|
|
178
|
+
className: "libro-lab-entry-point-item-config-text",
|
|
179
|
+
children: "\u5FEB\u6377\u952E\u8BBE\u7F6E"
|
|
180
|
+
})]
|
|
181
|
+
})
|
|
182
|
+
})]
|
|
183
|
+
})]
|
|
184
|
+
});
|
|
185
|
+
});
|
|
186
|
+
export var EntryPointView = (_dec = singleton(), _dec2 = view('entry-point-view'), _dec(_class = _dec2(_class = /*#__PURE__*/function (_BaseView) {
|
|
187
|
+
_inherits(EntryPointView, _BaseView);
|
|
188
|
+
var _super = _createSuper(EntryPointView);
|
|
189
|
+
function EntryPointView() {
|
|
190
|
+
var _this;
|
|
191
|
+
_classCallCheck(this, EntryPointView);
|
|
192
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
193
|
+
args[_key] = arguments[_key];
|
|
194
|
+
}
|
|
195
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
196
|
+
_this.view = EntryPointComponent;
|
|
197
|
+
return _this;
|
|
198
|
+
}
|
|
199
|
+
return _createClass(EntryPointView);
|
|
200
|
+
}(BaseView)) || _class) || _class);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/// <reference types="react" resolution-mode="require"/>
|
|
2
|
+
import { ViewManager } from '@difizen/mana-app';
|
|
3
|
+
import { BaseView } from '@difizen/mana-app';
|
|
4
|
+
import { EntryPointView } from './entry-point-view.js';
|
|
5
|
+
import './index.less';
|
|
6
|
+
export declare const WelcomeComponent: import("react").ForwardRefExoticComponent<import("react").RefAttributes<unknown>>;
|
|
7
|
+
export declare class WelcomeView extends BaseView {
|
|
8
|
+
view: import("react").ForwardRefExoticComponent<import("react").RefAttributes<unknown>>;
|
|
9
|
+
viewManager: ViewManager;
|
|
10
|
+
entryPointView: EntryPointView;
|
|
11
|
+
constructor(viewManager: ViewManager);
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/welcome/index.tsx"],"names":[],"mappings":";AACA,OAAO,EAML,WAAW,EAEZ,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAK7C,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEvD,OAAO,cAAc,CAAC;AAEtB,eAAO,MAAM,gBAAgB,mFAwB3B,CAAC;AAEH,qBAEa,WAAY,SAAQ,QAAQ;IAC9B,IAAI,oFAAoB;IACjC,WAAW,EAAE,WAAW,CAAC;IACzB,cAAc,EAAE,cAAc,CAAC;gBACE,WAAW,EAAE,WAAW;CAgB1D"}
|
|
@@ -0,0 +1,75 @@
|
|
|
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 _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(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
6
|
+
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); }
|
|
7
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
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 { ServerConnection } from '@difizen/libro-jupyter';
|
|
16
|
+
import { inject, singleton, useInject, view, ViewInstance, ViewManager, ViewRender } from '@difizen/mana-app';
|
|
17
|
+
import { BaseView } from '@difizen/mana-app';
|
|
18
|
+
import { forwardRef } from 'react';
|
|
19
|
+
import { LayoutService } from "../layout/layout-service.js";
|
|
20
|
+
import { EntryPointView } from "./entry-point-view.js";
|
|
21
|
+
import "./index.less";
|
|
22
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
23
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
24
|
+
export var WelcomeComponent = /*#__PURE__*/forwardRef(function WelcomeComponent() {
|
|
25
|
+
var instance = useInject(ViewInstance);
|
|
26
|
+
var layoutService = useInject(LayoutService);
|
|
27
|
+
var serverConnection = useInject(ServerConnection);
|
|
28
|
+
return /*#__PURE__*/_jsxs("div", {
|
|
29
|
+
className: "libro-lab-welcome-page",
|
|
30
|
+
children: [/*#__PURE__*/_jsx("div", {
|
|
31
|
+
className: "libro-lab-welcome-page-title",
|
|
32
|
+
children: "\u6B22\u8FCE\u4F7F\u7528 Notebook \u5DE5\u4F5C\u53F0 \uD83C\uDF89\uD83C\uDF89"
|
|
33
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
34
|
+
className: "libro-lab-welcome-page-title-tip",
|
|
35
|
+
children: "\uD83D\uDC4B \u4F60\u597D\uFF0C\u670D\u52A1\u6B63\u5728\u52A0\u8F7D\u4E2D\uFF0C\u8BF7\u7A0D\u540E\u5F00\u542F\u4F60\u7684\u7814\u53D1\u4E4B\u65C5\u5427\uFF5E"
|
|
36
|
+
}), /*#__PURE__*/_jsxs("div", {
|
|
37
|
+
className: "libro-lab-welcome-page-server-info",
|
|
38
|
+
children: [/*#__PURE__*/_jsx("div", {
|
|
39
|
+
className: "libro-lab-welcome-page-server-info-title",
|
|
40
|
+
children: "\u670D\u52A1\u8FDE\u63A5\u4FE1\u606F"
|
|
41
|
+
}), /*#__PURE__*/_jsxs("div", {
|
|
42
|
+
className: "libro-lab-welcome-page-server-info-item",
|
|
43
|
+
children: ["BaseURL: ", "".concat(serverConnection.settings.baseUrl)]
|
|
44
|
+
}), /*#__PURE__*/_jsxs("div", {
|
|
45
|
+
className: "libro-lab-welcome-page-server-info-item",
|
|
46
|
+
children: ["WsURL: ", "".concat(serverConnection.settings.wsUrl)]
|
|
47
|
+
})]
|
|
48
|
+
}), layoutService.serverSatus === 'success' && /*#__PURE__*/_jsx(ViewRender, {
|
|
49
|
+
view: instance.entryPointView
|
|
50
|
+
})]
|
|
51
|
+
});
|
|
52
|
+
});
|
|
53
|
+
export var WelcomeView = (_dec = singleton(), _dec2 = view('welcome-view'), _dec(_class = _dec2(_class = /*#__PURE__*/function (_BaseView) {
|
|
54
|
+
_inherits(WelcomeView, _BaseView);
|
|
55
|
+
var _super = _createSuper(WelcomeView);
|
|
56
|
+
function WelcomeView(viewManager) {
|
|
57
|
+
var _this;
|
|
58
|
+
_classCallCheck(this, WelcomeView);
|
|
59
|
+
_this = _super.call(this);
|
|
60
|
+
_this.view = WelcomeComponent;
|
|
61
|
+
_this.title.icon = '🙌 ';
|
|
62
|
+
_this.title.label = '欢迎使用';
|
|
63
|
+
_this.title.closable = false;
|
|
64
|
+
_this.viewManager = viewManager;
|
|
65
|
+
_this.viewManager.getOrCreateView(EntryPointView).then(function (entryPointView) {
|
|
66
|
+
_this.entryPointView = entryPointView;
|
|
67
|
+
return;
|
|
68
|
+
}).catch(function () {
|
|
69
|
+
//
|
|
70
|
+
});
|
|
71
|
+
return _this;
|
|
72
|
+
}
|
|
73
|
+
WelcomeView = inject(ViewManager)(WelcomeView, undefined, 0) || WelcomeView;
|
|
74
|
+
return _createClass(WelcomeView);
|
|
75
|
+
}(BaseView)) || _class) || _class);
|