react 0.14.10 → 15.0.0
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/LICENSE +1 -1
- package/dist/react-with-addons.js +4900 -4627
- package/dist/react-with-addons.min.js +7 -7
- package/dist/react.js +4556 -4059
- package/dist/react.min.js +7 -7
- package/lib/AutoFocusUtils.js +3 -15
- package/lib/BeforeInputEventPlugin.js +8 -25
- package/lib/CSSProperty.js +10 -1
- package/lib/CSSPropertyOperations.js +49 -19
- package/lib/CallbackQueue.js +16 -4
- package/lib/ChangeEventPlugin.js +58 -54
- package/lib/DOMChildrenOperations.js +91 -61
- package/lib/DOMLazyTree.js +105 -0
- package/lib/{ClientReactRootIndex.js → DOMNamespaces.js} +7 -10
- package/lib/DOMProperty.js +18 -39
- package/lib/DOMPropertyOperations.js +42 -53
- package/lib/Danger.js +13 -14
- package/lib/DefaultEventPluginOrder.js +1 -1
- package/lib/EnterLeaveEventPlugin.js +24 -43
- package/lib/EventConstants.js +6 -1
- package/lib/EventPluginHub.js +22 -66
- package/lib/EventPluginRegistry.js +30 -9
- package/lib/EventPluginUtils.js +61 -36
- package/lib/EventPropagators.js +19 -17
- package/lib/FallbackCompositionState.js +4 -4
- package/lib/HTMLDOMPropertyConfig.js +131 -152
- package/lib/LinkedStateMixin.js +1 -2
- package/lib/LinkedValueUtils.js +6 -7
- package/lib/MetaMatchers.js +2 -2
- package/lib/OrderedMap.js +17 -16
- package/lib/PooledClass.js +2 -2
- package/lib/React.js +50 -20
- package/lib/ReactBrowserEventEmitter.js +19 -26
- package/lib/ReactCSSTransitionGroup.js +4 -5
- package/lib/ReactCSSTransitionGroupChild.js +1 -6
- package/lib/ReactChildReconciler.js +15 -13
- package/lib/ReactChildren.js +5 -4
- package/lib/ReactClass.js +44 -92
- package/lib/ReactComponent.js +9 -10
- package/lib/ReactComponentBrowserEnvironment.js +9 -6
- package/lib/ReactComponentEnvironment.js +4 -4
- package/lib/ReactComponentWithPureRenderMixin.js +2 -2
- package/lib/ReactCompositeComponent.js +166 -74
- package/lib/ReactCurrentOwner.js +2 -1
- package/lib/ReactDOM.js +27 -15
- package/lib/ReactDOMButton.js +2 -2
- package/lib/ReactDOMComponent.js +186 -250
- package/lib/ReactDOMComponentFlags.js +18 -0
- package/lib/ReactDOMComponentTree.js +186 -0
- package/lib/ReactDOMContainerInfo.js +32 -0
- package/lib/ReactDOMDebugTool.js +61 -0
- package/lib/ReactDOMEmptyComponent.js +60 -0
- package/lib/ReactDOMFactories.js +1 -2
- package/lib/ReactDOMFeatureFlags.js +2 -2
- package/lib/ReactDOMIDOperations.js +5 -60
- package/lib/ReactDOMInput.js +73 -23
- package/lib/ReactDOMInstrumentation.js +16 -0
- package/lib/ReactDOMOption.js +14 -12
- package/lib/ReactDOMSelect.js +43 -19
- package/lib/ReactDOMSelection.js +4 -4
- package/lib/ReactDOMServer.js +1 -1
- package/lib/ReactDOMTextComponent.js +87 -45
- package/lib/ReactDOMTextarea.js +39 -11
- package/lib/ReactDOMTreeTraversal.js +134 -0
- package/lib/ReactDOMUnknownPropertyDevtool.js +64 -0
- package/lib/ReactDebugInstanceMap.js +102 -0
- package/lib/ReactDebugTool.js +72 -0
- package/lib/ReactDefaultBatchingStrategy.js +4 -3
- package/lib/ReactDefaultInjection.js +11 -15
- package/lib/ReactDefaultPerf.js +105 -26
- package/lib/ReactDefaultPerfAnalysis.js +23 -15
- package/lib/ReactElement.js +63 -23
- package/lib/ReactElementValidator.js +9 -9
- package/lib/ReactEmptyComponent.js +8 -33
- package/lib/ReactErrorUtils.js +1 -2
- package/lib/ReactEventEmitterMixin.js +3 -8
- package/lib/ReactEventListener.js +23 -77
- package/lib/ReactFeatureFlags.js +21 -0
- package/lib/ReactFragment.js +6 -6
- package/lib/ReactInjection.js +3 -3
- package/lib/ReactInputSelection.js +4 -4
- package/lib/ReactInstanceHandles.js +10 -12
- package/lib/ReactInstanceMap.js +2 -1
- package/lib/ReactInstrumentation.js +16 -0
- package/lib/ReactInvalidSetStateWarningDevTool.js +36 -0
- package/lib/ReactLink.js +2 -3
- package/lib/ReactMarkupChecksum.js +8 -3
- package/lib/ReactMount.js +88 -460
- package/lib/ReactMultiChild.js +106 -200
- package/lib/ReactMultiChildUpdateTypes.js +1 -1
- package/lib/ReactNativeComponent.js +6 -5
- package/lib/ReactNodeTypes.js +37 -0
- package/lib/ReactNoopUpdateQueue.js +2 -25
- package/lib/ReactOwner.js +7 -6
- package/lib/ReactPerf.js +2 -2
- package/lib/ReactPropTransferer.js +5 -4
- package/lib/ReactPropTypeLocationNames.js +1 -1
- package/lib/ReactPropTypeLocations.js +1 -1
- package/lib/ReactPropTypes.js +31 -7
- package/lib/ReactReconcileTransaction.js +20 -9
- package/lib/ReactReconciler.js +29 -6
- package/lib/ReactRef.js +1 -1
- package/lib/ReactServerBatchingStrategy.js +1 -2
- package/lib/ReactServerRendering.js +17 -35
- package/lib/ReactServerRenderingTransaction.js +11 -29
- package/lib/ReactSimpleEmptyComponent.js +36 -0
- package/lib/ReactStateSetters.js +1 -1
- package/lib/ReactTestUtils.js +47 -28
- package/lib/ReactTransitionChildMapping.js +1 -2
- package/lib/ReactTransitionEvents.js +8 -44
- package/lib/ReactTransitionGroup.js +4 -3
- package/lib/ReactUMDEntry.js +26 -0
- package/lib/ReactUpdateQueue.js +24 -66
- package/lib/ReactUpdates.js +29 -11
- package/lib/ReactVersion.js +2 -2
- package/lib/ReactWithAddons.js +1 -21
- package/lib/ReactWithAddonsUMDEntry.js +26 -0
- package/lib/ResponderEventPlugin.js +54 -66
- package/lib/ResponderSyntheticEvent.js +2 -3
- package/lib/ResponderTouchHistoryStore.js +5 -5
- package/lib/SVGDOMPropertyConfig.js +267 -94
- package/lib/SelectEventPlugin.js +13 -18
- package/lib/SimpleEventPlugin.js +57 -17
- package/lib/SyntheticAnimationEvent.js +39 -0
- package/lib/SyntheticClipboardEvent.js +2 -3
- package/lib/SyntheticCompositionEvent.js +2 -3
- package/lib/SyntheticDragEvent.js +2 -3
- package/lib/SyntheticEvent.js +102 -21
- package/lib/SyntheticFocusEvent.js +2 -3
- package/lib/SyntheticInputEvent.js +2 -3
- package/lib/SyntheticKeyboardEvent.js +2 -3
- package/lib/SyntheticMouseEvent.js +2 -3
- package/lib/SyntheticTouchEvent.js +2 -3
- package/lib/SyntheticTransitionEvent.js +39 -0
- package/lib/SyntheticUIEvent.js +2 -3
- package/lib/SyntheticWheelEvent.js +2 -3
- package/lib/TapEventPlugin.js +3 -12
- package/lib/Transaction.js +3 -3
- package/lib/ViewportMetrics.js +1 -1
- package/lib/accumulate.js +2 -2
- package/lib/accumulateInto.js +2 -2
- package/lib/adler32.js +3 -2
- package/lib/canDefineProperty.js +1 -1
- package/lib/createHierarchyRenderer.js +1 -1
- package/lib/createMicrosoftUnsafeLocalFunction.js +32 -0
- package/lib/dangerousStyleValue.js +25 -3
- package/lib/deprecated.js +7 -4
- package/lib/escapeTextContentForBrowser.js +1 -1
- package/lib/findDOMNode.js +15 -8
- package/lib/flattenChildren.js +2 -2
- package/lib/forEachAccumulated.js +2 -1
- package/lib/getEventCharCode.js +2 -2
- package/lib/getEventKey.js +1 -2
- package/lib/getEventModifierState.js +1 -2
- package/lib/getEventTarget.js +8 -2
- package/lib/getIteratorFn.js +2 -2
- package/lib/getNativeComponentFromComposite.js +30 -0
- package/lib/getNodeForCharacterOffset.js +2 -1
- package/lib/getTestDocument.js +1 -1
- package/lib/getTextContentAccessor.js +1 -1
- package/lib/getVendorPrefixedEventName.js +101 -0
- package/lib/instantiateReactComponent.js +12 -13
- package/lib/isEventSupported.js +2 -2
- package/lib/isTextInputElement.js +2 -1
- package/lib/onlyChild.js +2 -2
- package/lib/quoteAttributeValueForBrowser.js +1 -1
- package/lib/reactComponentExpect.js +5 -4
- package/lib/renderSubtreeIntoContainer.js +1 -1
- package/lib/setInnerHTML.js +6 -14
- package/lib/setTextContent.js +1 -1
- package/lib/shallowCompare.js +1 -1
- package/lib/shouldUpdateReactComponent.js +2 -3
- package/lib/sliceChildren.js +1 -1
- package/lib/traverseAllChildren.js +8 -8
- package/lib/update.js +16 -15
- package/lib/validateDOMNesting.js +18 -13
- package/package.json +23 -32
- package/addons.js +0 -13
- package/cjs/react-jsx-dev-runtime.development.js +0 -861
- package/cjs/react-jsx-dev-runtime.production.min.js +0 -9
- package/cjs/react-jsx-runtime.development.js +0 -883
- package/cjs/react-jsx-runtime.production.min.js +0 -10
- package/jsx-dev-runtime.js +0 -7
- package/jsx-runtime.js +0 -7
- package/lib/Object.assign.js +0 -47
- package/lib/React.native.js +0 -5
- package/lib/ReactBrowserComponentMixin.js +0 -36
- package/lib/ReactEmptyComponentRegistry.js +0 -48
- package/lib/ReactIsomorphic.js +0 -74
- package/lib/ReactRootIndex.js +0 -29
- package/lib/ServerReactRootIndex.js +0 -29
- package/lib/cloneWithProps.js +0 -54
- package/lib/webcomponents.js +0 -6379
package/lib/LinkedStateMixin.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright 2013-
|
|
2
|
+
* Copyright 2013-present, Facebook, Inc.
|
|
3
3
|
* All rights reserved.
|
|
4
4
|
*
|
|
5
5
|
* This source code is licensed under the BSD-style license found in the
|
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
8
8
|
*
|
|
9
9
|
* @providesModule LinkedStateMixin
|
|
10
|
-
* @typechecks static-only
|
|
11
10
|
*/
|
|
12
11
|
|
|
13
12
|
'use strict';
|
package/lib/LinkedValueUtils.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright 2013-
|
|
2
|
+
* Copyright 2013-present, Facebook, Inc.
|
|
3
3
|
* All rights reserved.
|
|
4
4
|
*
|
|
5
5
|
* This source code is licensed under the BSD-style license found in the
|
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
8
8
|
*
|
|
9
9
|
* @providesModule LinkedValueUtils
|
|
10
|
-
* @typechecks static-only
|
|
11
10
|
*/
|
|
12
11
|
|
|
13
12
|
'use strict';
|
|
@@ -29,16 +28,16 @@ var hasReadOnlyValue = {
|
|
|
29
28
|
};
|
|
30
29
|
|
|
31
30
|
function _assertSingleLink(inputProps) {
|
|
32
|
-
!(inputProps.checkedLink == null || inputProps.valueLink == null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Cannot provide a checkedLink and a valueLink. If you want to use ' + 'checkedLink, you probably don\'t want to use valueLink and vice versa.') : invariant(false) :
|
|
31
|
+
!(inputProps.checkedLink == null || inputProps.valueLink == null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Cannot provide a checkedLink and a valueLink. If you want to use ' + 'checkedLink, you probably don\'t want to use valueLink and vice versa.') : invariant(false) : void 0;
|
|
33
32
|
}
|
|
34
33
|
function _assertValueLink(inputProps) {
|
|
35
34
|
_assertSingleLink(inputProps);
|
|
36
|
-
!(inputProps.value == null && inputProps.onChange == null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Cannot provide a valueLink and a value or onChange event. If you want ' + 'to use value or onChange, you probably don\'t want to use valueLink.') : invariant(false) :
|
|
35
|
+
!(inputProps.value == null && inputProps.onChange == null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Cannot provide a valueLink and a value or onChange event. If you want ' + 'to use value or onChange, you probably don\'t want to use valueLink.') : invariant(false) : void 0;
|
|
37
36
|
}
|
|
38
37
|
|
|
39
38
|
function _assertCheckedLink(inputProps) {
|
|
40
39
|
_assertSingleLink(inputProps);
|
|
41
|
-
!(inputProps.checked == null && inputProps.onChange == null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Cannot provide a checkedLink and a checked property or onChange event. ' + 'If you want to use checked or onChange, you probably don\'t want to ' + 'use checkedLink') : invariant(false) :
|
|
40
|
+
!(inputProps.checked == null && inputProps.onChange == null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Cannot provide a checkedLink and a checked property or onChange event. ' + 'If you want to use checked or onChange, you probably don\'t want to ' + 'use checkedLink') : invariant(false) : void 0;
|
|
42
41
|
}
|
|
43
42
|
|
|
44
43
|
var propTypes = {
|
|
@@ -76,7 +75,7 @@ var LinkedValueUtils = {
|
|
|
76
75
|
checkPropTypes: function (tagName, props, owner) {
|
|
77
76
|
for (var propName in propTypes) {
|
|
78
77
|
if (propTypes.hasOwnProperty(propName)) {
|
|
79
|
-
var error = propTypes[propName](props, propName, tagName, ReactPropTypeLocations.prop
|
|
78
|
+
var error = propTypes[propName](props, propName, tagName, ReactPropTypeLocations.prop);
|
|
80
79
|
}
|
|
81
80
|
if (error instanceof Error && !(error.message in loggedTypeFailures)) {
|
|
82
81
|
// Only monitor this failure once because there tends to be a lot of the
|
|
@@ -84,7 +83,7 @@ var LinkedValueUtils = {
|
|
|
84
83
|
loggedTypeFailures[error.message] = true;
|
|
85
84
|
|
|
86
85
|
var addendum = getDeclarationErrorAddendum(owner);
|
|
87
|
-
process.env.NODE_ENV !== 'production' ? warning(false, 'Failed form propType: %s%s', error.message, addendum) :
|
|
86
|
+
process.env.NODE_ENV !== 'production' ? warning(false, 'Failed form propType: %s%s', error.message, addendum) : void 0;
|
|
88
87
|
}
|
|
89
88
|
}
|
|
90
89
|
},
|
package/lib/MetaMatchers.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright 2015, Facebook, Inc.
|
|
2
|
+
* Copyright 2015-present, Facebook, Inc.
|
|
3
3
|
* All rights reserved.
|
|
4
4
|
*
|
|
5
5
|
* This source code is licensed under the BSD-style license found in the
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
function getRunnerWithResults(describeFunction) {
|
|
21
21
|
if (describeFunction._cachedRunner) {
|
|
22
22
|
// Cached result of execution. This is a convenience way to test against
|
|
23
|
-
// the same
|
|
23
|
+
// the same authoritative function multiple times.
|
|
24
24
|
return describeFunction._cachedRunner;
|
|
25
25
|
}
|
|
26
26
|
// Patch the current global environment.
|
package/lib/OrderedMap.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright 2013-
|
|
2
|
+
* Copyright 2013-present, Facebook, Inc.
|
|
3
3
|
* All rights reserved.
|
|
4
4
|
*
|
|
5
5
|
* This source code is licensed under the BSD-style license found in the
|
|
@@ -11,7 +11,8 @@
|
|
|
11
11
|
|
|
12
12
|
'use strict';
|
|
13
13
|
|
|
14
|
-
var
|
|
14
|
+
var _assign = require('object-assign');
|
|
15
|
+
|
|
15
16
|
var invariant = require('fbjs/lib/invariant');
|
|
16
17
|
|
|
17
18
|
var PREFIX = 'key:';
|
|
@@ -34,7 +35,7 @@ function extractObjectFromArray(arr, keyExtractor) {
|
|
|
34
35
|
var key = keyExtractor(item);
|
|
35
36
|
assertValidPublicKey(key);
|
|
36
37
|
var normalizedKey = PREFIX + key;
|
|
37
|
-
!!(normalizedKey in normalizedObj) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'OrderedMap: IDs returned by the key extraction function must be unique.') : invariant(false) :
|
|
38
|
+
!!(normalizedKey in normalizedObj) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'OrderedMap: IDs returned by the key extraction function must be unique.') : invariant(false) : void 0;
|
|
38
39
|
normalizedObj[normalizedKey] = item;
|
|
39
40
|
}
|
|
40
41
|
return normalizedObj;
|
|
@@ -81,7 +82,7 @@ function OrderedMapImpl(normalizedObj, computedLength) {
|
|
|
81
82
|
* @throws Error if key is not appropriate for use in `OrderedMap`.
|
|
82
83
|
*/
|
|
83
84
|
function assertValidPublicKey(key) {
|
|
84
|
-
!(key !== '' && (typeof key === 'string' || typeof key === 'number')) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'OrderedMap: Key must be non-empty, non-null string or number.') : invariant(false) :
|
|
85
|
+
!(key !== '' && (typeof key === 'string' || typeof key === 'number')) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'OrderedMap: Key must be non-empty, non-null string or number.') : invariant(false) : void 0;
|
|
85
86
|
}
|
|
86
87
|
|
|
87
88
|
/**
|
|
@@ -94,7 +95,7 @@ function assertValidPublicKey(key) {
|
|
|
94
95
|
* @throws Error if range arguments are out of bounds.
|
|
95
96
|
*/
|
|
96
97
|
function assertValidRangeIndices(start, length, actualLen) {
|
|
97
|
-
!(typeof start === 'number' && typeof length === 'number' && length >= 0 && start >= 0 && start + length <= actualLen) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'OrderedMap: `mapRange` and `forEachRange` expect non-negative start and ' + 'length arguments within the bounds of the instance.') : invariant(false) :
|
|
98
|
+
!(typeof start === 'number' && typeof length === 'number' && length >= 0 && start >= 0 && start + length <= actualLen) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'OrderedMap: `mapRange` and `forEachRange` expect non-negative start and ' + 'length arguments within the bounds of the instance.') : invariant(false) : void 0;
|
|
98
99
|
}
|
|
99
100
|
|
|
100
101
|
/**
|
|
@@ -107,7 +108,7 @@ function assertValidRangeIndices(start, length, actualLen) {
|
|
|
107
108
|
*/
|
|
108
109
|
function _fromNormalizedObjects(a, b) {
|
|
109
110
|
// Second optional, both must be plain JavaScript objects.
|
|
110
|
-
!(a && a.constructor === Object && (!b || b.constructor === Object)) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'OrderedMap: Corrupted instance of OrderedMap detected.') : invariant(false) :
|
|
111
|
+
!(a && a.constructor === Object && (!b || b.constructor === Object)) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'OrderedMap: Corrupted instance of OrderedMap detected.') : invariant(false) : void 0;
|
|
111
112
|
|
|
112
113
|
var newSet = {};
|
|
113
114
|
var length = 0;
|
|
@@ -183,7 +184,7 @@ var OrderedMapMethods = {
|
|
|
183
184
|
* merge.
|
|
184
185
|
*/
|
|
185
186
|
merge: function (orderedMap) {
|
|
186
|
-
!(orderedMap instanceof OrderedMapImpl) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'OrderedMap.merge(...): Expected an OrderedMap instance.') : invariant(false) :
|
|
187
|
+
!(orderedMap instanceof OrderedMapImpl) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'OrderedMap.merge(...): Expected an OrderedMap instance.') : invariant(false) : void 0;
|
|
187
188
|
return _fromNormalizedObjects(this._normalizedObj, orderedMap._normalizedObj);
|
|
188
189
|
},
|
|
189
190
|
|
|
@@ -295,16 +296,16 @@ var OrderedMapMethods = {
|
|
|
295
296
|
mapKeyRange: function (cb, startKey, endKey, context) {
|
|
296
297
|
var startIndex = this.indexOfKey(startKey);
|
|
297
298
|
var endIndex = this.indexOfKey(endKey);
|
|
298
|
-
!(startIndex !== undefined && endIndex !== undefined) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'mapKeyRange must be given keys that are present.') : invariant(false) :
|
|
299
|
-
!(endIndex >= startIndex) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'OrderedMap.mapKeyRange(...): `endKey` must not come before `startIndex`.') : invariant(false) :
|
|
299
|
+
!(startIndex !== undefined && endIndex !== undefined) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'mapKeyRange must be given keys that are present.') : invariant(false) : void 0;
|
|
300
|
+
!(endIndex >= startIndex) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'OrderedMap.mapKeyRange(...): `endKey` must not come before `startIndex`.') : invariant(false) : void 0;
|
|
300
301
|
return this.mapRange(cb, startIndex, endIndex - startIndex + 1, context);
|
|
301
302
|
},
|
|
302
303
|
|
|
303
304
|
forEachKeyRange: function (cb, startKey, endKey, context) {
|
|
304
305
|
var startIndex = this.indexOfKey(startKey);
|
|
305
306
|
var endIndex = this.indexOfKey(endKey);
|
|
306
|
-
!(startIndex !== undefined && endIndex !== undefined) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'forEachKeyRange must be given keys that are present.') : invariant(false) :
|
|
307
|
-
!(endIndex >= startIndex) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'OrderedMap.forEachKeyRange(...): `endKey` must not come before ' + '`startIndex`.') : invariant(false) :
|
|
307
|
+
!(startIndex !== undefined && endIndex !== undefined) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'forEachKeyRange must be given keys that are present.') : invariant(false) : void 0;
|
|
308
|
+
!(endIndex >= startIndex) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'OrderedMap.forEachKeyRange(...): `endKey` must not come before ' + '`startIndex`.') : invariant(false) : void 0;
|
|
308
309
|
this.forEachRange(cb, startIndex, endIndex - startIndex + 1, context);
|
|
309
310
|
},
|
|
310
311
|
|
|
@@ -348,7 +349,7 @@ var OrderedMapMethods = {
|
|
|
348
349
|
*/
|
|
349
350
|
nthKeyAfter: function (key, n) {
|
|
350
351
|
var curIndex = this.indexOfKey(key);
|
|
351
|
-
!(curIndex !== undefined) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'OrderedMap.nthKeyAfter: The key `%s` does not exist in this instance.', key) : invariant(false) :
|
|
352
|
+
!(curIndex !== undefined) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'OrderedMap.nthKeyAfter: The key `%s` does not exist in this instance.', key) : invariant(false) : void 0;
|
|
352
353
|
return this.keyAtIndex(curIndex + n);
|
|
353
354
|
},
|
|
354
355
|
|
|
@@ -435,17 +436,17 @@ var OrderedMapMethods = {
|
|
|
435
436
|
}
|
|
436
437
|
};
|
|
437
438
|
|
|
438
|
-
|
|
439
|
+
_assign(OrderedMapImpl.prototype, OrderedMapMethods);
|
|
439
440
|
|
|
440
441
|
var OrderedMap = {
|
|
441
442
|
from: function (orderedMap) {
|
|
442
|
-
!(orderedMap instanceof OrderedMapImpl) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'OrderedMap.from(...): Expected an OrderedMap instance.') : invariant(false) :
|
|
443
|
+
!(orderedMap instanceof OrderedMapImpl) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'OrderedMap.from(...): Expected an OrderedMap instance.') : invariant(false) : void 0;
|
|
443
444
|
return _fromNormalizedObjects(orderedMap._normalizedObj, null);
|
|
444
445
|
},
|
|
445
446
|
|
|
446
447
|
fromArray: function (arr, keyExtractor) {
|
|
447
|
-
!Array.isArray(arr) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'OrderedMap.fromArray(...): First argument must be an array.') : invariant(false) :
|
|
448
|
-
!(typeof keyExtractor === 'function') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'OrderedMap.fromArray(...): Second argument must be a function used ' + 'to determine the unique key for each entry.') : invariant(false) :
|
|
448
|
+
!Array.isArray(arr) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'OrderedMap.fromArray(...): First argument must be an array.') : invariant(false) : void 0;
|
|
449
|
+
!(typeof keyExtractor === 'function') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'OrderedMap.fromArray(...): Second argument must be a function used ' + 'to determine the unique key for each entry.') : invariant(false) : void 0;
|
|
449
450
|
return new OrderedMapImpl(extractObjectFromArray(arr, keyExtractor), arr.length);
|
|
450
451
|
}
|
|
451
452
|
};
|
package/lib/PooledClass.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright 2013-
|
|
2
|
+
* Copyright 2013-present, Facebook, Inc.
|
|
3
3
|
* All rights reserved.
|
|
4
4
|
*
|
|
5
5
|
* This source code is licensed under the BSD-style license found in the
|
|
@@ -77,7 +77,7 @@ var fiveArgumentPooler = function (a1, a2, a3, a4, a5) {
|
|
|
77
77
|
|
|
78
78
|
var standardReleaser = function (instance) {
|
|
79
79
|
var Klass = this;
|
|
80
|
-
!(instance instanceof Klass) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Trying to release an instance into a pool of a different type.') : invariant(false) :
|
|
80
|
+
!(instance instanceof Klass) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Trying to release an instance into a pool of a different type.') : invariant(false) : void 0;
|
|
81
81
|
instance.destructor();
|
|
82
82
|
if (Klass.instancePool.length < Klass.poolSize) {
|
|
83
83
|
Klass.instancePool.push(instance);
|
package/lib/React.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright 2013-
|
|
2
|
+
* Copyright 2013-present, Facebook, Inc.
|
|
3
3
|
* All rights reserved.
|
|
4
4
|
*
|
|
5
5
|
* This source code is licensed under the BSD-style license found in the
|
|
@@ -11,30 +11,60 @@
|
|
|
11
11
|
|
|
12
12
|
'use strict';
|
|
13
13
|
|
|
14
|
-
var
|
|
15
|
-
var
|
|
16
|
-
var
|
|
14
|
+
var ReactChildren = require('./ReactChildren');
|
|
15
|
+
var ReactComponent = require('./ReactComponent');
|
|
16
|
+
var ReactClass = require('./ReactClass');
|
|
17
|
+
var ReactDOMFactories = require('./ReactDOMFactories');
|
|
18
|
+
var ReactElement = require('./ReactElement');
|
|
19
|
+
var ReactElementValidator = require('./ReactElementValidator');
|
|
20
|
+
var ReactPropTypes = require('./ReactPropTypes');
|
|
21
|
+
var ReactVersion = require('./ReactVersion');
|
|
17
22
|
|
|
18
|
-
var
|
|
19
|
-
var deprecated = require('./deprecated');
|
|
23
|
+
var onlyChild = require('./onlyChild');
|
|
20
24
|
|
|
21
|
-
|
|
22
|
-
var
|
|
25
|
+
var createElement = ReactElement.createElement;
|
|
26
|
+
var createFactory = ReactElement.createFactory;
|
|
27
|
+
var cloneElement = ReactElement.cloneElement;
|
|
23
28
|
|
|
24
|
-
|
|
29
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
30
|
+
createElement = ReactElementValidator.createElement;
|
|
31
|
+
createFactory = ReactElementValidator.createFactory;
|
|
32
|
+
cloneElement = ReactElementValidator.cloneElement;
|
|
33
|
+
}
|
|
25
34
|
|
|
26
|
-
|
|
27
|
-
// ReactDOM
|
|
28
|
-
findDOMNode: deprecated('findDOMNode', 'ReactDOM', 'react-dom', ReactDOM, ReactDOM.findDOMNode),
|
|
29
|
-
render: deprecated('render', 'ReactDOM', 'react-dom', ReactDOM, ReactDOM.render),
|
|
30
|
-
unmountComponentAtNode: deprecated('unmountComponentAtNode', 'ReactDOM', 'react-dom', ReactDOM, ReactDOM.unmountComponentAtNode),
|
|
35
|
+
var React = {
|
|
31
36
|
|
|
32
|
-
//
|
|
33
|
-
renderToString: deprecated('renderToString', 'ReactDOMServer', 'react-dom/server', ReactDOMServer, ReactDOMServer.renderToString),
|
|
34
|
-
renderToStaticMarkup: deprecated('renderToStaticMarkup', 'ReactDOMServer', 'react-dom/server', ReactDOMServer, ReactDOMServer.renderToStaticMarkup)
|
|
35
|
-
});
|
|
37
|
+
// Modern
|
|
36
38
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
+
Children: {
|
|
40
|
+
map: ReactChildren.map,
|
|
41
|
+
forEach: ReactChildren.forEach,
|
|
42
|
+
count: ReactChildren.count,
|
|
43
|
+
toArray: ReactChildren.toArray,
|
|
44
|
+
only: onlyChild
|
|
45
|
+
},
|
|
46
|
+
|
|
47
|
+
Component: ReactComponent,
|
|
48
|
+
|
|
49
|
+
createElement: createElement,
|
|
50
|
+
cloneElement: cloneElement,
|
|
51
|
+
isValidElement: ReactElement.isValidElement,
|
|
52
|
+
|
|
53
|
+
// Classic
|
|
54
|
+
|
|
55
|
+
PropTypes: ReactPropTypes,
|
|
56
|
+
createClass: ReactClass.createClass,
|
|
57
|
+
createFactory: createFactory,
|
|
58
|
+
createMixin: function (mixin) {
|
|
59
|
+
// Currently a noop. Will be used to validate and trace mixins.
|
|
60
|
+
return mixin;
|
|
61
|
+
},
|
|
62
|
+
|
|
63
|
+
// This looks DOM specific but these are actually isomorphic helpers
|
|
64
|
+
// since they are just generating DOM strings.
|
|
65
|
+
DOM: ReactDOMFactories,
|
|
66
|
+
|
|
67
|
+
version: ReactVersion
|
|
68
|
+
};
|
|
39
69
|
|
|
40
70
|
module.exports = React;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright 2013-
|
|
2
|
+
* Copyright 2013-present, Facebook, Inc.
|
|
3
3
|
* All rights reserved.
|
|
4
4
|
*
|
|
5
5
|
* This source code is licensed under the BSD-style license found in the
|
|
@@ -7,19 +7,18 @@
|
|
|
7
7
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
8
8
|
*
|
|
9
9
|
* @providesModule ReactBrowserEventEmitter
|
|
10
|
-
* @typechecks static-only
|
|
11
10
|
*/
|
|
12
11
|
|
|
13
12
|
'use strict';
|
|
14
13
|
|
|
14
|
+
var _assign = require('object-assign');
|
|
15
|
+
|
|
15
16
|
var EventConstants = require('./EventConstants');
|
|
16
|
-
var EventPluginHub = require('./EventPluginHub');
|
|
17
17
|
var EventPluginRegistry = require('./EventPluginRegistry');
|
|
18
18
|
var ReactEventEmitterMixin = require('./ReactEventEmitterMixin');
|
|
19
|
-
var ReactPerf = require('./ReactPerf');
|
|
20
19
|
var ViewportMetrics = require('./ViewportMetrics');
|
|
21
20
|
|
|
22
|
-
var
|
|
21
|
+
var getVendorPrefixedEventName = require('./getVendorPrefixedEventName');
|
|
23
22
|
var isEventSupported = require('./isEventSupported');
|
|
24
23
|
|
|
25
24
|
/**
|
|
@@ -77,6 +76,7 @@ var isEventSupported = require('./isEventSupported');
|
|
|
77
76
|
* React Core . General Purpose Event Plugin System
|
|
78
77
|
*/
|
|
79
78
|
|
|
79
|
+
var hasEventPageXY;
|
|
80
80
|
var alreadyListeningTo = {};
|
|
81
81
|
var isMonitoringScrollValue = false;
|
|
82
82
|
var reactTopListenersCounter = 0;
|
|
@@ -86,6 +86,9 @@ var reactTopListenersCounter = 0;
|
|
|
86
86
|
// events so we don't include them here
|
|
87
87
|
var topEventMapping = {
|
|
88
88
|
topAbort: 'abort',
|
|
89
|
+
topAnimationEnd: getVendorPrefixedEventName('animationend') || 'animationend',
|
|
90
|
+
topAnimationIteration: getVendorPrefixedEventName('animationiteration') || 'animationiteration',
|
|
91
|
+
topAnimationStart: getVendorPrefixedEventName('animationstart') || 'animationstart',
|
|
89
92
|
topBlur: 'blur',
|
|
90
93
|
topCanPlay: 'canplay',
|
|
91
94
|
topCanPlayThrough: 'canplaythrough',
|
|
@@ -142,6 +145,7 @@ var topEventMapping = {
|
|
|
142
145
|
topTouchEnd: 'touchend',
|
|
143
146
|
topTouchMove: 'touchmove',
|
|
144
147
|
topTouchStart: 'touchstart',
|
|
148
|
+
topTransitionEnd: getVendorPrefixedEventName('transitionend') || 'transitionend',
|
|
145
149
|
topVolumeChange: 'volumechange',
|
|
146
150
|
topWaiting: 'waiting',
|
|
147
151
|
topWheel: 'wheel'
|
|
@@ -166,13 +170,13 @@ function getListeningForDocument(mountAt) {
|
|
|
166
170
|
* `ReactBrowserEventEmitter` is used to attach top-level event listeners. For
|
|
167
171
|
* example:
|
|
168
172
|
*
|
|
169
|
-
*
|
|
173
|
+
* EventPluginHub.putListener('myID', 'onClick', myFunction);
|
|
170
174
|
*
|
|
171
175
|
* This would allocate a "registration" of `('onClick', myFunction)` on 'myID'.
|
|
172
176
|
*
|
|
173
177
|
* @internal
|
|
174
178
|
*/
|
|
175
|
-
var ReactBrowserEventEmitter =
|
|
179
|
+
var ReactBrowserEventEmitter = _assign({}, ReactEventEmitterMixin, {
|
|
176
180
|
|
|
177
181
|
/**
|
|
178
182
|
* Injectable event backend
|
|
@@ -290,35 +294,24 @@ var ReactBrowserEventEmitter = assign({}, ReactEventEmitterMixin, {
|
|
|
290
294
|
* Listens to window scroll and resize events. We cache scroll values so that
|
|
291
295
|
* application code can access them without triggering reflows.
|
|
292
296
|
*
|
|
297
|
+
* ViewportMetrics is only used by SyntheticMouse/TouchEvent and only when
|
|
298
|
+
* pageX/pageY isn't supported (legacy browsers).
|
|
299
|
+
*
|
|
293
300
|
* NOTE: Scroll events do not bubble.
|
|
294
301
|
*
|
|
295
302
|
* @see http://www.quirksmode.org/dom/events/scroll.html
|
|
296
303
|
*/
|
|
297
304
|
ensureScrollValueMonitoring: function () {
|
|
298
|
-
if (
|
|
305
|
+
if (hasEventPageXY === undefined) {
|
|
306
|
+
hasEventPageXY = document.createEvent && 'pageX' in document.createEvent('MouseEvent');
|
|
307
|
+
}
|
|
308
|
+
if (!hasEventPageXY && !isMonitoringScrollValue) {
|
|
299
309
|
var refresh = ViewportMetrics.refreshScrollValues;
|
|
300
310
|
ReactBrowserEventEmitter.ReactEventListener.monitorScrollValue(refresh);
|
|
301
311
|
isMonitoringScrollValue = true;
|
|
302
312
|
}
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
eventNameDispatchConfigs: EventPluginHub.eventNameDispatchConfigs,
|
|
306
|
-
|
|
307
|
-
registrationNameModules: EventPluginHub.registrationNameModules,
|
|
308
|
-
|
|
309
|
-
putListener: EventPluginHub.putListener,
|
|
310
|
-
|
|
311
|
-
getListener: EventPluginHub.getListener,
|
|
312
|
-
|
|
313
|
-
deleteListener: EventPluginHub.deleteListener,
|
|
314
|
-
|
|
315
|
-
deleteAllListeners: EventPluginHub.deleteAllListeners
|
|
316
|
-
|
|
317
|
-
});
|
|
313
|
+
}
|
|
318
314
|
|
|
319
|
-
ReactPerf.measureMethods(ReactBrowserEventEmitter, 'ReactBrowserEventEmitter', {
|
|
320
|
-
putListener: 'putListener',
|
|
321
|
-
deleteListener: 'deleteListener'
|
|
322
315
|
});
|
|
323
316
|
|
|
324
317
|
module.exports = ReactBrowserEventEmitter;
|
|
@@ -1,20 +1,19 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright 2013-
|
|
2
|
+
* Copyright 2013-present, Facebook, Inc.
|
|
3
3
|
* All rights reserved.
|
|
4
4
|
*
|
|
5
5
|
* This source code is licensed under the BSD-style license found in the
|
|
6
6
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
7
7
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
8
8
|
*
|
|
9
|
-
* @typechecks
|
|
10
9
|
* @providesModule ReactCSSTransitionGroup
|
|
11
10
|
*/
|
|
12
11
|
|
|
13
12
|
'use strict';
|
|
14
13
|
|
|
15
|
-
var
|
|
14
|
+
var _assign = require('object-assign');
|
|
16
15
|
|
|
17
|
-
var
|
|
16
|
+
var React = require('./React');
|
|
18
17
|
|
|
19
18
|
var ReactTransitionGroup = require('./ReactTransitionGroup');
|
|
20
19
|
var ReactCSSTransitionGroupChild = require('./ReactCSSTransitionGroupChild');
|
|
@@ -76,7 +75,7 @@ var ReactCSSTransitionGroup = React.createClass({
|
|
|
76
75
|
},
|
|
77
76
|
|
|
78
77
|
render: function () {
|
|
79
|
-
return React.createElement(ReactTransitionGroup,
|
|
78
|
+
return React.createElement(ReactTransitionGroup, _assign({}, this.props, { childFactory: this._wrapChild }));
|
|
80
79
|
}
|
|
81
80
|
});
|
|
82
81
|
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright 2013-
|
|
2
|
+
* Copyright 2013-present, Facebook, Inc.
|
|
3
3
|
* All rights reserved.
|
|
4
4
|
*
|
|
5
5
|
* This source code is licensed under the BSD-style license found in the
|
|
6
6
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
7
7
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
8
8
|
*
|
|
9
|
-
* @typechecks
|
|
10
9
|
* @providesModule ReactCSSTransitionGroupChild
|
|
11
10
|
*/
|
|
12
11
|
|
|
@@ -20,10 +19,6 @@ var ReactTransitionEvents = require('./ReactTransitionEvents');
|
|
|
20
19
|
|
|
21
20
|
var onlyChild = require('./onlyChild');
|
|
22
21
|
|
|
23
|
-
// We don't remove the element from the DOM until we receive an animationend or
|
|
24
|
-
// transitionend event. If the user screws up and forgets to add an animation
|
|
25
|
-
// their node will be stuck in the DOM forever, so we detect if an animation
|
|
26
|
-
// does not start and if it doesn't, we just call the end listener immediately.
|
|
27
22
|
var TICK = 17;
|
|
28
23
|
|
|
29
24
|
var ReactCSSTransitionGroupChild = React.createClass({
|