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

@jupyterlab/application

Package Overview
Dependencies
Maintainers
10
Versions
385
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@jupyterlab/application - npm Package Compare versions

Comparing version 4.1.3 to 4.1.4

6

lib/lab.d.ts

@@ -63,8 +63,2 @@ import { IRenderMime } from '@jupyterlab/rendermime-interfaces';

registerPluginModules(mods: JupyterLab.IPluginModule[]): void;
/**
* Override keydown handling to prevent command shortcuts from preventing user input.
*
* This introduces a slight delay to the command invocation, but no delay to user input.
*/
protected evtKeydown(event: KeyboardEvent): void;
private _info;

@@ -71,0 +65,0 @@ private _paths;

@@ -169,55 +169,2 @@ // Copyright (c) Jupyter Development Team.

}
/**
* Override keydown handling to prevent command shortcuts from preventing user input.
*
* This introduces a slight delay to the command invocation, but no delay to user input.
*/
evtKeydown(event) {
// Process select keys which may call `preventDefault()` immediately
if (['Tab', 'ArrowDown', 'ArrowUp', 'ArrowRight', 'ArrowLeft'].includes(event.key)) {
return this.commands.processKeydownEvent(event);
}
// Process remaining events conditionally, depending on whether they would lead to text insertion
const causesInputPromise = Promise.race([
new Promise(resolve => {
if (!event.target) {
return resolve(false);
}
event.target.addEventListener('beforeinput', (inputEvent) => {
switch (inputEvent.inputType) {
case 'historyUndo':
case 'historyRedo': {
if (inputEvent.target instanceof Element &&
inputEvent.target.closest('[data-jp-undoer]')) {
// Allow to use custom undo/redo bindings on `jpUndoer`s
inputEvent.preventDefault();
return resolve(false);
}
break;
}
case 'insertLineBreak': {
if (inputEvent.target instanceof Element &&
inputEvent.target.closest('.jp-Cell')) {
// Allow to override the default action of Shift + Enter on cells as this is used for cell execution
inputEvent.preventDefault();
return resolve(false);
}
break;
}
}
return resolve(true);
}, { once: true });
}),
new Promise(resolve => {
setTimeout(() => resolve(false), Private.INPUT_GUARD_TIMEOUT);
})
]);
causesInputPromise
.then(willCauseInput => {
if (!willCauseInput) {
this.commands.processKeydownEvent(event);
}
})
.catch(console.warn);
}
}

@@ -274,17 +221,2 @@ /**

})(JupyterLab || (JupyterLab = {}));
/**
* A namespace for module-private functionality.
*/
var Private;
(function (Private) {
/**
* The delay for invoking a command introduced by user input guard.
* Decreasing this value may lead to commands incorrectly triggering
* on user input. Increasing this value will lead to longer delay for
* command invocation. Note that user input is never delayed.
*
* The value represents the number in milliseconds.
*/
Private.INPUT_GUARD_TIMEOUT = 10;
})(Private || (Private = {}));
//# sourceMappingURL=lab.js.map

22

package.json
{
"name": "@jupyterlab/application",
"version": "4.1.3",
"version": "4.1.4",
"description": "JupyterLab - Application",

@@ -46,11 +46,11 @@ "homepage": "https://github.com/jupyterlab/jupyterlab",

"@fortawesome/fontawesome-free": "^5.12.0",
"@jupyterlab/apputils": "^4.2.3",
"@jupyterlab/coreutils": "^6.1.3",
"@jupyterlab/docregistry": "^4.1.3",
"@jupyterlab/rendermime": "^4.1.3",
"@jupyterlab/rendermime-interfaces": "^3.9.3",
"@jupyterlab/services": "^7.1.3",
"@jupyterlab/statedb": "^4.1.3",
"@jupyterlab/translation": "^4.1.3",
"@jupyterlab/ui-components": "^4.1.3",
"@jupyterlab/apputils": "^4.2.4",
"@jupyterlab/coreutils": "^6.1.4",
"@jupyterlab/docregistry": "^4.1.4",
"@jupyterlab/rendermime": "^4.1.4",
"@jupyterlab/rendermime-interfaces": "^3.9.4",
"@jupyterlab/services": "^7.1.4",
"@jupyterlab/statedb": "^4.1.4",
"@jupyterlab/translation": "^4.1.4",
"@jupyterlab/ui-components": "^4.1.4",
"@lumino/algorithm": "^2.0.1",

@@ -68,3 +68,3 @@ "@lumino/application": "^2.3.0",

"devDependencies": {
"@jupyterlab/testing": "^4.1.3",
"@jupyterlab/testing": "^4.1.4",
"@types/jest": "^29.2.0",

@@ -71,0 +71,0 @@ "jest": "^29.2.0",

@@ -202,68 +202,2 @@ // Copyright (c) Jupyter Development Team.

/**
* Override keydown handling to prevent command shortcuts from preventing user input.
*
* This introduces a slight delay to the command invocation, but no delay to user input.
*/
protected evtKeydown(event: KeyboardEvent): void {
// Process select keys which may call `preventDefault()` immediately
if (
['Tab', 'ArrowDown', 'ArrowUp', 'ArrowRight', 'ArrowLeft'].includes(
event.key
)
) {
return this.commands.processKeydownEvent(event);
}
// Process remaining events conditionally, depending on whether they would lead to text insertion
const causesInputPromise = Promise.race([
new Promise(resolve => {
if (!event.target) {
return resolve(false);
}
event.target.addEventListener(
'beforeinput',
(inputEvent: InputEvent) => {
switch (inputEvent.inputType) {
case 'historyUndo':
case 'historyRedo': {
if (
inputEvent.target instanceof Element &&
inputEvent.target.closest('[data-jp-undoer]')
) {
// Allow to use custom undo/redo bindings on `jpUndoer`s
inputEvent.preventDefault();
return resolve(false);
}
break;
}
case 'insertLineBreak': {
if (
inputEvent.target instanceof Element &&
inputEvent.target.closest('.jp-Cell')
) {
// Allow to override the default action of Shift + Enter on cells as this is used for cell execution
inputEvent.preventDefault();
return resolve(false);
}
break;
}
}
return resolve(true);
},
{ once: true }
);
}),
new Promise(resolve => {
setTimeout(() => resolve(false), Private.INPUT_GUARD_TIMEOUT);
})
]);
causesInputPromise
.then(willCauseInput => {
if (!willCauseInput) {
this.commands.processKeydownEvent(event);
}
})
.catch(console.warn);
}
private _info: JupyterLab.IInfo = JupyterLab.defaultInfo;

@@ -443,16 +377,1 @@ private _paths: JupyterFrontEnd.IPaths;

}
/**
* A namespace for module-private functionality.
*/
namespace Private {
/**
* The delay for invoking a command introduced by user input guard.
* Decreasing this value may lead to commands incorrectly triggering
* on user input. Increasing this value will lead to longer delay for
* command invocation. Note that user input is never delayed.
*
* The value represents the number in milliseconds.
*/
export const INPUT_GUARD_TIMEOUT = 10;
}

Sorry, the diff of this file is not supported yet

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