@difizen/libro-lab 0.1.1 → 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 (42) hide show
  1. package/es/config/config-contribution.d.ts +7 -0
  2. package/es/config/config-contribution.d.ts.map +1 -0
  3. package/es/config/config-contribution.js +34 -0
  4. package/es/config/index.d.ts +2 -0
  5. package/es/config/index.d.ts.map +1 -0
  6. package/es/config/index.js +1 -0
  7. package/es/lab-app.d.ts.map +1 -1
  8. package/es/lab-app.js +1 -3
  9. package/es/layout/content-bottom-tab-view.d.ts +8 -0
  10. package/es/layout/content-bottom-tab-view.d.ts.map +1 -0
  11. package/es/layout/content-bottom-tab-view.js +49 -0
  12. package/es/layout/layout-service.d.ts.map +1 -1
  13. package/es/layout/layout-service.js +4 -5
  14. package/es/layout/layout.d.ts.map +1 -1
  15. package/es/layout/layout.js +5 -1
  16. package/es/layout/module.d.ts.map +1 -1
  17. package/es/layout/module.js +2 -1
  18. package/es/layout/protocol.d.ts +0 -1
  19. package/es/layout/protocol.d.ts.map +1 -1
  20. package/es/layout/saveable-tab-view.js +1 -1
  21. package/es/menu/menu-contribution.d.ts +6 -1
  22. package/es/menu/menu-contribution.d.ts.map +1 -1
  23. package/es/menu/menu-contribution.js +37 -4
  24. package/es/module.d.ts.map +1 -1
  25. package/es/module.js +8 -2
  26. package/es/welcome/index.d.ts.map +1 -1
  27. package/es/welcome/index.js +1 -6
  28. package/es/welcome/index.less +1 -3
  29. package/package.json +9 -6
  30. package/src/config/config-contribution.ts +12 -0
  31. package/src/config/index.ts +1 -0
  32. package/src/index.spec.ts +0 -1
  33. package/src/lab-app.ts +1 -3
  34. package/src/layout/content-bottom-tab-view.tsx +18 -0
  35. package/src/layout/layout-service.ts +2 -3
  36. package/src/layout/layout.tsx +5 -1
  37. package/src/layout/module.ts +2 -0
  38. package/src/layout/saveable-tab-view.tsx +1 -1
  39. package/src/menu/menu-contribution.ts +24 -1
  40. package/src/module.tsx +9 -0
  41. package/src/welcome/index.less +1 -3
  42. package/src/welcome/index.tsx +1 -6
