react 0.13.1 → 0.14.0-alpha2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/addons.js +7 -0
- package/addons/CSSTransitionGroup.js +1 -0
- package/addons/LinkedStateMixin.js +1 -0
- package/addons/Perf.js +1 -0
- package/addons/PureRenderMixin.js +1 -0
- package/addons/TestUtils.js +1 -0
- package/addons/TransitionGroup.js +1 -0
- package/addons/batchedUpdates.js +1 -0
- package/addons/cloneWithProps.js +1 -0
- package/addons/createFragment.js +1 -0
- package/addons/renderSubtreeIntoContainer.js +1 -0
- package/addons/shallowCompare.js +1 -0
- package/addons/update.js +1 -0
- package/dist/JSXTransformer.js +3336 -1671
- package/dist/react-with-addons.js +3320 -5125
- package/dist/react-with-addons.min.js +6 -6
- package/dist/react.js +2952 -4533
- package/dist/react.min.js +5 -5
- package/lib/AutoFocusMixin.js +4 -3
- package/lib/BeforeInputEventPlugin.js +30 -118
- package/lib/CSSCore.js +12 -23
- package/lib/CSSProperty.js +9 -4
- package/lib/CSSPropertyOperations.js +14 -30
- package/lib/CallbackQueue.js +7 -10
- package/lib/ChangeEventPlugin.js +24 -88
- package/lib/ClientReactRootIndex.js +2 -2
- package/lib/DOMChildrenOperations.js +13 -33
- package/lib/DOMProperty.js +41 -67
- package/lib/DOMPropertyOperations.js +30 -51
- package/lib/Danger.js +19 -62
- package/lib/DefaultEventPluginOrder.js +2 -12
- package/lib/EnterLeaveEventPlugin.js +11 -33
- package/lib/EventConstants.js +2 -2
- package/lib/EventListener.js +11 -13
- package/lib/EventPluginHub.js +44 -47
- package/lib/EventPluginRegistry.js +18 -74
- package/lib/EventPluginUtils.js +27 -38
- package/lib/EventPropagators.js +23 -26
- package/lib/ExecutionEnvironment.js +4 -8
- package/lib/FallbackCompositionState.js +3 -3
- package/lib/HTMLDOMPropertyConfig.js +13 -20
- package/lib/LinkedStateMixin.js +3 -6
- package/lib/LinkedValueUtils.js +34 -64
- package/lib/LocalEventTrapMixin.js +9 -16
- package/lib/Object.assign.js +1 -1
- package/lib/PooledClass.js +8 -11
- package/lib/React.js +9 -129
- package/lib/ReactBrowserComponentMixin.js +9 -2
- package/lib/ReactBrowserEventEmitter.js +26 -82
- package/lib/ReactCSSTransitionGroup.js +13 -24
- package/lib/ReactCSSTransitionGroupChild.js +18 -28
- package/lib/ReactChildReconciler.js +11 -19
- package/lib/ReactChildren.js +21 -28
- package/lib/ReactClass.js +81 -234
- package/lib/ReactComponent.js +17 -33
- package/lib/ReactComponentBrowserEnvironment.js +4 -8
- package/lib/ReactComponentEnvironment.js +6 -12
- package/lib/ReactComponentWithPureRenderMixin.js +4 -5
- package/lib/ReactCompositeComponent.js +85 -297
- package/lib/ReactContext.js +2 -44
- package/lib/ReactCurrentOwner.js +1 -3
- package/lib/ReactDOM.js +4 -2
- package/lib/ReactDOMButton.js +3 -4
- package/lib/ReactDOMClient.js +85 -0
- package/lib/ReactDOMComponent.js +184 -146
- package/lib/ReactDOMForm.js +3 -3
- package/lib/ReactDOMIDOperations.js +11 -22
- package/lib/ReactDOMIframe.js +3 -3
- package/lib/ReactDOMImg.js +3 -3
- package/lib/ReactDOMInput.js +22 -35
- package/lib/ReactDOMOption.js +68 -10
- package/lib/ReactDOMSelect.js +50 -28
- package/lib/ReactDOMSelection.js +5 -20
- package/lib/ReactDOMServer.js +24 -0
- package/lib/ReactDOMTextComponent.js +17 -18
- package/lib/ReactDOMTextarea.js +15 -27
- package/lib/ReactDefaultBatchingStrategy.js +9 -13
- package/lib/ReactDefaultInjection.js +31 -40
- package/lib/ReactDefaultPerf.js +36 -69
- package/lib/ReactDefaultPerfAnalysis.js +8 -14
- package/lib/ReactElement.js +24 -57
- package/lib/ReactElementValidator.js +38 -105
- package/lib/ReactEmptyComponent.js +7 -11
- package/lib/ReactErrorUtils.js +2 -2
- package/lib/ReactEventEmitterMixin.js +3 -12
- package/lib/ReactEventListener.js +16 -38
- package/lib/ReactFragment.js +23 -54
- package/lib/ReactInjection.js +1 -1
- package/lib/ReactInputSelection.js +11 -21
- package/lib/ReactInstanceHandles.js +27 -57
- package/lib/ReactInstanceMap.js +5 -5
- package/lib/ReactIsomorphic.js +70 -0
- package/lib/ReactLifeCycle.js +1 -1
- package/lib/ReactLink.js +2 -4
- package/lib/ReactMarkupChecksum.js +5 -10
- package/lib/ReactMount.js +137 -260
- package/lib/ReactMultiChild.js +19 -45
- package/lib/ReactMultiChildUpdateTypes.js +1 -1
- package/lib/ReactNativeComponent.js +7 -11
- package/lib/ReactOwner.js +7 -24
- package/lib/ReactPerf.js +8 -12
- package/lib/ReactPropTransferer.js +4 -4
- package/lib/ReactPropTypeLocationNames.js +2 -2
- package/lib/ReactPropTypeLocations.js +1 -1
- package/lib/ReactPropTypes.js +29 -61
- package/lib/ReactReconcileTransaction.js +9 -34
- package/lib/ReactReconciler.js +9 -19
- package/lib/ReactRef.js +5 -8
- package/lib/ReactRootIndex.js +2 -2
- package/lib/ReactServerRendering.js +7 -15
- package/lib/ReactServerRenderingTransaction.js +7 -32
- package/lib/ReactStateSetters.js +6 -6
- package/lib/ReactTestUtils.js +93 -165
- package/lib/ReactTransitionChildMapping.js +5 -7
- package/lib/ReactTransitionEvents.js +5 -5
- package/lib/ReactTransitionGroup.js +30 -52
- package/lib/ReactUpdateQueue.js +27 -90
- package/lib/ReactUpdates.js +27 -79
- package/lib/ReactWithAddons.js +7 -6
- package/lib/SVGDOMPropertyConfig.js +41 -4
- package/lib/SelectEventPlugin.js +28 -29
- package/lib/ServerReactRootIndex.js +2 -2
- package/lib/SimpleEventPlugin.js +136 -128
- package/lib/SyntheticClipboardEvent.js +3 -7
- package/lib/SyntheticCompositionEvent.js +3 -9
- package/lib/SyntheticDragEvent.js +1 -1
- package/lib/SyntheticEvent.js +8 -10
- package/lib/SyntheticFocusEvent.js +1 -1
- package/lib/SyntheticInputEvent.js +3 -9
- package/lib/SyntheticKeyboardEvent.js +4 -4
- package/lib/SyntheticMouseEvent.js +8 -14
- package/lib/SyntheticTouchEvent.js +1 -1
- package/lib/SyntheticUIEvent.js +3 -3
- package/lib/SyntheticWheelEvent.js +11 -15
- package/lib/Transaction.js +12 -24
- package/lib/ViewportMetrics.js +2 -2
- package/lib/accumulateInto.js +2 -5
- package/lib/adler32.js +2 -4
- package/lib/camelize.js +4 -2
- package/lib/camelizeStyleName.js +2 -2
- package/lib/cloneWithProps.js +5 -11
- package/lib/containsNode.js +29 -16
- package/lib/createArrayFromMixed.js +17 -16
- package/lib/createFullPageComponent.js +4 -11
- package/lib/createNodesFromMarkup.js +6 -8
- package/lib/dangerousStyleValue.js +2 -3
- package/lib/emptyFunction.js +10 -4
- package/lib/emptyObject.js +1 -1
- package/lib/escapeTextContentForBrowser.js +1 -1
- package/lib/findDOMNode.js +5 -24
- package/lib/flattenChildren.js +4 -10
- package/lib/focusNode.js +2 -3
- package/lib/forEachAccumulated.js +2 -2
- package/lib/getActiveElement.js +4 -2
- package/lib/getEventCharCode.js +1 -1
- package/lib/getEventKey.js +1 -1
- package/lib/getEventModifierState.js +1 -1
- package/lib/getEventTarget.js +1 -1
- package/lib/getIteratorFn.js +2 -4
- package/lib/getMarkupWrap.js +7 -5
- package/lib/getNodeForCharacterOffset.js +1 -1
- package/lib/getTextContentAccessor.js +2 -4
- package/lib/getUnboundedScrollPosition.js +1 -1
- package/lib/hyphenate.js +3 -1
- package/lib/hyphenateStyleName.js +2 -2
- package/lib/instantiateReactComponent.js +14 -37
- package/lib/invariant.js +8 -12
- package/lib/isEventSupported.js +7 -10
- package/lib/isNode.js +4 -6
- package/lib/isTextInputElement.js +2 -4
- package/lib/isTextNode.js +3 -1
- package/lib/joinClasses.js +2 -2
- package/lib/keyMirror.js +3 -6
- package/lib/keyOf.js +4 -3
- package/lib/mapObject.js +1 -1
- package/lib/memoizeStringOnly.js +2 -2
- package/lib/onlyChild.js +2 -5
- package/lib/performance.js +2 -5
- package/lib/performanceNow.js +3 -1
- package/lib/quoteAttributeValueForBrowser.js +1 -1
- package/lib/renderSubtreeIntoContainer.js +16 -0
- package/lib/setInnerHTML.js +11 -8
- package/lib/setTextContent.js +3 -3
- package/lib/shallowCompare.js +24 -0
- package/lib/shallowEqual.js +17 -11
- package/lib/shouldUpdateReactComponent.js +3 -64
- package/lib/toArray.js +8 -19
- package/lib/traverseAllChildren.js +22 -89
- package/lib/update.js +33 -90
- package/lib/validateDOMNesting.js +355 -0
- package/lib/warning.js +17 -15
- package/package.json +3 -3
- package/lib/MobileSafariClickEventPlugin.js +0 -56
- package/lib/ReactPutListenerQueue.js +0 -54
- package/lib/cx.js +0 -52
- package/lib/getReactRootElementInContainer.js +0 -33
|
@@ -19,12 +19,8 @@ var SyntheticEvent = require("./SyntheticEvent");
|
|
|
19
19
|
* @see http://www.w3.org/TR/clipboard-apis/
|
|
20
20
|
*/
|
|
21
21
|
var ClipboardEventInterface = {
|
|
22
|
-
clipboardData: function(event) {
|
|
23
|
-
return
|
|
24
|
-
'clipboardData' in event ?
|
|
25
|
-
event.clipboardData :
|
|
26
|
-
window.clipboardData
|
|
27
|
-
);
|
|
22
|
+
clipboardData: function (event) {
|
|
23
|
+
return 'clipboardData' in event ? event.clipboardData : window.clipboardData;
|
|
28
24
|
}
|
|
29
25
|
};
|
|
30
26
|
|
|
@@ -40,4 +36,4 @@ function SyntheticClipboardEvent(dispatchConfig, dispatchMarker, nativeEvent) {
|
|
|
40
36
|
|
|
41
37
|
SyntheticEvent.augmentClass(SyntheticClipboardEvent, ClipboardEventInterface);
|
|
42
38
|
|
|
43
|
-
module.exports = SyntheticClipboardEvent;
|
|
39
|
+
module.exports = SyntheticClipboardEvent;
|
|
@@ -28,16 +28,10 @@ var CompositionEventInterface = {
|
|
|
28
28
|
* @param {object} nativeEvent Native browser event.
|
|
29
29
|
* @extends {SyntheticUIEvent}
|
|
30
30
|
*/
|
|
31
|
-
function SyntheticCompositionEvent(
|
|
32
|
-
dispatchConfig,
|
|
33
|
-
dispatchMarker,
|
|
34
|
-
nativeEvent) {
|
|
31
|
+
function SyntheticCompositionEvent(dispatchConfig, dispatchMarker, nativeEvent) {
|
|
35
32
|
SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent);
|
|
36
33
|
}
|
|
37
34
|
|
|
38
|
-
SyntheticEvent.augmentClass(
|
|
39
|
-
SyntheticCompositionEvent,
|
|
40
|
-
CompositionEventInterface
|
|
41
|
-
);
|
|
35
|
+
SyntheticEvent.augmentClass(SyntheticCompositionEvent, CompositionEventInterface);
|
|
42
36
|
|
|
43
|
-
module.exports = SyntheticCompositionEvent;
|
|
37
|
+
module.exports = SyntheticCompositionEvent;
|
package/lib/SyntheticEvent.js
CHANGED
|
@@ -30,7 +30,7 @@ var EventInterface = {
|
|
|
30
30
|
eventPhase: null,
|
|
31
31
|
bubbles: null,
|
|
32
32
|
cancelable: null,
|
|
33
|
-
timeStamp: function(event) {
|
|
33
|
+
timeStamp: function (event) {
|
|
34
34
|
return event.timeStamp || Date.now();
|
|
35
35
|
},
|
|
36
36
|
defaultPrevented: null,
|
|
@@ -72,9 +72,7 @@ function SyntheticEvent(dispatchConfig, dispatchMarker, nativeEvent) {
|
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
74
|
|
|
75
|
-
var defaultPrevented = nativeEvent.defaultPrevented != null ?
|
|
76
|
-
nativeEvent.defaultPrevented :
|
|
77
|
-
nativeEvent.returnValue === false;
|
|
75
|
+
var defaultPrevented = nativeEvent.defaultPrevented != null ? nativeEvent.defaultPrevented : nativeEvent.returnValue === false;
|
|
78
76
|
if (defaultPrevented) {
|
|
79
77
|
this.isDefaultPrevented = emptyFunction.thatReturnsTrue;
|
|
80
78
|
} else {
|
|
@@ -85,7 +83,7 @@ function SyntheticEvent(dispatchConfig, dispatchMarker, nativeEvent) {
|
|
|
85
83
|
|
|
86
84
|
assign(SyntheticEvent.prototype, {
|
|
87
85
|
|
|
88
|
-
preventDefault: function() {
|
|
86
|
+
preventDefault: function () {
|
|
89
87
|
this.defaultPrevented = true;
|
|
90
88
|
var event = this.nativeEvent;
|
|
91
89
|
if (event.preventDefault) {
|
|
@@ -96,7 +94,7 @@ assign(SyntheticEvent.prototype, {
|
|
|
96
94
|
this.isDefaultPrevented = emptyFunction.thatReturnsTrue;
|
|
97
95
|
},
|
|
98
96
|
|
|
99
|
-
stopPropagation: function() {
|
|
97
|
+
stopPropagation: function () {
|
|
100
98
|
var event = this.nativeEvent;
|
|
101
99
|
if (event.stopPropagation) {
|
|
102
100
|
event.stopPropagation();
|
|
@@ -111,7 +109,7 @@ assign(SyntheticEvent.prototype, {
|
|
|
111
109
|
* them back into the pool. This allows a way to hold onto a reference that
|
|
112
110
|
* won't be added back into the pool.
|
|
113
111
|
*/
|
|
114
|
-
persist: function() {
|
|
112
|
+
persist: function () {
|
|
115
113
|
this.isPersistent = emptyFunction.thatReturnsTrue;
|
|
116
114
|
},
|
|
117
115
|
|
|
@@ -125,7 +123,7 @@ assign(SyntheticEvent.prototype, {
|
|
|
125
123
|
/**
|
|
126
124
|
* `PooledClass` looks for `destructor` on each instance it releases.
|
|
127
125
|
*/
|
|
128
|
-
destructor: function() {
|
|
126
|
+
destructor: function () {
|
|
129
127
|
var Interface = this.constructor.Interface;
|
|
130
128
|
for (var propName in Interface) {
|
|
131
129
|
this[propName] = null;
|
|
@@ -145,7 +143,7 @@ SyntheticEvent.Interface = EventInterface;
|
|
|
145
143
|
* @param {function} Class
|
|
146
144
|
* @param {?object} Interface
|
|
147
145
|
*/
|
|
148
|
-
SyntheticEvent.augmentClass = function(Class, Interface) {
|
|
146
|
+
SyntheticEvent.augmentClass = function (Class, Interface) {
|
|
149
147
|
var Super = this;
|
|
150
148
|
|
|
151
149
|
var prototype = Object.create(Super.prototype);
|
|
@@ -161,4 +159,4 @@ SyntheticEvent.augmentClass = function(Class, Interface) {
|
|
|
161
159
|
|
|
162
160
|
PooledClass.addPoolingTo(SyntheticEvent, PooledClass.threeArgumentPooler);
|
|
163
161
|
|
|
164
|
-
module.exports = SyntheticEvent;
|
|
162
|
+
module.exports = SyntheticEvent;
|
|
@@ -29,16 +29,10 @@ var InputEventInterface = {
|
|
|
29
29
|
* @param {object} nativeEvent Native browser event.
|
|
30
30
|
* @extends {SyntheticUIEvent}
|
|
31
31
|
*/
|
|
32
|
-
function SyntheticInputEvent(
|
|
33
|
-
dispatchConfig,
|
|
34
|
-
dispatchMarker,
|
|
35
|
-
nativeEvent) {
|
|
32
|
+
function SyntheticInputEvent(dispatchConfig, dispatchMarker, nativeEvent) {
|
|
36
33
|
SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent);
|
|
37
34
|
}
|
|
38
35
|
|
|
39
|
-
SyntheticEvent.augmentClass(
|
|
40
|
-
SyntheticInputEvent,
|
|
41
|
-
InputEventInterface
|
|
42
|
-
);
|
|
36
|
+
SyntheticEvent.augmentClass(SyntheticInputEvent, InputEventInterface);
|
|
43
37
|
|
|
44
|
-
module.exports = SyntheticInputEvent;
|
|
38
|
+
module.exports = SyntheticInputEvent;
|
|
@@ -33,7 +33,7 @@ var KeyboardEventInterface = {
|
|
|
33
33
|
locale: null,
|
|
34
34
|
getModifierState: getEventModifierState,
|
|
35
35
|
// Legacy Interface
|
|
36
|
-
charCode: function(event) {
|
|
36
|
+
charCode: function (event) {
|
|
37
37
|
// `charCode` is the result of a KeyPress event and represents the value of
|
|
38
38
|
// the actual printable character.
|
|
39
39
|
|
|
@@ -44,7 +44,7 @@ var KeyboardEventInterface = {
|
|
|
44
44
|
}
|
|
45
45
|
return 0;
|
|
46
46
|
},
|
|
47
|
-
keyCode: function(event) {
|
|
47
|
+
keyCode: function (event) {
|
|
48
48
|
// `keyCode` is the result of a KeyDown/Up event and represents the value of
|
|
49
49
|
// physical keyboard key.
|
|
50
50
|
|
|
@@ -57,7 +57,7 @@ var KeyboardEventInterface = {
|
|
|
57
57
|
}
|
|
58
58
|
return 0;
|
|
59
59
|
},
|
|
60
|
-
which: function(event) {
|
|
60
|
+
which: function (event) {
|
|
61
61
|
// `which` is an alias for either `keyCode` or `charCode` depending on the
|
|
62
62
|
// type of the event.
|
|
63
63
|
if (event.type === 'keypress') {
|
|
@@ -82,4 +82,4 @@ function SyntheticKeyboardEvent(dispatchConfig, dispatchMarker, nativeEvent) {
|
|
|
82
82
|
|
|
83
83
|
SyntheticUIEvent.augmentClass(SyntheticKeyboardEvent, KeyboardEventInterface);
|
|
84
84
|
|
|
85
|
-
module.exports = SyntheticKeyboardEvent;
|
|
85
|
+
module.exports = SyntheticKeyboardEvent;
|
|
@@ -31,7 +31,7 @@ var MouseEventInterface = {
|
|
|
31
31
|
altKey: null,
|
|
32
32
|
metaKey: null,
|
|
33
33
|
getModifierState: getEventModifierState,
|
|
34
|
-
button: function(event) {
|
|
34
|
+
button: function (event) {
|
|
35
35
|
// Webkit, Firefox, IE9+
|
|
36
36
|
// which: 1 2 3
|
|
37
37
|
// button: 0 1 2 (standard)
|
|
@@ -46,21 +46,15 @@ var MouseEventInterface = {
|
|
|
46
46
|
return button === 2 ? 2 : button === 4 ? 1 : 0;
|
|
47
47
|
},
|
|
48
48
|
buttons: null,
|
|
49
|
-
relatedTarget: function(event) {
|
|
50
|
-
return event.relatedTarget || (
|
|
51
|
-
((event.fromElement === event.srcElement ? event.toElement : event.fromElement))
|
|
52
|
-
);
|
|
49
|
+
relatedTarget: function (event) {
|
|
50
|
+
return event.relatedTarget || (event.fromElement === event.srcElement ? event.toElement : event.fromElement);
|
|
53
51
|
},
|
|
54
52
|
// "Proprietary" Interface.
|
|
55
|
-
pageX: function(event) {
|
|
56
|
-
return 'pageX' in event ?
|
|
57
|
-
event.pageX :
|
|
58
|
-
event.clientX + ViewportMetrics.currentScrollLeft;
|
|
53
|
+
pageX: function (event) {
|
|
54
|
+
return 'pageX' in event ? event.pageX : event.clientX + ViewportMetrics.currentScrollLeft;
|
|
59
55
|
},
|
|
60
|
-
pageY: function(event) {
|
|
61
|
-
return 'pageY' in event ?
|
|
62
|
-
event.pageY :
|
|
63
|
-
event.clientY + ViewportMetrics.currentScrollTop;
|
|
56
|
+
pageY: function (event) {
|
|
57
|
+
return 'pageY' in event ? event.pageY : event.clientY + ViewportMetrics.currentScrollTop;
|
|
64
58
|
}
|
|
65
59
|
};
|
|
66
60
|
|
|
@@ -76,4 +70,4 @@ function SyntheticMouseEvent(dispatchConfig, dispatchMarker, nativeEvent) {
|
|
|
76
70
|
|
|
77
71
|
SyntheticUIEvent.augmentClass(SyntheticMouseEvent, MouseEventInterface);
|
|
78
72
|
|
|
79
|
-
module.exports = SyntheticMouseEvent;
|
|
73
|
+
module.exports = SyntheticMouseEvent;
|
package/lib/SyntheticUIEvent.js
CHANGED
|
@@ -21,7 +21,7 @@ var getEventTarget = require("./getEventTarget");
|
|
|
21
21
|
* @see http://www.w3.org/TR/DOM-Level-3-Events/
|
|
22
22
|
*/
|
|
23
23
|
var UIEventInterface = {
|
|
24
|
-
view: function(event) {
|
|
24
|
+
view: function (event) {
|
|
25
25
|
if (event.view) {
|
|
26
26
|
return event.view;
|
|
27
27
|
}
|
|
@@ -40,7 +40,7 @@ var UIEventInterface = {
|
|
|
40
40
|
return window;
|
|
41
41
|
}
|
|
42
42
|
},
|
|
43
|
-
detail: function(event) {
|
|
43
|
+
detail: function (event) {
|
|
44
44
|
return event.detail || 0;
|
|
45
45
|
}
|
|
46
46
|
};
|
|
@@ -57,4 +57,4 @@ function SyntheticUIEvent(dispatchConfig, dispatchMarker, nativeEvent) {
|
|
|
57
57
|
|
|
58
58
|
SyntheticEvent.augmentClass(SyntheticUIEvent, UIEventInterface);
|
|
59
59
|
|
|
60
|
-
module.exports = SyntheticUIEvent;
|
|
60
|
+
module.exports = SyntheticUIEvent;
|
|
@@ -19,21 +19,17 @@ var SyntheticMouseEvent = require("./SyntheticMouseEvent");
|
|
|
19
19
|
* @see http://www.w3.org/TR/DOM-Level-3-Events/
|
|
20
20
|
*/
|
|
21
21
|
var WheelEventInterface = {
|
|
22
|
-
deltaX: function(event) {
|
|
23
|
-
return
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
'wheelDeltaX' in event ? -event.wheelDeltaX : 0
|
|
27
|
-
);
|
|
22
|
+
deltaX: function (event) {
|
|
23
|
+
return 'deltaX' in event ? event.deltaX :
|
|
24
|
+
// Fallback to `wheelDeltaX` for Webkit and normalize (right is positive).
|
|
25
|
+
'wheelDeltaX' in event ? -event.wheelDeltaX : 0;
|
|
28
26
|
},
|
|
29
|
-
deltaY: function(event) {
|
|
30
|
-
return
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
'wheelDelta' in event ? -event.wheelDelta : 0
|
|
36
|
-
);
|
|
27
|
+
deltaY: function (event) {
|
|
28
|
+
return 'deltaY' in event ? event.deltaY :
|
|
29
|
+
// Fallback to `wheelDeltaY` for Webkit and normalize (down is positive).
|
|
30
|
+
'wheelDeltaY' in event ? -event.wheelDeltaY :
|
|
31
|
+
// Fallback to `wheelDelta` for IE<9 and normalize (down is positive).
|
|
32
|
+
'wheelDelta' in event ? -event.wheelDelta : 0;
|
|
37
33
|
},
|
|
38
34
|
deltaZ: null,
|
|
39
35
|
|
|
@@ -56,4 +52,4 @@ function SyntheticWheelEvent(dispatchConfig, dispatchMarker, nativeEvent) {
|
|
|
56
52
|
|
|
57
53
|
SyntheticMouseEvent.augmentClass(SyntheticWheelEvent, WheelEventInterface);
|
|
58
54
|
|
|
59
|
-
module.exports = SyntheticWheelEvent;
|
|
55
|
+
module.exports = SyntheticWheelEvent;
|
package/lib/Transaction.js
CHANGED
|
@@ -82,7 +82,7 @@ var Mixin = {
|
|
|
82
82
|
* That can be useful if you decide to make your subclass of this mixin a
|
|
83
83
|
* "PooledClass".
|
|
84
84
|
*/
|
|
85
|
-
reinitializeTransaction: function() {
|
|
85
|
+
reinitializeTransaction: function () {
|
|
86
86
|
this.transactionWrappers = this.getTransactionWrappers();
|
|
87
87
|
if (!this.wrapperInitData) {
|
|
88
88
|
this.wrapperInitData = [];
|
|
@@ -100,7 +100,7 @@ var Mixin = {
|
|
|
100
100
|
*/
|
|
101
101
|
getTransactionWrappers: null,
|
|
102
102
|
|
|
103
|
-
isInTransaction: function() {
|
|
103
|
+
isInTransaction: function () {
|
|
104
104
|
return !!this._isInTransaction;
|
|
105
105
|
},
|
|
106
106
|
|
|
@@ -115,12 +115,8 @@ var Mixin = {
|
|
|
115
115
|
* Helps prevent need to bind in many cases.
|
|
116
116
|
* @return Return value from `method`.
|
|
117
117
|
*/
|
|
118
|
-
perform: function(method, scope, a, b, c, d, e, f) {
|
|
119
|
-
|
|
120
|
-
!this.isInTransaction(),
|
|
121
|
-
'Transaction.perform(...): Cannot initialize a transaction when there ' +
|
|
122
|
-
'is already an outstanding transaction.'
|
|
123
|
-
) : invariant(!this.isInTransaction()));
|
|
118
|
+
perform: function (method, scope, a, b, c, d, e, f) {
|
|
119
|
+
'production' !== process.env.NODE_ENV ? invariant(!this.isInTransaction(), 'Transaction.perform(...): Cannot initialize a transaction when there ' + 'is already an outstanding transaction.') : invariant(!this.isInTransaction());
|
|
124
120
|
var errorThrown;
|
|
125
121
|
var ret;
|
|
126
122
|
try {
|
|
@@ -140,8 +136,7 @@ var Mixin = {
|
|
|
140
136
|
// by invoking `closeAll`.
|
|
141
137
|
try {
|
|
142
138
|
this.closeAll(0);
|
|
143
|
-
} catch (err) {
|
|
144
|
-
}
|
|
139
|
+
} catch (err) {}
|
|
145
140
|
} else {
|
|
146
141
|
// Since `method` didn't throw, we don't want to silence the exception
|
|
147
142
|
// here.
|
|
@@ -154,7 +149,7 @@ var Mixin = {
|
|
|
154
149
|
return ret;
|
|
155
150
|
},
|
|
156
151
|
|
|
157
|
-
initializeAll: function(startIndex) {
|
|
152
|
+
initializeAll: function (startIndex) {
|
|
158
153
|
var transactionWrappers = this.transactionWrappers;
|
|
159
154
|
for (var i = startIndex; i < transactionWrappers.length; i++) {
|
|
160
155
|
var wrapper = transactionWrappers[i];
|
|
@@ -164,9 +159,7 @@ var Mixin = {
|
|
|
164
159
|
// of initialize -- if it's still set to OBSERVED_ERROR in the finally
|
|
165
160
|
// block, it means wrapper.initialize threw.
|
|
166
161
|
this.wrapperInitData[i] = Transaction.OBSERVED_ERROR;
|
|
167
|
-
this.wrapperInitData[i] = wrapper.initialize ?
|
|
168
|
-
wrapper.initialize.call(this) :
|
|
169
|
-
null;
|
|
162
|
+
this.wrapperInitData[i] = wrapper.initialize ? wrapper.initialize.call(this) : null;
|
|
170
163
|
} finally {
|
|
171
164
|
if (this.wrapperInitData[i] === Transaction.OBSERVED_ERROR) {
|
|
172
165
|
// The initializer for wrapper i threw an error; initialize the
|
|
@@ -174,8 +167,7 @@ var Mixin = {
|
|
|
174
167
|
// that the first error is the one to bubble up.
|
|
175
168
|
try {
|
|
176
169
|
this.initializeAll(i + 1);
|
|
177
|
-
} catch (err) {
|
|
178
|
-
}
|
|
170
|
+
} catch (err) {}
|
|
179
171
|
}
|
|
180
172
|
}
|
|
181
173
|
}
|
|
@@ -187,11 +179,8 @@ var Mixin = {
|
|
|
187
179
|
* (`close`rs that correspond to initializers that failed will not be
|
|
188
180
|
* invoked).
|
|
189
181
|
*/
|
|
190
|
-
closeAll: function(startIndex) {
|
|
191
|
-
|
|
192
|
-
this.isInTransaction(),
|
|
193
|
-
'Transaction.closeAll(): Cannot close transaction when none are open.'
|
|
194
|
-
) : invariant(this.isInTransaction()));
|
|
182
|
+
closeAll: function (startIndex) {
|
|
183
|
+
'production' !== process.env.NODE_ENV ? invariant(this.isInTransaction(), 'Transaction.closeAll(): Cannot close transaction when none are open.') : invariant(this.isInTransaction());
|
|
195
184
|
var transactionWrappers = this.transactionWrappers;
|
|
196
185
|
for (var i = startIndex; i < transactionWrappers.length; i++) {
|
|
197
186
|
var wrapper = transactionWrappers[i];
|
|
@@ -214,8 +203,7 @@ var Mixin = {
|
|
|
214
203
|
// first error is the one to bubble up.
|
|
215
204
|
try {
|
|
216
205
|
this.closeAll(i + 1);
|
|
217
|
-
} catch (e) {
|
|
218
|
-
}
|
|
206
|
+
} catch (e) {}
|
|
219
207
|
}
|
|
220
208
|
}
|
|
221
209
|
}
|
|
@@ -234,4 +222,4 @@ var Transaction = {
|
|
|
234
222
|
|
|
235
223
|
};
|
|
236
224
|
|
|
237
|
-
module.exports = Transaction;
|
|
225
|
+
module.exports = Transaction;
|
package/lib/ViewportMetrics.js
CHANGED
|
@@ -17,11 +17,11 @@ var ViewportMetrics = {
|
|
|
17
17
|
|
|
18
18
|
currentScrollTop: 0,
|
|
19
19
|
|
|
20
|
-
refreshScrollValues: function(scrollPosition) {
|
|
20
|
+
refreshScrollValues: function (scrollPosition) {
|
|
21
21
|
ViewportMetrics.currentScrollLeft = scrollPosition.x;
|
|
22
22
|
ViewportMetrics.currentScrollTop = scrollPosition.y;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
};
|
|
26
26
|
|
|
27
|
-
module.exports = ViewportMetrics;
|
|
27
|
+
module.exports = ViewportMetrics;
|
package/lib/accumulateInto.js
CHANGED
|
@@ -28,10 +28,7 @@ var invariant = require("./invariant");
|
|
|
28
28
|
*/
|
|
29
29
|
|
|
30
30
|
function accumulateInto(current, next) {
|
|
31
|
-
|
|
32
|
-
next != null,
|
|
33
|
-
'accumulateInto(...): Accumulated items must not be null or undefined.'
|
|
34
|
-
) : invariant(next != null));
|
|
31
|
+
'production' !== process.env.NODE_ENV ? invariant(next != null, 'accumulateInto(...): Accumulated items must not be null or undefined.') : invariant(next != null);
|
|
35
32
|
if (current == null) {
|
|
36
33
|
return next;
|
|
37
34
|
}
|
|
@@ -59,4 +56,4 @@ function accumulateInto(current, next) {
|
|
|
59
56
|
return [current, next];
|
|
60
57
|
}
|
|
61
58
|
|
|
62
|
-
module.exports = accumulateInto;
|
|
59
|
+
module.exports = accumulateInto;
|
package/lib/adler32.js
CHANGED
|
@@ -9,8 +9,6 @@
|
|
|
9
9
|
* @providesModule adler32
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
-
/* jslint bitwise:true */
|
|
13
|
-
|
|
14
12
|
'use strict';
|
|
15
13
|
|
|
16
14
|
var MOD = 65521;
|
|
@@ -26,7 +24,7 @@ function adler32(data) {
|
|
|
26
24
|
a = (a + data.charCodeAt(i)) % MOD;
|
|
27
25
|
b = (b + a) % MOD;
|
|
28
26
|
}
|
|
29
|
-
return a |
|
|
27
|
+
return a | b << 16;
|
|
30
28
|
}
|
|
31
29
|
|
|
32
|
-
module.exports = adler32;
|
|
30
|
+
module.exports = adler32;
|
package/lib/camelize.js
CHANGED
|
@@ -10,6 +10,8 @@
|
|
|
10
10
|
* @typechecks
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
+
"use strict";
|
|
14
|
+
|
|
13
15
|
var _hyphenPattern = /-(.)/g;
|
|
14
16
|
|
|
15
17
|
/**
|
|
@@ -22,9 +24,9 @@ var _hyphenPattern = /-(.)/g;
|
|
|
22
24
|
* @return {string}
|
|
23
25
|
*/
|
|
24
26
|
function camelize(string) {
|
|
25
|
-
return string.replace(_hyphenPattern, function(_, character) {
|
|
27
|
+
return string.replace(_hyphenPattern, function (_, character) {
|
|
26
28
|
return character.toUpperCase();
|
|
27
29
|
});
|
|
28
30
|
}
|
|
29
31
|
|
|
30
|
-
module.exports = camelize;
|
|
32
|
+
module.exports = camelize;
|