New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

phosphide

Package Overview
Dependencies
Maintainers
2
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

phosphide - npm Package Compare versions

Comparing version 0.7.0 to 0.8.0

25

lib/commandpalette/index.d.ts
import { Token } from 'phosphor-di';
import { IDisposable } from 'phosphor-disposable';
import { ISignal } from 'phosphor-signaling';
import { Widget } from 'phosphor-widget';
/**
* The public interface of the command palette.
*
* #### Notes
* In addition to the public API, an `ICommandPalette` instance also needs to
* register the following commands:
* 1. `'command-palette:focus-input'`, which takes no arguments and focuses the
* search bar.
*/
export interface ICommandPalette {
/**
* A signal emitted when a command is triggered by the palette.
*
* #### Note
* The order in which the command executes and the signal emits is undefined.
*/
commandTriggered: ISignal<ICommandPalette, {
id: string;
args: any;
}>;
/**
* The underlying palette widget.
*/
widget: Widget;
/**
* Add new command items to the palette.

@@ -22,6 +43,2 @@ *

}[]): IDisposable;
/**
* The underlying palette widget.
*/
widget: Widget;
}

@@ -28,0 +45,0 @@ /**

@@ -12,2 +12,3 @@ /*-----------------------------------------------------------------------------

var phosphor_disposable_1 = require('phosphor-disposable');
var phosphor_signaling_1 = require('phosphor-signaling');
var index_1 = require('./index');

@@ -43,2 +44,7 @@ var index_2 = require('../commandregistry/index');

function CommandPaletteManager(commandRegistry, shortcutManager) {
var _this = this;
this._commandHandler = function (commandSpec) {
_this.commandTriggered.emit(commandSpec);
_this._commandRegistry.execute(commandSpec.id, commandSpec.args);
};
this._paletteModel = new phosphor_commandpalette_1.StandardPaletteModel();

@@ -49,3 +55,25 @@ this._commandPalette = new phosphor_commandpalette_1.CommandPalette();

this._shortcutManager = shortcutManager;
commandRegistry.add([
{
id: 'command-palette:focus-input',
handler: function () {
_this._commandPalette.inputNode.focus();
_this._commandPalette.inputNode.select();
}
}
]);
}
Object.defineProperty(CommandPaletteManager.prototype, "commandTriggered", {
/**
* A signal emitted when a command is triggered by the palette.
*
* #### Note
* The order in which the command executes and the signal emits is undefined.
*/
get: function () {
return CommandPaletteManagerPrivate.commandTriggeredSignal.bind(this);
},
enumerable: true,
configurable: true
});
Object.defineProperty(CommandPaletteManager.prototype, "widget", {

@@ -75,10 +103,9 @@ /**

var options = {
handler: function (args) {
_this._commandRegistry.execute(item.id, args);
},
args: item.args,
handler: _this._commandHandler,
args: { id: item.id, args: item.args },
text: item.text,
shortcut: '',
category: item.category,
caption: item.caption };
caption: item.caption
};
var shortcut = _this._shortcutManager.getSequences(item.id, item.args);

@@ -100,1 +127,14 @@ if (shortcut && shortcut.length > 0) {

}());
/**
* The namespace for the `CommandPaletteManager` class private data.
*/
var CommandPaletteManagerPrivate;
(function (CommandPaletteManagerPrivate) {
/**
* A signal emitted when a command is triggered by the palette.
*
* #### Note
* The order in which the command executes and the signal emits is undefined.
*/
CommandPaletteManagerPrivate.commandTriggeredSignal = new phosphor_signaling_1.Signal();
})(CommandPaletteManagerPrivate || (CommandPaletteManagerPrivate = {}));

2

package.json
{
"name": "phosphide",
"version": "0.7.0",
"version": "0.8.0",
"description": "Slightly opinionated scaffolding for building plugin-based IDE-style applications.",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

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