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

@phosphor/application

Package Overview
Dependencies
Maintainers
1
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@phosphor/application - npm Package Compare versions

Comparing version 0.3.0 to 0.3.1

24

lib/index.d.ts
import { CommandRegistry } from '@phosphor/commands';
import { Token } from '@phosphor/coreutils';
import { Widget } from '@phosphor/widgets';
import { ContextMenu, Menu, Widget } from '@phosphor/widgets';
/**

@@ -106,2 +106,6 @@ * A user-defined application plugin.

/**
* The application context menu.
*/
readonly contextMenu: ContextMenu;
/**
* The application shell widget.

@@ -273,2 +277,16 @@ *

/**
* A method invoked on a document `'contextmenu'` event.
*
* #### Notes
* The default implementation of this method opens the application
* `contextMenu` at the current mouse position.
*
* If the application context menu has no matching content *or* if
* the shift key is pressed, the default browser context menu will
* be opened instead.
*
* A subclass may reimplement this method as needed.
*/
protected evtContextMenu(event: MouseEvent): void;
/**
* A method invoked on a window `'resize'` event.

@@ -303,2 +321,6 @@ *

shell: T;
/**
* A custom renderer for the context menu.
*/
contextMenuRenderer?: Menu.IRenderer;
}

@@ -305,0 +327,0 @@ /**

@@ -28,6 +28,2 @@ "use strict";

function Application(options) {
/**
* The application command registry.
*/
this.commands = new commands_1.CommandRegistry();
this._started = false;

@@ -37,2 +33,10 @@ this._pluginMap = Private.createPluginMap();

this._delegate = new coreutils_1.PromiseDelegate();
// Create the application command registry.
var commands = new commands_1.CommandRegistry();
// Create the application context menu.
var renderer = options.contextMenuRenderer;
var contextMenu = new widgets_1.ContextMenu({ commands: commands, renderer: renderer });
// Initialize the application state.
this.commands = commands;
this.contextMenu = contextMenu;
this.shell = options.shell;

@@ -296,2 +300,5 @@ }

break;
case 'contextmenu':
this.evtContextMenu(event);
break;
}

@@ -322,2 +329,3 @@ };

Application.prototype.addEventListeners = function () {
document.addEventListener('contextmenu', this);
document.addEventListener('keydown', this, true);

@@ -339,2 +347,24 @@ window.addEventListener('resize', this);

/**
* A method invoked on a document `'contextmenu'` event.
*
* #### Notes
* The default implementation of this method opens the application
* `contextMenu` at the current mouse position.
*
* If the application context menu has no matching content *or* if
* the shift key is pressed, the default browser context menu will
* be opened instead.
*
* A subclass may reimplement this method as needed.
*/
Application.prototype.evtContextMenu = function (event) {
if (event.shiftKey) {
return;
}
if (this.contextMenu.open(event)) {
event.preventDefault();
event.stopPropagation();
}
};
/**
* A method invoked on a window `'resize'` event.

@@ -341,0 +371,0 @@ *

4

package.json
{
"name": "@phosphor/application",
"version": "0.3.0",
"version": "0.3.1",
"description": "PhosphorJS - Pluggable Application",

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

"@phosphor/coreutils": "^0.1.5",
"@phosphor/widgets": "^0.3.0"
"@phosphor/widgets": "^0.3.1"
},

@@ -20,0 +20,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