atom-keymap
Advanced tools
Comparing version 5.0.0 to 5.1.0
32
api.json
@@ -6,3 +6,3 @@ { | ||
"filename": "src/keymap-manager.coffee", | ||
"srcUrl": "https://github.com/atom/atom-keymap/blob/v5.0.0/src/keymap-manager.coffee#L68", | ||
"srcUrl": "https://github.com/atom/atom-keymap/blob/v5.1.0/src/keymap-manager.coffee#L66", | ||
"sections": [ | ||
@@ -42,3 +42,3 @@ { | ||
"sectionName": "Class Methods", | ||
"srcUrl": "https://github.com/atom/atom-keymap/blob/v5.0.0/src/keymap-manager.coffee#L87", | ||
"srcUrl": "https://github.com/atom/atom-keymap/blob/v5.1.0/src/keymap-manager.coffee#L83", | ||
"visibility": "Public", | ||
@@ -105,3 +105,3 @@ "summary": "Create a keydown DOM event for testing purposes.", | ||
"sectionName": "Construction and Destruction", | ||
"srcUrl": "https://github.com/atom/atom-keymap/blob/v5.0.0/src/keymap-manager.coffee#L115", | ||
"srcUrl": "https://github.com/atom/atom-keymap/blob/v5.1.0/src/keymap-manager.coffee#L107", | ||
"visibility": "Public", | ||
@@ -130,3 +130,3 @@ "summary": "Create a new KeymapManager.", | ||
"sectionName": "Construction and Destruction", | ||
"srcUrl": "https://github.com/atom/atom-keymap/blob/v5.0.0/src/keymap-manager.coffee#L128", | ||
"srcUrl": "https://github.com/atom/atom-keymap/blob/v5.1.0/src/keymap-manager.coffee#L120", | ||
"visibility": "Public", | ||
@@ -139,3 +139,3 @@ "summary": "Unwatch all watched paths. ", | ||
"sectionName": "Event Subscription", | ||
"srcUrl": "https://github.com/atom/atom-keymap/blob/v5.0.0/src/keymap-manager.coffee#L157", | ||
"srcUrl": "https://github.com/atom/atom-keymap/blob/v5.1.0/src/keymap-manager.coffee#L149", | ||
"visibility": "Public", | ||
@@ -190,3 +190,3 @@ "summary": "Invoke the given callback when one or more keystrokes completely\nmatch a key binding.", | ||
"sectionName": "Event Subscription", | ||
"srcUrl": "https://github.com/atom/atom-keymap/blob/v5.0.0/src/keymap-manager.coffee#L173", | ||
"srcUrl": "https://github.com/atom/atom-keymap/blob/v5.1.0/src/keymap-manager.coffee#L165", | ||
"visibility": "Public", | ||
@@ -241,3 +241,3 @@ "summary": "Invoke the given callback when one or more keystrokes partially\nmatch a binding.", | ||
"sectionName": "Event Subscription", | ||
"srcUrl": "https://github.com/atom/atom-keymap/blob/v5.0.0/src/keymap-manager.coffee#L187", | ||
"srcUrl": "https://github.com/atom/atom-keymap/blob/v5.1.0/src/keymap-manager.coffee#L179", | ||
"visibility": "Public", | ||
@@ -286,3 +286,3 @@ "summary": "Invoke the given callback when one or more keystrokes fail to match\nany bindings.", | ||
"sectionName": "Event Subscription", | ||
"srcUrl": "https://github.com/atom/atom-keymap/blob/v5.0.0/src/keymap-manager.coffee#L218", | ||
"srcUrl": "https://github.com/atom/atom-keymap/blob/v5.1.0/src/keymap-manager.coffee#L210", | ||
"visibility": "Public", | ||
@@ -331,3 +331,3 @@ "summary": "Invoke the given callback when a keymap file not able to be loaded.", | ||
"sectionName": "Adding and Removing Bindings", | ||
"srcUrl": "https://github.com/atom/atom-keymap/blob/v5.0.0/src/keymap-manager.coffee#L248", | ||
"srcUrl": "https://github.com/atom/atom-keymap/blob/v5.1.0/src/keymap-manager.coffee#L223", | ||
"visibility": "Public", | ||
@@ -354,3 +354,3 @@ "summary": "Add sets of key bindings grouped by CSS selector.", | ||
"sectionName": "Accessing Bindings", | ||
"srcUrl": "https://github.com/atom/atom-keymap/blob/v5.0.0/src/keymap-manager.coffee#L285", | ||
"srcUrl": "https://github.com/atom/atom-keymap/blob/v5.1.0/src/keymap-manager.coffee#L256", | ||
"visibility": "Public", | ||
@@ -369,3 +369,3 @@ "summary": "Get all current key bindings.", | ||
"sectionName": "Accessing Bindings", | ||
"srcUrl": "https://github.com/atom/atom-keymap/blob/v5.0.0/src/keymap-manager.coffee#L300", | ||
"srcUrl": "https://github.com/atom/atom-keymap/blob/v5.1.0/src/keymap-manager.coffee#L271", | ||
"visibility": "Public", | ||
@@ -412,3 +412,3 @@ "summary": "Get the key bindings for a given command and optional target.", | ||
"sectionName": "Managing Keymap Files", | ||
"srcUrl": "https://github.com/atom/atom-keymap/blob/v5.0.0/src/keymap-manager.coffee#L335", | ||
"srcUrl": "https://github.com/atom/atom-keymap/blob/v5.1.0/src/keymap-manager.coffee#L306", | ||
"visibility": "Public", | ||
@@ -443,3 +443,3 @@ "summary": "Load the key bindings from the given path.", | ||
"sectionName": "Managing Keymap Files", | ||
"srcUrl": "https://github.com/atom/atom-keymap/blob/v5.0.0/src/keymap-manager.coffee#L355", | ||
"srcUrl": "https://github.com/atom/atom-keymap/blob/v5.1.0/src/keymap-manager.coffee#L326", | ||
"visibility": "Public", | ||
@@ -460,3 +460,3 @@ "summary": "Cause the keymap to reload the key bindings file at the given path\nwhenever it changes.", | ||
"sectionName": "Managing Keyboard Events", | ||
"srcUrl": "https://github.com/atom/atom-keymap/blob/v5.0.0/src/keymap-manager.coffee#L427", | ||
"srcUrl": "https://github.com/atom/atom-keymap/blob/v5.1.0/src/keymap-manager.coffee#L398", | ||
"visibility": "Public", | ||
@@ -477,3 +477,3 @@ "summary": "Dispatch a custom event associated with the matching key binding for\nthe given `KeyboardEvent` if one can be found.", | ||
"sectionName": "Managing Keyboard Events", | ||
"srcUrl": "https://github.com/atom/atom-keymap/blob/v5.0.0/src/keymap-manager.coffee#L505", | ||
"srcUrl": "https://github.com/atom/atom-keymap/blob/v5.1.0/src/keymap-manager.coffee#L476", | ||
"visibility": "Public", | ||
@@ -500,3 +500,3 @@ "summary": "Translate a keydown event to a keystroke string.", | ||
"sectionName": "Managing Keyboard Events", | ||
"srcUrl": "https://github.com/atom/atom-keymap/blob/v5.0.0/src/keymap-manager.coffee#L512", | ||
"srcUrl": "https://github.com/atom/atom-keymap/blob/v5.1.0/src/keymap-manager.coffee#L483", | ||
"visibility": "Public", | ||
@@ -503,0 +503,0 @@ "summary": "Get the number of milliseconds allowed before pending states caused\nby partial matches of multi-keystroke bindings are terminated.", |
@@ -6,22 +6,7 @@ (function() { | ||
PropertyAccessors = require('property-accessors'); | ||
calculateSpecificity = require('./helpers').calculateSpecificity; | ||
module.exports = KeyBinding = (function() { | ||
PropertyAccessors.includeInto(KeyBinding); | ||
KeyBinding.currentIndex = 1; | ||
KeyBinding.prototype.accessor('keystroke', { | ||
get: function() { | ||
Grim.deprecate('Use KeyBinding.keystrokes instead'); | ||
return this.keystrokes; | ||
}, | ||
set: function(value) { | ||
Grim.deprecate('Use KeyBinding.keystrokes instead'); | ||
return this.keystrokes = value; | ||
} | ||
}); | ||
KeyBinding.prototype.enabled = true; | ||
@@ -61,2 +46,17 @@ | ||
if (Grim.includeDeprecatedAPIs) { | ||
PropertyAccessors = require('property-accessors'); | ||
PropertyAccessors.includeInto(KeyBinding); | ||
KeyBinding.prototype.accessor('keystroke', { | ||
get: function() { | ||
Grim.deprecate('Use KeyBinding.keystrokes instead'); | ||
return this.keystrokes; | ||
}, | ||
set: function(value) { | ||
Grim.deprecate('Use KeyBinding.keystrokes instead'); | ||
return this.keystrokes = value; | ||
} | ||
}); | ||
} | ||
}).call(this); |
(function() { | ||
var CSON, CommandEvent, CompositeDisposable, Disposable, Emitter, EmitterMixin, File, Grim, KeyBinding, KeymapManager, OtherPlatforms, Platforms, fs, isAtomModifier, keydownEvent, keystrokeForKeyboardEvent, normalizeKeystrokes, observeCurrentKeyboardLayout, path, _, _ref, _ref1, | ||
var CSON, CommandEvent, CompositeDisposable, Disposable, Emitter, EmitterMixin, File, Grim, KeyBinding, KeymapManager, OtherPlatforms, Platforms, fs, isAtomModifier, keydownEvent, keystrokeForKeyboardEvent, normalizeKeystrokes, observeCurrentKeyboardLayout, path, _ref, _ref1, | ||
__indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }; | ||
_ = require("underscore-plus"); | ||
CSON = require('season'); | ||
@@ -17,4 +15,2 @@ | ||
EmitterMixin = require('emissary').Emitter; | ||
File = require('pathwatcher').File; | ||
@@ -37,9 +33,6 @@ | ||
module.exports = KeymapManager = (function() { | ||
EmitterMixin.includeInto(KeymapManager); | ||
/* | ||
Section: Class Methods | ||
*/ | ||
KeymapManager.buildKeydownEvent = function(key, options) { | ||
@@ -49,8 +42,3 @@ return keydownEvent(key, options); | ||
KeymapManager.keydownEvent = function(key, options) { | ||
Grim.deprecate("Use .buildKeydownEvent instead."); | ||
return keydownEvent(key, options); | ||
}; | ||
/* | ||
@@ -143,26 +131,3 @@ Section: Properties | ||
KeymapManager.prototype.on = function(eventName) { | ||
switch (eventName) { | ||
case 'matched': | ||
Grim.deprecate("Call KeymapManager::onDidMatchBinding instead"); | ||
break; | ||
case 'matched-partially': | ||
Grim.deprecate("Call KeymapManager::onDidPartiallyMatchBinding instead"); | ||
break; | ||
case 'match-failed': | ||
Grim.deprecate("Call KeymapManager::onDidFailToMatchBinding instead"); | ||
break; | ||
case 'reloaded-key-bindings': | ||
Grim.deprecate("Call KeymapManager::onDidReloadKeymap instead"); | ||
break; | ||
case 'unloaded-key-bindings': | ||
Grim.deprecate("Call KeymapManager::onDidUnloadKeymap instead"); | ||
break; | ||
default: | ||
Grim.deprecate("Use explicit event subscription methods instead"); | ||
} | ||
return EmitterMixin.prototype.on.apply(this, arguments); | ||
}; | ||
/* | ||
@@ -206,7 +171,2 @@ Section: Adding and Removing Bindings | ||
KeymapManager.prototype.remove = function(source) { | ||
Grim.deprecate("Call .dispose() on the Disposable returned from KeymapManager::add instead"); | ||
return this.removeBindingsFromSource(source); | ||
}; | ||
KeymapManager.prototype.removeBindingsFromSource = function(source) { | ||
@@ -281,3 +241,3 @@ this.keyBindings = this.keyBindings.filter(function(keyBinding) { | ||
} else { | ||
this.addKeymap(bindingsPath, this.readKeymap(bindingsPath, options != null ? options.suppressErrors : void 0)); | ||
this.add(bindingsPath, this.readKeymap(bindingsPath, options != null ? options.suppressErrors : void 0)); | ||
if (options != null ? options.watch : void 0) { | ||
@@ -309,4 +269,6 @@ this.watchKeymap(bindingsPath); | ||
this.removeBindingsFromSource(filePath); | ||
this.addKeymap(filePath, bindings); | ||
this.emit('reloaded-key-bindings', filePath); | ||
this.add(filePath, bindings); | ||
if (Grim.includeDeprecatedAPIs) { | ||
this.emit('reloaded-key-bindings', filePath); | ||
} | ||
return this.emitter.emit('did-reload-keymap', { | ||
@@ -318,3 +280,5 @@ path: filePath | ||
this.removeBindingsFromSource(filePath); | ||
this.emit('unloaded-key-bindings', filePath); | ||
if (Grim.includeDeprecatedAPIs) { | ||
this.emit('unloaded-key-bindings', filePath); | ||
} | ||
return this.emitter.emit('did-unload-keymap', { | ||
@@ -406,3 +370,5 @@ path: filePath | ||
}; | ||
this.emit('matched', event); | ||
if (Grim.includeDeprecatedAPIs) { | ||
this.emit('matched', event); | ||
} | ||
this.emitter.emit('did-match-binding', event); | ||
@@ -424,3 +390,5 @@ return; | ||
}; | ||
this.emit('matched-partially', event); | ||
if (Grim.includeDeprecatedAPIs) { | ||
this.emit('matched-partially', event); | ||
} | ||
return this.emitter.emit('did-partially-match-binding', event); | ||
@@ -432,3 +400,5 @@ } else { | ||
}; | ||
this.emit('match-failed', event); | ||
if (Grim.includeDeprecatedAPIs) { | ||
this.emit('match-failed', event); | ||
} | ||
this.emitter.emit('did-fail-to-match-binding', event); | ||
@@ -501,4 +471,3 @@ return this.terminatePendingState(); | ||
KeymapManager.prototype.findExactMatches = function(exactMatchCandidates, target) { | ||
var exactMatches; | ||
return exactMatches = exactMatchCandidates.filter(function(binding) { | ||
return exactMatchCandidates.filter(function(binding) { | ||
return target.webkitMatchesSelector(binding.selector); | ||
@@ -617,10 +586,11 @@ }).sort(function(a, b) { | ||
KeymapManager.prototype.addKeymap = function(source, bindings) { | ||
return this.add(source, bindings); | ||
}; | ||
return KeymapManager; | ||
KeymapManager.prototype.removeKeymap = function(source) { | ||
return this.remove(source); | ||
})(); | ||
if (Grim.includeDeprecatedAPIs) { | ||
KeymapManager.keydownEvent = function(key, options) { | ||
Grim.deprecate("Use .buildKeydownEvent instead."); | ||
return keydownEvent(key, options); | ||
}; | ||
KeymapManager.prototype.handleKeyEvent = function(event) { | ||
@@ -640,3 +610,14 @@ var originalEvent, _ref2; | ||
}; | ||
KeymapManager.prototype.remove = function(source) { | ||
Grim.deprecate("Call .dispose() on the Disposable returned from KeymapManager::add instead"); | ||
return this.removeBindingsFromSource(source); | ||
}; | ||
KeymapManager.prototype.addKeymap = function(source, bindings) { | ||
Grim.deprecate("Use KeymapManager::add instead."); | ||
return this.add(source, bindings); | ||
}; | ||
KeymapManager.prototype.removeKeymap = function(source) { | ||
Grim.deprecate("Use KeymapManager::remove instead."); | ||
return this.remove(source); | ||
}; | ||
KeymapManager.prototype.keystrokeStringForEvent = function(event) { | ||
@@ -647,3 +628,2 @@ var _ref2; | ||
}; | ||
KeymapManager.prototype.bindKeys = function(source, selector, keyBindings) { | ||
@@ -654,5 +634,4 @@ var keyBindingsBySelector; | ||
keyBindingsBySelector[selector] = keyBindings; | ||
return this.addKeymap(source, keyBindingsBySelector); | ||
return this.add(source, keyBindingsBySelector); | ||
}; | ||
KeymapManager.prototype.keyBindingsForCommand = function(command) { | ||
@@ -664,3 +643,2 @@ Grim.deprecate("Use KeymapManager::findKeyBindings instead."); | ||
}; | ||
KeymapManager.prototype.keyBindingsForKeystroke = function(keystroke) { | ||
@@ -672,3 +650,2 @@ Grim.deprecate("Use KeymapManager::findKeyBindings instead."); | ||
}; | ||
KeymapManager.prototype.keyBindingsMatchingElement = function(target, keyBindings) { | ||
@@ -682,3 +659,2 @@ var _ref2; | ||
}; | ||
KeymapManager.prototype.keyBindingsForCommandMatchingElement = function(command, target) { | ||
@@ -692,3 +668,2 @@ var _ref2; | ||
}; | ||
KeymapManager.prototype.keyBindingsForKeystrokeMatchingElement = function(keystrokes, target) { | ||
@@ -702,7 +677,28 @@ var _ref2; | ||
}; | ||
EmitterMixin = require('emissary').Emitter; | ||
EmitterMixin.includeInto(KeymapManager); | ||
KeymapManager.prototype.on = function(eventName) { | ||
switch (eventName) { | ||
case 'matched': | ||
Grim.deprecate("Call KeymapManager::onDidMatchBinding instead"); | ||
break; | ||
case 'matched-partially': | ||
Grim.deprecate("Call KeymapManager::onDidPartiallyMatchBinding instead"); | ||
break; | ||
case 'match-failed': | ||
Grim.deprecate("Call KeymapManager::onDidFailToMatchBinding instead"); | ||
break; | ||
case 'reloaded-key-bindings': | ||
Grim.deprecate("Call KeymapManager::onDidReloadKeymap instead"); | ||
break; | ||
case 'unloaded-key-bindings': | ||
Grim.deprecate("Call KeymapManager::onDidUnloadKeymap instead"); | ||
break; | ||
default: | ||
Grim.deprecate("Use explicit event subscription methods instead"); | ||
} | ||
return EmitterMixin.prototype.on.apply(this, arguments); | ||
}; | ||
} | ||
return KeymapManager; | ||
})(); | ||
}).call(this); |
{ | ||
"name": "atom-keymap", | ||
"version": "5.0.0", | ||
"version": "5.1.0", | ||
"description": "Atom's DOM-aware keymap module", | ||
@@ -29,8 +29,7 @@ "main": "./lib/keymap-manager", | ||
"fs-plus": "^2.0.4", | ||
"grim": "^1.0.0", | ||
"grim": "^1.2.1", | ||
"keyboard-layout": "^0.10.0", | ||
"pathwatcher": "^4.2", | ||
"property-accessors": "^1", | ||
"season": "^5.0.2", | ||
"underscore-plus": "^1.0.0" | ||
"season": "^5.0.2" | ||
}, | ||
@@ -37,0 +36,0 @@ "devDependencies": { |
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
64178
9
1592
- Removedunderscore-plus@^1.0.0
Updatedgrim@^1.2.1