@difizen/libro-lab 0.1.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.
Files changed (90) 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/github-link/index.d.ts +9 -0
  9. package/es/github-link/index.d.ts.map +1 -0
  10. package/es/index.less +9 -0
  11. package/es/kernel-manager/index.d.ts +8 -0
  12. package/es/kernel-manager/index.d.ts.map +1 -0
  13. package/es/lab-app.d.ts +4 -1
  14. package/es/lab-app.d.ts.map +1 -1
  15. package/es/lab-app.js +28 -5
  16. package/es/layout/brand/index.d.ts +8 -0
  17. package/es/layout/brand/index.d.ts.map +1 -0
  18. package/es/layout/brand/index.js +1 -1
  19. package/es/layout/container.d.ts +8 -0
  20. package/es/layout/container.d.ts.map +1 -0
  21. package/es/layout/footer/current-file-footer-view.d.ts +1 -2
  22. package/es/layout/footer/current-file-footer-view.d.ts.map +1 -1
  23. package/es/layout/footer/current-file-footer-view.js +3 -7
  24. package/es/layout/footer/footer-view.d.ts +11 -0
  25. package/es/layout/footer/footer-view.d.ts.map +1 -0
  26. package/es/layout/footer/index.less +10 -7
  27. package/es/layout/footer/status-footer-view.d.ts +10 -0
  28. package/es/layout/footer/status-footer-view.d.ts.map +1 -0
  29. package/es/layout/footer/status-footer-view.js +73 -0
  30. package/es/layout/layout-service.d.ts +15 -0
  31. package/es/layout/layout-service.d.ts.map +1 -0
  32. package/es/layout/layout-service.js +15 -10
  33. package/es/layout/layout.d.ts +12 -0
  34. package/es/layout/layout.d.ts.map +1 -0
  35. package/es/layout/layout.js +39 -6
  36. package/es/layout/main.d.ts.map +1 -1
  37. package/es/layout/main.js +0 -1
  38. package/es/layout/module.d.ts.map +1 -1
  39. package/es/layout/module.js +6 -2
  40. package/es/layout/protocol.d.ts +18 -0
  41. package/es/layout/protocol.d.ts.map +1 -0
  42. package/es/layout/protocol.js +2 -1
  43. package/es/layout/{editor-tab-view.d.ts → saveable-tab-view.d.ts} +2 -2
  44. package/es/layout/saveable-tab-view.d.ts.map +1 -0
  45. package/es/layout/{editor-tab-view.js → saveable-tab-view.js} +9 -10
  46. package/es/menu/menu-bar-view.d.ts +9 -0
  47. package/es/menu/menu-bar-view.d.ts.map +1 -0
  48. package/es/menu/menu-command.d.ts +139 -0
  49. package/es/menu/menu-command.d.ts.map +1 -0
  50. package/es/module.d.ts.map +1 -1
  51. package/es/module.js +5 -3
  52. package/es/toc/libro-toc-panel-view.d.ts.map +1 -1
  53. package/es/toc/libro-toc-panel-view.js +2 -1
  54. package/es/welcome/entry-point-view.d.ts +8 -0
  55. package/es/welcome/entry-point-view.d.ts.map +1 -0
  56. package/es/welcome/entry-point-view.js +200 -0
  57. package/es/welcome/index.d.ts +13 -0
  58. package/es/welcome/index.d.ts.map +1 -0
  59. package/es/welcome/index.js +32 -4
  60. package/es/welcome/index.less +102 -1
  61. package/package.json +4 -3
  62. package/src/common/icon.tsx +300 -0
  63. package/src/common/index.less +8 -0
  64. package/src/common/index.tsx +1 -0
  65. package/src/index.less +9 -0
  66. package/src/lab-app.ts +18 -1
  67. package/src/layout/brand/index.tsx +1 -1
  68. package/src/layout/footer/current-file-footer-view.tsx +3 -7
  69. package/src/layout/footer/index.less +10 -7
  70. package/src/layout/footer/status-footer-view.tsx +45 -0
  71. package/src/layout/layout-service.ts +7 -5
  72. package/src/layout/layout.tsx +25 -1
  73. package/src/layout/main.tsx +0 -1
  74. package/src/layout/module.ts +8 -2
  75. package/src/layout/protocol.tsx +8 -0
  76. package/src/layout/{editor-tab-view.tsx → saveable-tab-view.tsx} +4 -5
  77. package/src/module.tsx +6 -2
  78. package/src/toc/libro-toc-panel-view.tsx +2 -1
  79. package/src/welcome/entry-point-view.tsx +169 -0
  80. package/src/welcome/index.less +102 -1
  81. package/src/welcome/index.tsx +43 -5
  82. package/es/layout/brand/logo.js +0 -41
  83. package/es/layout/editor-tab-view.d.ts.map +0 -1
  84. package/es/toc/libro-toc-icons.d.ts +0 -7
  85. package/es/toc/libro-toc-icons.d.ts.map +0 -1
  86. package/es/toc/libro-toc-icons.js +0 -38
  87. package/es/welcome/welcome-icon.js +0 -66
  88. package/src/layout/brand/logo.tsx +0 -39
  89. package/src/toc/libro-toc-icons.tsx +0 -35
  90. package/src/welcome/welcome-icon.tsx +0 -64
