Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@jupyterlab/codeeditor

Package Overview
Dependencies
Maintainers
4
Versions
355
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@jupyterlab/codeeditor - npm Package Compare versions

Comparing version 0.1.4 to 0.2.0

style/index.css

2

lib/mimetype.d.ts

@@ -1,2 +0,2 @@

import { nbformat } from '@jupyterlab/services';
import { nbformat } from '@jupyterlab/coreutils';
/**

@@ -3,0 +3,0 @@ * The mime type service of a code editor.

@@ -25,2 +25,13 @@ import { Message } from '@phosphor/messaging';

/**
* Handle the DOM events for the widget.
*
* @param event - The DOM event sent to the widget.
*
* #### Notes
* This method implements the DOM `EventListener` interface and is
* called in response to events on the panel's DOM node. It should
* not be called directly by user code.
*/
handleEvent(event: Event): void;
/**
* Handle `'activate-request'` messages.

@@ -34,6 +45,2 @@ */

/**
* Handle `before-detach` messages for the widget.
*/
protected onBeforeDetach(msg: Message): void;
/**
* A message handler invoked on an `'after-show'` message.

@@ -43,16 +50,9 @@ */

/**
* A message handler invoked on an `'resize'` message.
* Handle `before-detach` messages for the widget.
*/
protected onResize(msg: Widget.ResizeMessage): void;
protected onBeforeDetach(msg: Message): void;
/**
* Handle the DOM events for the widget.
*
* @param event - The DOM event sent to the widget.
*
* #### Notes
* This method implements the DOM `EventListener` interface and is
* called in response to events on the panel's DOM node. It should
* not be called directly by user code.
* A message handler invoked on a `'resize'` message.
*/
handleEvent(event: Event): void;
protected onResize(msg: Widget.ResizeMessage): void;
/**

@@ -62,2 +62,6 @@ * Handle `focus` events for the widget.

private _evtFocus(event);
/**
* Handle a change in model selections.
*/
private _onSelectionsChanged();
private _editor;

@@ -64,0 +68,0 @@ private _needsRefresh;

@@ -17,2 +17,6 @@ // Copyright (c) Jupyter Development Team.

/**
* The class name added to an editor widget that has a primary selection.
*/
var HAS_SELECTION_CLASS = 'jp-mod-has-primary-selection';
/**
* A widget which hosts a code editor.

@@ -29,3 +33,3 @@ */

_this._needsRefresh = false;
_this._editor = options.factory({
var editor = _this._editor = options.factory({
host: _this.node,

@@ -38,2 +42,3 @@ model: options.model,

});
editor.model.selections.changed.connect(_this._onSelectionsChanged, _this);
return _this;

@@ -73,2 +78,21 @@ }

/**
* Handle the DOM events for the widget.
*
* @param event - The DOM event sent to the widget.
*
* #### Notes
* This method implements the DOM `EventListener` interface and is
* called in response to events on the panel's DOM node. It should
* not be called directly by user code.
*/
CodeEditorWidget.prototype.handleEvent = function (event) {
switch (event.type) {
case 'focus':
this._evtFocus(event);
break;
default:
break;
}
};
/**
* Handle `'activate-request'` messages.

@@ -91,8 +115,2 @@ */

/**
* Handle `before-detach` messages for the widget.
*/
CodeEditorWidget.prototype.onBeforeDetach = function (msg) {
this.node.removeEventListener('focus', this, true);
};
/**
* A message handler invoked on an `'after-show'` message.

@@ -105,4 +123,10 @@ */

/**
* A message handler invoked on an `'resize'` message.
* Handle `before-detach` messages for the widget.
*/
CodeEditorWidget.prototype.onBeforeDetach = function (msg) {
this.node.removeEventListener('focus', this, true);
};
/**
* A message handler invoked on a `'resize'` message.
*/
CodeEditorWidget.prototype.onResize = function (msg) {

@@ -122,21 +146,2 @@ if (msg.width >= 0 && msg.height >= 0) {

/**
* Handle the DOM events for the widget.
*
* @param event - The DOM event sent to the widget.
*
* #### Notes
* This method implements the DOM `EventListener` interface and is
* called in response to events on the panel's DOM node. It should
* not be called directly by user code.
*/
CodeEditorWidget.prototype.handleEvent = function (event) {
switch (event.type) {
case 'focus':
this._evtFocus(event);
break;
default:
break;
}
};
/**
* Handle `focus` events for the widget.

@@ -150,4 +155,16 @@ */

};
/**
* Handle a change in model selections.
*/
CodeEditorWidget.prototype._onSelectionsChanged = function () {
var _a = this._editor.getSelection(), start = _a.start, end = _a.end;
if (start.column !== end.column || start.line !== end.line) {
this.addClass(HAS_SELECTION_CLASS);
}
else {
this.removeClass(HAS_SELECTION_CLASS);
}
};
return CodeEditorWidget;
}(widgets_1.Widget));
exports.CodeEditorWidget = CodeEditorWidget;
{
"name": "@jupyterlab/codeeditor",
"version": "0.1.4",
"version": "0.2.0",
"description": "JupyterLab - Abstract Code Editor",

@@ -9,3 +9,4 @@ "main": "lib/index.js",

"lib/*.d.ts",
"lib/*.js"
"lib/*.js",
"style/*.css"
],

@@ -16,9 +17,9 @@ "directories": {

"dependencies": {
"@jupyterlab/coreutils": "^0.1.1",
"@jupyterlab/services": "^0.40.1",
"@phosphor/coreutils": "^0.1.5",
"@phosphor/disposable": "^0.1.1",
"@phosphor/messaging": "^0.1.2",
"@phosphor/signaling": "^0.1.2",
"@phosphor/widgets": "^0.3.0"
"@jupyterlab/coreutils": "^0.2.0",
"@jupyterlab/services": "^0.41.0",
"@phosphor/coreutils": "^1.0.0",
"@phosphor/disposable": "^1.0.0",
"@phosphor/messaging": "^1.0.0",
"@phosphor/signaling": "^1.0.0",
"@phosphor/widgets": "^1.0.0"
},

@@ -25,0 +26,0 @@ "devDependencies": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc