@difizen/libro-lab 0.1.0 → 0.1.2

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.
Files changed (107) hide show
  1. package/es/common/icon.d.ts +14 -0
  2. package/es/common/icon.d.ts.map +1 -0
  3. package/es/common/icon.js +368 -0
  4. package/es/common/index.d.ts +2 -0
  5. package/es/common/index.d.ts.map +1 -0
  6. package/es/common/index.js +1 -0
  7. package/es/common/index.less +8 -0
  8. package/es/config/config-contribution.d.ts +7 -0
  9. package/es/config/config-contribution.d.ts.map +1 -0
  10. package/es/config/config-contribution.js +34 -0
  11. package/es/config/index.d.ts +2 -0
  12. package/es/config/index.d.ts.map +1 -0
  13. package/es/config/index.js +1 -0
  14. package/es/github-link/index.d.ts +9 -0
  15. package/es/github-link/index.d.ts.map +1 -0
  16. package/es/index.less +9 -0
  17. package/es/kernel-manager/index.d.ts +8 -0
  18. package/es/kernel-manager/index.d.ts.map +1 -0
  19. package/es/lab-app.d.ts +4 -1
  20. package/es/lab-app.d.ts.map +1 -1
  21. package/es/lab-app.js +26 -5
  22. package/es/layout/brand/index.d.ts +8 -0
  23. package/es/layout/brand/index.d.ts.map +1 -0
  24. package/es/layout/brand/index.js +1 -1
  25. package/es/layout/container.d.ts +8 -0
  26. package/es/layout/container.d.ts.map +1 -0
  27. package/es/layout/content-bottom-tab-view.d.ts +8 -0
  28. package/es/layout/content-bottom-tab-view.d.ts.map +1 -0
  29. package/es/layout/content-bottom-tab-view.js +49 -0
  30. package/es/layout/footer/current-file-footer-view.d.ts +1 -2
  31. package/es/layout/footer/current-file-footer-view.d.ts.map +1 -1
  32. package/es/layout/footer/current-file-footer-view.js +3 -7
  33. package/es/layout/footer/footer-view.d.ts +11 -0
  34. package/es/layout/footer/footer-view.d.ts.map +1 -0
  35. package/es/layout/footer/index.less +10 -7
  36. package/es/layout/footer/status-footer-view.d.ts +10 -0
  37. package/es/layout/footer/status-footer-view.d.ts.map +1 -0
  38. package/es/layout/footer/status-footer-view.js +73 -0
  39. package/es/layout/layout-service.d.ts +15 -0
  40. package/es/layout/layout-service.d.ts.map +1 -0
  41. package/es/layout/layout-service.js +19 -15
  42. package/es/layout/layout.d.ts +12 -0
  43. package/es/layout/layout.d.ts.map +1 -0
  44. package/es/layout/layout.js +43 -6
  45. package/es/layout/main.d.ts.map +1 -1
  46. package/es/layout/main.js +0 -1
  47. package/es/layout/module.d.ts.map +1 -1
  48. package/es/layout/module.js +7 -2
  49. package/es/layout/protocol.d.ts +17 -0
  50. package/es/layout/protocol.d.ts.map +1 -0
  51. package/es/layout/protocol.js +2 -1
  52. package/es/layout/{editor-tab-view.d.ts → saveable-tab-view.d.ts} +2 -2
  53. package/es/layout/saveable-tab-view.d.ts.map +1 -0
  54. package/es/layout/{editor-tab-view.js → saveable-tab-view.js} +9 -10
  55. package/es/menu/menu-bar-view.d.ts +9 -0
  56. package/es/menu/menu-bar-view.d.ts.map +1 -0
  57. package/es/menu/menu-command.d.ts +139 -0
  58. package/es/menu/menu-command.d.ts.map +1 -0
  59. package/es/menu/menu-contribution.d.ts +6 -1
  60. package/es/menu/menu-contribution.d.ts.map +1 -1
  61. package/es/menu/menu-contribution.js +37 -4
  62. package/es/module.d.ts.map +1 -1
  63. package/es/module.js +12 -4
  64. package/es/toc/libro-toc-panel-view.d.ts.map +1 -1
  65. package/es/toc/libro-toc-panel-view.js +2 -1
  66. package/es/welcome/entry-point-view.d.ts +8 -0
  67. package/es/welcome/entry-point-view.d.ts.map +1 -0
  68. package/es/welcome/entry-point-view.js +200 -0
  69. package/es/welcome/index.d.ts +13 -0
  70. package/es/welcome/index.d.ts.map +1 -0
  71. package/es/welcome/index.js +30 -7
  72. package/es/welcome/index.less +99 -0
  73. package/package.json +9 -5
  74. package/src/common/icon.tsx +300 -0
  75. package/src/common/index.less +8 -0
  76. package/src/common/index.tsx +1 -0
  77. package/src/config/config-contribution.ts +12 -0
  78. package/src/config/index.ts +1 -0
  79. package/src/index.less +9 -0
  80. package/src/index.spec.ts +0 -1
  81. package/src/lab-app.ts +16 -1
  82. package/src/layout/brand/index.tsx +1 -1
  83. package/src/layout/content-bottom-tab-view.tsx +18 -0
  84. package/src/layout/footer/current-file-footer-view.tsx +3 -7
  85. package/src/layout/footer/index.less +10 -7
  86. package/src/layout/footer/status-footer-view.tsx +45 -0
  87. package/src/layout/layout-service.ts +9 -8
  88. package/src/layout/layout.tsx +29 -1
  89. package/src/layout/main.tsx +0 -1
  90. package/src/layout/module.ts +10 -2
  91. package/src/layout/protocol.tsx +8 -0
  92. package/src/layout/{editor-tab-view.tsx → saveable-tab-view.tsx} +4 -5
  93. package/src/menu/menu-contribution.ts +24 -1
  94. package/src/module.tsx +15 -2
  95. package/src/toc/libro-toc-panel-view.tsx +2 -1
  96. package/src/welcome/entry-point-view.tsx +169 -0
  97. package/src/welcome/index.less +99 -0
  98. package/src/welcome/index.tsx +40 -7
  99. package/es/layout/brand/logo.js +0 -41
  100. package/es/layout/editor-tab-view.d.ts.map +0 -1
  101. package/es/toc/libro-toc-icons.d.ts +0 -7
  102. package/es/toc/libro-toc-icons.d.ts.map +0 -1
  103. package/es/toc/libro-toc-icons.js +0 -38
  104. package/es/welcome/welcome-icon.js +0 -66
  105. package/src/layout/brand/logo.tsx +0 -39
  106. package/src/toc/libro-toc-icons.tsx +0 -35
  107. package/src/welcome/welcome-icon.tsx +0 -64
