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/SyntheticUIEvent.js
CHANGED
|
@@ -1,17 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright 2013-2014 Facebook, Inc.
|
|
2
|
+
* Copyright 2013-2014, Facebook, Inc.
|
|
3
|
+
* All rights reserved.
|
|
3
4
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
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.
|
|
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.
|
|
15
8
|
*
|
|
16
9
|
* @providesModule SyntheticUIEvent
|
|
17
10
|
* @typechecks static-only
|
|
@@ -1,17 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright 2013-2014 Facebook, Inc.
|
|
2
|
+
* Copyright 2013-2014, Facebook, Inc.
|
|
3
|
+
* All rights reserved.
|
|
3
4
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
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.
|
|
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.
|
|
15
8
|
*
|
|
16
9
|
* @providesModule SyntheticWheelEvent
|
|
17
10
|
* @typechecks static-only
|
package/lib/Transaction.js
CHANGED
|
@@ -1,17 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright 2013-2014 Facebook, Inc.
|
|
2
|
+
* Copyright 2013-2014, Facebook, Inc.
|
|
3
|
+
* All rights reserved.
|
|
3
4
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
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.
|
|
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.
|
|
15
8
|
*
|
|
16
9
|
* @providesModule Transaction
|
|
17
10
|
*/
|
package/lib/ViewportMetrics.js
CHANGED
|
@@ -1,17 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright 2013-2014 Facebook, Inc.
|
|
2
|
+
* Copyright 2013-2014, Facebook, Inc.
|
|
3
|
+
* All rights reserved.
|
|
3
4
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
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.
|
|
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.
|
|
15
8
|
*
|
|
16
9
|
* @providesModule ViewportMetrics
|
|
17
10
|
*/
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2014, 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 accumulateInto
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
"use strict";
|
|
13
|
+
|
|
14
|
+
var invariant = require("./invariant");
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
*
|
|
18
|
+
* Accumulates items that must not be null or undefined into the first one. This
|
|
19
|
+
* is used to conserve memory by avoiding array allocations, and thus sacrifices
|
|
20
|
+
* API cleanness. Since `current` can be null before being passed in and not
|
|
21
|
+
* null after this function, make sure to assign it back to `current`:
|
|
22
|
+
*
|
|
23
|
+
* `a = accumulateInto(a, b);`
|
|
24
|
+
*
|
|
25
|
+
* This API should be sparingly used. Try `accumulate` for something cleaner.
|
|
26
|
+
*
|
|
27
|
+
* @return {*|array<*>} An accumulation of items.
|
|
28
|
+
*/
|
|
29
|
+
|
|
30
|
+
function accumulateInto(current, next) {
|
|
31
|
+
("production" !== process.env.NODE_ENV ? invariant(
|
|
32
|
+
next != null,
|
|
33
|
+
'accumulateInto(...): Accumulated items must not be null or undefined.'
|
|
34
|
+
) : invariant(next != null));
|
|
35
|
+
if (current == null) {
|
|
36
|
+
return next;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// Both are not empty. Warning: Never call x.concat(y) when you are not
|
|
40
|
+
// certain that x is an Array (x could be a string with concat method).
|
|
41
|
+
var currentIsArray = Array.isArray(current);
|
|
42
|
+
var nextIsArray = Array.isArray(next);
|
|
43
|
+
|
|
44
|
+
if (currentIsArray && nextIsArray) {
|
|
45
|
+
current.push.apply(current, next);
|
|
46
|
+
return current;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
if (currentIsArray) {
|
|
50
|
+
current.push(next);
|
|
51
|
+
return current;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
if (nextIsArray) {
|
|
55
|
+
// A bit too dangerous to mutate `next`.
|
|
56
|
+
return [current].concat(next);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
return [current, next];
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
module.exports = accumulateInto;
|
package/lib/adler32.js
CHANGED
|
@@ -1,17 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright 2013-2014 Facebook, Inc.
|
|
2
|
+
* Copyright 2013-2014, Facebook, Inc.
|
|
3
|
+
* All rights reserved.
|
|
3
4
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
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.
|
|
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.
|
|
15
8
|
*
|
|
16
9
|
* @providesModule adler32
|
|
17
10
|
*/
|
|
@@ -24,7 +17,7 @@ var MOD = 65521;
|
|
|
24
17
|
|
|
25
18
|
// This is a clean-room implementation of adler32 designed for detecting
|
|
26
19
|
// if markup is not what we expect it to be. It does not need to be
|
|
27
|
-
// cryptographically strong, only
|
|
20
|
+
// cryptographically strong, only reasonably good at detecting if markup
|
|
28
21
|
// generated on the server is different than that on the client.
|
|
29
22
|
function adler32(data) {
|
|
30
23
|
var a = 1;
|
package/lib/camelize.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2013-2014, 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 camelize
|
|
10
|
+
* @typechecks
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
var _hyphenPattern = /-(.)/g;
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Camelcases a hyphenated string, for example:
|
|
17
|
+
*
|
|
18
|
+
* > camelize('background-color')
|
|
19
|
+
* < "backgroundColor"
|
|
20
|
+
*
|
|
21
|
+
* @param {string} string
|
|
22
|
+
* @return {string}
|
|
23
|
+
*/
|
|
24
|
+
function camelize(string) {
|
|
25
|
+
return string.replace(_hyphenPattern, function(_, character) {
|
|
26
|
+
return character.toUpperCase();
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
module.exports = camelize;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2014, 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 camelizeStyleName
|
|
10
|
+
* @typechecks
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
"use strict";
|
|
14
|
+
|
|
15
|
+
var camelize = require("./camelize");
|
|
16
|
+
|
|
17
|
+
var msPattern = /^-ms-/;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Camelcases a hyphenated CSS property name, for example:
|
|
21
|
+
*
|
|
22
|
+
* > camelizeStyleName('background-color')
|
|
23
|
+
* < "backgroundColor"
|
|
24
|
+
* > camelizeStyleName('-moz-transition')
|
|
25
|
+
* < "MozTransition"
|
|
26
|
+
* > camelizeStyleName('-ms-transition')
|
|
27
|
+
* < "msTransition"
|
|
28
|
+
*
|
|
29
|
+
* As Andi Smith suggests
|
|
30
|
+
* (http://www.andismith.com/blog/2012/02/modernizr-prefixed/), an `-ms` prefix
|
|
31
|
+
* is converted to lowercase `ms`.
|
|
32
|
+
*
|
|
33
|
+
* @param {string} string
|
|
34
|
+
* @return {string}
|
|
35
|
+
*/
|
|
36
|
+
function camelizeStyleName(string) {
|
|
37
|
+
return camelize(string.replace(msPattern, 'ms-'));
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
module.exports = camelizeStyleName;
|
package/lib/cloneWithProps.js
CHANGED
|
@@ -1,17 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright 2013-2014 Facebook, Inc.
|
|
2
|
+
* Copyright 2013-2014, Facebook, Inc.
|
|
3
|
+
* All rights reserved.
|
|
3
4
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
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.
|
|
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.
|
|
15
8
|
*
|
|
16
9
|
* @typechecks
|
|
17
10
|
* @providesModule cloneWithProps
|
|
@@ -19,6 +12,7 @@
|
|
|
19
12
|
|
|
20
13
|
"use strict";
|
|
21
14
|
|
|
15
|
+
var ReactElement = require("./ReactElement");
|
|
22
16
|
var ReactPropTransferer = require("./ReactPropTransferer");
|
|
23
17
|
|
|
24
18
|
var keyOf = require("./keyOf");
|
|
@@ -38,7 +32,7 @@ var CHILDREN_PROP = keyOf({children: null});
|
|
|
38
32
|
function cloneWithProps(child, props) {
|
|
39
33
|
if ("production" !== process.env.NODE_ENV) {
|
|
40
34
|
("production" !== process.env.NODE_ENV ? warning(
|
|
41
|
-
!child.
|
|
35
|
+
!child.ref,
|
|
42
36
|
'You are calling cloneWithProps() on a child with a ref. This is ' +
|
|
43
37
|
'dangerous because you\'re creating a new child which will not be ' +
|
|
44
38
|
'added as a ref to its parent.'
|
|
@@ -54,8 +48,8 @@ function cloneWithProps(child, props) {
|
|
|
54
48
|
}
|
|
55
49
|
|
|
56
50
|
// The current API doesn't retain _owner and _context, which is why this
|
|
57
|
-
// doesn't use
|
|
58
|
-
return child.
|
|
51
|
+
// doesn't use ReactElement.cloneAndReplaceProps.
|
|
52
|
+
return ReactElement.createElement(child.type, newProps);
|
|
59
53
|
}
|
|
60
54
|
|
|
61
55
|
module.exports = cloneWithProps;
|
package/lib/containsNode.js
CHANGED
|
@@ -1,17 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright 2013-2014 Facebook, Inc.
|
|
2
|
+
* Copyright 2013-2014, Facebook, Inc.
|
|
3
|
+
* All rights reserved.
|
|
3
4
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
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.
|
|
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.
|
|
15
8
|
*
|
|
16
9
|
* @providesModule containsNode
|
|
17
10
|
* @typechecks
|
package/lib/copyProperties.js
CHANGED
|
@@ -1,17 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright 2013-2014 Facebook, Inc.
|
|
2
|
+
* Copyright 2013-2014, Facebook, Inc.
|
|
3
|
+
* All rights reserved.
|
|
3
4
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
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.
|
|
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.
|
|
15
8
|
*
|
|
16
9
|
* @providesModule copyProperties
|
|
17
10
|
*/
|
|
@@ -52,3 +45,10 @@ function copyProperties(obj, a, b, c, d, e, f) {
|
|
|
52
45
|
}
|
|
53
46
|
|
|
54
47
|
module.exports = copyProperties;
|
|
48
|
+
|
|
49
|
+
// deprecation notice
|
|
50
|
+
console.warn(
|
|
51
|
+
'react/lib/copyProperties has been deprecated and will be removed in the ' +
|
|
52
|
+
'next version of React. All uses can be replaced with ' +
|
|
53
|
+
'Object.assign(obj, a, b, ...) or _.extend(obj, a, b, ...).'
|
|
54
|
+
);
|
package/lib/createArrayFrom.js
CHANGED
|
@@ -1,17 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright 2013-2014 Facebook, Inc.
|
|
2
|
+
* Copyright 2013-2014, Facebook, Inc.
|
|
3
|
+
* All rights reserved.
|
|
3
4
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
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.
|
|
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.
|
|
15
8
|
*
|
|
16
9
|
* @providesModule createArrayFrom
|
|
17
10
|
* @typechecks
|
|
@@ -1,17 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright 2013-2014 Facebook, Inc.
|
|
2
|
+
* Copyright 2013-2014, Facebook, Inc.
|
|
3
|
+
* All rights reserved.
|
|
3
4
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
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.
|
|
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.
|
|
15
8
|
*
|
|
16
9
|
* @providesModule createFullPageComponent
|
|
17
10
|
* @typechecks
|
|
@@ -21,6 +14,7 @@
|
|
|
21
14
|
|
|
22
15
|
// Defeat circular references by requiring this directly.
|
|
23
16
|
var ReactCompositeComponent = require("./ReactCompositeComponent");
|
|
17
|
+
var ReactElement = require("./ReactElement");
|
|
24
18
|
|
|
25
19
|
var invariant = require("./invariant");
|
|
26
20
|
|
|
@@ -32,14 +26,14 @@ var invariant = require("./invariant");
|
|
|
32
26
|
* take advantage of React's reconciliation for styling and <title>
|
|
33
27
|
* management. So we just document it and throw in dangerous cases.
|
|
34
28
|
*
|
|
35
|
-
* @param {
|
|
29
|
+
* @param {string} tag The tag to wrap
|
|
36
30
|
* @return {function} convenience constructor of new component
|
|
37
31
|
*/
|
|
38
|
-
function createFullPageComponent(
|
|
32
|
+
function createFullPageComponent(tag) {
|
|
33
|
+
var elementFactory = ReactElement.createFactory(tag);
|
|
34
|
+
|
|
39
35
|
var FullPageComponent = ReactCompositeComponent.createClass({
|
|
40
|
-
displayName: 'ReactFullPageComponent' +
|
|
41
|
-
componentClass.type.displayName || ''
|
|
42
|
-
),
|
|
36
|
+
displayName: 'ReactFullPageComponent' + tag,
|
|
43
37
|
|
|
44
38
|
componentWillUnmount: function() {
|
|
45
39
|
("production" !== process.env.NODE_ENV ? invariant(
|
|
@@ -53,7 +47,7 @@ function createFullPageComponent(componentClass) {
|
|
|
53
47
|
},
|
|
54
48
|
|
|
55
49
|
render: function() {
|
|
56
|
-
return
|
|
50
|
+
return elementFactory(this.props);
|
|
57
51
|
}
|
|
58
52
|
});
|
|
59
53
|
|