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/getMarkupWrap.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 getNodeForCharacterOffset
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
'use strict';
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
15
|
* Given any node return the first leaf node without children.
|
|
@@ -53,7 +53,7 @@ function getNodeForCharacterOffset(root, offset) {
|
|
|
53
53
|
var nodeEnd = 0;
|
|
54
54
|
|
|
55
55
|
while (node) {
|
|
56
|
-
if (node.nodeType
|
|
56
|
+
if (node.nodeType === 3) {
|
|
57
57
|
nodeEnd = nodeStart + node.textContent.length;
|
|
58
58
|
|
|
59
59
|
if (nodeStart <= offset && nodeEnd >= offset) {
|
|
@@ -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 getReactRootElementInContainer
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
'use strict';
|
|
13
13
|
|
|
14
14
|
var DOC_NODE_TYPE = 9;
|
|
15
15
|
|
|
@@ -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 getTextContentAccessor
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
'use strict';
|
|
13
13
|
|
|
14
14
|
var ExecutionEnvironment = require("./ExecutionEnvironment");
|
|
15
15
|
|
package/lib/hyphenate.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,99 +10,121 @@
|
|
|
10
10
|
* @typechecks static-only
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
'use strict';
|
|
14
14
|
|
|
15
|
+
var ReactCompositeComponent = require("./ReactCompositeComponent");
|
|
16
|
+
var ReactEmptyComponent = require("./ReactEmptyComponent");
|
|
17
|
+
var ReactNativeComponent = require("./ReactNativeComponent");
|
|
18
|
+
|
|
19
|
+
var assign = require("./Object.assign");
|
|
20
|
+
var invariant = require("./invariant");
|
|
15
21
|
var warning = require("./warning");
|
|
16
22
|
|
|
17
|
-
|
|
18
|
-
var
|
|
19
|
-
|
|
20
|
-
|
|
23
|
+
// To avoid a cyclic dependency, we create the final class in this module
|
|
24
|
+
var ReactCompositeComponentWrapper = function() { };
|
|
25
|
+
assign(
|
|
26
|
+
ReactCompositeComponentWrapper.prototype,
|
|
27
|
+
ReactCompositeComponent.Mixin,
|
|
28
|
+
{
|
|
29
|
+
_instantiateReactComponent: instantiateReactComponent
|
|
30
|
+
}
|
|
31
|
+
);
|
|
21
32
|
|
|
22
33
|
/**
|
|
23
|
-
*
|
|
34
|
+
* Check if the type reference is a known internal type. I.e. not a user
|
|
35
|
+
* provided composite type.
|
|
24
36
|
*
|
|
25
|
-
* @param {
|
|
37
|
+
* @param {function} type
|
|
38
|
+
* @return {boolean} Returns true if this is a valid internal type.
|
|
39
|
+
*/
|
|
40
|
+
function isInternalComponentType(type) {
|
|
41
|
+
return (
|
|
42
|
+
typeof type === 'function' &&
|
|
43
|
+
typeof type.prototype.mountComponent === 'function' &&
|
|
44
|
+
typeof type.prototype.receiveComponent === 'function'
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Given a ReactNode, create an instance that will actually be mounted.
|
|
50
|
+
*
|
|
51
|
+
* @param {ReactNode} node
|
|
26
52
|
* @param {*} parentCompositeType The composite type that resolved this.
|
|
27
53
|
* @return {object} A new instance of the element's constructor.
|
|
28
54
|
* @protected
|
|
29
55
|
*/
|
|
30
|
-
function instantiateReactComponent(
|
|
56
|
+
function instantiateReactComponent(node, parentCompositeType) {
|
|
31
57
|
var instance;
|
|
32
58
|
|
|
33
|
-
if (
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
typeof element.type === 'string'),
|
|
37
|
-
'Only functions or strings can be mounted as React components.'
|
|
38
|
-
) : null);
|
|
59
|
+
if (node === null || node === false) {
|
|
60
|
+
node = ReactEmptyComponent.emptyElement;
|
|
61
|
+
}
|
|
39
62
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
instance = new element.type._mockedReactClassConstructor(
|
|
49
|
-
element.props
|
|
50
|
-
);
|
|
51
|
-
} finally {
|
|
52
|
-
ReactLegacyElement._isLegacyCallWarningEnabled = true;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
// If the mock implementation was a legacy factory, then it returns a
|
|
56
|
-
// element. We need to turn this into a real component instance.
|
|
57
|
-
if (ReactElement.isValidElement(instance)) {
|
|
58
|
-
instance = new instance.type(instance.props);
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
var render = instance.render;
|
|
62
|
-
if (!render) {
|
|
63
|
-
// For auto-mocked factories, the prototype isn't shimmed and therefore
|
|
64
|
-
// there is no render function on the instance. We replace the whole
|
|
65
|
-
// component with an empty component instance instead.
|
|
66
|
-
element = ReactEmptyComponent.getEmptyComponent();
|
|
67
|
-
} else {
|
|
68
|
-
if (render._isMockFunction && !render._getMockImplementation()) {
|
|
69
|
-
// Auto-mocked components may have a prototype with a mocked render
|
|
70
|
-
// function. For those, we'll need to mock the result of the render
|
|
71
|
-
// since we consider undefined to be invalid results from render.
|
|
72
|
-
render.mockImplementation(
|
|
73
|
-
ReactEmptyComponent.getEmptyComponent
|
|
74
|
-
);
|
|
75
|
-
}
|
|
76
|
-
instance.construct(element);
|
|
77
|
-
return instance;
|
|
78
|
-
}
|
|
63
|
+
if (typeof node === 'object') {
|
|
64
|
+
var element = node;
|
|
65
|
+
if ("production" !== process.env.NODE_ENV) {
|
|
66
|
+
("production" !== process.env.NODE_ENV ? warning(
|
|
67
|
+
element && (typeof element.type === 'function' ||
|
|
68
|
+
typeof element.type === 'string'),
|
|
69
|
+
'Only functions or strings can be mounted as React components.'
|
|
70
|
+
) : null);
|
|
79
71
|
}
|
|
80
|
-
}
|
|
81
72
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
element
|
|
87
|
-
|
|
88
|
-
|
|
73
|
+
// Special case string values
|
|
74
|
+
if (parentCompositeType === element.type &&
|
|
75
|
+
typeof element.type === 'string') {
|
|
76
|
+
// Avoid recursion if the wrapper renders itself.
|
|
77
|
+
instance = ReactNativeComponent.createInternalComponent(element);
|
|
78
|
+
// All native components are currently wrapped in a composite so we're
|
|
79
|
+
// safe to assume that this is what we should instantiate.
|
|
80
|
+
} else if (isInternalComponentType(element.type)) {
|
|
81
|
+
// This is temporarily available for custom components that are not string
|
|
82
|
+
// represenations. I.e. ART. Once those are updated to use the string
|
|
83
|
+
// representation, we can drop this code path.
|
|
84
|
+
instance = new element.type(element);
|
|
85
|
+
} else {
|
|
86
|
+
instance = new ReactCompositeComponentWrapper();
|
|
87
|
+
}
|
|
88
|
+
} else if (typeof node === 'string' || typeof node === 'number') {
|
|
89
|
+
instance = ReactNativeComponent.createInstanceForText(node);
|
|
89
90
|
} else {
|
|
90
|
-
|
|
91
|
-
|
|
91
|
+
("production" !== process.env.NODE_ENV ? invariant(
|
|
92
|
+
false,
|
|
93
|
+
'Encountered invalid React node of type %s',
|
|
94
|
+
typeof node
|
|
95
|
+
) : invariant(false));
|
|
92
96
|
}
|
|
93
97
|
|
|
94
98
|
if ("production" !== process.env.NODE_ENV) {
|
|
95
99
|
("production" !== process.env.NODE_ENV ? warning(
|
|
96
100
|
typeof instance.construct === 'function' &&
|
|
97
101
|
typeof instance.mountComponent === 'function' &&
|
|
98
|
-
typeof instance.receiveComponent === 'function'
|
|
102
|
+
typeof instance.receiveComponent === 'function' &&
|
|
103
|
+
typeof instance.unmountComponent === 'function',
|
|
99
104
|
'Only React Components can be mounted.'
|
|
100
105
|
) : null);
|
|
101
106
|
}
|
|
102
107
|
|
|
103
|
-
//
|
|
104
|
-
|
|
105
|
-
|
|
108
|
+
// Sets up the instance. This can probably just move into the constructor now.
|
|
109
|
+
instance.construct(node);
|
|
110
|
+
|
|
111
|
+
// These two fields are used by the DOM and ART diffing algorithms
|
|
112
|
+
// respectively. Instead of using expandos on components, we should be
|
|
113
|
+
// storing the state needed by the diffing algorithms elsewhere.
|
|
114
|
+
instance._mountIndex = 0;
|
|
115
|
+
instance._mountImage = null;
|
|
116
|
+
|
|
117
|
+
if ("production" !== process.env.NODE_ENV) {
|
|
118
|
+
instance._isOwnerNecessary = false;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
// Internal instances should fully constructed at this point, so they should
|
|
122
|
+
// not get any new fields added to them at this point.
|
|
123
|
+
if ("production" !== process.env.NODE_ENV) {
|
|
124
|
+
if (Object.preventExtensions) {
|
|
125
|
+
Object.preventExtensions(instance);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
106
128
|
|
|
107
129
|
return instance;
|
|
108
130
|
}
|
package/lib/invariant.js
CHANGED
package/lib/isEventSupported.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 isEventSupported
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
'use strict';
|
|
13
13
|
|
|
14
14
|
var ExecutionEnvironment = require("./ExecutionEnvironment");
|
|
15
15
|
|
package/lib/isNode.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
|
|
@@ -16,10 +16,9 @@
|
|
|
16
16
|
*/
|
|
17
17
|
function isNode(object) {
|
|
18
18
|
return !!(object && (
|
|
19
|
-
typeof Node === 'function' ? object instanceof Node :
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
typeof object.nodeName === 'string'
|
|
19
|
+
((typeof Node === 'function' ? object instanceof Node : typeof object === 'object' &&
|
|
20
|
+
typeof object.nodeType === 'number' &&
|
|
21
|
+
typeof object.nodeName === 'string'))
|
|
23
22
|
));
|
|
24
23
|
}
|
|
25
24
|
|
|
@@ -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 isTextInputElement
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
'use strict';
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
15
|
* @see http://www.whatwg.org/specs/web-apps/current-work/multipage/the-input-element.html#input-type-attr-summary
|
|
@@ -34,8 +34,7 @@ var supportedInputTypes = {
|
|
|
34
34
|
|
|
35
35
|
function isTextInputElement(elem) {
|
|
36
36
|
return elem && (
|
|
37
|
-
(elem.nodeName === 'INPUT' && supportedInputTypes[elem.type]
|
|
38
|
-
elem.nodeName === 'TEXTAREA'
|
|
37
|
+
(elem.nodeName === 'INPUT' && supportedInputTypes[elem.type] || elem.nodeName === 'TEXTAREA')
|
|
39
38
|
);
|
|
40
39
|
}
|
|
41
40
|
|
package/lib/isTextNode.js
CHANGED
package/lib/joinClasses.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
|
* Combines multiple className strings into one.
|
package/lib/keyMirror.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 invariant = require("./invariant");
|
|
16
16
|
|
package/lib/keyOf.js
CHANGED
package/lib/mapObject.js
CHANGED
package/lib/memoizeStringOnly.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
|
* Memoizes the return value of a function that accepts one string argument.
|
|
@@ -21,11 +21,10 @@
|
|
|
21
21
|
function memoizeStringOnly(callback) {
|
|
22
22
|
var cache = {};
|
|
23
23
|
return function(string) {
|
|
24
|
-
if (cache.hasOwnProperty(string)) {
|
|
25
|
-
|
|
26
|
-
} else {
|
|
27
|
-
return cache[string] = callback.call(this, string);
|
|
24
|
+
if (!cache.hasOwnProperty(string)) {
|
|
25
|
+
cache[string] = callback.call(this, string);
|
|
28
26
|
}
|
|
27
|
+
return cache[string];
|
|
29
28
|
};
|
|
30
29
|
}
|
|
31
30
|
|