@@ -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,mFAqB3B,CAAC;AAEH,qBAEa,WAAY,SAAQ,QAAQ;IAC9B,IAAI,oFAAoB;IACjC,WAAW,EAAE,WAAW,CAAC;IACzB,cAAc,EAAE,cAAc,CAAC;gBACE,WAAW,EAAE,WAAW;CAc1D"}
@@ -12,36 +12,59 @@ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) ===
12
12
  function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
13
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
14
  function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
15
- import { singleton, view } from '@difizen/mana-app';
15
+ import { ServerConnection } from '@difizen/libro-jupyter';
16
+ import { inject, singleton, useInject, view, ViewInstance, ViewManager, ViewRender } from '@difizen/mana-app';
16
17
  import { BaseView } from '@difizen/mana-app';
17
18
  import { forwardRef } from 'react';
18
- import { WelcomeIcon } from "./welcome-icon.js";
19
+ import { LayoutService } from "../layout/layout-service.js";
20
+ import { EntryPointView } from "./entry-point-view.js";
19
21
  import "./index.less";
20
22
  import { jsx as _jsx } from "react/jsx-runtime";
21
23
  import { jsxs as _jsxs } from "react/jsx-runtime";
22
24
  export var WelcomeComponent = /*#__PURE__*/forwardRef(function WelcomeComponent() {
25
+ var instance = useInject(ViewInstance);
26
+ var layoutService = useInject(LayoutService);
27
+ var serverConnection = useInject(ServerConnection);
23
28
  return /*#__PURE__*/_jsxs("div", {
24
29
  className: "libro-lab-welcome-page",
25
30
  children: [/*#__PURE__*/_jsx("div", {
26
31
  className: "libro-lab-welcome-page-title",
27
32
  children: "\u6B22\u8FCE\u4F7F\u7528 Notebook \u5DE5\u4F5C\u53F0 \uD83C\uDF89\uD83C\uDF89"
28
- }), /*#__PURE__*/_jsx("div", {
29
- className: "libro-lab-welcome-page-title-tip",
30
- 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"
33
+ }), /*#__PURE__*/_jsxs("div", {
34
+ className: "libro-lab-welcome-page-server-info",
35
+ children: [/*#__PURE__*/_jsx("div", {
36
+ className: "libro-lab-welcome-page-server-info-title",
37
+ children: "\u670D\u52A1\u8FDE\u63A5\u4FE1\u606F"
38
+ }), /*#__PURE__*/_jsxs("div", {
39
+ className: "libro-lab-welcome-page-server-info-item",
40
+ children: ["BaseURL: ", "".concat(serverConnection.settings.baseUrl)]
41
+ }), /*#__PURE__*/_jsxs("div", {
42
+ className: "libro-lab-welcome-page-server-info-item",
43
+ children: ["WsURL: ", "".concat(serverConnection.settings.wsUrl)]
44
+ })]
45
+ }), layoutService.serverSatus === 'success' && /*#__PURE__*/_jsx(ViewRender, {
46
+ view: instance.entryPointView
31
47
  })]
32
48
  });
33
49
  });
