react 0.11.2 → 0.12.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 +2714 -7859
- package/dist/react-with-addons.js +3139 -3593
- package/dist/react-with-addons.min.js +11 -17
- package/dist/react.js +2940 -3308
- package/dist/react.min.js +11 -16
- package/lib/AutoFocusMixin.js +5 -12
- package/lib/BeforeInputEventPlugin.js +12 -14
- package/lib/CSSCore.js +6 -13
- package/lib/CSSProperty.js +10 -14
- package/lib/CSSPropertyOperations.js +46 -12
- package/lib/CallbackQueue.js +7 -14
- package/lib/ChangeEventPlugin.js +5 -12
- package/lib/ClientReactRootIndex.js +5 -12
- package/lib/CompositionEventPlugin.js +5 -12
- package/lib/DOMChildrenOperations.js +8 -15
- package/lib/DOMProperty.js +16 -19
- package/lib/DOMPropertyOperations.js +14 -14
- package/lib/Danger.js +12 -17
- package/lib/DefaultEventPluginOrder.js +5 -12
- package/lib/EnterLeaveEventPlugin.js +5 -12
- package/lib/EventConstants.js +5 -12
- package/lib/EventListener.js +14 -0
- package/lib/EventPluginHub.js +8 -26
- package/lib/EventPluginRegistry.js +5 -12
- package/lib/EventPluginUtils.js +5 -12
- package/lib/EventPropagators.js +12 -17
- package/lib/ExecutionEnvironment.js +5 -12
- package/lib/HTMLDOMPropertyConfig.js +16 -15
- package/lib/LinkedStateMixin.js +5 -12
- package/lib/LinkedValueUtils.js +5 -12
- package/lib/LocalEventTrapMixin.js +8 -14
- package/lib/MobileSafariClickEventPlugin.js +5 -12
- package/lib/Object.assign.js +45 -0
- package/lib/PooledClass.js +5 -12
- package/lib/React.js +87 -54
- package/lib/ReactBrowserComponentMixin.js +5 -12
- package/lib/ReactBrowserEventEmitter.js +7 -14
- package/lib/ReactCSSTransitionGroup.js +15 -17
- package/lib/ReactCSSTransitionGroupChild.js +9 -13
- package/lib/ReactChildren.js +5 -12
- package/lib/ReactComponent.js +61 -68
- package/lib/ReactComponentBrowserEnvironment.js +5 -12
- package/lib/ReactComponentWithPureRenderMixin.js +5 -12
- package/lib/ReactCompositeComponent.js +191 -180
- package/lib/ReactContext.js +8 -15
- package/lib/ReactCurrentOwner.js +5 -12
- package/lib/ReactDOM.js +145 -177
- package/lib/ReactDOMButton.js +8 -14
- package/lib/ReactDOMComponent.js +103 -38
- package/lib/ReactDOMForm.js +9 -15
- package/lib/ReactDOMIDOperations.js +5 -12
- package/lib/ReactDOMImg.js +8 -14
- package/lib/ReactDOMInput.js +30 -38
- package/lib/ReactDOMOption.js +8 -14
- package/lib/ReactDOMSelect.js +25 -24
- package/lib/ReactDOMSelection.js +11 -18
- package/lib/ReactDOMTextarea.js +19 -24
- package/lib/ReactDefaultBatchingStrategy.js +14 -18
- package/lib/ReactDefaultInjection.js +23 -26
- package/lib/ReactDefaultPerf.js +14 -17
- package/lib/ReactDefaultPerfAnalysis.js +18 -17
- package/lib/ReactElement.js +242 -0
- package/lib/{ReactDescriptorValidator.js → ReactElementValidator.js} +51 -56
- package/lib/ReactEmptyComponent.js +8 -13
- package/lib/ReactErrorUtils.js +5 -12
- package/lib/ReactEventEmitterMixin.js +5 -12
- package/lib/ReactEventListener.js +7 -14
- package/lib/ReactInjection.js +7 -14
- package/lib/ReactInputSelection.js +5 -12
- package/lib/ReactInstanceHandles.js +5 -12
- package/lib/ReactLegacyElement.js +243 -0
- package/lib/ReactLink.js +5 -12
- package/lib/ReactMarkupChecksum.js +5 -12
- package/lib/ReactMount.js +45 -32
- package/lib/ReactMultiChild.js +14 -18
- package/lib/ReactMultiChildUpdateTypes.js +5 -12
- package/lib/ReactNativeComponent.js +69 -0
- package/lib/ReactOwner.js +5 -12
- package/lib/ReactPerf.js +8 -13
- package/lib/ReactPropTransferer.js +34 -33
- package/lib/ReactPropTypeLocationNames.js +5 -12
- package/lib/ReactPropTypeLocations.js +5 -12
- package/lib/ReactPropTypes.js +38 -29
- package/lib/ReactPutListenerQueue.js +7 -14
- package/lib/ReactReconcileTransaction.js +7 -15
- package/lib/ReactRootIndex.js +5 -12
- package/lib/ReactServerRendering.js +21 -34
- package/lib/ReactServerRenderingTransaction.js +11 -15
- package/lib/ReactStateSetters.js +5 -12
- package/lib/ReactTestUtils.js +31 -33
- package/lib/ReactTextComponent.js +18 -21
- package/lib/ReactTransitionChildMapping.js +6 -13
- package/lib/ReactTransitionEvents.js +5 -12
- package/lib/ReactTransitionGroup.js +14 -17
- package/lib/ReactUpdates.js +43 -22
- package/lib/ReactWithAddons.js +7 -13
- package/lib/SVGDOMPropertyConfig.js +5 -12
- package/lib/SelectEventPlugin.js +13 -20
- package/lib/ServerReactRootIndex.js +5 -12
- package/lib/SimpleEventPlugin.js +20 -15
- package/lib/SyntheticClipboardEvent.js +5 -12
- package/lib/SyntheticCompositionEvent.js +5 -12
- package/lib/SyntheticDragEvent.js +5 -12
- package/lib/SyntheticEvent.js +9 -17
- package/lib/SyntheticFocusEvent.js +5 -12
- package/lib/SyntheticInputEvent.js +4 -11
- package/lib/SyntheticKeyboardEvent.js +17 -19
- package/lib/SyntheticMouseEvent.js +5 -12
- package/lib/SyntheticTouchEvent.js +5 -12
- package/lib/SyntheticUIEvent.js +5 -12
- package/lib/SyntheticWheelEvent.js +5 -12
- package/lib/Transaction.js +5 -12
- package/lib/ViewportMetrics.js +5 -12
- package/lib/accumulateInto.js +62 -0
- package/lib/adler32.js +6 -13
- package/lib/camelize.js +30 -0
- package/lib/camelizeStyleName.js +40 -0
- package/lib/cloneWithProps.js +9 -15
- package/lib/containsNode.js +5 -12
- package/lib/copyProperties.js +12 -12
- package/lib/createArrayFrom.js +5 -12
- package/lib/createFullPageComponent.js +12 -18
- package/lib/createNodesFromMarkup.js +5 -12
- package/lib/cx.js +5 -12
- package/lib/dangerousStyleValue.js +5 -12
- package/lib/deprecated.js +47 -0
- package/lib/emptyFunction.js +11 -22
- package/lib/emptyObject.js +5 -12
- package/lib/escapeTextForBrowser.js +5 -12
- package/lib/flattenChildren.js +19 -13
- package/lib/focusNode.js +10 -16
- package/lib/forEachAccumulated.js +5 -12
- package/lib/getActiveElement.js +5 -12
- package/lib/getEventCharCode.js +50 -0
- package/lib/getEventKey.js +9 -21
- package/lib/getEventModifierState.js +4 -11
- package/lib/getEventTarget.js +5 -12
- package/lib/getMarkupWrap.js +5 -12
- package/lib/getNodeForCharacterOffset.js +5 -12
- package/lib/getReactRootElementInContainer.js +5 -12
- package/lib/getTextContentAccessor.js +5 -12
- package/lib/getUnboundedScrollPosition.js +5 -12
- package/lib/hyphenate.js +5 -12
- package/lib/hyphenateStyleName.js +8 -15
- package/lib/instantiateReactComponent.js +90 -42
- package/lib/invariant.js +5 -12
- package/lib/isEventSupported.js +5 -12
- package/lib/isNode.js +5 -12
- package/lib/isTextInputElement.js +5 -12
- package/lib/isTextNode.js +5 -12
- package/lib/joinClasses.js +8 -13
- package/lib/keyMirror.js +5 -12
- package/lib/keyOf.js +5 -12
- package/lib/mapObject.js +35 -36
- package/lib/memoizeStringOnly.js +5 -12
- package/lib/merge.js +14 -17
- package/lib/mergeInto.js +13 -35
- package/lib/monitorCodeUse.js +5 -12
- package/lib/onlyChild.js +8 -15
- package/lib/performance.js +5 -12
- package/lib/performanceNow.js +5 -12
- package/lib/setInnerHTML.js +10 -19
- package/lib/shallowEqual.js +6 -13
- package/lib/shouldUpdateReactComponent.js +14 -22
- package/lib/toArray.js +5 -12
- package/lib/traverseAllChildren.js +34 -48
- package/lib/update.js +8 -15
- package/lib/warning.js +6 -13
- package/package.json +3 -8
- package/lib/ReactDescriptor.js +0 -251
- package/lib/accumulate.js +0 -54
- package/lib/mergeHelpers.js +0 -147
- package/lib/mixInto.js +0 -34
package/lib/accumulate.js
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright 2013-2014 Facebook, Inc.
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*
|
|
16
|
-
* @providesModule accumulate
|
|
17
|
-
*/
|
|
18
|
-
|
|
19
|
-
"use strict";
|
|
20
|
-
|
|
21
|
-
var invariant = require("./invariant");
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* Accumulates items that must not be null or undefined.
|
|
25
|
-
*
|
|
26
|
-
* This is used to conserve memory by avoiding array allocations.
|
|
27
|
-
*
|
|
28
|
-
* @return {*|array<*>} An accumulation of items.
|
|
29
|
-
*/
|
|
30
|
-
function accumulate(current, next) {
|
|
31
|
-
("production" !== process.env.NODE_ENV ? invariant(
|
|
32
|
-
next != null,
|
|
33
|
-
'accumulate(...): Accumulated items must be not be null or undefined.'
|
|
34
|
-
) : invariant(next != null));
|
|
35
|
-
if (current == null) {
|
|
36
|
-
return next;
|
|
37
|
-
} else {
|
|
38
|
-
// Both are not empty. Warning: Never call x.concat(y) when you are not
|
|
39
|
-
// certain that x is an Array (x could be a string with concat method).
|
|
40
|
-
var currentIsArray = Array.isArray(current);
|
|
41
|
-
var nextIsArray = Array.isArray(next);
|
|
42
|
-
if (currentIsArray) {
|
|
43
|
-
return current.concat(next);
|
|
44
|
-
} else {
|
|
45
|
-
if (nextIsArray) {
|
|
46
|
-
return [current].concat(next);
|
|
47
|
-
} else {
|
|
48
|
-
return [current, next];
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
module.exports = accumulate;
|
package/lib/mergeHelpers.js
DELETED
|
@@ -1,147 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright 2013-2014 Facebook, Inc.
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*
|
|
16
|
-
* @providesModule mergeHelpers
|
|
17
|
-
*
|
|
18
|
-
* requiresPolyfills: Array.isArray
|
|
19
|
-
*/
|
|
20
|
-
|
|
21
|
-
"use strict";
|
|
22
|
-
|
|
23
|
-
var invariant = require("./invariant");
|
|
24
|
-
var keyMirror = require("./keyMirror");
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Maximum number of levels to traverse. Will catch circular structures.
|
|
28
|
-
* @const
|
|
29
|
-
*/
|
|
30
|
-
var MAX_MERGE_DEPTH = 36;
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* We won't worry about edge cases like new String('x') or new Boolean(true).
|
|
34
|
-
* Functions are considered terminals, and arrays are not.
|
|
35
|
-
* @param {*} o The item/object/value to test.
|
|
36
|
-
* @return {boolean} true iff the argument is a terminal.
|
|
37
|
-
*/
|
|
38
|
-
var isTerminal = function(o) {
|
|
39
|
-
return typeof o !== 'object' || o === null;
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
var mergeHelpers = {
|
|
43
|
-
|
|
44
|
-
MAX_MERGE_DEPTH: MAX_MERGE_DEPTH,
|
|
45
|
-
|
|
46
|
-
isTerminal: isTerminal,
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* Converts null/undefined values into empty object.
|
|
50
|
-
*
|
|
51
|
-
* @param {?Object=} arg Argument to be normalized (nullable optional)
|
|
52
|
-
* @return {!Object}
|
|
53
|
-
*/
|
|
54
|
-
normalizeMergeArg: function(arg) {
|
|
55
|
-
return arg === undefined || arg === null ? {} : arg;
|
|
56
|
-
},
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* If merging Arrays, a merge strategy *must* be supplied. If not, it is
|
|
60
|
-
* likely the caller's fault. If this function is ever called with anything
|
|
61
|
-
* but `one` and `two` being `Array`s, it is the fault of the merge utilities.
|
|
62
|
-
*
|
|
63
|
-
* @param {*} one Array to merge into.
|
|
64
|
-
* @param {*} two Array to merge from.
|
|
65
|
-
*/
|
|
66
|
-
checkMergeArrayArgs: function(one, two) {
|
|
67
|
-
("production" !== process.env.NODE_ENV ? invariant(
|
|
68
|
-
Array.isArray(one) && Array.isArray(two),
|
|
69
|
-
'Tried to merge arrays, instead got %s and %s.',
|
|
70
|
-
one,
|
|
71
|
-
two
|
|
72
|
-
) : invariant(Array.isArray(one) && Array.isArray(two)));
|
|
73
|
-
},
|
|
74
|
-
|
|
75
|
-
/**
|
|
76
|
-
* @param {*} one Object to merge into.
|
|
77
|
-
* @param {*} two Object to merge from.
|
|
78
|
-
*/
|
|
79
|
-
checkMergeObjectArgs: function(one, two) {
|
|
80
|
-
mergeHelpers.checkMergeObjectArg(one);
|
|
81
|
-
mergeHelpers.checkMergeObjectArg(two);
|
|
82
|
-
},
|
|
83
|
-
|
|
84
|
-
/**
|
|
85
|
-
* @param {*} arg
|
|
86
|
-
*/
|
|
87
|
-
checkMergeObjectArg: function(arg) {
|
|
88
|
-
("production" !== process.env.NODE_ENV ? invariant(
|
|
89
|
-
!isTerminal(arg) && !Array.isArray(arg),
|
|
90
|
-
'Tried to merge an object, instead got %s.',
|
|
91
|
-
arg
|
|
92
|
-
) : invariant(!isTerminal(arg) && !Array.isArray(arg)));
|
|
93
|
-
},
|
|
94
|
-
|
|
95
|
-
/**
|
|
96
|
-
* @param {*} arg
|
|
97
|
-
*/
|
|
98
|
-
checkMergeIntoObjectArg: function(arg) {
|
|
99
|
-
("production" !== process.env.NODE_ENV ? invariant(
|
|
100
|
-
(!isTerminal(arg) || typeof arg === 'function') && !Array.isArray(arg),
|
|
101
|
-
'Tried to merge into an object, instead got %s.',
|
|
102
|
-
arg
|
|
103
|
-
) : invariant((!isTerminal(arg) || typeof arg === 'function') && !Array.isArray(arg)));
|
|
104
|
-
},
|
|
105
|
-
|
|
106
|
-
/**
|
|
107
|
-
* Checks that a merge was not given a circular object or an object that had
|
|
108
|
-
* too great of depth.
|
|
109
|
-
*
|
|
110
|
-
* @param {number} Level of recursion to validate against maximum.
|
|
111
|
-
*/
|
|
112
|
-
checkMergeLevel: function(level) {
|
|
113
|
-
("production" !== process.env.NODE_ENV ? invariant(
|
|
114
|
-
level < MAX_MERGE_DEPTH,
|
|
115
|
-
'Maximum deep merge depth exceeded. You may be attempting to merge ' +
|
|
116
|
-
'circular structures in an unsupported way.'
|
|
117
|
-
) : invariant(level < MAX_MERGE_DEPTH));
|
|
118
|
-
},
|
|
119
|
-
|
|
120
|
-
/**
|
|
121
|
-
* Checks that the supplied merge strategy is valid.
|
|
122
|
-
*
|
|
123
|
-
* @param {string} Array merge strategy.
|
|
124
|
-
*/
|
|
125
|
-
checkArrayStrategy: function(strategy) {
|
|
126
|
-
("production" !== process.env.NODE_ENV ? invariant(
|
|
127
|
-
strategy === undefined || strategy in mergeHelpers.ArrayStrategies,
|
|
128
|
-
'You must provide an array strategy to deep merge functions to ' +
|
|
129
|
-
'instruct the deep merge how to resolve merging two arrays.'
|
|
130
|
-
) : invariant(strategy === undefined || strategy in mergeHelpers.ArrayStrategies));
|
|
131
|
-
},
|
|
132
|
-
|
|
133
|
-
/**
|
|
134
|
-
* Set of possible behaviors of merge algorithms when encountering two Arrays
|
|
135
|
-
* that must be merged together.
|
|
136
|
-
* - `clobber`: The left `Array` is ignored.
|
|
137
|
-
* - `indexByIndex`: The result is achieved by recursively deep merging at
|
|
138
|
-
* each index. (not yet supported.)
|
|
139
|
-
*/
|
|
140
|
-
ArrayStrategies: keyMirror({
|
|
141
|
-
Clobber: true,
|
|
142
|
-
IndexByIndex: true
|
|
143
|
-
})
|
|
144
|
-
|
|
145
|
-
};
|
|
146
|
-
|
|
147
|
-
module.exports = mergeHelpers;
|
package/lib/mixInto.js
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright 2013-2014 Facebook, Inc.
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*
|
|
16
|
-
* @providesModule mixInto
|
|
17
|
-
*/
|
|
18
|
-
|
|
19
|
-
"use strict";
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* Simply copies properties to the prototype.
|
|
23
|
-
*/
|
|
24
|
-
var mixInto = function(constructor, methodBag) {
|
|
25
|
-
var methodName;
|
|
26
|
-
for (methodName in methodBag) {
|
|
27
|
-
if (!methodBag.hasOwnProperty(methodName)) {
|
|
28
|
-
continue;
|
|
29
|
-
}
|
|
30
|
-
constructor.prototype[methodName] = methodBag[methodName];
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
module.exports = mixInto;
|