mirror of
https://github.com/facebook/react.git
synced 2026-02-26 18:58:05 +00:00
Kill keyOf :) (#7615)
This commit is contained in:
committed by
GitHub
parent
2f9a9dc4c5
commit
f7076b7759
@@ -24,8 +24,7 @@ var LinkedStateMixin = {
|
||||
* ReactLink will have the current value of this.state[key] and will call
|
||||
* setState() when a change is requested.
|
||||
*
|
||||
* @param {string} key state key to update. Note: you may want to use keyOf()
|
||||
* if you're using Google Closure Compiler advanced mode.
|
||||
* @param {string} key state key to update.
|
||||
* @return {ReactLink} ReactLink instance linking to the state.
|
||||
*/
|
||||
linkState: function(key) {
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
var keyOf = require('keyOf');
|
||||
var invariant = require('invariant');
|
||||
var hasOwnProperty = {}.hasOwnProperty;
|
||||
|
||||
@@ -27,12 +26,12 @@ function shallowCopy(x) {
|
||||
}
|
||||
}
|
||||
|
||||
var COMMAND_PUSH = keyOf({$push: null});
|
||||
var COMMAND_UNSHIFT = keyOf({$unshift: null});
|
||||
var COMMAND_SPLICE = keyOf({$splice: null});
|
||||
var COMMAND_SET = keyOf({$set: null});
|
||||
var COMMAND_MERGE = keyOf({$merge: null});
|
||||
var COMMAND_APPLY = keyOf({$apply: null});
|
||||
var COMMAND_PUSH = '$push';
|
||||
var COMMAND_UNSHIFT = '$unshift';
|
||||
var COMMAND_SPLICE = '$splice';
|
||||
var COMMAND_SET = '$set';
|
||||
var COMMAND_MERGE = '$merge';
|
||||
var COMMAND_APPLY = '$apply';
|
||||
|
||||
var ALL_COMMANDS_LIST = [
|
||||
COMMAND_PUSH,
|
||||
|
||||
@@ -18,12 +18,11 @@ var ReactNoopUpdateQueue = require('ReactNoopUpdateQueue');
|
||||
|
||||
var emptyObject = require('emptyObject');
|
||||
var invariant = require('invariant');
|
||||
var keyOf = require('keyOf');
|
||||
var warning = require('warning');
|
||||
|
||||
import type { ReactPropTypeLocations } from 'ReactPropTypeLocations';
|
||||
|
||||
var MIXINS_KEY = keyOf({mixins: null});
|
||||
var MIXINS_KEY = 'mixins';
|
||||
|
||||
/**
|
||||
* Policies that describe methods in `ReactClassInterface`.
|
||||
|
||||
@@ -11,8 +11,6 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
var keyOf = require('keyOf');
|
||||
|
||||
var EventListener;
|
||||
var EventPluginHub;
|
||||
var EventPluginRegistry;
|
||||
@@ -36,10 +34,10 @@ var recordIDAndReturnFalse = function(id, event) {
|
||||
return false;
|
||||
};
|
||||
var LISTENER = jest.fn();
|
||||
var ON_CLICK_KEY = keyOf({onClick: null});
|
||||
var ON_TOUCH_TAP_KEY = keyOf({onTouchTap: null});
|
||||
var ON_CHANGE_KEY = keyOf({onChange: null});
|
||||
var ON_MOUSE_ENTER_KEY = keyOf({onMouseEnter: null});
|
||||
var ON_CLICK_KEY = 'onClick';
|
||||
var ON_TOUCH_TAP_KEY = 'onTouchTap';
|
||||
var ON_CHANGE_KEY = 'onChange';
|
||||
var ON_MOUSE_ENTER_KEY = 'onMouseEnter';
|
||||
|
||||
var GRANDPARENT;
|
||||
var PARENT;
|
||||
|
||||
@@ -17,8 +17,6 @@ var FallbackCompositionState = require('FallbackCompositionState');
|
||||
var SyntheticCompositionEvent = require('SyntheticCompositionEvent');
|
||||
var SyntheticInputEvent = require('SyntheticInputEvent');
|
||||
|
||||
var keyOf = require('keyOf');
|
||||
|
||||
import type { TopLevelTypes } from 'EventConstants';
|
||||
|
||||
var END_KEYCODES = [9, 13, 27, 32]; // Tab, Return, Esc, Space
|
||||
@@ -75,8 +73,8 @@ var SPACEBAR_CHAR = String.fromCharCode(SPACEBAR_CODE);
|
||||
var eventTypes = {
|
||||
beforeInput: {
|
||||
phasedRegistrationNames: {
|
||||
bubbled: keyOf({onBeforeInput: null}),
|
||||
captured: keyOf({onBeforeInputCapture: null}),
|
||||
bubbled: 'onBeforeInput',
|
||||
captured: 'onBeforeInputCapture',
|
||||
},
|
||||
dependencies: [
|
||||
'topCompositionEnd',
|
||||
@@ -87,8 +85,8 @@ var eventTypes = {
|
||||
},
|
||||
compositionEnd: {
|
||||
phasedRegistrationNames: {
|
||||
bubbled: keyOf({onCompositionEnd: null}),
|
||||
captured: keyOf({onCompositionEndCapture: null}),
|
||||
bubbled: 'onCompositionEnd',
|
||||
captured: 'onCompositionEndCapture',
|
||||
},
|
||||
dependencies: [
|
||||
'topBlur',
|
||||
@@ -101,8 +99,8 @@ var eventTypes = {
|
||||
},
|
||||
compositionStart: {
|
||||
phasedRegistrationNames: {
|
||||
bubbled: keyOf({onCompositionStart: null}),
|
||||
captured: keyOf({onCompositionStartCapture: null}),
|
||||
bubbled: 'onCompositionStart',
|
||||
captured: 'onCompositionStartCapture',
|
||||
},
|
||||
dependencies: [
|
||||
'topBlur',
|
||||
@@ -115,8 +113,8 @@ var eventTypes = {
|
||||
},
|
||||
compositionUpdate: {
|
||||
phasedRegistrationNames: {
|
||||
bubbled: keyOf({onCompositionUpdate: null}),
|
||||
captured: keyOf({onCompositionUpdateCapture: null}),
|
||||
bubbled: 'onCompositionUpdate',
|
||||
captured: 'onCompositionUpdateCapture',
|
||||
},
|
||||
dependencies: [
|
||||
'topBlur',
|
||||
|
||||
@@ -22,14 +22,12 @@ var inputValueTracking = require('inputValueTracking');
|
||||
var getEventTarget = require('getEventTarget');
|
||||
var isEventSupported = require('isEventSupported');
|
||||
var isTextInputElement = require('isTextInputElement');
|
||||
var keyOf = require('keyOf');
|
||||
|
||||
|
||||
var eventTypes = {
|
||||
change: {
|
||||
phasedRegistrationNames: {
|
||||
bubbled: keyOf({onChange: null}),
|
||||
captured: keyOf({onChangeCapture: null}),
|
||||
bubbled: 'onChange',
|
||||
captured: 'onChangeCapture',
|
||||
},
|
||||
dependencies: [
|
||||
'topBlur',
|
||||
|
||||
@@ -11,8 +11,6 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
var keyOf = require('keyOf');
|
||||
|
||||
/**
|
||||
* Module that is injectable into `EventPluginHub`, that specifies a
|
||||
* deterministic ordering of `EventPlugin`s. A convenient way to reason about
|
||||
@@ -23,13 +21,13 @@ var keyOf = require('keyOf');
|
||||
* preventing default on events is convenient in `SimpleEventPlugin` handlers.
|
||||
*/
|
||||
var DefaultEventPluginOrder = [
|
||||
keyOf({ResponderEventPlugin: null}),
|
||||
keyOf({SimpleEventPlugin: null}),
|
||||
keyOf({TapEventPlugin: null}),
|
||||
keyOf({EnterLeaveEventPlugin: null}),
|
||||
keyOf({ChangeEventPlugin: null}),
|
||||
keyOf({SelectEventPlugin: null}),
|
||||
keyOf({BeforeInputEventPlugin: null}),
|
||||
'ResponderEventPlugin',
|
||||
'SimpleEventPlugin',
|
||||
'TapEventPlugin',
|
||||
'EnterLeaveEventPlugin',
|
||||
'ChangeEventPlugin',
|
||||
'SelectEventPlugin',
|
||||
'BeforeInputEventPlugin',
|
||||
];
|
||||
|
||||
module.exports = DefaultEventPluginOrder;
|
||||
|
||||
@@ -15,18 +15,16 @@ var EventPropagators = require('EventPropagators');
|
||||
var ReactDOMComponentTree = require('ReactDOMComponentTree');
|
||||
var SyntheticMouseEvent = require('SyntheticMouseEvent');
|
||||
|
||||
var keyOf = require('keyOf');
|
||||
|
||||
var eventTypes = {
|
||||
mouseEnter: {
|
||||
registrationName: keyOf({onMouseEnter: null}),
|
||||
registrationName: 'onMouseEnter',
|
||||
dependencies: [
|
||||
'topMouseOut',
|
||||
'topMouseOver',
|
||||
],
|
||||
},
|
||||
mouseLeave: {
|
||||
registrationName: keyOf({onMouseLeave: null}),
|
||||
registrationName: 'onMouseLeave',
|
||||
dependencies: [
|
||||
'topMouseOut',
|
||||
'topMouseOver',
|
||||
|
||||
@@ -19,7 +19,6 @@ var SyntheticEvent = require('SyntheticEvent');
|
||||
|
||||
var getActiveElement = require('getActiveElement');
|
||||
var isTextInputElement = require('isTextInputElement');
|
||||
var keyOf = require('keyOf');
|
||||
var shallowEqual = require('shallowEqual');
|
||||
|
||||
var skipSelectionChangeEvent = (
|
||||
@@ -31,8 +30,8 @@ var skipSelectionChangeEvent = (
|
||||
var eventTypes = {
|
||||
select: {
|
||||
phasedRegistrationNames: {
|
||||
bubbled: keyOf({onSelect: null}),
|
||||
captured: keyOf({onSelectCapture: null}),
|
||||
bubbled: 'onSelect',
|
||||
captured: 'onSelectCapture',
|
||||
},
|
||||
dependencies: [
|
||||
'topBlur',
|
||||
@@ -55,7 +54,6 @@ var mouseDown = false;
|
||||
// Track whether a listener exists for this plugin. If none exist, we do
|
||||
// not extract events. See #3639.
|
||||
var hasListener = false;
|
||||
var ON_SELECT_KEY = keyOf({onSelect: null});
|
||||
|
||||
/**
|
||||
* Get an object which is a unique representation of the current selection.
|
||||
@@ -212,7 +210,7 @@ var SelectEventPlugin = {
|
||||
},
|
||||
|
||||
didPutListener: function(inst, registrationName, listener) {
|
||||
if (registrationName === ON_SELECT_KEY) {
|
||||
if (registrationName === 'onSelect') {
|
||||
hasListener = true;
|
||||
}
|
||||
},
|
||||
|
||||
@@ -29,381 +29,380 @@ var SyntheticWheelEvent = require('SyntheticWheelEvent');
|
||||
var emptyFunction = require('emptyFunction');
|
||||
var getEventCharCode = require('getEventCharCode');
|
||||
var invariant = require('invariant');
|
||||
var keyOf = require('keyOf');
|
||||
|
||||
var eventTypes = {
|
||||
abort: {
|
||||
phasedRegistrationNames: {
|
||||
bubbled: keyOf({onAbort: true}),
|
||||
captured: keyOf({onAbortCapture: true}),
|
||||
bubbled: 'onAbort',
|
||||
captured: 'onAbortCapture',
|
||||
},
|
||||
},
|
||||
animationEnd: {
|
||||
phasedRegistrationNames: {
|
||||
bubbled: keyOf({onAnimationEnd: true}),
|
||||
captured: keyOf({onAnimationEndCapture: true}),
|
||||
bubbled: 'onAnimationEnd',
|
||||
captured: 'onAnimationEndCapture',
|
||||
},
|
||||
},
|
||||
animationIteration: {
|
||||
phasedRegistrationNames: {
|
||||
bubbled: keyOf({onAnimationIteration: true}),
|
||||
captured: keyOf({onAnimationIterationCapture: true}),
|
||||
bubbled: 'onAnimationIteration',
|
||||
captured: 'onAnimationIterationCapture',
|
||||
},
|
||||
},
|
||||
animationStart: {
|
||||
phasedRegistrationNames: {
|
||||
bubbled: keyOf({onAnimationStart: true}),
|
||||
captured: keyOf({onAnimationStartCapture: true}),
|
||||
bubbled: 'onAnimationStart',
|
||||
captured: 'onAnimationStartCapture',
|
||||
},
|
||||
},
|
||||
blur: {
|
||||
phasedRegistrationNames: {
|
||||
bubbled: keyOf({onBlur: true}),
|
||||
captured: keyOf({onBlurCapture: true}),
|
||||
bubbled: 'onBlur',
|
||||
captured: 'onBlurCapture',
|
||||
},
|
||||
},
|
||||
canPlay: {
|
||||
phasedRegistrationNames: {
|
||||
bubbled: keyOf({onCanPlay: true}),
|
||||
captured: keyOf({onCanPlayCapture: true}),
|
||||
bubbled: 'onCanPlay',
|
||||
captured: 'onCanPlayCapture',
|
||||
},
|
||||
},
|
||||
canPlayThrough: {
|
||||
phasedRegistrationNames: {
|
||||
bubbled: keyOf({onCanPlayThrough: true}),
|
||||
captured: keyOf({onCanPlayThroughCapture: true}),
|
||||
bubbled: 'onCanPlayThrough',
|
||||
captured: 'onCanPlayThroughCapture',
|
||||
},
|
||||
},
|
||||
click: {
|
||||
phasedRegistrationNames: {
|
||||
bubbled: keyOf({onClick: true}),
|
||||
captured: keyOf({onClickCapture: true}),
|
||||
bubbled: 'onClick',
|
||||
captured: 'onClickCapture',
|
||||
},
|
||||
},
|
||||
contextMenu: {
|
||||
phasedRegistrationNames: {
|
||||
bubbled: keyOf({onContextMenu: true}),
|
||||
captured: keyOf({onContextMenuCapture: true}),
|
||||
bubbled: 'onContextMenu',
|
||||
captured: 'onContextMenuCapture',
|
||||
},
|
||||
},
|
||||
copy: {
|
||||
phasedRegistrationNames: {
|
||||
bubbled: keyOf({onCopy: true}),
|
||||
captured: keyOf({onCopyCapture: true}),
|
||||
bubbled: 'onCopy',
|
||||
captured: 'onCopyCapture',
|
||||
},
|
||||
},
|
||||
cut: {
|
||||
phasedRegistrationNames: {
|
||||
bubbled: keyOf({onCut: true}),
|
||||
captured: keyOf({onCutCapture: true}),
|
||||
bubbled: 'onCut',
|
||||
captured: 'onCutCapture',
|
||||
},
|
||||
},
|
||||
doubleClick: {
|
||||
phasedRegistrationNames: {
|
||||
bubbled: keyOf({onDoubleClick: true}),
|
||||
captured: keyOf({onDoubleClickCapture: true}),
|
||||
bubbled: 'onDoubleClick',
|
||||
captured: 'onDoubleClickCapture',
|
||||
},
|
||||
},
|
||||
drag: {
|
||||
phasedRegistrationNames: {
|
||||
bubbled: keyOf({onDrag: true}),
|
||||
captured: keyOf({onDragCapture: true}),
|
||||
bubbled: 'onDrag',
|
||||
captured: 'onDragCapture',
|
||||
},
|
||||
},
|
||||
dragEnd: {
|
||||
phasedRegistrationNames: {
|
||||
bubbled: keyOf({onDragEnd: true}),
|
||||
captured: keyOf({onDragEndCapture: true}),
|
||||
bubbled: 'onDragEnd',
|
||||
captured: 'onDragEndCapture',
|
||||
},
|
||||
},
|
||||
dragEnter: {
|
||||
phasedRegistrationNames: {
|
||||
bubbled: keyOf({onDragEnter: true}),
|
||||
captured: keyOf({onDragEnterCapture: true}),
|
||||
bubbled: 'onDragEnter',
|
||||
captured: 'onDragEnterCapture',
|
||||
},
|
||||
},
|
||||
dragExit: {
|
||||
phasedRegistrationNames: {
|
||||
bubbled: keyOf({onDragExit: true}),
|
||||
captured: keyOf({onDragExitCapture: true}),
|
||||
bubbled: 'onDragExit',
|
||||
captured: 'onDragExitCapture',
|
||||
},
|
||||
},
|
||||
dragLeave: {
|
||||
phasedRegistrationNames: {
|
||||
bubbled: keyOf({onDragLeave: true}),
|
||||
captured: keyOf({onDragLeaveCapture: true}),
|
||||
bubbled: 'onDragLeave',
|
||||
captured: 'onDragLeaveCapture',
|
||||
},
|
||||
},
|
||||
dragOver: {
|
||||
phasedRegistrationNames: {
|
||||
bubbled: keyOf({onDragOver: true}),
|
||||
captured: keyOf({onDragOverCapture: true}),
|
||||
bubbled: 'onDragOver',
|
||||
captured: 'onDragOverCapture',
|
||||
},
|
||||
},
|
||||
dragStart: {
|
||||
phasedRegistrationNames: {
|
||||
bubbled: keyOf({onDragStart: true}),
|
||||
captured: keyOf({onDragStartCapture: true}),
|
||||
bubbled: 'onDragStart',
|
||||
captured: 'onDragStartCapture',
|
||||
},
|
||||
},
|
||||
drop: {
|
||||
phasedRegistrationNames: {
|
||||
bubbled: keyOf({onDrop: true}),
|
||||
captured: keyOf({onDropCapture: true}),
|
||||
bubbled: 'onDrop',
|
||||
captured: 'onDropCapture',
|
||||
},
|
||||
},
|
||||
durationChange: {
|
||||
phasedRegistrationNames: {
|
||||
bubbled: keyOf({onDurationChange: true}),
|
||||
captured: keyOf({onDurationChangeCapture: true}),
|
||||
bubbled: 'onDurationChange',
|
||||
captured: 'onDurationChangeCapture',
|
||||
},
|
||||
},
|
||||
emptied: {
|
||||
phasedRegistrationNames: {
|
||||
bubbled: keyOf({onEmptied: true}),
|
||||
captured: keyOf({onEmptiedCapture: true}),
|
||||
bubbled: 'onEmptied',
|
||||
captured: 'onEmptiedCapture',
|
||||
},
|
||||
},
|
||||
encrypted: {
|
||||
phasedRegistrationNames: {
|
||||
bubbled: keyOf({onEncrypted: true}),
|
||||
captured: keyOf({onEncryptedCapture: true}),
|
||||
bubbled: 'onEncrypted',
|
||||
captured: 'onEncryptedCapture',
|
||||
},
|
||||
},
|
||||
ended: {
|
||||
phasedRegistrationNames: {
|
||||
bubbled: keyOf({onEnded: true}),
|
||||
captured: keyOf({onEndedCapture: true}),
|
||||
bubbled: 'onEnded',
|
||||
captured: 'onEndedCapture',
|
||||
},
|
||||
},
|
||||
error: {
|
||||
phasedRegistrationNames: {
|
||||
bubbled: keyOf({onError: true}),
|
||||
captured: keyOf({onErrorCapture: true}),
|
||||
bubbled: 'onError',
|
||||
captured: 'onErrorCapture',
|
||||
},
|
||||
},
|
||||
focus: {
|
||||
phasedRegistrationNames: {
|
||||
bubbled: keyOf({onFocus: true}),
|
||||
captured: keyOf({onFocusCapture: true}),
|
||||
bubbled: 'onFocus',
|
||||
captured: 'onFocusCapture',
|
||||
},
|
||||
},
|
||||
input: {
|
||||
phasedRegistrationNames: {
|
||||
bubbled: keyOf({onInput: true}),
|
||||
captured: keyOf({onInputCapture: true}),
|
||||
bubbled: 'onInput',
|
||||
captured: 'onInputCapture',
|
||||
},
|
||||
},
|
||||
invalid: {
|
||||
phasedRegistrationNames: {
|
||||
bubbled: keyOf({onInvalid: true}),
|
||||
captured: keyOf({onInvalidCapture: true}),
|
||||
bubbled: 'onInvalid',
|
||||
captured: 'onInvalidCapture',
|
||||
},
|
||||
},
|
||||
keyDown: {
|
||||
phasedRegistrationNames: {
|
||||
bubbled: keyOf({onKeyDown: true}),
|
||||
captured: keyOf({onKeyDownCapture: true}),
|
||||
bubbled: 'onKeyDown',
|
||||
captured: 'onKeyDownCapture',
|
||||
},
|
||||
},
|
||||
keyPress: {
|
||||
phasedRegistrationNames: {
|
||||
bubbled: keyOf({onKeyPress: true}),
|
||||
captured: keyOf({onKeyPressCapture: true}),
|
||||
bubbled: 'onKeyPress',
|
||||
captured: 'onKeyPressCapture',
|
||||
},
|
||||
},
|
||||
keyUp: {
|
||||
phasedRegistrationNames: {
|
||||
bubbled: keyOf({onKeyUp: true}),
|
||||
captured: keyOf({onKeyUpCapture: true}),
|
||||
bubbled: 'onKeyUp',
|
||||
captured: 'onKeyUpCapture',
|
||||
},
|
||||
},
|
||||
load: {
|
||||
phasedRegistrationNames: {
|
||||
bubbled: keyOf({onLoad: true}),
|
||||
captured: keyOf({onLoadCapture: true}),
|
||||
bubbled: 'onLoad',
|
||||
captured: 'onLoadCapture',
|
||||
},
|
||||
},
|
||||
loadedData: {
|
||||
phasedRegistrationNames: {
|
||||
bubbled: keyOf({onLoadedData: true}),
|
||||
captured: keyOf({onLoadedDataCapture: true}),
|
||||
bubbled: 'onLoadedData',
|
||||
captured: 'onLoadedDataCapture',
|
||||
},
|
||||
},
|
||||
loadedMetadata: {
|
||||
phasedRegistrationNames: {
|
||||
bubbled: keyOf({onLoadedMetadata: true}),
|
||||
captured: keyOf({onLoadedMetadataCapture: true}),
|
||||
bubbled: 'onLoadedMetadata',
|
||||
captured: 'onLoadedMetadataCapture',
|
||||
},
|
||||
},
|
||||
loadStart: {
|
||||
phasedRegistrationNames: {
|
||||
bubbled: keyOf({onLoadStart: true}),
|
||||
captured: keyOf({onLoadStartCapture: true}),
|
||||
bubbled: 'onLoadStart',
|
||||
captured: 'onLoadStartCapture',
|
||||
},
|
||||
},
|
||||
// Note: We do not allow listening to mouseOver events. Instead, use the
|
||||
// onMouseEnter/onMouseLeave created by `EnterLeaveEventPlugin`.
|
||||
mouseDown: {
|
||||
phasedRegistrationNames: {
|
||||
bubbled: keyOf({onMouseDown: true}),
|
||||
captured: keyOf({onMouseDownCapture: true}),
|
||||
bubbled: 'onMouseDown',
|
||||
captured: 'onMouseDownCapture',
|
||||
},
|
||||
},
|
||||
mouseMove: {
|
||||
phasedRegistrationNames: {
|
||||
bubbled: keyOf({onMouseMove: true}),
|
||||
captured: keyOf({onMouseMoveCapture: true}),
|
||||
bubbled: 'onMouseMove',
|
||||
captured: 'onMouseMoveCapture',
|
||||
},
|
||||
},
|
||||
mouseOut: {
|
||||
phasedRegistrationNames: {
|
||||
bubbled: keyOf({onMouseOut: true}),
|
||||
captured: keyOf({onMouseOutCapture: true}),
|
||||
bubbled: 'onMouseOut',
|
||||
captured: 'onMouseOutCapture',
|
||||
},
|
||||
},
|
||||
mouseOver: {
|
||||
phasedRegistrationNames: {
|
||||
bubbled: keyOf({onMouseOver: true}),
|
||||
captured: keyOf({onMouseOverCapture: true}),
|
||||
bubbled: 'onMouseOver',
|
||||
captured: 'onMouseOverCapture',
|
||||
},
|
||||
},
|
||||
mouseUp: {
|
||||
phasedRegistrationNames: {
|
||||
bubbled: keyOf({onMouseUp: true}),
|
||||
captured: keyOf({onMouseUpCapture: true}),
|
||||
bubbled: 'onMouseUp',
|
||||
captured: 'onMouseUpCapture',
|
||||
},
|
||||
},
|
||||
paste: {
|
||||
phasedRegistrationNames: {
|
||||
bubbled: keyOf({onPaste: true}),
|
||||
captured: keyOf({onPasteCapture: true}),
|
||||
bubbled: 'onPaste',
|
||||
captured: 'onPasteCapture',
|
||||
},
|
||||
},
|
||||
pause: {
|
||||
phasedRegistrationNames: {
|
||||
bubbled: keyOf({onPause: true}),
|
||||
captured: keyOf({onPauseCapture: true}),
|
||||
bubbled: 'onPause',
|
||||
captured: 'onPauseCapture',
|
||||
},
|
||||
},
|
||||
play: {
|
||||
phasedRegistrationNames: {
|
||||
bubbled: keyOf({onPlay: true}),
|
||||
captured: keyOf({onPlayCapture: true}),
|
||||
bubbled: 'onPlay',
|
||||
captured: 'onPlayCapture',
|
||||
},
|
||||
},
|
||||
playing: {
|
||||
phasedRegistrationNames: {
|
||||
bubbled: keyOf({onPlaying: true}),
|
||||
captured: keyOf({onPlayingCapture: true}),
|
||||
bubbled: 'onPlaying',
|
||||
captured: 'onPlayingCapture',
|
||||
},
|
||||
},
|
||||
progress: {
|
||||
phasedRegistrationNames: {
|
||||
bubbled: keyOf({onProgress: true}),
|
||||
captured: keyOf({onProgressCapture: true}),
|
||||
bubbled: 'onProgress',
|
||||
captured: 'onProgressCapture',
|
||||
},
|
||||
},
|
||||
rateChange: {
|
||||
phasedRegistrationNames: {
|
||||
bubbled: keyOf({onRateChange: true}),
|
||||
captured: keyOf({onRateChangeCapture: true}),
|
||||
bubbled: 'onRateChange',
|
||||
captured: 'onRateChangeCapture',
|
||||
},
|
||||
},
|
||||
reset: {
|
||||
phasedRegistrationNames: {
|
||||
bubbled: keyOf({onReset: true}),
|
||||
captured: keyOf({onResetCapture: true}),
|
||||
bubbled: 'onReset',
|
||||
captured: 'onResetCapture',
|
||||
},
|
||||
},
|
||||
scroll: {
|
||||
phasedRegistrationNames: {
|
||||
bubbled: keyOf({onScroll: true}),
|
||||
captured: keyOf({onScrollCapture: true}),
|
||||
bubbled: 'onScroll',
|
||||
captured: 'onScrollCapture',
|
||||
},
|
||||
},
|
||||
seeked: {
|
||||
phasedRegistrationNames: {
|
||||
bubbled: keyOf({onSeeked: true}),
|
||||
captured: keyOf({onSeekedCapture: true}),
|
||||
bubbled: 'onSeeked',
|
||||
captured: 'onSeekedCapture',
|
||||
},
|
||||
},
|
||||
seeking: {
|
||||
phasedRegistrationNames: {
|
||||
bubbled: keyOf({onSeeking: true}),
|
||||
captured: keyOf({onSeekingCapture: true}),
|
||||
bubbled: 'onSeeking',
|
||||
captured: 'onSeekingCapture',
|
||||
},
|
||||
},
|
||||
stalled: {
|
||||
phasedRegistrationNames: {
|
||||
bubbled: keyOf({onStalled: true}),
|
||||
captured: keyOf({onStalledCapture: true}),
|
||||
bubbled: 'onStalled',
|
||||
captured: 'onStalledCapture',
|
||||
},
|
||||
},
|
||||
submit: {
|
||||
phasedRegistrationNames: {
|
||||
bubbled: keyOf({onSubmit: true}),
|
||||
captured: keyOf({onSubmitCapture: true}),
|
||||
bubbled: 'onSubmit',
|
||||
captured: 'onSubmitCapture',
|
||||
},
|
||||
},
|
||||
suspend: {
|
||||
phasedRegistrationNames: {
|
||||
bubbled: keyOf({onSuspend: true}),
|
||||
captured: keyOf({onSuspendCapture: true}),
|
||||
bubbled: 'onSuspend',
|
||||
captured: 'onSuspendCapture',
|
||||
},
|
||||
},
|
||||
timeUpdate: {
|
||||
phasedRegistrationNames: {
|
||||
bubbled: keyOf({onTimeUpdate: true}),
|
||||
captured: keyOf({onTimeUpdateCapture: true}),
|
||||
bubbled: 'onTimeUpdate',
|
||||
captured: 'onTimeUpdateCapture',
|
||||
},
|
||||
},
|
||||
touchCancel: {
|
||||
phasedRegistrationNames: {
|
||||
bubbled: keyOf({onTouchCancel: true}),
|
||||
captured: keyOf({onTouchCancelCapture: true}),
|
||||
bubbled: 'onTouchCancel',
|
||||
captured: 'onTouchCancelCapture',
|
||||
},
|
||||
},
|
||||
touchEnd: {
|
||||
phasedRegistrationNames: {
|
||||
bubbled: keyOf({onTouchEnd: true}),
|
||||
captured: keyOf({onTouchEndCapture: true}),
|
||||
bubbled: 'onTouchEnd',
|
||||
captured: 'onTouchEndCapture',
|
||||
},
|
||||
},
|
||||
touchMove: {
|
||||
phasedRegistrationNames: {
|
||||
bubbled: keyOf({onTouchMove: true}),
|
||||
captured: keyOf({onTouchMoveCapture: true}),
|
||||
bubbled: 'onTouchMove',
|
||||
captured: 'onTouchMoveCapture',
|
||||
},
|
||||
},
|
||||
touchStart: {
|
||||
phasedRegistrationNames: {
|
||||
bubbled: keyOf({onTouchStart: true}),
|
||||
captured: keyOf({onTouchStartCapture: true}),
|
||||
bubbled: 'onTouchStart',
|
||||
captured: 'onTouchStartCapture',
|
||||
},
|
||||
},
|
||||
transitionEnd: {
|
||||
phasedRegistrationNames: {
|
||||
bubbled: keyOf({onTransitionEnd: true}),
|
||||
captured: keyOf({onTransitionEndCapture: true}),
|
||||
bubbled: 'onTransitionEnd',
|
||||
captured: 'onTransitionEndCapture',
|
||||
},
|
||||
},
|
||||
volumeChange: {
|
||||
phasedRegistrationNames: {
|
||||
bubbled: keyOf({onVolumeChange: true}),
|
||||
captured: keyOf({onVolumeChangeCapture: true}),
|
||||
bubbled: 'onVolumeChange',
|
||||
captured: 'onVolumeChangeCapture',
|
||||
},
|
||||
},
|
||||
waiting: {
|
||||
phasedRegistrationNames: {
|
||||
bubbled: keyOf({onWaiting: true}),
|
||||
captured: keyOf({onWaitingCapture: true}),
|
||||
bubbled: 'onWaiting',
|
||||
captured: 'onWaitingCapture',
|
||||
},
|
||||
},
|
||||
wheel: {
|
||||
phasedRegistrationNames: {
|
||||
bubbled: keyOf({onWheel: true}),
|
||||
captured: keyOf({onWheelCapture: true}),
|
||||
bubbled: 'onWheel',
|
||||
captured: 'onWheelCapture',
|
||||
},
|
||||
},
|
||||
};
|
||||
@@ -477,7 +476,6 @@ for (var type in topLevelEventsToDispatchConfig) {
|
||||
topLevelEventsToDispatchConfig[type].dependencies = [type];
|
||||
}
|
||||
|
||||
var ON_CLICK_KEY = keyOf({onClick: null});
|
||||
var onClickListeners = {};
|
||||
|
||||
function getDictionaryKey(inst) {
|
||||
@@ -622,7 +620,7 @@ var SimpleEventPlugin = {
|
||||
// non-interactive elements, which means delegated click listeners do not
|
||||
// fire. The workaround for this bug involves attaching an empty click
|
||||
// listener on the target node.
|
||||
if (registrationName === ON_CLICK_KEY) {
|
||||
if (registrationName === 'onClick') {
|
||||
var key = getDictionaryKey(inst);
|
||||
var node = ReactDOMComponentTree.getNodeFromInstance(inst);
|
||||
if (!onClickListeners[key]) {
|
||||
@@ -636,7 +634,7 @@ var SimpleEventPlugin = {
|
||||
},
|
||||
|
||||
willDeleteListener: function(inst, registrationName) {
|
||||
if (registrationName === ON_CLICK_KEY) {
|
||||
if (registrationName === 'onClick') {
|
||||
var key = getDictionaryKey(inst);
|
||||
onClickListeners[key].remove();
|
||||
delete onClickListeners[key];
|
||||
|
||||
@@ -17,8 +17,6 @@ var SyntheticUIEvent = require('SyntheticUIEvent');
|
||||
var TouchEventUtils = require('TouchEventUtils');
|
||||
var ViewportMetrics = require('ViewportMetrics');
|
||||
|
||||
var keyOf = require('keyOf');
|
||||
|
||||
var isStartish = EventPluginUtils.isStartish;
|
||||
var isEndish = EventPluginUtils.isEndish;
|
||||
|
||||
@@ -69,8 +67,8 @@ var dependencies = [
|
||||
var eventTypes = {
|
||||
touchTap: {
|
||||
phasedRegistrationNames: {
|
||||
bubbled: keyOf({onTouchTap: null}),
|
||||
captured: keyOf({onTouchTapCapture: null}),
|
||||
bubbled: 'onTouchTap',
|
||||
captured: 'onTouchTapCapture',
|
||||
},
|
||||
dependencies: dependencies,
|
||||
},
|
||||
|
||||
@@ -37,7 +37,6 @@ var emptyFunction = require('emptyFunction');
|
||||
var escapeTextContentForBrowser = require('escapeTextContentForBrowser');
|
||||
var invariant = require('invariant');
|
||||
var isEventSupported = require('isEventSupported');
|
||||
var keyOf = require('keyOf');
|
||||
var shallowEqual = require('shallowEqual');
|
||||
var inputValueTracking = require('inputValueTracking');
|
||||
var validateDOMNesting = require('validateDOMNesting');
|
||||
@@ -52,8 +51,8 @@ var registrationNameModules = EventPluginRegistry.registrationNameModules;
|
||||
// For quickly matching children type, to test if can be treated as content.
|
||||
var CONTENT_TYPES = {'string': true, 'number': true};
|
||||
|
||||
var STYLE = keyOf({style: null});
|
||||
var HTML = keyOf({__html: null});
|
||||
var STYLE = 'style';
|
||||
var HTML = '__html';
|
||||
var RESERVED_PROPS = {
|
||||
children: null,
|
||||
dangerouslySetInnerHTML: null,
|
||||
|
||||
@@ -17,7 +17,6 @@ var ResponderSyntheticEvent = require('ResponderSyntheticEvent');
|
||||
var ResponderTouchHistoryStore = require('ResponderTouchHistoryStore');
|
||||
|
||||
var accumulate = require('accumulate');
|
||||
var keyOf = require('keyOf');
|
||||
|
||||
var isStartish = EventPluginUtils.isStartish;
|
||||
var isMoveish = EventPluginUtils.isMoveish;
|
||||
@@ -63,8 +62,8 @@ var eventTypes = {
|
||||
*/
|
||||
startShouldSetResponder: {
|
||||
phasedRegistrationNames: {
|
||||
bubbled: keyOf({onStartShouldSetResponder: null}),
|
||||
captured: keyOf({onStartShouldSetResponderCapture: null}),
|
||||
bubbled: 'onStartShouldSetResponder',
|
||||
captured: 'onStartShouldSetResponderCapture',
|
||||
},
|
||||
},
|
||||
|
||||
@@ -79,8 +78,8 @@ var eventTypes = {
|
||||
*/
|
||||
scrollShouldSetResponder: {
|
||||
phasedRegistrationNames: {
|
||||
bubbled: keyOf({onScrollShouldSetResponder: null}),
|
||||
captured: keyOf({onScrollShouldSetResponderCapture: null}),
|
||||
bubbled: 'onScrollShouldSetResponder',
|
||||
captured: 'onScrollShouldSetResponderCapture',
|
||||
},
|
||||
},
|
||||
|
||||
@@ -93,8 +92,8 @@ var eventTypes = {
|
||||
*/
|
||||
selectionChangeShouldSetResponder: {
|
||||
phasedRegistrationNames: {
|
||||
bubbled: keyOf({onSelectionChangeShouldSetResponder: null}),
|
||||
captured: keyOf({onSelectionChangeShouldSetResponderCapture: null}),
|
||||
bubbled: 'onSelectionChangeShouldSetResponder',
|
||||
captured: 'onSelectionChangeShouldSetResponderCapture',
|
||||
},
|
||||
},
|
||||
|
||||
@@ -104,24 +103,24 @@ var eventTypes = {
|
||||
*/
|
||||
moveShouldSetResponder: {
|
||||
phasedRegistrationNames: {
|
||||
bubbled: keyOf({onMoveShouldSetResponder: null}),
|
||||
captured: keyOf({onMoveShouldSetResponderCapture: null}),
|
||||
bubbled: 'onMoveShouldSetResponder',
|
||||
captured: 'onMoveShouldSetResponderCapture',
|
||||
},
|
||||
},
|
||||
|
||||
/**
|
||||
* Direct responder events dispatched directly to responder. Do not bubble.
|
||||
*/
|
||||
responderStart: {registrationName: keyOf({onResponderStart: null})},
|
||||
responderMove: {registrationName: keyOf({onResponderMove: null})},
|
||||
responderEnd: {registrationName: keyOf({onResponderEnd: null})},
|
||||
responderRelease: {registrationName: keyOf({onResponderRelease: null})},
|
||||
responderStart: {registrationName: 'onResponderStart'},
|
||||
responderMove: {registrationName: 'onResponderMove'},
|
||||
responderEnd: {registrationName: 'onResponderEnd'},
|
||||
responderRelease: {registrationName: 'onResponderRelease'},
|
||||
responderTerminationRequest: {
|
||||
registrationName: keyOf({onResponderTerminationRequest: null}),
|
||||
registrationName: 'onResponderTerminationRequest',
|
||||
},
|
||||
responderGrant: {registrationName: keyOf({onResponderGrant: null})},
|
||||
responderReject: {registrationName: keyOf({onResponderReject: null})},
|
||||
responderTerminate: {registrationName: keyOf({onResponderTerminate: null})},
|
||||
responderGrant: {registrationName: 'onResponderGrant'},
|
||||
responderReject: {registrationName: 'onResponderReject'},
|
||||
responderTerminate: {registrationName: 'onResponderTerminate'},
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user