@phosphor/commands
Advanced tools
Comparing version 1.1.0 to 1.2.0
@@ -105,2 +105,6 @@ import { JSONObject } from '@phosphor/coreutils'; | ||
/** | ||
* @deprecated Use `iconClass()` instead. | ||
*/ | ||
icon(id: string, args?: JSONObject): string; | ||
/** | ||
* Get the icon class for a specific command. | ||
@@ -115,4 +119,15 @@ * | ||
*/ | ||
icon(id: string, args?: JSONObject): string; | ||
iconClass(id: string, args?: JSONObject): string; | ||
/** | ||
* Get the icon label for a specific command. | ||
* | ||
* @param id - The id of the command of interest. | ||
* | ||
* @param args - The arguments for the command. | ||
* | ||
* @returns The icon label for the command, or an empty string if | ||
* the command is not registered. | ||
*/ | ||
iconLabel(id: string, args?: JSONObject): string; | ||
/** | ||
* Get the short form caption for a specific command. | ||
@@ -347,2 +362,6 @@ * | ||
/** | ||
* @deprecated Use `iconClass` instead. | ||
*/ | ||
icon?: string | CommandFunc<string>; | ||
/** | ||
* The icon class for the command. | ||
@@ -361,4 +380,17 @@ * | ||
*/ | ||
icon?: string | CommandFunc<string>; | ||
iconClass?: string | CommandFunc<string>; | ||
/** | ||
* The icon label for the command. | ||
* | ||
* #### Notes | ||
* This label will be added as text to the icon node for the visual | ||
* representation of the command. | ||
* | ||
* This can be a string literal, or a function which returns the | ||
* label based on the provided command arguments. | ||
* | ||
* The default value is an empty string. | ||
*/ | ||
iconLabel?: string | CommandFunc<string>; | ||
/** | ||
* The caption for the command. | ||
@@ -365,0 +397,0 @@ * |
@@ -186,2 +186,9 @@ "use strict"; | ||
/** | ||
* @deprecated Use `iconClass()` instead. | ||
*/ | ||
CommandRegistry.prototype.icon = function (id, args) { | ||
if (args === void 0) { args = coreutils_1.JSONExt.emptyObject; } | ||
return this.iconClass(id, args); | ||
}; | ||
/** | ||
* Get the icon class for a specific command. | ||
@@ -196,8 +203,23 @@ * | ||
*/ | ||
CommandRegistry.prototype.icon = function (id, args) { | ||
CommandRegistry.prototype.iconClass = function (id, args) { | ||
if (args === void 0) { args = coreutils_1.JSONExt.emptyObject; } | ||
var cmd = this._commands[id]; | ||
return cmd ? cmd.icon.call(undefined, args) : ''; | ||
return cmd ? cmd.iconClass.call(undefined, args) : ''; | ||
}; | ||
/** | ||
* Get the icon label for a specific command. | ||
* | ||
* @param id - The id of the command of interest. | ||
* | ||
* @param args - The arguments for the command. | ||
* | ||
* @returns The icon label for the command, or an empty string if | ||
* the command is not registered. | ||
*/ | ||
CommandRegistry.prototype.iconLabel = function (id, args) { | ||
if (args === void 0) { args = coreutils_1.JSONExt.emptyObject; } | ||
var cmd = this._commands[id]; | ||
return cmd ? cmd.iconLabel.call(undefined, args) : ''; | ||
}; | ||
/** | ||
* Get the short form caption for a specific command. | ||
@@ -653,3 +675,4 @@ * | ||
mnemonic: asFunc(options.mnemonic, negativeOneFunc), | ||
icon: asFunc(options.icon, emptyStringFunc), | ||
iconClass: asFunc(options.iconClass || options.icon, emptyStringFunc), | ||
iconLabel: asFunc(options.iconLabel, emptyStringFunc), | ||
caption: asFunc(options.caption, emptyStringFunc), | ||
@@ -656,0 +679,0 @@ usage: asFunc(options.usage, emptyStringFunc), |
{ | ||
"name": "@phosphor/commands", | ||
"version": "1.1.0", | ||
"version": "1.2.0", | ||
"description": "PhosphorJS - Commands", | ||
@@ -15,11 +15,12 @@ "main": "lib/index.js", | ||
"dependencies": { | ||
"@phosphor/algorithm": "^1.0.0", | ||
"@phosphor/coreutils": "^1.0.0", | ||
"@phosphor/disposable": "^1.0.0", | ||
"@phosphor/domutils": "^1.0.0", | ||
"@phosphor/keyboard": "^1.0.0", | ||
"@phosphor/signaling": "^1.1.0" | ||
"@phosphor/algorithm": "^1.1.0", | ||
"@phosphor/coreutils": "^1.1.0", | ||
"@phosphor/disposable": "^1.1.0", | ||
"@phosphor/domutils": "^1.1.0", | ||
"@phosphor/keyboard": "^1.1.0", | ||
"@phosphor/signaling": "^1.2.0" | ||
}, | ||
"devDependencies": { | ||
"rimraf": "^2.5.2", | ||
"typedoc": "^0.6.0", | ||
"typescript": "^2.2.1" | ||
@@ -29,3 +30,4 @@ }, | ||
"build": "tsc", | ||
"clean": "rimraf lib" | ||
"clean": "rimraf lib", | ||
"docs": "typedoc --options tdoptions.json ." | ||
}, | ||
@@ -32,0 +34,0 @@ "repository": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
58526
1565
3
Updated@phosphor/algorithm@^1.1.0
Updated@phosphor/coreutils@^1.1.0
Updated@phosphor/disposable@^1.1.0
Updated@phosphor/domutils@^1.1.0
Updated@phosphor/keyboard@^1.1.0
Updated@phosphor/signaling@^1.2.0