34
50
  export var WelcomeView = (_dec = singleton(), _dec2 = view('welcome-view'), _dec(_class = _dec2(_class = /*#__PURE__*/function (_BaseView) {
35
51
  _inherits(WelcomeView, _BaseView);
36
52
  var _super = _createSuper(WelcomeView);
37
- function WelcomeView() {
53
+ function WelcomeView(viewManager) {
38
54
  var _this;
39
55
  _classCallCheck(this, WelcomeView);
40
56
  _this = _super.call(this);
41
57
  _this.view = WelcomeComponent;
42
- _this.title.icon = /*#__PURE__*/_jsx(WelcomeIcon, {});
58
+ _this.title.icon = '🙌 ';
43
59
  _this.title.label = '欢迎使用';
60
+ _this.title.closable = false;
61
+ _this.viewManager = viewManager;
62
+ _this.viewManager.getOrCreateView(EntryPointView).then(function (entryPointView) {
63
+ _this.entryPointView = entryPointView;
64
+ return;
65
+ }).catch(console.error);
44
66
  return _this;
45
67
  }
68
+ WelcomeView = inject(ViewManager)(WelcomeView, undefined, 0) || WelcomeView;
46
69
  return _createClass(WelcomeView);
47
70
  }(BaseView)) || _class) || _class);
@@ -2,6 +2,7 @@
2
2
  padding: 32px 54px;
3
3
  height: 100%;
4
4
  background: white;
5
+ overflow: auto;
5
6
 
6
7
  .libro-lab-welcome-page-title {
7
8
  /* stylelint-disable-next-line declaration-property-value-disallowed-list */
@@ -19,3 +20,101 @@
19
20
  color: rgba(0, 10, 26, 78%);
20
21
  }
21
22
  }