@@ -1 +1 @@
1
- {"version":3,"file":"current-file-footer-view.d.ts","sourceRoot":"","sources":["../../../src/layout/footer/current-file-footer-view.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EACL,QAAQ,EAMT,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAErD,OAAO,cAAc,CAAC;AAiBtB,qBAEa,6BAA8B,SAAQ,QAAQ;IAChD,IAAI,uEAA8B;IACpB,SAAS,CAAC,aAAa,EAAE,aAAa,CAAC;IAE9D,IAAI,oBAAoB,qCAMvB;CACF"}
1
+ {"version":3,"file":"current-file-footer-view.d.ts","sourceRoot":"","sources":["../../../src/layout/footer/current-file-footer-view.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAMT,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAErD,OAAO,cAAc,CAAC;AAiBtB,qBAEa,6BAA8B,SAAQ,QAAQ;IAChD,IAAI,uEAA8B;IACpB,SAAS,CAAC,aAAa,EAAE,aAAa,CAAC;IAE9D,IAAI,eAAe,iDAGlB;CACF"}
@@ -15,7 +15,6 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
15
15
  function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
16
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
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
18
  import { BaseView, inject, singleton, useInject, view, ViewInstance } from '@difizen/mana-app';
20
19
  import * as React from 'react';
21
20
  import { LayoutService } from "../layout-service.js";
@@ -29,7 +28,7 @@ var CurrentFileFooterComponent = /*#__PURE__*/React.forwardRef(function CurrentF
29
28
  className: "libro-lab-current-file-footer",
30
29
  ref: ref,
31
30
  children: /*#__PURE__*/_jsx("span", {
32
- children: "\u5F53\u524D\u6587\u4EF6\uFF1A".concat(((_currentFileFooterVie = currentFileFooterView.libroNavigatableView) === null || _currentFileFooterVie === void 0 ? void 0 : _currentFileFooterVie.title.label) || '')
31
+ children: "\u5F53\u524D\u6587\u4EF6\uFF1A".concat(((_currentFileFooterVie = currentFileFooterView.navigatableView) === null || _currentFileFooterVie === void 0 ? void 0 : _currentFileFooterVie.title.label) || '')
33
32
  })
34
33
  });
35
34
  });
