Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function activateWidgetExtension(app: JupyterLab, registry: IJupyterWidgetRegistry): void {
let SidecarView = class extends output.OutputView {
model: SidecarModel;
render() {
if (!this.model.rendered) {
super.render();
let w = this._outputView;
w.addClass('jupyterlab-sidecar');
w.addClass('jp-LinkedOutputView');
w.title.label = this.model.get('title');
w.title.closable = true;
app.shell['_rightHandler'].sideBar.tabCloseRequested.connect((sender : any, tab : any) => {
tab.title.owner.dispose();
});
w.id = UUID.uuid4();
if (Object.keys(this.model.views).length > 1) {
w.node.style.display = 'none';