react 0.12.2 → 0.13.0-beta.2
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/dist/JSXTransformer.js +986 -511
- package/dist/react-with-addons.js +6076 -4560
- package/dist/react-with-addons.min.js +6 -7
- package/dist/react.js +5386 -4170
- package/dist/react.min.js +6 -7
- package/lib/AutoFocusMixin.js +2 -2
- package/lib/BeforeInputEventPlugin.js +388 -115
- package/lib/CSSCore.js +1 -1
- package/lib/CSSProperty.js +2 -2
- package/lib/CSSPropertyOperations.js +58 -11
- package/lib/CallbackQueue.js +3 -3
- package/lib/ChangeEventPlugin.js +4 -4
- package/lib/ClientReactRootIndex.js +2 -2
- package/lib/DOMChildrenOperations.js +10 -47
- package/lib/DOMProperty.js +2 -2
- package/lib/DOMPropertyOperations.js +11 -16
- package/lib/Danger.js +8 -7
- package/lib/DefaultEventPluginOrder.js +3 -4
- package/lib/EnterLeaveEventPlugin.js +2 -2
- package/lib/EventConstants.js +2 -2
- package/lib/EventListener.js +1 -1
- package/lib/EventPluginHub.js +10 -8
- package/lib/EventPluginRegistry.js +2 -2
- package/lib/EventPluginUtils.js +4 -4
- package/lib/EventPropagators.js +2 -2
- package/lib/ExecutionEnvironment.js +3 -4
- package/lib/FallbackCompositionState.js +89 -0
- package/lib/HTMLDOMPropertyConfig.js +23 -10
- package/lib/LinkedStateMixin.js +2 -2
- package/lib/LinkedValueUtils.js +4 -4
- package/lib/LocalEventTrapMixin.js +10 -3
- package/lib/MobileSafariClickEventPlugin.js +2 -2
- package/lib/Object.assign.js +4 -2
- package/lib/PooledClass.js +2 -2
- package/lib/React.js +19 -58
- package/lib/ReactBrowserComponentMixin.js +4 -14
- package/lib/ReactBrowserEventEmitter.js +6 -8
- package/lib/ReactCSSTransitionGroup.js +5 -2
- package/lib/ReactCSSTransitionGroupChild.js +20 -7
- package/lib/ReactChildReconciler.js +125 -0
- package/lib/ReactChildren.js +13 -10
- package/lib/ReactClass.js +918 -0
- package/lib/ReactComponent.js +98 -406
- package/lib/ReactComponentBrowserEnvironment.js +11 -84
- package/lib/ReactComponentEnvironment.js +57 -0
- package/lib/ReactComponentWithPureRenderMixin.js +2 -2
- package/lib/ReactCompositeComponent.js +574 -1140
- package/lib/ReactContext.js +17 -3
- package/lib/ReactCurrentOwner.js +2 -2
- package/lib/ReactDOM.js +4 -9
- package/lib/ReactDOMButton.js +6 -7
- package/lib/ReactDOMComponent.js +123 -105
- package/lib/ReactDOMForm.js +6 -7
- package/lib/ReactDOMIDOperations.js +59 -77
- package/lib/ReactDOMIframe.js +43 -0
- package/lib/ReactDOMImg.js +5 -7
- package/lib/ReactDOMInput.js +6 -7
- package/lib/ReactDOMOption.js +6 -7
- package/lib/ReactDOMSelect.js +58 -66
- package/lib/ReactDOMSelection.js +7 -3
- package/lib/{ReactTextComponent.js → ReactDOMTextComponent.js} +48 -37
- package/lib/ReactDOMTextarea.js +6 -7
- package/lib/ReactDefaultBatchingStrategy.js +5 -5
- package/lib/ReactDefaultInjection.js +39 -9
- package/lib/ReactDefaultPerf.js +17 -8
- package/lib/ReactDefaultPerfAnalysis.js +2 -2
- package/lib/ReactElement.js +23 -15
- package/lib/ReactElementValidator.js +206 -89
- package/lib/ReactEmptyComponent.js +33 -15
- package/lib/ReactErrorUtils.js +1 -1
- package/lib/ReactEventEmitterMixin.js +2 -2
- package/lib/ReactEventListener.js +4 -5
- package/lib/ReactFragment.js +172 -0
- package/lib/ReactInjection.js +8 -6
- package/lib/ReactInputSelection.js +4 -5
- package/lib/ReactInstanceHandles.js +4 -3
- package/lib/ReactInstanceMap.js +47 -0
- package/lib/ReactLifeCycle.js +35 -0
- package/lib/ReactLink.js +2 -2
- package/lib/ReactMarkupChecksum.js +2 -2
- package/lib/ReactMount.js +264 -71
- package/lib/ReactMultiChild.js +50 -48
- package/lib/ReactMultiChildUpdateTypes.js +2 -2
- package/lib/ReactNativeComponent.js +59 -25
- package/lib/ReactOwner.js +5 -49
- package/lib/ReactPerf.js +22 -2
- package/lib/ReactPropTransferer.js +3 -58
- package/lib/ReactPropTypeLocationNames.js +2 -2
- package/lib/ReactPropTypeLocations.js +2 -2
- package/lib/ReactPropTypes.js +17 -25
- package/lib/ReactPutListenerQueue.js +2 -2
- package/lib/ReactReconcileTransaction.js +2 -2
- package/lib/ReactReconciler.js +121 -0
- package/lib/ReactRef.js +69 -0
- package/lib/ReactRootIndex.js +2 -2
- package/lib/ReactServerRendering.js +6 -4
- package/lib/ReactServerRenderingTransaction.js +2 -2
- package/lib/ReactStateSetters.js +2 -2
- package/lib/ReactTestUtils.js +113 -27
- package/lib/ReactTransitionChildMapping.js +8 -4
- package/lib/ReactTransitionEvents.js +2 -2
- package/lib/ReactTransitionGroup.js +53 -12
- package/lib/ReactUpdateQueue.js +295 -0
- package/lib/ReactUpdates.js +54 -62
- package/lib/ReactWithAddons.js +4 -2
- package/lib/SVGDOMPropertyConfig.js +2 -2
- package/lib/SelectEventPlugin.js +4 -4
- package/lib/ServerReactRootIndex.js +2 -2
- package/lib/SimpleEventPlugin.js +4 -4
- package/lib/SyntheticClipboardEvent.js +2 -3
- package/lib/SyntheticCompositionEvent.js +2 -3
- package/lib/SyntheticDragEvent.js +2 -2
- package/lib/SyntheticEvent.js +12 -4
- package/lib/SyntheticFocusEvent.js +2 -2
- package/lib/SyntheticInputEvent.js +2 -3
- package/lib/SyntheticKeyboardEvent.js +2 -2
- package/lib/SyntheticMouseEvent.js +3 -5
- package/lib/SyntheticTouchEvent.js +2 -2
- package/lib/SyntheticUIEvent.js +2 -2
- package/lib/SyntheticWheelEvent.js +2 -2
- package/lib/Transaction.js +4 -4
- package/lib/ViewportMetrics.js +3 -6
- package/lib/accumulateInto.js +2 -2
- package/lib/adler32.js +2 -2
- package/lib/camelize.js +1 -1
- package/lib/camelizeStyleName.js +1 -1
- package/lib/cloneWithProps.js +4 -4
- package/lib/containsNode.js +1 -1
- package/lib/{createArrayFrom.js → createArrayFromMixed.js} +6 -6
- package/lib/createFullPageComponent.js +4 -4
- package/lib/createNodesFromMarkup.js +4 -4
- package/lib/cx.js +1 -1
- package/lib/dangerousStyleValue.js +2 -2
- package/lib/emptyFunction.js +1 -1
- package/lib/emptyObject.js +1 -1
- package/lib/{escapeTextForBrowser.js → escapeTextContentForBrowser.js} +10 -11
- package/lib/findDOMNode.js +51 -0
- package/lib/flattenChildren.js +12 -23
- package/lib/focusNode.js +1 -1
- package/lib/forEachAccumulated.js +2 -2
- package/lib/getActiveElement.js +1 -1
- package/lib/getEventCharCode.js +2 -2
- package/lib/getEventKey.js +2 -2
- package/lib/getEventModifierState.js +2 -2
- package/lib/getEventTarget.js +2 -2
- package/lib/getIteratorFn.js +42 -0
- package/lib/getMarkupWrap.js +1 -1
- package/lib/getNodeForCharacterOffset.js +3 -3
- package/lib/getReactRootElementInContainer.js +2 -2
- package/lib/getTextContentAccessor.js +2 -2
- package/lib/getUnboundedScrollPosition.js +1 -1
- package/lib/hyphenate.js +1 -1
- package/lib/hyphenateStyleName.js +1 -1
- package/lib/instantiateReactComponent.js +90 -68
- package/lib/invariant.js +1 -1
- package/lib/isEventSupported.js +2 -2
- package/lib/isNode.js +4 -5
- package/lib/isTextInputElement.js +3 -4
- package/lib/isTextNode.js +1 -1
- package/lib/joinClasses.js +2 -2
- package/lib/keyMirror.js +2 -2
- package/lib/keyOf.js +1 -1
- package/lib/mapObject.js +1 -1
- package/lib/memoizeStringOnly.js +5 -6
- package/lib/onlyChild.js +2 -2
- package/lib/performance.js +1 -1
- package/lib/performanceNow.js +1 -1
- package/lib/quoteAttributeValueForBrowser.js +26 -0
- package/lib/setInnerHTML.js +13 -2
- package/lib/setTextContent.js +40 -0
- package/lib/shallowEqual.js +2 -2
- package/lib/shouldUpdateReactComponent.js +71 -7
- package/lib/toArray.js +2 -2
- package/lib/traverseAllChildren.js +114 -56
- package/lib/update.js +2 -2
- package/lib/warning.js +20 -2
- package/package.json +1 -1
- package/lib/CompositionEventPlugin.js +0 -257
- package/lib/ReactLegacyElement.js +0 -243
- package/lib/copyProperties.js +0 -54
- package/lib/deprecated.js +0 -47
- package/lib/merge.js +0 -34
- package/lib/mergeInto.js +0 -24
- package/lib/monitorCodeUse.js +0 -30
package/lib/cloneWithProps.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright 2013-
|
|
2
|
+
* Copyright 2013-2015, Facebook, Inc.
|
|
3
3
|
* All rights reserved.
|
|
4
4
|
*
|
|
5
5
|
* This source code is licensed under the BSD-style license found in the
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* @providesModule cloneWithProps
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
'use strict';
|
|
14
14
|
|
|
15
15
|
var ReactElement = require("./ReactElement");
|
|
16
16
|
var ReactPropTransferer = require("./ReactPropTransferer");
|
|
@@ -25,8 +25,8 @@ var CHILDREN_PROP = keyOf({children: null});
|
|
|
25
25
|
* this is to add a CSS class.
|
|
26
26
|
*
|
|
27
27
|
* @param {object} child child component you'd like to clone
|
|
28
|
-
* @param {object} props props you'd like to modify.
|
|
29
|
-
*
|
|
28
|
+
* @param {object} props props you'd like to modify. className and style will be
|
|
29
|
+
* merged automatically.
|
|
30
30
|
* @return {object} a clone of child with props merged in.
|
|
31
31
|
*/
|
|
32
32
|
function cloneWithProps(child, props) {
|
package/lib/containsNode.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright 2013-
|
|
2
|
+
* Copyright 2013-2015, 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
|
-
* @providesModule
|
|
9
|
+
* @providesModule createArrayFromMixed
|
|
10
10
|
* @typechecks
|
|
11
11
|
*/
|
|
12
12
|
|
|
@@ -56,10 +56,10 @@ function hasArrayNature(obj) {
|
|
|
56
56
|
*
|
|
57
57
|
* This is mostly useful idiomatically:
|
|
58
58
|
*
|
|
59
|
-
* var
|
|
59
|
+
* var createArrayFromMixed = require('createArrayFromMixed');
|
|
60
60
|
*
|
|
61
61
|
* function takesOneOrMoreThings(things) {
|
|
62
|
-
* things =
|
|
62
|
+
* things = createArrayFromMixed(things);
|
|
63
63
|
* ...
|
|
64
64
|
* }
|
|
65
65
|
*
|
|
@@ -71,7 +71,7 @@ function hasArrayNature(obj) {
|
|
|
71
71
|
* @param {*} obj
|
|
72
72
|
* @return {array}
|
|
73
73
|
*/
|
|
74
|
-
function
|
|
74
|
+
function createArrayFromMixed(obj) {
|
|
75
75
|
if (!hasArrayNature(obj)) {
|
|
76
76
|
return [obj];
|
|
77
77
|
} else if (Array.isArray(obj)) {
|
|
@@ -81,4 +81,4 @@ function createArrayFrom(obj) {
|
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
83
|
|
|
84
|
-
module.exports =
|
|
84
|
+
module.exports = createArrayFromMixed;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright 2013-
|
|
2
|
+
* Copyright 2013-2015, Facebook, Inc.
|
|
3
3
|
* All rights reserved.
|
|
4
4
|
*
|
|
5
5
|
* This source code is licensed under the BSD-style license found in the
|
|
@@ -10,10 +10,10 @@
|
|
|
10
10
|
* @typechecks
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
'use strict';
|
|
14
14
|
|
|
15
15
|
// Defeat circular references by requiring this directly.
|
|
16
|
-
var
|
|
16
|
+
var ReactClass = require("./ReactClass");
|
|
17
17
|
var ReactElement = require("./ReactElement");
|
|
18
18
|
|
|
19
19
|
var invariant = require("./invariant");
|
|
@@ -32,7 +32,7 @@ var invariant = require("./invariant");
|
|
|
32
32
|
function createFullPageComponent(tag) {
|
|
33
33
|
var elementFactory = ReactElement.createFactory(tag);
|
|
34
34
|
|
|
35
|
-
var FullPageComponent =
|
|
35
|
+
var FullPageComponent = ReactClass.createClass({
|
|
36
36
|
displayName: 'ReactFullPageComponent' + tag,
|
|
37
37
|
|
|
38
38
|
componentWillUnmount: function() {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright 2013-
|
|
2
|
+
* Copyright 2013-2015, Facebook, Inc.
|
|
3
3
|
* All rights reserved.
|
|
4
4
|
*
|
|
5
5
|
* This source code is licensed under the BSD-style license found in the
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
|
|
15
15
|
var ExecutionEnvironment = require("./ExecutionEnvironment");
|
|
16
16
|
|
|
17
|
-
var
|
|
17
|
+
var createArrayFromMixed = require("./createArrayFromMixed");
|
|
18
18
|
var getMarkupWrap = require("./getMarkupWrap");
|
|
19
19
|
var invariant = require("./invariant");
|
|
20
20
|
|
|
@@ -73,10 +73,10 @@ function createNodesFromMarkup(markup, handleScript) {
|
|
|
73
73
|
handleScript,
|
|
74
74
|
'createNodesFromMarkup(...): Unexpected <script> element rendered.'
|
|
75
75
|
) : invariant(handleScript));
|
|
76
|
-
|
|
76
|
+
createArrayFromMixed(scripts).forEach(handleScript);
|
|
77
77
|
}
|
|
78
78
|
|
|
79
|
-
var nodes =
|
|
79
|
+
var nodes = createArrayFromMixed(node.childNodes);
|
|
80
80
|
while (node.lastChild) {
|
|
81
81
|
node.removeChild(node.lastChild);
|
|
82
82
|
}
|
package/lib/cx.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright 2013-
|
|
2
|
+
* Copyright 2013-2015, Facebook, Inc.
|
|
3
3
|
* All rights reserved.
|
|
4
4
|
*
|
|
5
5
|
* This source code is licensed under the BSD-style license found in the
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* @typechecks static-only
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
'use strict';
|
|
14
14
|
|
|
15
15
|
var CSSProperty = require("./CSSProperty");
|
|
16
16
|
|
package/lib/emptyFunction.js
CHANGED
package/lib/emptyObject.js
CHANGED
|
@@ -1,23 +1,22 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright 2013-
|
|
2
|
+
* Copyright 2013-2015, 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
|
-
* @providesModule
|
|
10
|
-
* @typechecks static-only
|
|
9
|
+
* @providesModule escapeTextContentForBrowser
|
|
11
10
|
*/
|
|
12
11
|
|
|
13
|
-
|
|
12
|
+
'use strict';
|
|
14
13
|
|
|
15
14
|
var ESCAPE_LOOKUP = {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
"
|
|
20
|
-
|
|
15
|
+
'&': '&',
|
|
16
|
+
'>': '>',
|
|
17
|
+
'<': '<',
|
|
18
|
+
'"': '"',
|
|
19
|
+
'\'': '''
|
|
21
20
|
};
|
|
22
21
|
|
|
23
22
|
var ESCAPE_REGEX = /[&><"']/g;
|
|
@@ -32,8 +31,8 @@ function escaper(match) {
|
|
|
32
31
|
* @param {*} text Text value to escape.
|
|
33
32
|
* @return {string} An escaped string.
|
|
34
33
|
*/
|
|
35
|
-
function
|
|
34
|
+
function escapeTextContentForBrowser(text) {
|
|
36
35
|
return ('' + text).replace(ESCAPE_REGEX, escaper);
|
|
37
36
|
}
|
|
38
37
|
|
|
39
|
-
module.exports =
|
|
38
|
+
module.exports = escapeTextContentForBrowser;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2013-2015, Facebook, Inc.
|
|
3
|
+
* All rights reserved.
|
|
4
|
+
*
|
|
5
|
+
* This source code is licensed under the BSD-style license found in the
|
|
6
|
+
* LICENSE file in the root directory of this source tree. An additional grant
|
|
7
|
+
* of patent rights can be found in the PATENTS file in the same directory.
|
|
8
|
+
*
|
|
9
|
+
* @providesModule findDOMNode
|
|
10
|
+
* @typechecks static-only
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
'use strict';
|
|
14
|
+
var ReactInstanceMap = require("./ReactInstanceMap");
|
|
15
|
+
var ReactMount = require("./ReactMount");
|
|
16
|
+
|
|
17
|
+
var invariant = require("./invariant");
|
|
18
|
+
var isNode = require("./isNode");
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Returns the DOM node rendered by this element.
|
|
22
|
+
*
|
|
23
|
+
* @param {ReactComponent|DOMElement} componentOrElement
|
|
24
|
+
* @return {DOMElement} The root node of this element.
|
|
25
|
+
*/
|
|
26
|
+
function findDOMNode(componentOrElement) {
|
|
27
|
+
if (componentOrElement == null) {
|
|
28
|
+
return null;
|
|
29
|
+
}
|
|
30
|
+
if (isNode(componentOrElement)) {
|
|
31
|
+
return componentOrElement;
|
|
32
|
+
}
|
|
33
|
+
if (ReactInstanceMap.has(componentOrElement)) {
|
|
34
|
+
return ReactMount.getNodeFromInstance(componentOrElement);
|
|
35
|
+
}
|
|
36
|
+
("production" !== process.env.NODE_ENV ? invariant(
|
|
37
|
+
componentOrElement.render == null ||
|
|
38
|
+
typeof componentOrElement.render !== 'function',
|
|
39
|
+
'Component (with keys: %s) contains `render` method ' +
|
|
40
|
+
'but is not mounted in the DOM',
|
|
41
|
+
Object.keys(componentOrElement)
|
|
42
|
+
) : invariant(componentOrElement.render == null ||
|
|
43
|
+
typeof componentOrElement.render !== 'function'));
|
|
44
|
+
("production" !== process.env.NODE_ENV ? invariant(
|
|
45
|
+
false,
|
|
46
|
+
'Element appears to be neither ReactComponent nor DOMNode (keys: %s)',
|
|
47
|
+
Object.keys(componentOrElement)
|
|
48
|
+
) : invariant(false));
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
module.exports = findDOMNode;
|
package/lib/flattenChildren.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright 2013-
|
|
2
|
+
* Copyright 2013-2015, Facebook, Inc.
|
|
3
3
|
* All rights reserved.
|
|
4
4
|
*
|
|
5
5
|
* This source code is licensed under the BSD-style license found in the
|
|
@@ -9,9 +9,7 @@
|
|
|
9
9
|
* @providesModule flattenChildren
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
var ReactTextComponent = require("./ReactTextComponent");
|
|
12
|
+
'use strict';
|
|
15
13
|
|
|
16
14
|
var traverseAllChildren = require("./traverseAllChildren");
|
|
17
15
|
var warning = require("./warning");
|
|
@@ -25,26 +23,17 @@ function flattenSingleChildIntoContext(traverseContext, child, name) {
|
|
|
25
23
|
// We found a component instance.
|
|
26
24
|
var result = traverseContext;
|
|
27
25
|
var keyUnique = !result.hasOwnProperty(name);
|
|
28
|
-
("production" !== process.env.NODE_ENV
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
26
|
+
if ("production" !== process.env.NODE_ENV) {
|
|
27
|
+
("production" !== process.env.NODE_ENV ? warning(
|
|
28
|
+
keyUnique,
|
|
29
|
+
'flattenChildren(...): Encountered two children with the same key, ' +
|
|
30
|
+
'`%s`. Child keys must be unique; when two children share a key, only ' +
|
|
31
|
+
'the first child will be used.',
|
|
32
|
+
name
|
|
33
|
+
) : null);
|
|
34
|
+
}
|
|
35
35
|
if (keyUnique && child != null) {
|
|
36
|
-
|
|
37
|
-
var normalizedValue;
|
|
38
|
-
|
|
39
|
-
if (type === 'string') {
|
|
40
|
-
normalizedValue = ReactTextComponent(child);
|
|
41
|
-
} else if (type === 'number') {
|
|
42
|
-
normalizedValue = ReactTextComponent('' + child);
|
|
43
|
-
} else {
|
|
44
|
-
normalizedValue = child;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
result[name] = normalizedValue;
|
|
36
|
+
result[name] = child;
|
|
48
37
|
}
|
|
49
38
|
}
|
|
50
39
|
|
package/lib/focusNode.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright 2013-
|
|
2
|
+
* Copyright 2013-2015, Facebook, Inc.
|
|
3
3
|
* All rights reserved.
|
|
4
4
|
*
|
|
5
5
|
* This source code is licensed under the BSD-style license found in the
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* @providesModule forEachAccumulated
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
'use strict';
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
15
|
* @param {array} an "accumulation" of items which is either an Array or
|
package/lib/getActiveElement.js
CHANGED
package/lib/getEventCharCode.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright 2013-
|
|
2
|
+
* Copyright 2013-2015, Facebook, Inc.
|
|
3
3
|
* All rights reserved.
|
|
4
4
|
*
|
|
5
5
|
* This source code is licensed under the BSD-style license found in the
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* @typechecks static-only
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
'use strict';
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
16
|
* `charCode` represents the actual "character code" and is safe to use with
|
package/lib/getEventKey.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright 2013-
|
|
2
|
+
* Copyright 2013-2015, Facebook, Inc.
|
|
3
3
|
* All rights reserved.
|
|
4
4
|
*
|
|
5
5
|
* This source code is licensed under the BSD-style license found in the
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* @typechecks static-only
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
'use strict';
|
|
14
14
|
|
|
15
15
|
var getEventCharCode = require("./getEventCharCode");
|
|
16
16
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright 2013 Facebook, Inc.
|
|
2
|
+
* Copyright 2013-2015, Facebook, Inc.
|
|
3
3
|
* All rights reserved.
|
|
4
4
|
*
|
|
5
5
|
* This source code is licensed under the BSD-style license found in the
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* @typechecks static-only
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
'use strict';
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
16
|
* Translation from modifier key to the associated property in the event.
|
package/lib/getEventTarget.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright 2013-
|
|
2
|
+
* Copyright 2013-2015, Facebook, Inc.
|
|
3
3
|
* All rights reserved.
|
|
4
4
|
*
|
|
5
5
|
* This source code is licensed under the BSD-style license found in the
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* @typechecks static-only
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
'use strict';
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
16
|
* Gets the target node from a native browser event by accounting for
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2013-2015, Facebook, Inc.
|
|
3
|
+
* All rights reserved.
|
|
4
|
+
*
|
|
5
|
+
* This source code is licensed under the BSD-style license found in the
|
|
6
|
+
* LICENSE file in the root directory of this source tree. An additional grant
|
|
7
|
+
* of patent rights can be found in the PATENTS file in the same directory.
|
|
8
|
+
*
|
|
9
|
+
* @providesModule getIteratorFn
|
|
10
|
+
* @typechecks static-only
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
'use strict';
|
|
14
|
+
|
|
15
|
+
/* global Symbol */
|
|
16
|
+
var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
|
|
17
|
+
var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Returns the iterator method function contained on the iterable object.
|
|
21
|
+
*
|
|
22
|
+
* Be sure to invoke the function with the iterable as context:
|
|
23
|
+
*
|
|
24
|
+
* var iteratorFn = getIteratorFn(myIterable);
|
|
25
|
+
* if (iteratorFn) {
|
|
26
|
+
* var iterator = iteratorFn.call(myIterable);
|
|
27
|
+
* ...
|
|
28
|
+
* }
|
|
29
|
+
*
|
|
30
|
+
* @param {?object} maybeIterable
|
|
31
|
+
* @return {?function}
|
|
32
|
+
*/
|
|
33
|
+
function getIteratorFn(maybeIterable) {
|
|
34
|
+
var iteratorFn = maybeIterable && (
|
|
35
|
+
(ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL])
|
|
36
|
+
);
|
|
37
|
+
if (typeof iteratorFn === 'function') {
|
|
38
|
+
return iteratorFn;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
module.exports = getIteratorFn;
|