@@ -48,13 +47,10 @@ export var LibroLabCurrentFileFooterView = (_dec = singleton(), _dec2 = view('li
48
47
  return _this;
49
48
  }
50
49
  _createClass(LibroLabCurrentFileFooterView, [{
51
- key: "libroNavigatableView",
50
+ key: "navigatableView",
52
51
  get: function get() {
53
52
  var contentView = this.layoutService.getActiveView(LibroLabLayoutSlots.content);
54
- if (contentView instanceof LibroNavigatableView) {
55
- return contentView;
56
- }
57
- return undefined;
53
+ return contentView;
58
54
  }
59
55
  }]);
60
56
  return LibroLabCurrentFileFooterView;
@@ -0,0 +1,11 @@
1
+ import { DefaultSlotView } from '@difizen/mana-app';
2
+ import * as React from 'react';
3
+ import './index.less';
4
+ export declare enum FooterArea {
5
+ left = "libro-lab-footer-left",
6
+ right = "libro-lab-footer-right"
7
+ }
8
+ export declare class LibroLabLayoutFooterView extends DefaultSlotView {
9
+ view: React.ForwardRefExoticComponent<any>;
10
+ }
11
+ //# sourceMappingURL=footer-view.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"footer-view.d.ts","sourceRoot":"","sources":["../../../src/layout/footer/footer-view.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAyB,MAAM,mBAAmB,CAAC;AAE3E,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,cAAc,CAAC;AAEtB,oBAAY,UAAU;IACpB,IAAI,0BAA0B;IAC9B,KAAK,2BAA2B;CACjC;AAiBD,qBAEa,wBAAyB,SAAQ,eAAe;IAClD,IAAI,uCAAmB;CACjC"}
@@ -1,17 +1,20 @@
1
1
  .libro-lab-footer {
2
- .libro-lab-footer-left {
2
+ .libro-lab-footer-left,
3
+ .libro-lab-footer-right {
3
4
  padding: 0 24px;
4
5
  }
5
6
  }
6
7
 
7
- .libro-lab-current-file-footer {
8
+ .libro-lab-current-file-footer,
9
+ .libro-lab-status-footer {
8
10
  height: 100%;
9
11
  display: flex;
10
12
  align-items: center;
13
+ font-weight: 400;
14
+ font-size: 12px;
15
+ color: rgba(0, 10, 26, 68%);
16
+ }
11
17
 
12
- span {
13
- font-weight: 400;
14
- font-size: 12px;
15
- color: rgba(0, 10, 26, 68%);
16
- }
18
+ .libro-lab-status-footer {
19
+ justify-content: end;
17
20
  }
@@ -0,0 +1,10 @@
1
+ import { BaseView } from '@difizen/mana-app';
2
+ import * as React from 'react';
3
+ import { LayoutService } from '../layout-service.js';
4
+ import './index.less';
5
+ export declare class LibroLabStatusFooterView extends BaseView {
6
+ view: React.ForwardRefExoticComponent<React.RefAttributes<HTMLDivElement>>;
7
+ protected layoutService: LayoutService;
8
+ get navigatableView(): import("@difizen/mana-app").View | undefined;
9
+ }
10
+ //# sourceMappingURL=status-footer-view.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"status-footer-view.d.ts","sourceRoot":"","sources":["../../../src/layout/footer/status-footer-view.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAsC,MAAM,mBAAmB,CAAC;AACjF,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAGrD,OAAO,cAAc,CAAC;AA2BtB,qBAEa,wBAAyB,SAAQ,QAAQ;IAC3C,IAAI,uEAAyB;IACf,SAAS,CAAC,aAAa,EAAE,aAAa,CAAC;IAE9D,IAAI,eAAe,iDAGlB;CACF"}
@@ -0,0 +1,73 @@
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 { BaseView, inject, singleton, useInject, view } from '@difizen/mana-app';
19
+ import * as React from 'react';
20
+ import { Loadding, SuccIcon } from "../../common/icon.js";
21
+ import { LayoutService } from "../layout-service.js";
22
+ import { LibroLabLayoutSlots } from "../protocol.js";
23
+ import "./index.less";
24
+ import { jsx as _jsx } from "react/jsx-runtime";
25
+ import { jsxs as _jsxs } from "react/jsx-runtime";
26
+ var Status = {
27
+ loading: {
28
+ label: '启动中',
29
+ icon: /*#__PURE__*/_jsx(Loadding, {})
30
+ },
31
+ success: {
32
+ label: '启动成功',
33
+ icon: /*#__PURE__*/_jsx(SuccIcon, {})
34
+ }
35
+ };
36
+ var StatusFooterComponent = /*#__PURE__*/React.forwardRef(function CurrentFileFooterComponent(_props, ref) {
37
+ var layoutService = useInject(LayoutService);
38
+ return /*#__PURE__*/_jsxs("div", {
39
+ className: "libro-lab-status-footer",
40
+ ref: ref,
41
+ children: [/*#__PURE__*/_jsx("span", {
42
+ children: "\u670D\u52A1\u72B6\u6001\uFF1A"
43
+ }), Status[layoutService.serverSatus].icon, Status[layoutService.serverSatus].label]
44
+ });
45
+ });
46
+ export var LibroLabStatusFooterView = (_dec = singleton(), _dec2 = view('libro-lab-status-footer-view'), _dec3 = inject(LayoutService), _dec(_class = _dec2(_class = (_class2 = /*#__PURE__*/function (_BaseView) {
47
+ _inherits(LibroLabStatusFooterView, _BaseView);
48
+ var _super = _createSuper(LibroLabStatusFooterView);
49
+ function LibroLabStatusFooterView() {
50
+ var _this;
51
+ _classCallCheck(this, LibroLabStatusFooterView);
52
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
53
+ args[_key] = arguments[_key];
54
+ }
55
+ _this = _super.call.apply(_super, [this].concat(args));
56
+ _this.view = StatusFooterComponent;
57
+ _initializerDefineProperty(_this, "layoutService", _descriptor, _assertThisInitialized(_this));
58
+ return _this;
59
+ }
60
+ _createClass(LibroLabStatusFooterView, [{
61
+ key: "navigatableView",
62
+ get: function get() {
63
+ var contentView = this.layoutService.getActiveView(LibroLabLayoutSlots.content);
64
+ return contentView;
65
+ }
66
+ }]);
67
+ return LibroLabStatusFooterView;
68
+ }(BaseView), (_descriptor = _applyDecoratedDescriptor(_class2.prototype, "layoutService", [_dec3], {
69
+ configurable: true,
70
+ enumerable: true,
71
+ writable: true,
72
+ initializer: null
73
+ })), _class2)) || _class) || _class);
@@ -0,0 +1,15 @@
1
+ import type { View, ViewOpenHandlerOptions } from '@difizen/mana-app';
2
+ import { SlotViewManager } from '@difizen/mana-app';
3
+ import type { LibroLabLayoutSlotsType, StatusType } from './protocol.js';
4
+ export type VisibilityMap = Record<LibroLabLayoutSlotsType, boolean>;
5
+ export declare class LayoutService {
6
+ protected readonly slotViewManager: SlotViewManager;
7
+ serverSatus: StatusType;
8
+ visibilityMap: VisibilityMap;
9
+ isAreaVisible(slot: LibroLabLayoutSlotsType): boolean;
10
+ setAreaVisible(slot: LibroLabLayoutSlotsType, visible: boolean): void;
11
+ addView(view: View, option?: ViewOpenHandlerOptions): Promise<void>;
12
+ getActiveView(slot: LibroLabLayoutSlotsType): View | undefined;
13
+ onSlotActiveChange(slot: LibroLabLayoutSlotsType, handler: () => void): import("@difizen/mana-app").Disposable | undefined;
14
+ }
15
+ //# sourceMappingURL=layout-service.d.ts.map
@@ -0,0 +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,6 +1,6 @@
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 _excluded = ["slot"];
3
- var _dec, _dec2, _dec3, _class, _class2, _descriptor, _descriptor2;
3
+ var _dec, _dec2, _dec3, _dec4, _class, _class2, _descriptor, _descriptor2, _descriptor3;
4
4
  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; }
5
5
  function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
6
6
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
@@ -15,13 +15,14 @@ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _ty
15
15
  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); }