@@ -0,0 +1,7 @@
1
+ import { ConfigurationService } from '@difizen/mana-app';
2
+ import { ApplicationContribution } from '@difizen/mana-app';
3
+ export declare class LabConfigAppContribution implements ApplicationContribution {
4
+ configurationService: ConfigurationService;
5
+ onViewStart(): void;
6
+ }
7
+ //# sourceMappingURL=config-contribution.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config-contribution.d.ts","sourceRoot":"","sources":["../../src/config/config-contribution.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAC;AAG5D,qBACa,wBAAyB,YAAW,uBAAuB;IACxC,oBAAoB,EAAE,oBAAoB,CAAC;IACzE,WAAW;CAGZ"}
@@ -0,0 +1,34 @@
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, _class2, _descriptor;
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 _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; }
10
+ 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.'); }
11
+ import { LibroConfigAutoSave } from '@difizen/libro-jupyter';
12
+ import { ConfigurationService } from '@difizen/mana-app';
13
+ import { ApplicationContribution } from '@difizen/mana-app';
14
+ import { inject, singleton } from '@difizen/mana-app';
15
+ export var LabConfigAppContribution = (_dec = singleton({
16
+ contrib: ApplicationContribution
17
+ }), _dec2 = inject(ConfigurationService), _dec(_class = (_class2 = /*#__PURE__*/function () {
18
+ function LabConfigAppContribution() {
19
+ _classCallCheck(this, LabConfigAppContribution);
20
+ _initializerDefineProperty(this, "configurationService", _descriptor, this);
21
+ }
22
+ _createClass(LabConfigAppContribution, [{
23
+ key: "onViewStart",
24
+ value: function onViewStart() {
25
+ this.configurationService.set(LibroConfigAutoSave, true);
26
+ }
27
+ }]);
28
+ return LabConfigAppContribution;
29
+ }(), (_descriptor = _applyDecoratedDescriptor(_class2.prototype, "configurationService", [_dec2], {
30
+ configurable: true,
31
+ enumerable: true,
32
+ writable: true,
33
+ initializer: null
34
+ })), _class2)) || _class);
@@ -0,0 +1,2 @@
1
+ export * from './config-contribution.js';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/config/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC"}
@@ -0,0 +1 @@
1
+ export * from "./config-contribution.js";
@@ -1 +1 @@
1
- {"version":3,"file":"lab-app.d.ts","sourceRoot":"","sources":["../src/lab-app.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,gBAAgB,EAEhB,aAAa,EACd,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EACL,oBAAoB,EAGpB,uBAAuB,EACvB,eAAe,EACf,WAAW,EAGZ,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAI3D,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;cAmBG,gBAAgB;CAQjC"}
1
+ {"version":3,"file":"lab-app.d.ts","sourceRoot":"","sources":["../src/lab-app.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,gBAAgB,EAEhB,aAAa,EACd,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EACL,oBAAoB,EAGpB,uBAAuB,EACvB,eAAe,EACf,WAAW,EAGZ,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAI3D,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;cAiBG,gBAAgB;CAQjC"}
package/es/lab-app.js CHANGED
@@ -45,9 +45,7 @@ export var LibroLabApp = (_dec = singleton({
45
45
  _this.layoutService.serverSatus = 'success';
46
46
  _this.initialWorkspace();
47
47
  return;
48
- }).catch(function () {
49
- //
50
- });
48
+ }).catch(console.error);
51
49
  case 3:
52
50
  case "end":
53
51
  return _context.stop();
@@ -0,0 +1,8 @@
1
+ import type { View } from '@difizen/mana-app';
2
+ import { CardTabView } from '@difizen/mana-app';
3
+ import { LayoutService } from './layout-service.js';
4
+ export declare class ContentBottomTabView extends CardTabView {
5
+ layoutService: LayoutService;
6
+ close(item: View): void;
7
+ }
8
+ //# sourceMappingURL=content-bottom-tab-view.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"content-bottom-tab-view.d.ts","sourceRoot":"","sources":["../../src/layout/content-bottom-tab-view.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAmB,WAAW,EAAU,MAAM,mBAAmB,CAAC;AAEzE,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAGpD,qBAEa,oBAAqB,SAAQ,WAAW;IAC5B,aAAa,EAAE,aAAa,CAAC;IAE3C,KAAK,CAAC,IAAI,EAAE,IAAI;CAM1B"}
@@ -0,0 +1,49 @@
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, _class, _class2, _descriptor;
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 { transient, view, CardTabView, inject } from '@difizen/mana-app';
19
+ import { LayoutService } from "./layout-service.js";
20
+ import { LibroLabLayoutSlots } from "./protocol.js";
21
+ export var ContentBottomTabView = (_dec = transient(), _dec2 = view('libro-lab-layout-content-bottom'), _dec3 = inject(LayoutService), _dec(_class = _dec2(_class = (_class2 = /*#__PURE__*/function (_CardTabView) {
22
+ _inherits(ContentBottomTabView, _CardTabView);
23
+ var _super = _createSuper(ContentBottomTabView);
24
+ function ContentBottomTabView() {
25
+ var _this;
26
+ _classCallCheck(this, ContentBottomTabView);
27
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
28
+ args[_key] = arguments[_key];
29
+ }
30
+ _this = _super.call.apply(_super, [this].concat(args));
31
+ _initializerDefineProperty(_this, "layoutService", _descriptor, _assertThisInitialized(_this));
32
+ return _this;
33
+ }
34
+ _createClass(ContentBottomTabView, [{
35
+ key: "close",
36
+ value: function close(item) {
37
+ item.dispose();
38
+ if (this.children.length === 0) {
39
+ this.layoutService.setAreaVisible(LibroLabLayoutSlots.contentBottom, false);
40
+ }
41
+ }
42
+ }]);
43
+ return ContentBottomTabView;
44
+ }(CardTabView), (_descriptor = _applyDecoratedDescriptor(_class2.prototype, "layoutService", [_dec3], {
45
+ configurable: true,
46
+ enumerable: true,
47
+ writable: true,
48
+ initializer: null
49
+ })), _class2)) || _class) || _class);
@@ -1 +1 @@
1
- {"version":3,"file":"layout-service.d.ts","sourceRoot":"","sources":["../../src/layout/layout-service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAY,IAAI,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAChF,OAAO,EAKL,eAAe,EAChB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,KAAK,EAAE,uBAAuB,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAGzE,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC,uBAAuB,EAAE,OAAO,CAAC,CAAC;AAErE,qBACa,aAAa;IACC,SAAS,CAAC,QAAQ,CAAC,eAAe,EAAE,eAAe,CAAC;IAG7E,WAAW,EAAE,UAAU,CAAa;IAEpC,aAAa,EAAE,aAAa,CAS1B;IAEF,aAAa,CAAC,IAAI,EAAE,uBAAuB,GAAG,OAAO;IAIrD,cAAc,CAAC,IAAI,EAAE,uBAAuB,EAAE,OAAO,EAAE,OAAO;IAIxD,OAAO,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,CAAC,EAAE,sBAAsB,GAAG,OAAO,CAAC,IAAI,CAAC;IAMzE,aAAa,CAAC,IAAI,EAAE,uBAAuB;IAU3C,kBAAkB,CAAC,IAAI,EAAE,uBAAuB,EAAE,OAAO,EAAE,MAAM,IAAI;CAStE"}
1
+ {"version":3,"file":"layout-service.d.ts","sourceRoot":"","sources":["../../src/layout/layout-service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AACtE,OAAO,EAKL,eAAe,EAChB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,KAAK,EAAE,uBAAuB,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAGzE,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC,uBAAuB,EAAE,OAAO,CAAC,CAAC;AAErE,qBACa,aAAa;IACC,SAAS,CAAC,QAAQ,CAAC,eAAe,EAAE,eAAe,CAAC;IAG7E,WAAW,EAAE,UAAU,CAAa;IAEpC,aAAa,EAAE,aAAa,CAS1B;IAEF,aAAa,CAAC,IAAI,EAAE,uBAAuB,GAAG,OAAO;IAIrD,cAAc,CAAC,IAAI,EAAE,uBAAuB,EAAE,OAAO,EAAE,OAAO;IAIxD,OAAO,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,CAAC,EAAE,sBAAsB,GAAG,OAAO,CAAC,IAAI,CAAC;IAKzE,aAAa,CAAC,IAAI,EAAE,uBAAuB;IAU3C,kBAAkB,CAAC,IAAI,EAAE,uBAAuB,EAAE,OAAO,EAAE,MAAM,IAAI;CAStE"}
@@ -38,15 +38,14 @@ export var LayoutService = (_dec = singleton(), _dec2 = inject(SlotViewManager),
38
38
  key: "addView",
39
39
  value: function () {
40
40
  var _addView = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(view, option) {
41
- var _ref, _ref$slot, slot, viewOpenOption, slotView;
41
+ var _ref, _ref$slot, slot, viewOpenOption;
42
42
  return _regeneratorRuntime().wrap(function _callee$(_context) {
43
43
  while (1) switch (_context.prev = _context.next) {
44
44
  case 0:
45
45
  _ref = option || {}, _ref$slot = _ref.slot, slot = _ref$slot === void 0 ? LibroLabLayoutSlots.main : _ref$slot, viewOpenOption = _objectWithoutProperties(_ref, _excluded);
46
- slotView = this.slotViewManager.getSlotView(slot);
47
- _context.next = 4;
48
- return slotView.addView(view, viewOpenOption);
49
- case 4:
46
+ _context.next = 3;
47
+ return this.slotViewManager.addView(view, slot, viewOpenOption);
48
+ case 3:
50
49
  case "end":
51
50
  return _context.stop();
52
51
  }
@@ -1 +1 @@
1
- {"version":3,"file":"layout.d.ts","sourceRoot":"","sources":["../../src/layout/layout.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAO7C,OAAO,cAAc,CAAC;AAEtB,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAGpD,eAAO,MAAM,gCAAgC,mFA8B5C,CAAC;AAEF,qBAEa,kBAAmB,SAAQ,QAAQ;IACrC,IAAI,oFAAoC;IAE1B,aAAa,EAAE,aAAa,CAAC;IAEpD,UAAU,IAAI,MAAM;IAIpB,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;CAIrC"}
1
+ {"version":3,"file":"layout.d.ts","sourceRoot":"","sources":["../../src/layout/layout.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAO7C,OAAO,cAAc,CAAC;AAEtB,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAGpD,eAAO,MAAM,gCAAgC,mFA8B5C,CAAC;AAEF,qBAEa,kBAAmB,SAAQ,QAAQ;IACrC,IAAI,oFAAoC;IAE1B,aAAa,EAAE,aAAa,CAAC;IAEpD,UAAU,IAAI,MAAM;IAIpB,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;CAQrC"}
@@ -1,5 +1,8 @@
1
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
2
  var _dec, _dec2, _dec3, _class, _class2, _descriptor;
3
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
4
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
5
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
3
6
  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
7
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
5
8
  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); } }
@@ -79,8 +82,9 @@ export var LibroLabLayoutView = (_dec = singleton(), _dec2 = view('libro-lab-lay
79
82
  }, {
80
83
  key: "restoreState",
81
84
  value: function restoreState(oldState) {
85
+ var _objectSpread2;
82
86
  var state = oldState;
83
- this.layoutService.visibilityMap = state.visibilityMap;
87
+ this.layoutService.visibilityMap = _objectSpread(_objectSpread({}, state.visibilityMap), {}, (_objectSpread2 = {}, _defineProperty(_objectSpread2, LibroLabLayoutSlots.navigator, false), _defineProperty(_objectSpread2, LibroLabLayoutSlots.alert, true), _objectSpread2));
84
88
  }
85
89
  }]);
86
90
  return LibroLabLayoutView;
@@ -1 +1 @@
1
- {"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../src/layout/module.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,UAAU,EACX,MAAM,mBAAmB,CAAC;AAa3B,eAAO,MAAM,oBAAoB,YAgDhC,CAAC"}
1
+ {"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../src/layout/module.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,UAAU,EACX,MAAM,mBAAmB,CAAC;AAc3B,eAAO,MAAM,oBAAoB,YAiDhC,CAAC"}
@@ -1,6 +1,7 @@
1
1
  import { createSlotPreference, FlexSlotView, HeaderArea, HeaderView, ManaModule } from '@difizen/mana-app';
2
2
  import { BrandView } from "./brand/index.js";
3
3
  import { LibroLabLayoutContainerView } from "./container.js";
4
+ import { ContentBottomTabView } from "./content-bottom-tab-view.js";
4
5
  import { LibroLabCurrentFileFooterView } from "./footer/current-file-footer-view.js";
5
6
  import { FooterArea, LibroLabLayoutFooterView } from "./footer/footer-view.js";
6
7
  import { LibroLabStatusFooterView } from "./footer/status-footer-view.js";
@@ -9,7 +10,7 @@ import { LibroLabLayoutView } from "./layout.js";
9
10
  import { LibroLabLayoutMainView } from "./main.js";
10
11
  import { LibroLabLayoutSlots } from "./protocol.js";
11
12
  import { SaveableTabView } from "./saveable-tab-view.js";
12
- export var LibroLabLayoutModule = ManaModule.create('LibroLabLayoutModule').register(LibroLabLayoutView, LibroLabLayoutContainerView, LibroLabLayoutMainView, BrandView, SaveableTabView, LibroLabLayoutFooterView, LibroLabCurrentFileFooterView, LayoutService, createSlotPreference({
13
+ export var LibroLabLayoutModule = ManaModule.create('LibroLabLayoutModule').register(LibroLabLayoutView, LibroLabLayoutContainerView, LibroLabLayoutMainView, BrandView, SaveableTabView, ContentBottomTabView, LibroLabLayoutFooterView, LibroLabCurrentFileFooterView, LayoutService, createSlotPreference({
13
14
  slot: LibroLabLayoutSlots.header,
14
15
  view: HeaderView
15
16
  }), createSlotPreference({
@@ -1,4 +1,3 @@
1
- /// <reference types="react" resolution-mode="require"/>
2
1
  export declare const LibroLabLayoutSlots: {
3
2
  header: string;
4
3
  container: string;
@@ -1 +1 @@
1
- {"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../../src/layout/protocol.tsx"],"names":[],"mappings":";AAAA,eAAO,MAAM,mBAAmB;;;;;;;;;CAS/B,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,SAAS,CAAC;AAE/C,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,GAAG,CAAC,OAAO,CAAC;CACnB;AAED,MAAM,MAAM,uBAAuB,GACjC,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,OAAO,mBAAmB,CAAC,CAAC"}
1
+ {"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../../src/layout/protocol.tsx"],"names":[],"mappings":"AAAA,eAAO,MAAM,mBAAmB;;;;;;;;;CAS/B,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,SAAS,CAAC;AAE/C,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,GAAG,CAAC,OAAO,CAAC;CACnB;AAED,MAAM,MAAM,uBAAuB,GACjC,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,OAAO,mBAAmB,CAAC,CAAC"}
@@ -19,7 +19,7 @@ import { Badge } from 'antd';
19
19
  import classnames from 'classnames';
20
20
  import { jsx as _jsx } from "react/jsx-runtime";
21
21
  import { jsxs as _jsxs } from "react/jsx-runtime";
22
- export var SaveableTabView = (_dec = transient(), _dec2 = view('LibroLabSaveableTab'), _dec(_class = _dec2(_class = /*#__PURE__*/function (_CardTabView) {
22
+ export var SaveableTabView = (_dec = transient(), _dec2 = view('libro-lab-saveable-tab'), _dec(_class = _dec2(_class = /*#__PURE__*/function (_CardTabView) {
23
23
  _inherits(SaveableTabView, _CardTabView);
24
24
  var _super = _createSuper(SaveableTabView);
25
25
  function SaveableTabView() {
@@ -1,6 +1,8 @@
1
1
  import { LibroService } from '@difizen/libro-jupyter';
2
+ import { TerminalManager } from '@difizen/libro-terminal';
2
3
  import type { MenuRegistry } from '@difizen/mana-app';
3
- import { CommandContribution, CommandRegistry, MenuContribution } from '@difizen/mana-app';
4
+ import { CommandContribution, CommandRegistry, MenuContribution, ViewManager } from '@difizen/mana-app';
5
+ import { LayoutService } from '../layout/layout-service.js';
4
6
  export declare namespace HeaderMenus {
5
7
  const FILE: string[];
6
8
  const EDIT: string[];
@@ -12,6 +14,9 @@ export declare namespace HeaderMenus {
12
14
  export declare class HeaderMenu implements MenuContribution, CommandContribution {
13
15
  protected commandRegistry: CommandRegistry;
14
16
  protected libroService: LibroService;
17
+ protected layoutService: LayoutService;
18
+ terminalManager: TerminalManager;
19
+ viewManager: ViewManager;
15
20
  registerMenus(menu: MenuRegistry): void;
16
21
  registerCommands(commands: CommandRegistry): void;
17
22
  }
@@ -1 +1 @@
1
- {"version":3,"file":"menu-contribution.d.ts","sourceRoot":"","sources":["../../src/menu/menu-contribution.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,YAAY,EAEb,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EACL,mBAAmB,EACnB,eAAe,EAGf,gBAAgB,EAEjB,MAAM,mBAAmB,CAAC;AAI3B,yBAAiB,WAAW,CAAC;IACpB,MAAM,IAAI,UAA+B,CAAC;IAC1C,MAAM,IAAI,UAA+B,CAAC;IAC1C,MAAM,IAAI,UAA+B,CAAC;IAC1C,MAAM,GAAG,UAA8B,CAAC;IACxC,MAAM,QAAQ,UAAmC,CAAC;IAClD,MAAM,IAAI,UAA+B,CAAC;CAClD;AAED,qBACa,UAAW,YAAW,gBAAgB,EAAE,mBAAmB;IAC7C,SAAS,CAAC,eAAe,EAAE,eAAe,CAAC;IAC9C,SAAS,CAAC,YAAY,EAAE,YAAY,CAAC;IAE3D,aAAa,CAAC,IAAI,EAAE,YAAY;IAkLhC,gBAAgB,CAAC,QAAQ,EAAE,eAAe;CA+b3C"}
1
+ {"version":3,"file":"menu-contribution.d.ts","sourceRoot":"","sources":["../../src/menu/menu-contribution.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,YAAY,EAEb,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAqB,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC7E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EACL,mBAAmB,EACnB,eAAe,EAGf,gBAAgB,EAEhB,WAAW,EACZ,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAK5D,yBAAiB,WAAW,CAAC;IACpB,MAAM,IAAI,UAA+B,CAAC;IAC1C,MAAM,IAAI,UAA+B,CAAC;IAC1C,MAAM,IAAI,UAA+B,CAAC;IAC1C,MAAM,GAAG,UAA8B,CAAC;IACxC,MAAM,QAAQ,UAAmC,CAAC;IAClD,MAAM,IAAI,UAA+B,CAAC;CAClD;AAED,qBACa,UAAW,YAAW,gBAAgB,EAAE,mBAAmB;IAC7C,SAAS,CAAC,eAAe,EAAE,eAAe,CAAC;IAC9C,SAAS,CAAC,YAAY,EAAE,YAAY,CAAC;IACpC,SAAS,CAAC,aAAa,EAAE,aAAa,CAAC;IACrC,eAAe,EAAE,eAAe,CAAC;IACrC,WAAW,EAAE,WAAW,CAAC;IAE9C,aAAa,CAAC,IAAI,EAAE,YAAY;IAkLhC,gBAAgB,CAAC,QAAQ,EAAE,eAAe;CA6c3C"}
@@ -1,5 +1,5 @@
1
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, _class, _class2, _descriptor, _descriptor2;
2
+ var _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _class, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5;
3
3
  function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
4
4
  function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
5
5
  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,7 +18,11 @@ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input ==
18
18
  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; }
19
19
  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.'); }
20
20
  import { LibroJupyterView, LibroService, NotebookCommands } from '@difizen/libro-jupyter';
21
- import { CommandContribution, CommandRegistry, inject, MAIN_MENU_BAR, MenuContribution, singleton } from '@difizen/mana-app';
21
+ import { LibroTerminalView, TerminalManager } from '@difizen/libro-terminal';
22
+ import { CommandContribution, CommandRegistry, inject, MAIN_MENU_BAR, MenuContribution, singleton, ViewManager } from '@difizen/mana-app';
23
+ import { v4 } from 'uuid';
24
+ import { LayoutService } from "../layout/layout-service.js";
25
+ import { LibroLabLayoutSlots } from "../layout/protocol.js";
22
26
  import { MenuCommands } from "./menu-command.js";
23
27
  export var HeaderMenus;
24
28
  (function (_HeaderMenus) {
@@ -31,11 +35,14 @@ export var HeaderMenus;
31
35
  })(HeaderMenus || (HeaderMenus = {}));
32
36
  export var HeaderMenu = (_dec = singleton({
33
37
  contrib: [MenuContribution, CommandContribution]
34
- }), _dec2 = inject(CommandRegistry), _dec3 = inject(LibroService), _dec(_class = (_class2 = /*#__PURE__*/function () {
38
+ }), _dec2 = inject(CommandRegistry), _dec3 = inject(LibroService), _dec4 = inject(LayoutService), _dec5 = inject(TerminalManager), _dec6 = inject(ViewManager), _dec(_class = (_class2 = /*#__PURE__*/function () {
35
39
  function HeaderMenu() {
36
40
  _classCallCheck(this, HeaderMenu);
37
41
  _initializerDefineProperty(this, "commandRegistry", _descriptor, this);
38
42
  _initializerDefineProperty(this, "libroService", _descriptor2, this);
43
+ _initializerDefineProperty(this, "layoutService", _descriptor3, this);
44
+ _initializerDefineProperty(this, "terminalManager", _descriptor4, this);
45
+ _initializerDefineProperty(this, "viewManager", _descriptor5, this);
39
46
  }
40
47
  _createClass(HeaderMenu, [{
41
48
  key: "registerMenus",
@@ -235,7 +242,18 @@ export var HeaderMenu = (_dec = singleton({
235
242
  var _this = this;
236
243
  commands.registerCommand(MenuCommands.OpenTerminal, {
237
244
  execute: function execute() {
238
- //TODO: 增加终端
245
+ _this.viewManager.getOrCreateView(LibroTerminalView, {
246
+ id: v4()
247
+ }).then(function (terminalView) {
248
+ _this.layoutService.setAreaVisible(LibroLabLayoutSlots.contentBottom, true);
249
+ _this.layoutService.addView(terminalView, {
250
+ slot: LibroLabLayoutSlots.contentBottom,
251
+ reveal: true
252
+ });
253
+ return;
254
+ }).catch(function () {
255
+ //
256
+ });
239
257
  }
240
258
  });
241
259
  commands.registerCommand(MenuCommands.About, {
@@ -988,4 +1006,19 @@ export var HeaderMenu = (_dec = singleton({
988
1006
  enumerable: true,
989
1007
  writable: true,
990
1008
  initializer: null
1009
+ }), _descriptor3 = _applyDecoratedDescriptor(_class2.prototype, "layoutService", [_dec4], {
1010
+ configurable: true,
1011
+ enumerable: true,
1012
+ writable: true,
1013
+ initializer: null
1014
+ }), _descriptor4 = _applyDecoratedDescriptor(_class2.prototype, "terminalManager", [_dec5], {
1015
+ configurable: true,
1016
+ enumerable: true,
1017
+ writable: true,
1018
+ initializer: null
1019
+ }), _descriptor5 = _applyDecoratedDescriptor(_class2.prototype, "viewManager", [_dec6], {
1020
+ configurable: true,
1021
+ enumerable: true,
1022
+ writable: true,
1023
+ initializer: null
991
1024
  })), _class2)) || _class);
@@ -1 +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"}
1
+ {"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../src/module.tsx"],"names":[],"mappings":"AAGA,OAAO,EACL,UAAU,EAMX,MAAM,mBAAmB,CAAC;AAa3B,OAAO,cAAc,CAAC;AAMtB,eAAO,MAAM,cAAc,YAuExB,CAAC"}
package/es/module.js CHANGED
@@ -1,9 +1,12 @@
1
1
  import { FileView, LibroJupyterModule } from '@difizen/libro-jupyter';
2
2
  import { LibroPromptCellModule } from '@difizen/libro-prompt-cell';
3
+ import { TerminalModule } from '@difizen/libro-terminal';
3
4
  import { ManaModule, createSlotPreference, RootSlotId, SideTabView, createViewPreference, HeaderArea } from '@difizen/mana-app';
5
+ import { LabConfigAppContribution } from "./config/config-contribution.js";
4
6
  import { GithubLinkView } from "./github-link/index.js";
5
7
  import { KernelManagerView } from "./kernel-manager/index.js";
6
8
  import { LibroLabApp } from "./lab-app.js";
9
+ import { ContentBottomTabView } from "./layout/content-bottom-tab-view.js";
7
10
  import { LibroLabLayoutModule, LibroLabLayoutSlots, LibroLabLayoutView } from "./layout/index.js";
8
11
  import { SaveableTabView } from "./layout/saveable-tab-view.js";
9
12
  import "./index.less";
@@ -11,7 +14,7 @@ import { LibroLabHeaderMenuModule } from "./menu/module.js";
11
14
  import { LibroLabTocModule } from "./toc/module.js";
12
15
  import { EntryPointView } from "./welcome/entry-point-view.js";
13
16
  import { WelcomeView } from "./welcome/index.js";
14
- export var LibroLabModule = ManaModule.create().register(LibroLabApp, LibroLabLayoutView, GithubLinkView, createViewPreference({
17
+ export var LibroLabModule = ManaModule.create().register(LibroLabApp, LibroLabLayoutView, GithubLinkView, LabConfigAppContribution, createViewPreference({
15
18
  view: GithubLinkView,
16
19
  slot: HeaderArea.right,
17
20
  openOptions: {
@@ -32,6 +35,9 @@ export var LibroLabModule = ManaModule.create().register(LibroLabApp, LibroLabLa
32
35
  }), createSlotPreference({
33
36
  view: SaveableTabView,
34
37
  slot: LibroLabLayoutSlots.content
38
+ }), createSlotPreference({
39
+ view: ContentBottomTabView,
40
+ slot: LibroLabLayoutSlots.contentBottom
35
41
  }), createSlotPreference({
36
42
  view: SideTabView,
37
43
  slot: LibroLabLayoutSlots.navigator,
@@ -54,4 +60,4 @@ export var LibroLabModule = ManaModule.create().register(LibroLabApp, LibroLabLa
54
60
  reveal: true,
55
61
  order: 'welcome'
56
62
  }
57
- }), EntryPointView).dependOn(LibroJupyterModule, LibroLabLayoutModule, LibroLabHeaderMenuModule, LibroLabTocModule, LibroPromptCellModule);
63
+ }), EntryPointView).dependOn(LibroJupyterModule, LibroLabLayoutModule, LibroLabHeaderMenuModule, LibroLabTocModule, LibroPromptCellModule, TerminalModule);
@@ -1 +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"}
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"}
@@ -30,9 +30,6 @@ export var WelcomeComponent = /*#__PURE__*/forwardRef(function WelcomeComponent(
30
30
  children: [/*#__PURE__*/_jsx("div", {
31
31
  className: "libro-lab-welcome-page-title",
32
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
33
  }), /*#__PURE__*/_jsxs("div", {
37
34
  className: "libro-lab-welcome-page-server-info",
38
35
  children: [/*#__PURE__*/_jsx("div", {
@@ -65,9 +62,7 @@ export var WelcomeView = (_dec = singleton(), _dec2 = view('welcome-view'), _dec
65
62
  _this.viewManager.getOrCreateView(EntryPointView).then(function (entryPointView) {
66
63
  _this.entryPointView = entryPointView;
67
64
  return;
68
- }).catch(function () {
69
- //
70
- });
65
+ }).catch(console.error);
71
66
  return _this;
72
67
  }
73
68
  WelcomeView = inject(ViewManager)(WelcomeView, undefined, 0) || WelcomeView;
@@ -1,6 +1,6 @@
1
1
  .libro-lab-welcome-page {
2
2
  padding: 32px 54px;
3
- height: calc(100% - 64px);
3
+ height: 100%;
4
4
  background: white;
5
5
  overflow: auto;
6
6
 
@@ -91,7 +91,6 @@
91
91
  padding: 0 14px;
92
92
  cursor: pointer;
93
93
  height: 32px;
94
- width: 100px;
95
94
  border: 1px solid rgba(0, 0, 0, 15%);
96
95
  border-radius: 6px;
97
96
  }
@@ -103,7 +102,6 @@
103
102
  }
104
103
 
105
104
  .libro-lab-welcome-page-server-info {
106
- height: 80px;
107
105
  width: 400px;
108
106
  background-color: rgba(0, 10, 26, 2%);
109
107
  border-radius: 8px;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@difizen/libro-lab",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "libro",
@@ -35,18 +35,21 @@
35
35
  "dependencies": {
36
36
  "@difizen/mana-app": "latest",
37
37
  "@difizen/mana-react": "latest",
38
- "@difizen/libro-jupyter": "^0.1.1",
39
- "@difizen/libro-toc": "^0.1.1",
40
- "@difizen/libro-prompt-cell": "^0.1.1",
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",
41
42
  "@ant-design/icons": "^5.1.0",
42
- "classnames": "^2.2.6"
43
+ "classnames": "^2.3.2",
44
+ "uuid": "^9.0.0"
43
45
  },
44
46
  "peerDependencies": {
45
47
  "react": "^18.2.0",
46
48
  "antd": "^5.8.6"
47
49
  },
48
50
  "devDependencies": {
49
- "@types/react": "^18.2.25"
51
+ "@types/react": "^18.2.25",
52
+ "@types/uuid": "^9.0.2"
50
53
  },
51
54
  "scripts": {
52
55
  "setup": "father build",
@@ -0,0 +1,12 @@
1
+ import { LibroConfigAutoSave } from '@difizen/libro-jupyter';
2
+ import { ConfigurationService } from '@difizen/mana-app';
3
+ import { ApplicationContribution } from '@difizen/mana-app';
4
+ import { inject, singleton } from '@difizen/mana-app';
5
+
6
+ @singleton({ contrib: ApplicationContribution })
7
+ export class LabConfigAppContribution implements ApplicationContribution {
8
+ @inject(ConfigurationService) configurationService: ConfigurationService;
9
+ onViewStart() {
10
+ this.configurationService.set(LibroConfigAutoSave, true);
11
+ }
12
+ }
@@ -0,0 +1 @@
1
+ export * from './config-contribution.js';
package/src/index.spec.ts CHANGED
@@ -1,6 +1,5 @@
1
1
  import assert from 'assert';
2
2
 
3
- import {} from './index.js';
4
3
  import 'reflect-metadata';
5
4
 
6
5
  describe('libro-lab', () => {
package/src/lab-app.ts CHANGED
@@ -45,9 +45,7 @@ export class LibroLabApp implements ApplicationContribution {
45
45
  this.initialWorkspace();
46
46
  return;
47
47
  })
48
- .catch(() => {
49
- //
50
- });
48
+ .catch(console.error);
51
49
  }
52
50
 
53
51
  protected async initialWorkspace() {
@@ -0,0 +1,18 @@
1
+ import type { View } from '@difizen/mana-app';
2
+ import { transient, view, CardTabView, inject } from '@difizen/mana-app';
3
+
4
+ import { LayoutService } from './layout-service.js';
5
+ import { LibroLabLayoutSlots } from './protocol.js';
6
+
7
+ @transient()
8
+ @view('libro-lab-layout-content-bottom')
9
+ export class ContentBottomTabView extends CardTabView {
10
+ @inject(LayoutService) layoutService: LayoutService;
11
+
12
+ override close(item: View) {
13
+ item.dispose();
14
+ if (this.children.length === 0) {
15
+ this.layoutService.setAreaVisible(LibroLabLayoutSlots.contentBottom, false);
16
+ }
17
+ }
18
+ }
@@ -1,4 +1,4 @@
1
- import type { SlotView, View, ViewOpenHandlerOptions } from '@difizen/mana-app';
1
+ import type { View, ViewOpenHandlerOptions } from '@difizen/mana-app';
2
2
  import {
3
3
  DefaultSlotView,
4
4
  inject,
@@ -40,8 +40,7 @@ export class LayoutService {
40
40
 
41
41
  async addView(view: View, option?: ViewOpenHandlerOptions): Promise<void> {
42
42
  const { slot = LibroLabLayoutSlots.main, ...viewOpenOption } = option || {};
43
- const slotView = this.slotViewManager.getSlotView(slot) as SlotView;
44
- await slotView.addView(view, viewOpenOption);
43
+ await this.slotViewManager.addView(view, slot, viewOpenOption);
45
44
  }
46
45
 
47
46
  getActiveView(slot: LibroLabLayoutSlotsType) {
@@ -56,6 +56,10 @@ export class LibroLabLayoutView extends BaseView {
56
56
 
57
57
  restoreState(oldState: object): void {
58
58
  const state = oldState as { visibilityMap: VisibilityMap };
59
- this.layoutService.visibilityMap = state.visibilityMap;
59
+ this.layoutService.visibilityMap = {
60
+ ...state.visibilityMap,
61
+ [LibroLabLayoutSlots.navigator]: false,
62
+ [LibroLabLayoutSlots.alert]: true,
63
+ };
60
64
  }
61
65
  }
@@ -8,6 +8,7 @@ import {
8
8
 
9
9
  import { BrandView } from './brand/index.js';
10
10
  import { LibroLabLayoutContainerView } from './container.js';
11
+ import { ContentBottomTabView } from './content-bottom-tab-view.js';
11
12
  import { LibroLabCurrentFileFooterView } from './footer/current-file-footer-view.js';
12
13
  import { FooterArea, LibroLabLayoutFooterView } from './footer/footer-view.js';
13
14
  import { LibroLabStatusFooterView } from './footer/status-footer-view.js';
@@ -23,6 +24,7 @@ export const LibroLabLayoutModule = ManaModule.create('LibroLabLayoutModule').re
23
24
  LibroLabLayoutMainView,
24
25
  BrandView,
25
26
  SaveableTabView,
27
+ ContentBottomTabView,
26
28
  LibroLabLayoutFooterView,
27
29
  LibroLabCurrentFileFooterView,
28
30
  LayoutService,
@@ -13,7 +13,7 @@ import { Badge } from 'antd';
13
13
  import classnames from 'classnames';
14
14
 
15
15
  @transient()
16
- @view('LibroLabSaveableTab')
16
+ @view('libro-lab-saveable-tab')
17
17
  export class SaveableTabView extends CardTabView {
18
18
  protected override renderTab(item: View) {
19
19
  return (
@@ -4,6 +4,7 @@ import {
4
4
  LibroService,
5
5
  NotebookCommands,
6
6
  } from '@difizen/libro-jupyter';
7
+ import { LibroTerminalView, TerminalManager } from '@difizen/libro-terminal';
7
8
  import type { MenuRegistry } from '@difizen/mana-app';
8
9
  import {
9
10
  CommandContribution,
@@ -12,7 +13,12 @@ import {
12
13
  MAIN_MENU_BAR,
13
14
  MenuContribution,
14
15
  singleton,
16
+ ViewManager,
15
17
  } from '@difizen/mana-app';
18
+ import { v4 } from 'uuid';
19
+
20
+ import { LayoutService } from '../layout/layout-service.js';
21
+ import { LibroLabLayoutSlots } from '../layout/protocol.js';
16
22
 
17
23
  import { MenuCommands } from './menu-command.js';
18
24
 
@@ -29,6 +35,9 @@ export namespace HeaderMenus {
29
35
  export class HeaderMenu implements MenuContribution, CommandContribution {
30
36
  @inject(CommandRegistry) protected commandRegistry: CommandRegistry;
31
37
  @inject(LibroService) protected libroService: LibroService;
38
+ @inject(LayoutService) protected layoutService: LayoutService;
39
+ @inject(TerminalManager) terminalManager: TerminalManager;
40
+ @inject(ViewManager) viewManager: ViewManager;
32
41
 
33
42
  registerMenus(menu: MenuRegistry) {
34
43
  menu.registerSubmenu(HeaderMenus.FILE, { label: '文件' });
@@ -211,7 +220,21 @@ export class HeaderMenu implements MenuContribution, CommandContribution {
211
220
  registerCommands(commands: CommandRegistry) {
212
221
  commands.registerCommand(MenuCommands.OpenTerminal, {
213
222
  execute: () => {
214
- //TODO: 增加终端
223
+ this.viewManager
224
+ .getOrCreateView<LibroTerminalView>(LibroTerminalView, {
225
+ id: v4(),
226
+ })
227
+ .then((terminalView) => {
228
+ this.layoutService.setAreaVisible(LibroLabLayoutSlots.contentBottom, true);
229
+ this.layoutService.addView(terminalView, {
230
+ slot: LibroLabLayoutSlots.contentBottom,
231
+ reveal: true,
232
+ });
233
+ return;
234
+ })
235
+ .catch(() => {
236
+ //
237
+ });
215
238
  },
216
239
  });
217
240
  commands.registerCommand(MenuCommands.About, {
package/src/module.tsx CHANGED
@@ -1,5 +1,6 @@
1
1
  import { FileView, LibroJupyterModule } from '@difizen/libro-jupyter';
2
2
  import { LibroPromptCellModule } from '@difizen/libro-prompt-cell';
3
+ import { TerminalModule } from '@difizen/libro-terminal';
3
4
  import {
4
5
  ManaModule,
5
6
  createSlotPreference,
@@ -9,9 +10,11 @@ import {
9
10
  HeaderArea,
10
11
  } from '@difizen/mana-app';
11
12
 
13
+ import { LabConfigAppContribution } from './config/config-contribution.js';
12
14
  import { GithubLinkView } from './github-link/index.js';
13
15
  import { KernelManagerView } from './kernel-manager/index.js';
14
16
  import { LibroLabApp } from './lab-app.js';
17
+ import { ContentBottomTabView } from './layout/content-bottom-tab-view.js';
15
18
  import {
16
19
  LibroLabLayoutModule,
17
20
  LibroLabLayoutSlots,
@@ -29,6 +32,7 @@ export const LibroLabModule = ManaModule.create()
29
32
  LibroLabApp,
30
33
  LibroLabLayoutView,
31
34
  GithubLinkView,
35
+ LabConfigAppContribution,
32
36
  createViewPreference({
33
37
  view: GithubLinkView,
34
38
  slot: HeaderArea.right,
@@ -55,6 +59,10 @@ export const LibroLabModule = ManaModule.create()
55
59
  view: SaveableTabView,
56
60
  slot: LibroLabLayoutSlots.content,
57
61
  }),
62
+ createSlotPreference({
63
+ view: ContentBottomTabView,
64
+ slot: LibroLabLayoutSlots.contentBottom,
65
+ }),
58
66
  createSlotPreference({
59
67
  view: SideTabView,
60
68
  slot: LibroLabLayoutSlots.navigator,
@@ -89,4 +97,5 @@ export const LibroLabModule = ManaModule.create()
89
97
  LibroLabHeaderMenuModule,
90
98
  LibroLabTocModule,
91
99
  LibroPromptCellModule,
100
+ TerminalModule,
92
101
  );
@@ -1,6 +1,6 @@
1
1
  .libro-lab-welcome-page {
2
2
  padding: 32px 54px;
3
- height: calc(100% - 64px);
3
+ height: 100%;
4
4
  background: white;
5
5
  overflow: auto;
6
6
 
@@ -91,7 +91,6 @@
91
91
  padding: 0 14px;
92
92
  cursor: pointer;
93
93
  height: 32px;
94
- width: 100px;
95
94
  border: 1px solid rgba(0, 0, 0, 15%);
96
95
  border-radius: 6px;
97
96
  }
@@ -103,7 +102,6 @@
103
102
  }
104
103
 
105
104
  .libro-lab-welcome-page-server-info {
106
- height: 80px;
107
105
  width: 400px;
108
106
  background-color: rgba(0, 10, 26, 2%);
109
107
  border-radius: 8px;
@@ -24,9 +24,6 @@ export const WelcomeComponent = forwardRef(function WelcomeComponent() {
24
24
  return (
25
25
  <div className="libro-lab-welcome-page">
26
26
  <div className="libro-lab-welcome-page-title">欢迎使用 Notebook 工作台 🎉🎉</div>
27
- <div className="libro-lab-welcome-page-title-tip">
28
- 👋 你好,服务正在加载中,请稍后开启你的研发之旅吧~
29
- </div>
30
27
  <div className="libro-lab-welcome-page-server-info">
31
28
  <div className="libro-lab-welcome-page-server-info-title">服务连接信息</div>
32
29
  <div className="libro-lab-welcome-page-server-info-item">
@@ -61,8 +58,6 @@ export class WelcomeView extends BaseView {
61
58
  this.entryPointView = entryPointView;
62
59
  return;
63
60
  })
64
- .catch(() => {
65
- //
66
- });
61
+ .catch(console.error);
67
62
  }
68
63
  }