Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
constructor(options: PluginEditor.IOptions) {
super();
this.addClass(PLUGIN_EDITOR_CLASS);
const { commands, editorFactory, registry, rendermime } = options;
// TODO: Remove this layout. We were using this before when we
// when we had a way to switch between the raw and table editor
// Now, the raw editor is the only child and probably could merged into
// this class directly in the future.
const layout = (this.layout = new StackedLayout());
const { onSaveError } = Private;
this.raw = this._rawEditor = new RawEditor({
commands,
editorFactory,
onSaveError,
registry,
rendermime
});
this._rawEditor.handleMoved.connect(this._onStateChanged, this);
layout.addWidget(this._rawEditor);
}
constructor(options: MarkdownViewer.IOptions) {
super();
this.context = options.context;
this.renderer = options.renderer;
this.node.tabIndex = -1;
this.addClass(MARKDOWNVIEWER_CLASS);
const layout = (this.layout = new StackedLayout());
layout.addWidget(this.renderer);
void this.context.ready.then(async () => {
await this._render();
// Throttle the rendering rate of the widget.
this._monitor = new ActivityMonitor({
signal: this.context.model.contentChanged,
timeout: this._config.renderTimeout
});
this._monitor.activityStopped.connect(this.update, this);
this._ready.resolve(undefined);
});
}
constructor(options: FileEditor.IOptions) {
super();
this.addClass('jp-FileEditor');
const context = (this._context = options.context);
this._mimeTypeService = options.mimeTypeService;
let editorWidget = (this.editorWidget = new FileEditorCodeWrapper(options));
this.editor = editorWidget.editor;
this.model = editorWidget.model;
// Listen for changes to the path.
context.pathChanged.connect(this._onPathChanged, this);
this._onPathChanged();
let layout = (this.layout = new StackedLayout());
layout.addWidget(editorWidget);
}