16
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
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 { DefaultSlotView, inject, Notifier, prop, singleton, SlotViewManager } from '@difizen/mana-app';
18
+ import { DefaultSlotView, inject, prop, singleton, SlotViewManager } from '@difizen/mana-app';
19
19
  import { LibroLabLayoutSlots } from "./protocol.js";
20
- export var LayoutService = (_dec = singleton(), _dec2 = inject(SlotViewManager), _dec3 = prop(), _dec(_class = (_class2 = /*#__PURE__*/function () {
20
+ export var LayoutService = (_dec = singleton(), _dec2 = inject(SlotViewManager), _dec3 = prop(), _dec4 = prop(), _dec(_class = (_class2 = /*#__PURE__*/function () {
21
21
  function LayoutService() {
22
22
  _classCallCheck(this, LayoutService);
23
23
  _initializerDefineProperty(this, "slotViewManager", _descriptor, this);
24
- _initializerDefineProperty(this, "visibilityMap", _descriptor2, this);
24
+ _initializerDefineProperty(this, "serverSatus", _descriptor2, this);
25
+ _initializerDefineProperty(this, "visibilityMap", _descriptor3, this);
25
26
  }
26
27
  _createClass(LayoutService, [{
27
28
  key: "isAreaVisible",
@@ -73,10 +74,7 @@ export var LayoutService = (_dec = singleton(), _dec2 = inject(SlotViewManager),
73
74
  if (this.isAreaVisible(slot)) {
74
75
  var slotView = this.slotViewManager.getSlotView(slot);
75
76
  if (slotView instanceof DefaultSlotView) {
76
- var _Notifier$find;
77
- return (_Notifier$find = Notifier.find(slotView, 'active')) === null || _Notifier$find === void 0 ? void 0 : _Notifier$find.onChange(function () {
78
- return handler();
79
- });
77
+ return slotView.onActiveChange(handler);
80
78
  }
81
79
  }
82
80
  return undefined;
@@ -88,12 +86,19 @@ export var LayoutService = (_dec = singleton(), _dec2 = inject(SlotViewManager),
88
86
  enumerable: true,
89
87
  writable: true,
90
88
  initializer: null
91
- }), _descriptor2 = _applyDecoratedDescriptor(_class2.prototype, "visibilityMap", [_dec3], {
89
+ }), _descriptor2 = _applyDecoratedDescriptor(_class2.prototype, "serverSatus", [_dec3], {
90
+ configurable: true,
91
+ enumerable: true,
92
+ writable: true,
93
+ initializer: function initializer() {
94
+ return 'loading';
95
+ }
96
+ }), _descriptor3 = _applyDecoratedDescriptor(_class2.prototype, "visibilityMap", [_dec4], {
92
97
  configurable: true,
93
98
  enumerable: true,
94
99
  writable: true,
95
100
  initializer: function initializer() {
96
101
  var _ref2;
97
- return _ref2 = {}, _defineProperty(_ref2, LibroLabLayoutSlots.header, true), _defineProperty(_ref2, LibroLabLayoutSlots.container, true), _defineProperty(_ref2, LibroLabLayoutSlots.main, true), _defineProperty(_ref2, LibroLabLayoutSlots.footer, true), _defineProperty(_ref2, LibroLabLayoutSlots.navigator, true), _defineProperty(_ref2, LibroLabLayoutSlots.content, true), _defineProperty(_ref2, LibroLabLayoutSlots.contentBottom, false), _ref2;
102
+ return _ref2 = {}, _defineProperty(_ref2, LibroLabLayoutSlots.header, true), _defineProperty(_ref2, LibroLabLayoutSlots.container, true), _defineProperty(_ref2, LibroLabLayoutSlots.main, true), _defineProperty(_ref2, LibroLabLayoutSlots.footer, true), _defineProperty(_ref2, LibroLabLayoutSlots.navigator, false), _defineProperty(_ref2, LibroLabLayoutSlots.content, true), _defineProperty(_ref2, LibroLabLayoutSlots.contentBottom, false), _defineProperty(_ref2, LibroLabLayoutSlots.alert, true), _ref2;
98
103
  }
99
104
  })), _class2)) || _class);
@@ -0,0 +1,12 @@
1
+ /// <reference types="react" resolution-mode="require"/>
2
+ import { BaseView } from '@difizen/mana-app';
3
+ import './index.less';
4
+ import { LayoutService } from './layout-service.js';
5
+ export declare const LibroLabLayoutContainerComponent: import("react").ForwardRefExoticComponent<import("react").RefAttributes<unknown>>;
6
+ export declare class LibroLabLayoutView extends BaseView {
7
+ view: import("react").ForwardRefExoticComponent<import("react").RefAttributes<unknown>>;
8
+ layoutService: LayoutService;
9
+ storeState(): object;
10
+ restoreState(oldState: object): void;
11
+ }
12
+ //# sourceMappingURL=layout.d.ts.map
@@ -0,0 +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,10 +1,11 @@
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, _class;
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"); } }
3
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); } }
4
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; }
5
7
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
6
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); }
7
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
8
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); }
9
10
  function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