23
+
24
+ .libro-lab-entry-point-item {
25
+ display: flex;
26
+ align-items: center;
27
+ justify-content: center;
28
+ flex-direction: column;
29
+ margin-bottom: 24px;
30
+ height: 100px;
31
+ width: 100px;
32
+ background-color: rgba(0, 10, 26, 2%);
33
+ border-radius: 8px;
34
+ cursor: pointer;
35
+
36
+ &:hover {
37
+ background-color: rgba(0, 10, 26, 4%);
38
+ }
39
+ }
40
+
41
+ .libro-lab-entry-point-item-text {
42
+ margin-top: 6px;
43
+ line-height: 20px;
44
+ font-size: 14px;
45
+ color: rgba(0, 10, 26, 68%);
46
+ }
47
+
48
+ .libro-lab-entry-point-title {
49
+ font-weight: 500;
50
+ font-size: 18px;
51
+ margin-bottom: 12px;
52
+ color: rgba(0, 10, 26, 89%);
53
+ }
54
+
55
+ .libro-lab-entry-point-item-title {
56
+ font-weight: 500;
57
+ font-size: 16px;
58
+ color: rgba(0, 10, 26, 89%);
59
+ margin-bottom: 16px;
60
+ }
61
+
62
+ .libro-lab-entry-point-item-recent {
63
+ display: flex;
64
+ align-items: center;
65
+ padding: 0 12px;
66
+ height: 52px;
67
+ width: 180px;
68
+ border: 1px solid rgba(0, 10, 26, 7%);
69
+ border-radius: 8px;
70
+ margin-bottom: 24px;
71
+ cursor: pointer;
72
+
73
+ &:hover {
74
+ border-color: transparent;
75
+ background-color: rgba(0, 10, 26, 4%);
76
+ }
77
+ }
78
+
79
+ .libro-lab-entry-point-item-recent-icon {
80
+ font-size: 24px;
81
+ }
82
+
83
+ .libro-lab-entry-point-item-recent-text {
84
+ margin-left: 8px;
85
+ color: rgba(0, 10, 26, 89%);
86
+ }
87
+
88
+ .libro-lab-entry-point-item-config {
89
+ display: flex;
90
+ align-items: center;
91
+ padding: 0 14px;
92
+ cursor: pointer;
93
+ height: 32px;
94
+ border: 1px solid rgba(0, 0, 0, 15%);
95
+ border-radius: 6px;
96
+ }
97
+
98
+ .libro-lab-entry-point-item-config-text {
99
+ margin-left: 4px;
100
+ color: rgba(0, 0, 0, 88%);
101
+ line-height: 22px;
102
+ }
103
+
104
+ .libro-lab-welcome-page-server-info {
105
+ width: 400px;
106
+ background-color: rgba(0, 10, 26, 2%);
107
+ border-radius: 8px;
108
+ margin-bottom: 24px;
109
+ padding: 16px 24px;
110
+ }
111
+
112
+ .libro-lab-welcome-page-server-info-title {
113
+ font-weight: 500;
114
+ font-size: 16px;
115
+ color: rgba(0, 10, 26, 89%);
116
+ }
117
+
118
+ .libro-lab-welcome-page-server-info-item {
119
+ color: rgba(0, 10, 26, 78%);
120
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@difizen/libro-lab",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "libro",
@@ -35,17 +35,21 @@
35
35
  "dependencies": {
36
36
  "@difizen/mana-app": "latest",
37
37
  "@difizen/mana-react": "latest",
38
- "@difizen/libro-jupyter": "0.1.0",
39
- "@difizen/libro-toc": "0.1.0",
38
+ "@difizen/libro-jupyter": "^0.1.2",
39
+ "@difizen/libro-toc": "^0.1.2",
40
+ "@difizen/libro-prompt-cell": "^0.1.2",
41
+ "@difizen/libro-terminal": "^0.1.2",
40
42
  "@ant-design/icons": "^5.1.0",
41
- "classnames": "^2.2.6"
43
+ "classnames": "^2.3.2",
44
+ "uuid": "^9.0.0"
42
45
  },
43
46
  "peerDependencies": {
44
47
  "react": "^18.2.0",
45
48
  "antd": "^5.8.6"
46
49
  },
47
50
  "devDependencies": {
48
- "@types/react": "^18.2.25"
51
+ "@types/react": "^18.2.25",
52
+ "@types/uuid": "^9.0.2"
49
53
  },
50
54
  "scripts": {
51
55
  "setup": "father build",