@difizen/libro-lab 0.0.2-alpha.0 → 0.1.0

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 (92) hide show
  1. package/es/github-link/index.js +43 -0
  2. package/es/index.d.ts +1 -1
  3. package/es/index.d.ts.map +1 -1
  4. package/es/index.js +1 -0
  5. package/es/index.less +69 -0
  6. package/es/kernel-manager/index.js +40 -0
  7. package/es/lab-app.d.ts +12 -0
  8. package/es/lab-app.d.ts.map +1 -0
  9. package/es/lab-app.js +103 -0
  10. package/es/layout/brand/index.js +46 -0
  11. package/es/layout/brand/index.less +16 -0
  12. package/es/layout/brand/logo.js +41 -0
  13. package/es/layout/container.js +54 -0
  14. package/es/layout/editor-tab-view.d.ts +7 -0
  15. package/es/layout/editor-tab-view.d.ts.map +1 -0
  16. package/es/layout/editor-tab-view.js +78 -0
  17. package/es/layout/footer/current-file-footer-view.d.ts +11 -0
  18. package/es/layout/footer/current-file-footer-view.d.ts.map +1 -0
  19. package/es/layout/footer/current-file-footer-view.js +66 -0
  20. package/es/layout/footer/footer-view.js +60 -0
  21. package/es/layout/footer/index.less +17 -0
  22. package/es/layout/index.d.ts +5 -0
  23. package/es/layout/index.d.ts.map +1 -0
  24. package/es/layout/index.js +4 -0
  25. package/es/layout/index.less +59 -0
  26. package/es/layout/layout-service.js +99 -0
  27. package/es/layout/layout.js +59 -0
  28. package/es/layout/main.d.ts +8 -0
  29. package/es/layout/main.d.ts.map +1 -0
  30. package/es/layout/main.js +80 -0
  31. package/es/layout/module.d.ts +3 -0
  32. package/es/layout/module.d.ts.map +1 -0
  33. package/es/layout/module.js +41 -0
  34. package/es/layout/protocol.js +9 -0
  35. package/es/menu/menu-bar-view.js +49 -0
  36. package/es/menu/menu-command.js +138 -0
  37. package/es/menu/menu-contribution.d.ts +18 -0
  38. package/es/menu/menu-contribution.d.ts.map +1 -0
  39. package/es/menu/menu-contribution.js +991 -0
  40. package/es/menu/module.d.ts +3 -0
  41. package/es/menu/module.d.ts.map +1 -0
  42. package/es/menu/module.js +7 -0
  43. package/es/module.d.ts +4 -0
  44. package/es/module.d.ts.map +1 -0
  45. package/es/module.js +55 -0
  46. package/es/toc/index.less +25 -0
  47. package/es/toc/libro-toc-icons.d.ts +7 -0
  48. package/es/toc/libro-toc-icons.d.ts.map +1 -0
  49. package/es/toc/libro-toc-icons.js +38 -0
  50. package/es/toc/libro-toc-panel-view.d.ts +18 -0
  51. package/es/toc/libro-toc-panel-view.d.ts.map +1 -0
  52. package/es/toc/libro-toc-panel-view.js +103 -0
  53. package/es/toc/module.d.ts +3 -0
  54. package/es/toc/module.d.ts.map +1 -0
  55. package/es/toc/module.js +13 -0
  56. package/es/welcome/index.js +47 -0
  57. package/es/welcome/index.less +21 -0
  58. package/es/welcome/welcome-icon.js +66 -0
  59. package/package.json +9 -3
  60. package/src/github-link/index.tsx +27 -0
  61. package/src/index.less +69 -0
  62. package/src/index.spec.ts +10 -0
  63. package/src/index.ts +1 -0
  64. package/src/kernel-manager/index.tsx +22 -0
  65. package/src/lab-app.ts +44 -0
  66. package/src/layout/brand/index.less +16 -0
  67. package/src/layout/brand/index.tsx +22 -0
  68. package/src/layout/brand/logo.tsx +39 -0
  69. package/src/layout/container.tsx +28 -0
  70. package/src/layout/editor-tab-view.tsx +67 -0
  71. package/src/layout/footer/current-file-footer-view.tsx +44 -0
  72. package/src/layout/footer/footer-view.tsx +30 -0
  73. package/src/layout/footer/index.less +17 -0
  74. package/src/layout/index.less +59 -0
  75. package/src/layout/index.tsx +4 -0
  76. package/src/layout/layout-service.ts +64 -0
  77. package/src/layout/layout.tsx +37 -0
  78. package/src/layout/main.tsx +68 -0
  79. package/src/layout/module.ts +62 -0
  80. package/src/layout/protocol.tsx +12 -0
  81. package/src/menu/menu-bar-view.tsx +28 -0
  82. package/src/menu/menu-command.ts +138 -0
  83. package/src/menu/menu-contribution.ts +658 -0
  84. package/src/menu/module.ts +13 -0
  85. package/src/module.tsx +88 -0
  86. package/src/toc/index.less +25 -0
  87. package/src/toc/libro-toc-icons.tsx +35 -0
  88. package/src/toc/libro-toc-panel-view.tsx +87 -0
  89. package/src/toc/module.ts +21 -0
  90. package/src/welcome/index.less +21 -0
  91. package/src/welcome/index.tsx +30 -0
  92. package/src/welcome/welcome-icon.tsx +64 -0