10
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,10 +13,14 @@ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) ===
12
13
  function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
13
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; } }
14
15
  function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
15
- import { singleton, Slot, useInject, view } from '@difizen/mana-app';
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 { inject, singleton, Slot, useInject, view } from '@difizen/mana-app';
16
19
  import { BaseView } from '@difizen/mana-app';
17
20
  import { BoxPanel } from '@difizen/mana-react';
21
+ import { Alert } from 'antd';
18
22
  import { forwardRef } from 'react';
23
+ import { Loadding } from "../common/icon.js";
19
24
  import "./index.less";
20
25
  import { LayoutService } from "./layout-service.js";
21
26
  import { LibroLabLayoutSlots } from "./protocol.js";
@@ -32,6 +37,14 @@ export var LibroLabLayoutContainerComponent = /*#__PURE__*/forwardRef(function L
32
37
  children: /*#__PURE__*/_jsx(Slot, {
33
38
  name: LibroLabLayoutSlots.header
34
39
  })
40
+ }), layoutService.isAreaVisible(LibroLabLayoutSlots.alert) && /*#__PURE__*/_jsx(Alert, {
41
+ message: "\u670D\u52A1\u542F\u52A8\u4E2D\uFF0C\u8BF7\u7A0D\u540E\uFF0C\u5F85\u5BB9\u5668\u542F\u52A8\u5B8C\u6210\u540E\u5373\u53EF\u7F16\u8F91\u6587\u4EF6\u3002",
42
+ type: "info",
43
+ banner: true,
44
+ closable: true,
45
+ icon: /*#__PURE__*/_jsx(Loadding, {
46
+ className: "libro-lab-loadding"
47
+ })
35
48
  }), layoutService.isAreaVisible(LibroLabLayoutSlots.container) && /*#__PURE__*/_jsx(BoxPanel.Pane, {
36
49
  className: "libro-lab-layout-container",
37
50
  flex: 1,
@@ -42,7 +55,7 @@ export var LibroLabLayoutContainerComponent = /*#__PURE__*/forwardRef(function L
42
55
  })
43
56
  });
