@phosphor/commands
Advanced tools
Comparing version 1.6.0 to 1.6.1
@@ -679,2 +679,6 @@ import { ReadonlyJSONObject } from '@phosphor/coreutils'; | ||
/** | ||
* Format a keystroke for display on the local system. | ||
*/ | ||
function formatKeystroke(keystroke: string): string; | ||
/** | ||
* Create a normalized keystroke for a `'keydown'` event. | ||
@@ -681,0 +685,0 @@ * |
@@ -627,2 +627,36 @@ "use strict"; | ||
/** | ||
* Format a keystroke for display on the local system. | ||
*/ | ||
function formatKeystroke(keystroke) { | ||
var mods = ''; | ||
var parts = parseKeystroke(keystroke); | ||
if (domutils_1.Platform.IS_MAC) { | ||
if (parts.ctrl) { | ||
mods += '\u2303 '; | ||
} | ||
if (parts.alt) { | ||
mods += '\u2325 '; | ||
} | ||
if (parts.shift) { | ||
mods += '\u21E7 '; | ||
} | ||
if (parts.cmd) { | ||
mods += '\u2318 '; | ||
} | ||
} | ||
else { | ||
if (parts.ctrl) { | ||
mods += 'Ctrl+'; | ||
} | ||
if (parts.alt) { | ||
mods += 'Alt+'; | ||
} | ||
if (parts.shift) { | ||
mods += 'Shift+'; | ||
} | ||
} | ||
return mods + parts.key; | ||
} | ||
CommandRegistry.formatKeystroke = formatKeystroke; | ||
/** | ||
* Create a normalized keystroke for a `'keydown'` event. | ||
@@ -629,0 +663,0 @@ * |
{ | ||
"name": "@phosphor/commands", | ||
"version": "1.6.0", | ||
"version": "1.6.1", | ||
"description": "PhosphorJS - Commands", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
58455
1607
0