bit-bin
Version:
<a href="https://opensource.org/licenses/Apache-2.0"><img alt="apache" src="https://img.shields.io/badge/License-Apache%202.0-blue.svg"></a> <a href="https://github.com/teambit/bit/blob/master/CONTRIBUTING.md"><img alt="prs" src="https://img.shields.io/b
89 lines (65 loc) • 1.55 kB
JavaScript
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.WorkspaceUI = void 0;
function _bluebird() {
const data = require("bluebird");
_bluebird = function () {
return data;
};
return data;
}
function _defineProperty2() {
const data = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
_defineProperty2 = function () {
return data;
};
return data;
}
function _react() {
const data = _interopRequireDefault(require("react"));
_react = function () {
return data;
};
return data;
}
function _harmony() {
const data = require("@teambit/harmony");
_harmony = function () {
return data;
};
return data;
}
function _ui() {
const data = require("./ui");
_ui = function () {
return data;
};
return data;
}
class WorkspaceUI {
constructor(topBarSlot) {
this.topBarSlot = topBarSlot;
}
/**
* register a new menu item.
*/
registerMenuItem(menuItem) {
this.topBarSlot.register(menuItem);
return this;
}
getMain() {
return /*#__PURE__*/_react().default.createElement(_ui().Workspace, {
topBarSlot: this.topBarSlot
});
}
static provider(deps, config, [topBarSlot]) {
return (0, _bluebird().coroutine)(function* () {
return new WorkspaceUI(topBarSlot);
})();
}
}
exports.WorkspaceUI = WorkspaceUI;
(0, _defineProperty2().default)(WorkspaceUI, "slots", [_harmony().Slot.withType()]);
;