44
57
  });
45
- export var LibroLabLayoutView = (_dec = singleton(), _dec2 = view('libro-lab-layout'), _dec(_class = _dec2(_class = /*#__PURE__*/function (_BaseView) {
58
+ export var LibroLabLayoutView = (_dec = singleton(), _dec2 = view('libro-lab-layout'), _dec3 = inject(LayoutService), _dec(_class = _dec2(_class = (_class2 = /*#__PURE__*/function (_BaseView) {
46
59
  _inherits(LibroLabLayoutView, _BaseView);
47
60
  var _super = _createSuper(LibroLabLayoutView);
48
61
  function LibroLabLayoutView() {
@@ -53,7 +66,27 @@ export var LibroLabLayoutView = (_dec = singleton(), _dec2 = view('libro-lab-lay
53
66
  }
54
67
  _this = _super.call.apply(_super, [this].concat(args));
55
68
  _this.view = LibroLabLayoutContainerComponent;
69
+ _initializerDefineProperty(_this, "layoutService", _descriptor, _assertThisInitialized(_this));
56
70
  return _this;
57
71
  }
58
- return _createClass(LibroLabLayoutView);
59
- }(BaseView)) || _class) || _class);
72
+ _createClass(LibroLabLayoutView, [{
73
+ key: "storeState",
74
+ value: function storeState() {
75
+ return {
76
+ visibilityMap: this.layoutService.visibilityMap
77
+ };
78
+ }
79
+ }, {
80
+ key: "restoreState",
81
+ value: function restoreState(oldState) {
82
+ var state = oldState;
83
+ this.layoutService.visibilityMap = state.visibilityMap;
84
+ }
85
+ }]);
86
+ return LibroLabLayoutView;
87
+ }(BaseView), (_descriptor = _applyDecoratedDescriptor(_class2.prototype, "layoutService", [_dec3], {
88
+ configurable: true,
89
+ enumerable: true,
90
+ writable: true,
91
+ initializer: null
92
+ })), _class2)) || _class) || _class);
@@ -1 +1 @@
1
- {"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../src/layout/main.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAI7C,OAAO,cAAc,CAAC;AAItB,eAAO,MAAM,2BAA2B,mFAoDvC,CAAC;AAEF,qBAEa,sBAAuB,SAAQ,QAAQ;IACzC,IAAI,oFAA+B;CAC7C"}
1
+ {"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../src/layout/main.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAI7C,OAAO,cAAc,CAAC;AAItB,eAAO,MAAM,2BAA2B,mFAmDvC,CAAC;AAEF,qBAEa,sBAAuB,SAAQ,QAAQ;IACzC,IAAI,oFAA+B;CAC7C"}
package/es/layout/main.js CHANGED
@@ -29,7 +29,6 @@ export var LibroLabLayoutMainComponent = /*#__PURE__*/forwardRef(function LibroL
29
29
  id: "libro-lab-content-layout-left",
30
30
  className: "libro-lab-content-layout-left",
31
31
  defaultSize: 300,
32
- minResize: 160,
33
32
  children: /*#__PURE__*/_jsx(Slot, {
34
33
  name: LibroLabLayoutSlots.navigator
35
34
  })
@@ -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;AAY3B,eAAO,MAAM,oBAAoB,YA2ChC,CAAC"}
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,14 +1,15 @@
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 { EditorTabView } from "./editor-tab-view.js";
5
4
  import { LibroLabCurrentFileFooterView } from "./footer/current-file-footer-view.js";
6
5
  import { FooterArea, LibroLabLayoutFooterView } from "./footer/footer-view.js";
6
+ import { LibroLabStatusFooterView } from "./footer/status-footer-view.js";
7
7
  import { LayoutService } from "./layout-service.js";
8
8
  import { LibroLabLayoutView } from "./layout.js";
9
9
  import { LibroLabLayoutMainView } from "./main.js";
10
10
  import { LibroLabLayoutSlots } from "./protocol.js";
11
- export var LibroLabLayoutModule = ManaModule.create('LibroLabLayoutModule').register(LibroLabLayoutView, LibroLabLayoutContainerView, LibroLabLayoutMainView, BrandView, EditorTabView, LibroLabLayoutFooterView, LibroLabCurrentFileFooterView, LayoutService, createSlotPreference({
11
+ import { SaveableTabView } from "./saveable-tab-view.js";
12
+ export var LibroLabLayoutModule = ManaModule.create('LibroLabLayoutModule').register(LibroLabLayoutView, LibroLabLayoutContainerView, LibroLabLayoutMainView, BrandView, SaveableTabView, LibroLabLayoutFooterView, LibroLabCurrentFileFooterView, LayoutService, createSlotPreference({
12
13
  slot: LibroLabLayoutSlots.header,
13
14
  view: HeaderView
14
15
  }), createSlotPreference({
@@ -38,4 +39,7 @@ export var LibroLabLayoutModule = ManaModule.create('LibroLabLayoutModule').regi
38
39
  }), createSlotPreference({
39
40
  slot: FooterArea.left,
40
41
  view: LibroLabCurrentFileFooterView
42
+ }), LibroLabStatusFooterView, createSlotPreference({
43
+ slot: FooterArea.right,
44
+ view: LibroLabStatusFooterView
41
45
  }));
@@ -0,0 +1,18 @@
1
+ /// <reference types="react" resolution-mode="require"/>
2
+ export declare const LibroLabLayoutSlots: {
3
+ header: string;
4
+ container: string;
5
+ main: string;
6
+ footer: string;
7
+ navigator: string;
8
+ content: string;
9
+ contentBottom: string;
10
+ alert: string;
11
+ };
12
+ export type StatusType = 'loading' | 'success';
13
+ export interface StatusItem {
14
+ label: string;
15
+ icon: JSX.Element;
16
+ }
17
+ export type LibroLabLayoutSlotsType = (typeof LibroLabLayoutSlots)[keyof typeof LibroLabLayoutSlots];
18
+ //# sourceMappingURL=protocol.d.ts.map
@@ -0,0 +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"}
@@ -5,5 +5,6 @@ export var LibroLabLayoutSlots = {
5
5
  footer: 'libro-lab-footer',
6
6
  navigator: 'libro-lab-navigator',
7
7
  content: 'libro-lab-content',
8
- contentBottom: 'libro-lab-content-bottom'
8
+ contentBottom: 'libro-lab-content-bottom',
9
+ alert: 'libro-lab-alert'
9
10
  };
@@ -1,7 +1,7 @@
1
1
  import type { View } from '@difizen/mana-app';
2
2
  import { CardTabView } from '@difizen/mana-app';
3
- export declare class EditorTabView extends CardTabView {
3
+ export declare class SaveableTabView extends CardTabView {
4
4
  protected renderTab(item: View): import("react/jsx-runtime").JSX.Element;
5
5
  protected renderTail(item: View): import("react/jsx-runtime").JSX.Element;
6
6
  }
7
- //# sourceMappingURL=editor-tab-view.d.ts.map
7
+ //# sourceMappingURL=saveable-tab-view.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"saveable-tab-view.d.ts","sourceRoot":"","sources":["../../src/layout/saveable-tab-view.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EACL,WAAW,EAMZ,MAAM,mBAAmB,CAAC;AAK3B,qBAEa,eAAgB,SAAQ,WAAW;cAC3B,SAAS,CAAC,IAAI,EAAE,IAAI;IAuBvC,SAAS,CAAC,UAAU,CAAC,IAAI,EAAE,IAAI;CAyBhC"}
@@ -13,21 +13,20 @@ function _assertThisInitialized(self) { if (self === void 0) { throw new Referen
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
15
  import { CloseOutlined } from '@ant-design/icons';
16
- import { EditorView } from '@difizen/libro-jupyter';
17
- import { CardTabView, MenuRender, transient, view, ViewContext } from '@difizen/mana-app';
16
+ import { CardTabView, MenuRender, transient, view, ViewContext, Saveable } from '@difizen/mana-app';
18
17
  import { Dropdown } from '@difizen/mana-react';
19
18
  import { Badge } from 'antd';
20
19
  import classnames from 'classnames';
21
20
  import { jsx as _jsx } from "react/jsx-runtime";
22
21
  import { jsxs as _jsxs } from "react/jsx-runtime";
23
- export var EditorTabView = (_dec = transient(), _dec2 = view('LibroLabEditorTab'), _dec(_class = _dec2(_class = /*#__PURE__*/function (_CardTabView) {
24
- _inherits(EditorTabView, _CardTabView);
25
- var _super = _createSuper(EditorTabView);
26
- function EditorTabView() {
27
- _classCallCheck(this, EditorTabView);
22
+ export var SaveableTabView = (_dec = transient(), _dec2 = view('LibroLabSaveableTab'), _dec(_class = _dec2(_class = /*#__PURE__*/function (_CardTabView) {
23
+ _inherits(SaveableTabView, _CardTabView);
24
+ var _super = _createSuper(SaveableTabView);
25
+ function SaveableTabView() {
26
+ _classCallCheck(this, SaveableTabView);
28
27
  return _super.apply(this, arguments);
29
28
  }
30
- _createClass(EditorTabView, [{
29
+ _createClass(SaveableTabView, [{
31
30
  key: "renderTab",
32
31
  value: function renderTab(item) {
33
32
  return /*#__PURE__*/_jsx(ViewContext, {
@@ -53,7 +52,7 @@ export var EditorTabView = (_dec = transient(), _dec2 = view('LibroLabEditorTab'
53
52
  key: "renderTail",
54
53
  value: function renderTail(item) {
55
54
  var _this = this;
56
- var isDirty = EditorView.is(item) && item.dirty;
55
+ var isDirty = Saveable.is(item) && Saveable.isDirty(item);
57
56
  return /*#__PURE__*/_jsx("div", {
58
57
  className: "libro-lab-editor-tab-tail",
59
58
  children: isDirty ? /*#__PURE__*/_jsx("div", {
@@ -74,5 +73,5 @@ export var EditorTabView = (_dec = transient(), _dec2 = view('LibroLabEditorTab'
74
73
  });
75
74
  }
76
75
  }]);
77
- return EditorTabView;
76
+ return SaveableTabView;
78
77
  }(CardTabView)) || _class) || _class);
@@ -0,0 +1,9 @@
1
+ /// <reference types="react" resolution-mode="require"/>
2
+ import { BaseView } from '@difizen/mana-app';
3
+ export declare const ManaMenubarComponent: import("react").ForwardRefExoticComponent<import("react").RefAttributes<unknown>>;
4
+ export declare class MenuBarView extends BaseView {
5
+ view: import("react").ForwardRefExoticComponent<import("react").RefAttributes<unknown>>;
6
+ count: number;
7
+ constructor();
8
+ }
9
+ //# sourceMappingURL=menu-bar-view.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"menu-bar-view.d.ts","sourceRoot":"","sources":["../../src/menu/menu-bar-view.tsx"],"names":[],"mappings":";AACA,OAAO,EACL,QAAQ,EAMT,MAAM,mBAAmB,CAAC;AAG3B,eAAO,MAAM,oBAAoB,mFAE/B,CAAC;AAEH,qBAEa,WAAY,SAAQ,QAAQ;IAC9B,IAAI,oFAAwB;IAErC,KAAK,SAAK;;CAOX"}