@@ -0,0 +1,66 @@
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 { LibroNavigatableView } from '@difizen/libro-jupyter';
19
+ import { BaseView, inject, singleton, useInject, view, ViewInstance } from '@difizen/mana-app';
20
+ import * as React from 'react';
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
+ var CurrentFileFooterComponent = /*#__PURE__*/React.forwardRef(function CurrentFileFooterComponent(_props, ref) {
26
+ var _currentFileFooterVie;
27
+ var currentFileFooterView = useInject(ViewInstance);
28
+ return /*#__PURE__*/_jsx("div", {
29
+ className: "libro-lab-current-file-footer",
30
+ ref: ref,
31
+ children: /*#__PURE__*/_jsx("span", {
32
+ children: "\u5F53\u524D\u6587\u4EF6\uFF1A".concat(((_currentFileFooterVie = currentFileFooterView.libroNavigatableView) === null || _currentFileFooterVie === void 0 ? void 0 : _currentFileFooterVie.title.label) || '')
33
+ })
34
+ });
35
+ });
36
+ export var LibroLabCurrentFileFooterView = (_dec = singleton(), _dec2 = view('libro-lab-current-file-footer-view'), _dec3 = inject(LayoutService), _dec(_class = _dec2(_class = (_class2 = /*#__PURE__*/function (_BaseView) {
37
+ _inherits(LibroLabCurrentFileFooterView, _BaseView);
38
+ var _super = _createSuper(LibroLabCurrentFileFooterView);
39
+ function LibroLabCurrentFileFooterView() {
40
+ var _this;
41
+ _classCallCheck(this, LibroLabCurrentFileFooterView);
42
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
43
+ args[_key] = arguments[_key];
44
+ }
45
+ _this = _super.call.apply(_super, [this].concat(args));
46
+ _this.view = CurrentFileFooterComponent;
47
+ _initializerDefineProperty(_this, "layoutService", _descriptor, _assertThisInitialized(_this));
48
+ return _this;
49
+ }
50
+ _createClass(LibroLabCurrentFileFooterView, [{
51
+ key: "libroNavigatableView",
52
+ get: function get() {
53
+ var contentView = this.layoutService.getActiveView(LibroLabLayoutSlots.content);
54
+ if (contentView instanceof LibroNavigatableView) {
55
+ return contentView;
56
+ }
57
+ return undefined;
58
+ }
59
+ }]);
60
+ return LibroLabCurrentFileFooterView;
61
+ }(BaseView), (_descriptor = _applyDecoratedDescriptor(_class2.prototype, "layoutService", [_dec3], {
62
+ configurable: true,
63
+ enumerable: true,
64
+ writable: true,
65
+ initializer: null
66
+ })), _class2)) || _class) || _class);
@@ -0,0 +1,60 @@
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ var _dec, _dec2, _class;
3
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
4
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
5
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
6
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
7
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
8
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
9
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
10
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
11
+ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
12
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
13
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
14
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
15
+ import { DefaultSlotView, singleton, Slot, view } from '@difizen/mana-app';
16
+ import { BoxPanel } from '@difizen/mana-react';
17
+ import * as React from 'react';
18
+ import "./index.less";
19
+ import { jsx as _jsx } from "react/jsx-runtime";
20
+ import { jsxs as _jsxs } from "react/jsx-runtime";
21
+ export var FooterArea = /*#__PURE__*/function (FooterArea) {
22
+ FooterArea["left"] = "libro-lab-footer-left";
23
+ FooterArea["right"] = "libro-lab-footer-right";
24
+ return FooterArea;
25
+ }({});
26
+ var FooterComponent = /*#__PURE__*/React.forwardRef(function FooterComponent(_props, ref) {
27
+ return /*#__PURE__*/_jsxs(BoxPanel, {
28
+ direction: "left-to-right",
29
+ className: 'libro-lab-footer',
30
+ ref: ref,
31
+ children: [/*#__PURE__*/_jsx(BoxPanel.Pane, {
32
+ flex: 1,
33
+ className: 'libro-lab-footer-left',
34
+ children: /*#__PURE__*/_jsx(Slot, {
35
+ name: FooterArea.left
36
+ })
37
+ }), /*#__PURE__*/_jsx(BoxPanel.Pane, {
38
+ flex: 1,
39
+ className: 'libro-lab-footer-right',
40
+ children: /*#__PURE__*/_jsx(Slot, {
41
+ name: FooterArea.right
42
+ })
43
+ })]
44
+ });
45
+ });
46
+ export var LibroLabLayoutFooterView = (_dec = singleton(), _dec2 = view('libro-lab-footer-view'), _dec(_class = _dec2(_class = /*#__PURE__*/function (_DefaultSlotView) {
47
+ _inherits(LibroLabLayoutFooterView, _DefaultSlotView);
48
+ var _super = _createSuper(LibroLabLayoutFooterView);
49
+ function LibroLabLayoutFooterView() {
50
+ var _this;
51
+ _classCallCheck(this, LibroLabLayoutFooterView);
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 = FooterComponent;
57
+ return _this;
58
+ }
59
+ return _createClass(LibroLabLayoutFooterView);
60
+ }(DefaultSlotView)) || _class) || _class);
@@ -0,0 +1,17 @@
1
+ .libro-lab-footer {
2
+ .libro-lab-footer-left {
3
+ padding: 0 24px;
4
+ }
5
+ }
6
+
7
+ .libro-lab-current-file-footer {
8
+ height: 100%;
9
+ display: flex;
10
+ align-items: center;
11
+
12
+ span {
13
+ font-weight: 400;
14
+ font-size: 12px;
15
+ color: rgba(0, 10, 26, 68%);
16
+ }
17
+ }
@@ -0,0 +1,5 @@
1
+ export * from './protocol.js';
2
+ export * from './module.js';
3
+ export * from './layout.js';
4
+ export * from './footer/footer-view.js';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/layout/index.tsx"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,yBAAyB,CAAC"}
@@ -0,0 +1,4 @@
1
+ export * from "./protocol.js";
2
+ export * from "./module.js";
3
+ export * from "./layout.js";
4
+ export * from "./footer/footer-view.js";
@@ -0,0 +1,59 @@
1
+ @ant-prefix: ant;
2
+
3
+ .libro-lab-layout {
4
+ width: 100%;
5
+ height: 100%;
6
+
7
+ &-header {
8
+ height: 56px;
9
+ min-height: 56px;
10
+ }
11
+
12
+ &-container {
13
+ overflow: auto;
14
+ }
15
+
16
+ &-main {
17
+ overflow: auto;
18
+ }
19
+
20
+ &-footer {
21
+ height: 28px;
22
+ min-height: 28px;
23
+ background-image: linear-gradient(270deg, #fafafa 0%, #fff 100%);
24
+ box-shadow: 0 -1px 1px 0 rgba(0, 0, 0, 12%);
25
+ }
26
+
27
+ .mana-header {
28
+ background: var(--mana-color-bg-container);
29
+ border-bottom: none;
30
+
31
+ .mana-header-left,
32
+ .mana-header-right {
33
+ flex: unset !important;
34
+ }
35
+
36
+ .mana-menubar {
37
+ height: 100%;
38
+ padding: unset;
39
+ }
40
+
41
+ .mana-menubar-item-text {
42
+ color: rgba(0, 10, 26, 89%);
43
+ font-weight: 400;
44
+ }
45
+ }
46
+ }
47
+
48
+ .libro-lab-editor-tab-tail {
49
+ width: 16px;
50
+
51
+ .libro-lab-editor-tab-dirty {
52
+ padding: 0 4px;
53
+
54
+ .ant-badge.ant-badge-status .ant-badge-status-dot {
55
+ height: 8px;
56
+ width: 8px;
57
+ }
58
+ }
59
+ }
@@ -0,0 +1,99 @@
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 _excluded = ["slot"];
3
+ var _dec, _dec2, _dec3, _class, _class2, _descriptor, _descriptor2;
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
+ 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
+ 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; }
7
+ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
8
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
9
+ function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
10
+ 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 }); }
11
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
12
+ 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); } }
13
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
14
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
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
+ 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 { DefaultSlotView, inject, Notifier, prop, singleton, SlotViewManager } from '@difizen/mana-app';
19
+ import { LibroLabLayoutSlots } from "./protocol.js";
20
+ export var LayoutService = (_dec = singleton(), _dec2 = inject(SlotViewManager), _dec3 = prop(), _dec(_class = (_class2 = /*#__PURE__*/function () {
21
+ function LayoutService() {
22
+ _classCallCheck(this, LayoutService);
23
+ _initializerDefineProperty(this, "slotViewManager", _descriptor, this);
24
+ _initializerDefineProperty(this, "visibilityMap", _descriptor2, this);
25
+ }
26
+ _createClass(LayoutService, [{
27
+ key: "isAreaVisible",
28
+ value: function isAreaVisible(slot) {
29
+ return this.visibilityMap[slot];
30
+ }
31
+ }, {
32
+ key: "setAreaVisible",
33
+ value: function setAreaVisible(slot, visible) {
34
+ this.visibilityMap[slot] = visible;
35
+ }
36
+ }, {
37
+ key: "addView",
38
+ value: function () {
39
+ var _addView = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(view, option) {
40
+ var _ref, _ref$slot, slot, viewOpenOption, slotView;
41
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
42
+ while (1) switch (_context.prev = _context.next) {
43
+ case 0:
44
+ _ref = option || {}, _ref$slot = _ref.slot, slot = _ref$slot === void 0 ? LibroLabLayoutSlots.main : _ref$slot, viewOpenOption = _objectWithoutProperties(_ref, _excluded);
45
+ slotView = this.slotViewManager.getSlotView(slot);
46
+ _context.next = 4;
47
+ return slotView.addView(view, viewOpenOption);
48
+ case 4:
49
+ case "end":
50
+ return _context.stop();
51
+ }
52
+ }, _callee, this);
53
+ }));
54
+ function addView(_x, _x2) {
55
+ return _addView.apply(this, arguments);
56
+ }
57
+ return addView;
58
+ }()
59
+ }, {
60
+ key: "getActiveView",
61
+ value: function getActiveView(slot) {
62
+ if (this.isAreaVisible(slot)) {
63
+ var slotView = this.slotViewManager.getSlotView(slot);
64
+ if (slotView instanceof DefaultSlotView) {
65
+ return slotView.active;
66
+ }
67
+ }
68
+ return undefined;
69
+ }
70
+ }, {
71
+ key: "onSlotActiveChange",
72
+ value: function onSlotActiveChange(slot, handler) {
73
+ if (this.isAreaVisible(slot)) {
74
+ var slotView = this.slotViewManager.getSlotView(slot);
75
+ 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
+ });
80
+ }
81
+ }
82
+ return undefined;
83
+ }
84
+ }]);
85
+ return LayoutService;
86
+ }(), (_descriptor = _applyDecoratedDescriptor(_class2.prototype, "slotViewManager", [_dec2], {
87
+ configurable: true,
88
+ enumerable: true,
89
+ writable: true,
90
+ initializer: null
91
+ }), _descriptor2 = _applyDecoratedDescriptor(_class2.prototype, "visibilityMap", [_dec3], {
92
+ configurable: true,
93
+ enumerable: true,
94
+ writable: true,
95
+ initializer: function initializer() {
96
+ 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;
98
+ }
99
+ })), _class2)) || _class);
@@ -0,0 +1,59 @@
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ var _dec, _dec2, _class;
3
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
4
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
5
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
6
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
7
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
8
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
9
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
10
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
11
+ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
12
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
13
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
14
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
15
+ import { singleton, Slot, useInject, view } from '@difizen/mana-app';
16
+ import { BaseView } from '@difizen/mana-app';
17
+ import { BoxPanel } from '@difizen/mana-react';
18
+ import { forwardRef } from 'react';
19
+ import "./index.less";
20
+ import { LayoutService } from "./layout-service.js";
21
+ import { LibroLabLayoutSlots } from "./protocol.js";
22
+ import { jsx as _jsx } from "react/jsx-runtime";
23
+ import { jsxs as _jsxs } from "react/jsx-runtime";
24
+ export var LibroLabLayoutContainerComponent = /*#__PURE__*/forwardRef(function LibroLabLayoutContainerComponent() {
25
+ var layoutService = useInject(LayoutService);
26
+ return /*#__PURE__*/_jsx("div", {
27
+ className: "libro-lab-layout",
28
+ children: /*#__PURE__*/_jsxs(BoxPanel, {
29
+ direction: "top-to-bottom",
30
+ children: [layoutService.isAreaVisible(LibroLabLayoutSlots.header) && /*#__PURE__*/_jsx(BoxPanel.Pane, {
31
+ className: "libro-lab-layout-header",
32
+ children: /*#__PURE__*/_jsx(Slot, {
33
+ name: LibroLabLayoutSlots.header
34
+ })
35
+ }), layoutService.isAreaVisible(LibroLabLayoutSlots.container) && /*#__PURE__*/_jsx(BoxPanel.Pane, {
36
+ className: "libro-lab-layout-container",
37
+ flex: 1,
38
+ children: /*#__PURE__*/_jsx(Slot, {
39
+ name: LibroLabLayoutSlots.container
40
+ })
41
+ })]
42
+ })
43
+ });
44
+ });
45
+ export var LibroLabLayoutView = (_dec = singleton(), _dec2 = view('libro-lab-layout'), _dec(_class = _dec2(_class = /*#__PURE__*/function (_BaseView) {
46
+ _inherits(LibroLabLayoutView, _BaseView);
47
+ var _super = _createSuper(LibroLabLayoutView);
48
+ function LibroLabLayoutView() {
49
+ var _this;
50
+ _classCallCheck(this, LibroLabLayoutView);
51
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
52
+ args[_key] = arguments[_key];
53
+ }
54
+ _this = _super.call.apply(_super, [this].concat(args));
55
+ _this.view = LibroLabLayoutContainerComponent;
56
+ return _this;
57
+ }
58
+ return _createClass(LibroLabLayoutView);
59
+ }(BaseView)) || _class) || _class);
@@ -0,0 +1,8 @@
1
+ /// <reference types="react" resolution-mode="require"/>
2
+ import { BaseView } from '@difizen/mana-app';
3
+ import './index.less';
4
+ export declare const LibroLabLayoutMainComponent: import("react").ForwardRefExoticComponent<import("react").RefAttributes<unknown>>;
5
+ export declare class LibroLabLayoutMainView extends BaseView {
6
+ view: import("react").ForwardRefExoticComponent<import("react").RefAttributes<unknown>>;
7
+ }
8
+ //# sourceMappingURL=main.d.ts.map
@@ -0,0 +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"}
@@ -0,0 +1,80 @@
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ var _dec, _dec2, _class;
3
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
4
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
5
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
6
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
7
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
8
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
9
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
10
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
11
+ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
12
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
13
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
14
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
15
+ import { singleton, Slot, useInject, view } from '@difizen/mana-app';
16
+ import { BaseView } from '@difizen/mana-app';
17
+ import { SplitPanel } from '@difizen/mana-react';
18
+ import { forwardRef } from 'react';
19
+ import "./index.less";
20
+ import { LayoutService } from "./layout-service.js";
21
+ import { LibroLabLayoutSlots } from "./protocol.js";
22
+ import { jsx as _jsx } from "react/jsx-runtime";
23
+ import { jsxs as _jsxs } from "react/jsx-runtime";
24
+ export var LibroLabLayoutMainComponent = /*#__PURE__*/forwardRef(function LibroLabLayoutMainComponent() {
25
+ var layoutService = useInject(LayoutService);
26
+ return /*#__PURE__*/_jsxs(SplitPanel, {
27
+ id: "libro-lab-content-layout",
28
+ children: [layoutService.isAreaVisible(LibroLabLayoutSlots.navigator) && /*#__PURE__*/_jsx(SplitPanel.Pane, {
29
+ id: "libro-lab-content-layout-left",
30
+ className: "libro-lab-content-layout-left",
31
+ defaultSize: 300,
32
+ minResize: 160,
33
+ children: /*#__PURE__*/_jsx(Slot, {
34
+ name: LibroLabLayoutSlots.navigator
35
+ })
36
+ }), /*#__PURE__*/_jsx(SplitPanel.Pane, {
37
+ id: "libro-lab-content-layout-main-container",
38
+ className: "libro-lab-content-layout-main-container",
39
+ flex: 1,
40
+ minResize: 200,
41
+ children: /*#__PURE__*/_jsxs(SplitPanel, {
42
+ id: "libro-lab-content-layout-main-panel",
43
+ direction: "top-to-bottom",
44
+ children: [layoutService.isAreaVisible(LibroLabLayoutSlots.content) && /*#__PURE__*/_jsx(SplitPanel.Pane, {
45
+ id: "libro-lab-content-layout-main",
46
+ className: "libro-lab-content-layout-main",
47
+ flex: 2,
48
+ flexGrow: 1,
49
+ minResize: 200,
50
+ children: /*#__PURE__*/_jsx(Slot, {
51
+ name: LibroLabLayoutSlots.content
52
+ })
53
+ }), layoutService.isAreaVisible(LibroLabLayoutSlots.contentBottom) && /*#__PURE__*/_jsx(SplitPanel.Pane, {
54
+ id: "libro-lab-content-layout-bottom",
55
+ className: "libro-lab-content-layout-bottom",
56
+ flex: 1,
57
+ defaultSize: 200,
58
+ children: /*#__PURE__*/_jsx(Slot, {
59
+ name: LibroLabLayoutSlots.contentBottom
60
+ })
61
+ })]
62
+ })
63
+ })]
64
+ });
65
+ });
66
+ export var LibroLabLayoutMainView = (_dec = singleton(), _dec2 = view('libro-lab-layout-main'), _dec(_class = _dec2(_class = /*#__PURE__*/function (_BaseView) {
67
+ _inherits(LibroLabLayoutMainView, _BaseView);
68
+ var _super = _createSuper(LibroLabLayoutMainView);
69
+ function LibroLabLayoutMainView() {
70
+ var _this;
71
+ _classCallCheck(this, LibroLabLayoutMainView);
72
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
73
+ args[_key] = arguments[_key];
74
+ }
75
+ _this = _super.call.apply(_super, [this].concat(args));
76
+ _this.view = LibroLabLayoutMainComponent;
77
+ return _this;
78
+ }
79
+ return _createClass(LibroLabLayoutMainView);
80
+ }(BaseView)) || _class) || _class);
@@ -0,0 +1,3 @@
1
+ import { ManaModule } from '@difizen/mana-app';
2
+ export declare const LibroLabLayoutModule: ManaModule;
3
+ //# sourceMappingURL=module.d.ts.map
@@ -0,0 +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"}
@@ -0,0 +1,41 @@
1
+ import { createSlotPreference, FlexSlotView, HeaderArea, HeaderView, ManaModule } from '@difizen/mana-app';
2
+ import { BrandView } from "./brand/index.js";
3
+ import { LibroLabLayoutContainerView } from "./container.js";
4
+ import { EditorTabView } from "./editor-tab-view.js";
5
+ import { LibroLabCurrentFileFooterView } from "./footer/current-file-footer-view.js";
6
+ import { FooterArea, LibroLabLayoutFooterView } from "./footer/footer-view.js";
7
+ import { LayoutService } from "./layout-service.js";
8
+ import { LibroLabLayoutView } from "./layout.js";
9
+ import { LibroLabLayoutMainView } from "./main.js";
10
+ import { LibroLabLayoutSlots } from "./protocol.js";
11
+ export var LibroLabLayoutModule = ManaModule.create('LibroLabLayoutModule').register(LibroLabLayoutView, LibroLabLayoutContainerView, LibroLabLayoutMainView, BrandView, EditorTabView, LibroLabLayoutFooterView, LibroLabCurrentFileFooterView, LayoutService, createSlotPreference({
12
+ slot: LibroLabLayoutSlots.header,
13
+ view: HeaderView
14
+ }), createSlotPreference({
15
+ slot: HeaderArea.left,
16
+ view: BrandView
17
+ }), createSlotPreference({
18
+ slot: LibroLabLayoutSlots.container,
19
+ view: LibroLabLayoutContainerView
20
+ }), createSlotPreference({
21
+ slot: LibroLabLayoutSlots.main,
22
+ view: LibroLabLayoutMainView
23
+ }), createSlotPreference({
24
+ slot: LibroLabLayoutSlots.footer,
25
+ view: LibroLabLayoutFooterView
26
+ }), createSlotPreference({
27
+ slot: FooterArea.right,
28
+ view: FlexSlotView,
29
+ options: {
30
+ sort: true
31
+ }
32
+ }), createSlotPreference({
33
+ slot: FooterArea.left,
34
+ view: FlexSlotView,
35
+ options: {
36
+ sort: true
37
+ }
38
+ }), createSlotPreference({
39
+ slot: FooterArea.left,
40
+ view: LibroLabCurrentFileFooterView
41
+ }));
@@ -0,0 +1,9 @@
1
+ export var LibroLabLayoutSlots = {
2
+ header: 'libro-lab-header',
3
+ container: 'libro-lab-container',
4
+ main: 'libro-lab-main',
5
+ footer: 'libro-lab-footer',
6
+ navigator: 'libro-lab-navigator',
7
+ content: 'libro-lab-content',
8
+ contentBottom: 'libro-lab-content-bottom'
9
+ };
@@ -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 _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
5
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
6
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
7
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
8
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
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 { MacCommandOutlined } from '@ant-design/icons';
19
+ import { BaseView, MAIN_MENU_BAR, MenuBarRender, prop, singleton, view } from '@difizen/mana-app';
20
+ import { forwardRef } from 'react';
21
+ import { jsx as _jsx } from "react/jsx-runtime";
22
+ export var ManaMenubarComponent = /*#__PURE__*/forwardRef(function GithubLinkComponent() {
23
+ return /*#__PURE__*/_jsx(MenuBarRender, {
24
+ menuPath: MAIN_MENU_BAR
25
+ });
26
+ });
27
+ export var MenuBarView = (_dec = singleton(), _dec2 = view('MenuBarView'), _dec3 = prop(), _dec(_class = _dec2(_class = (_class2 = /*#__PURE__*/function (_BaseView) {
28
+ _inherits(MenuBarView, _BaseView);
29
+ var _super = _createSuper(MenuBarView);
30
+ function MenuBarView() {
31
+ var _this;
32
+ _classCallCheck(this, MenuBarView);
33
+ _this = _super.call(this);
34
+ _this.view = ManaMenubarComponent;
35
+ _initializerDefineProperty(_this, "count", _descriptor, _assertThisInitialized(_this));
36
+ _this.title.icon = MacCommandOutlined;
37
+ _this.title.label = '菜单';
38
+ _this.id = 'menu-bar';
39
+ return _this;
40
+ }
41
+ return _createClass(MenuBarView);
42
+ }(BaseView), (_descriptor = _applyDecoratedDescriptor(_class2.prototype, "count", [_dec3], {
43
+ configurable: true,
44
+ enumerable: true,
45
+ writable: true,
46
+ initializer: function initializer() {
47
+ return 0;
48
+ }
49
+ })), _class2)) || _class) || _class);