react 0.13.3 → 0.14.0-beta1
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/README.md +5 -2
- package/addons.js +7 -0
- package/dist/JSXTransformer.js +4101 -2432
- package/dist/react-with-addons.js +4389 -6277
- package/dist/react-with-addons.min.js +6 -8
- package/dist/react.js +4028 -5697
- package/dist/react.min.js +5 -6
- package/lib/{AutoFocusMixin.js → AutoFocusUtils.js} +16 -5
- package/lib/BeforeInputEventPlugin.js +30 -118
- package/lib/CSSCore.js +12 -23
- package/lib/CSSProperty.js +4 -3
- package/lib/CSSPropertyOperations.js +14 -30
- package/lib/CallbackQueue.js +7 -10
- package/lib/ChangeEventPlugin.js +26 -88
- package/lib/ClientReactRootIndex.js +2 -2
- package/lib/DOMChildrenOperations.js +13 -33
- package/lib/DOMProperty.js +86 -147
- package/lib/DOMPropertyOperations.js +91 -67
- package/lib/Danger.js +19 -62
- package/lib/DefaultEventPluginOrder.js +2 -12
- package/lib/EnterLeaveEventPlugin.js +11 -33
- package/lib/EventConstants.js +2 -2
- package/lib/EventListener.js +11 -13
- package/lib/EventPluginHub.js +44 -47
- package/lib/EventPluginRegistry.js +18 -74
- package/lib/EventPluginUtils.js +33 -44
- package/lib/EventPropagators.js +23 -26
- package/lib/ExecutionEnvironment.js +4 -8
- package/lib/FallbackCompositionState.js +3 -3
- package/lib/HTMLDOMPropertyConfig.js +15 -20
- package/lib/LinkedStateMixin.js +3 -6
- package/lib/LinkedValueUtils.js +71 -89
- package/lib/Object.assign.js +1 -1
- package/lib/PooledClass.js +20 -11
- package/lib/React.js +9 -129
- package/lib/ReactBrowserComponentMixin.js +9 -2
- package/lib/ReactBrowserEventEmitter.js +26 -82
- package/lib/ReactCSSTransitionGroup.js +13 -24
- package/lib/ReactCSSTransitionGroupChild.js +26 -28
- package/lib/ReactChildReconciler.js +11 -19
- package/lib/ReactChildren.js +24 -31
- package/lib/ReactClass.js +96 -267
- package/lib/ReactComponent.js +28 -57
- package/lib/ReactComponentBrowserEnvironment.js +4 -8
- package/lib/ReactComponentEnvironment.js +6 -12
- package/lib/ReactComponentWithPureRenderMixin.js +6 -7
- package/lib/ReactCompositeComponent.js +115 -381
- package/lib/ReactCurrentOwner.js +1 -3
- package/lib/ReactDOM.js +4 -2
- package/lib/ReactDOMButton.js +16 -28
- package/lib/ReactDOMClient.js +90 -0
- package/lib/ReactDOMComponent.js +468 -156
- package/lib/ReactDOMIDOperations.js +25 -22
- package/lib/ReactDOMInput.js +79 -108
- package/lib/ReactDOMOption.js +58 -20
- package/lib/ReactDOMSelect.js +95 -83
- package/lib/ReactDOMSelection.js +5 -20
- package/lib/ReactDOMServer.js +24 -0
- package/lib/ReactDOMTextComponent.js +17 -18
- package/lib/ReactDOMTextarea.js +44 -69
- package/lib/ReactDefaultBatchingStrategy.js +9 -13
- package/lib/ReactDefaultInjection.js +20 -76
- package/lib/ReactDefaultPerf.js +36 -69
- package/lib/ReactDefaultPerfAnalysis.js +8 -14
- package/lib/ReactElement.js +26 -120
- package/lib/ReactElementValidator.js +56 -192
- package/lib/ReactEmptyComponent.js +7 -11
- package/lib/ReactErrorUtils.js +3 -3
- package/lib/ReactEventEmitterMixin.js +3 -13
- package/lib/ReactEventListener.js +58 -40
- package/lib/ReactFragment.js +33 -59
- package/lib/ReactInjection.js +1 -1
- package/lib/ReactInputSelection.js +14 -23
- package/lib/ReactInstanceHandles.js +29 -58
- package/lib/ReactInstanceMap.js +5 -5
- package/lib/ReactIsomorphic.js +70 -0
- package/lib/ReactLink.js +2 -4
- package/lib/ReactMarkupChecksum.js +5 -10
- package/lib/ReactMount.js +142 -285
- package/lib/ReactMultiChild.js +19 -45
- package/lib/ReactMultiChildUpdateTypes.js +1 -1
- package/lib/ReactNativeComponent.js +6 -15
- package/lib/ReactNoopUpdateQueue.js +118 -0
- package/lib/ReactOwner.js +7 -24
- package/lib/ReactPerf.js +8 -12
- package/lib/ReactPropTransferer.js +4 -4
- package/lib/ReactPropTypeLocationNames.js +2 -2
- package/lib/ReactPropTypeLocations.js +1 -1
- package/lib/ReactPropTypes.js +41 -61
- package/lib/ReactReconcileTransaction.js +11 -36
- package/lib/ReactReconciler.js +14 -26
- package/lib/ReactRef.js +5 -8
- package/lib/ReactRootIndex.js +2 -2
- package/lib/ReactServerBatchingStrategy.js +23 -0
- package/lib/ReactServerRendering.js +20 -15
- package/lib/ReactServerRenderingTransaction.js +9 -34
- package/lib/ReactStateSetters.js +6 -6
- package/lib/ReactTestUtils.js +137 -190
- package/lib/ReactTransitionChildMapping.js +5 -7
- package/lib/ReactTransitionEvents.js +5 -5
- package/lib/ReactTransitionGroup.js +30 -52
- package/lib/ReactUpdateQueue.js +69 -107
- package/lib/ReactUpdates.js +26 -81
- package/lib/ReactWithAddons.js +5 -6
- package/lib/SVGDOMPropertyConfig.js +39 -4
- package/lib/SelectEventPlugin.js +31 -33
- package/lib/ServerReactRootIndex.js +2 -2
- package/lib/SimpleEventPlugin.js +138 -130
- package/lib/SyntheticClipboardEvent.js +5 -9
- package/lib/SyntheticCompositionEvent.js +4 -10
- package/lib/SyntheticDragEvent.js +3 -3
- package/lib/SyntheticEvent.js +14 -15
- package/lib/SyntheticFocusEvent.js +3 -3
- package/lib/SyntheticInputEvent.js +4 -10
- package/lib/SyntheticKeyboardEvent.js +6 -6
- package/lib/SyntheticMouseEvent.js +10 -16
- package/lib/SyntheticTouchEvent.js +3 -3
- package/lib/SyntheticUIEvent.js +5 -5
- package/lib/SyntheticWheelEvent.js +13 -17
- package/lib/Transaction.js +22 -28
- package/lib/ViewportMetrics.js +2 -2
- package/lib/accumulateInto.js +2 -5
- package/lib/adler32.js +2 -4
- package/lib/camelize.js +4 -2
- package/lib/camelizeStyleName.js +2 -2
- package/lib/cloneWithProps.js +6 -12
- package/lib/containsNode.js +29 -16
- package/lib/createArrayFromMixed.js +17 -16
- package/lib/createNodesFromMarkup.js +6 -8
- package/lib/dangerousStyleValue.js +2 -3
- package/lib/deprecated.js +47 -0
- package/lib/emptyFunction.js +10 -4
- package/lib/emptyObject.js +1 -1
- package/lib/escapeTextContentForBrowser.js +1 -1
- package/lib/findDOMNode.js +7 -27
- package/lib/flattenChildren.js +4 -10
- package/lib/focusNode.js +2 -3
- package/lib/forEachAccumulated.js +3 -3
- package/lib/getActiveElement.js +4 -2
- package/lib/getEventCharCode.js +2 -2
- package/lib/getEventKey.js +1 -1
- package/lib/getEventModifierState.js +1 -2
- package/lib/getEventTarget.js +1 -1
- package/lib/getIteratorFn.js +2 -4
- package/lib/getMarkupWrap.js +18 -40
- package/lib/getNodeForCharacterOffset.js +1 -1
- package/lib/getTextContentAccessor.js +2 -4
- package/lib/getUnboundedScrollPosition.js +1 -1
- package/lib/hyphenate.js +3 -1
- package/lib/hyphenateStyleName.js +2 -2
- package/lib/instantiateReactComponent.js +23 -43
- package/lib/invariant.js +8 -12
- package/lib/isEventSupported.js +7 -10
- package/lib/isNode.js +4 -6
- package/lib/isTextInputElement.js +3 -4
- package/lib/isTextNode.js +3 -1
- package/lib/joinClasses.js +3 -3
- package/lib/keyMirror.js +3 -6
- package/lib/keyOf.js +4 -3
- package/lib/mapObject.js +1 -1
- package/lib/memoizeStringOnly.js +2 -2
- package/lib/onlyChild.js +2 -5
- package/lib/performance.js +2 -5
- package/lib/performanceNow.js +3 -1
- package/lib/quoteAttributeValueForBrowser.js +1 -1
- package/lib/renderSubtreeIntoContainer.js +16 -0
- package/lib/setInnerHTML.js +11 -8
- package/lib/setTextContent.js +3 -3
- package/lib/shallowCompare.js +24 -0
- package/lib/shallowEqual.js +17 -11
- package/lib/shouldUpdateReactComponent.js +3 -64
- package/lib/toArray.js +8 -19
- package/lib/traverseAllChildren.js +23 -90
- package/lib/update.js +25 -85
- package/lib/validateDOMNesting.js +363 -0
- package/lib/warning.js +15 -17
- package/package.json +3 -3
- package/react.js +53 -1
- package/lib/LocalEventTrapMixin.js +0 -53
- package/lib/MobileSafariClickEventPlugin.js +0 -56
- package/lib/ReactContext.js +0 -74
- package/lib/ReactDOMForm.js +0 -47
- package/lib/ReactDOMIframe.js +0 -43
- package/lib/ReactDOMImg.js +0 -44
- package/lib/ReactLifeCycle.js +0 -35
- package/lib/ReactPutListenerQueue.js +0 -54
- package/lib/createFullPageComponent.js +0 -58
- package/lib/cx.js +0 -52
- package/lib/getReactRootElementInContainer.js +0 -33
package/lib/ReactLifeCycle.js
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright 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 ReactLifeCycle
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
'use strict';
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* This module manages the bookkeeping when a component is in the process
|
|
16
|
-
* of being mounted or being unmounted. This is used as a way to enforce
|
|
17
|
-
* invariants (or warnings) when it is not recommended to call
|
|
18
|
-
* setState/forceUpdate.
|
|
19
|
-
*
|
|
20
|
-
* currentlyMountingInstance: During the construction phase, it is not possible
|
|
21
|
-
* to trigger an update since the instance is not fully mounted yet. However, we
|
|
22
|
-
* currently allow this as a convenience for mutating the initial state.
|
|
23
|
-
*
|
|
24
|
-
* currentlyUnmountingInstance: During the unmounting phase, the instance is
|
|
25
|
-
* still mounted and can therefore schedule an update. However, this is not
|
|
26
|
-
* recommended and probably an error since it's about to be unmounted.
|
|
27
|
-
* Therefore we still want to trigger in an error for that case.
|
|
28
|
-
*/
|
|
29
|
-
|
|
30
|
-
var ReactLifeCycle = {
|
|
31
|
-
currentlyMountingInstance: null,
|
|
32
|
-
currentlyUnmountingInstance: null
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
module.exports = ReactLifeCycle;
|
|
@@ -1,54 +0,0 @@
|
|
|
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 ReactPutListenerQueue
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
'use strict';
|
|
13
|
-
|
|
14
|
-
var PooledClass = require("./PooledClass");
|
|
15
|
-
var ReactBrowserEventEmitter = require("./ReactBrowserEventEmitter");
|
|
16
|
-
|
|
17
|
-
var assign = require("./Object.assign");
|
|
18
|
-
|
|
19
|
-
function ReactPutListenerQueue() {
|
|
20
|
-
this.listenersToPut = [];
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
assign(ReactPutListenerQueue.prototype, {
|
|
24
|
-
enqueuePutListener: function(rootNodeID, propKey, propValue) {
|
|
25
|
-
this.listenersToPut.push({
|
|
26
|
-
rootNodeID: rootNodeID,
|
|
27
|
-
propKey: propKey,
|
|
28
|
-
propValue: propValue
|
|
29
|
-
});
|
|
30
|
-
},
|
|
31
|
-
|
|
32
|
-
putListeners: function() {
|
|
33
|
-
for (var i = 0; i < this.listenersToPut.length; i++) {
|
|
34
|
-
var listenerToPut = this.listenersToPut[i];
|
|
35
|
-
ReactBrowserEventEmitter.putListener(
|
|
36
|
-
listenerToPut.rootNodeID,
|
|
37
|
-
listenerToPut.propKey,
|
|
38
|
-
listenerToPut.propValue
|
|
39
|
-
);
|
|
40
|
-
}
|
|
41
|
-
},
|
|
42
|
-
|
|
43
|
-
reset: function() {
|
|
44
|
-
this.listenersToPut.length = 0;
|
|
45
|
-
},
|
|
46
|
-
|
|
47
|
-
destructor: function() {
|
|
48
|
-
this.reset();
|
|
49
|
-
}
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
PooledClass.addPoolingTo(ReactPutListenerQueue);
|
|
53
|
-
|
|
54
|
-
module.exports = ReactPutListenerQueue;
|
|
@@ -1,58 +0,0 @@
|
|
|
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 createFullPageComponent
|
|
10
|
-
* @typechecks
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
'use strict';
|
|
14
|
-
|
|
15
|
-
// Defeat circular references by requiring this directly.
|
|
16
|
-
var ReactClass = require("./ReactClass");
|
|
17
|
-
var ReactElement = require("./ReactElement");
|
|
18
|
-
|
|
19
|
-
var invariant = require("./invariant");
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* Create a component that will throw an exception when unmounted.
|
|
23
|
-
*
|
|
24
|
-
* Components like <html> <head> and <body> can't be removed or added
|
|
25
|
-
* easily in a cross-browser way, however it's valuable to be able to
|
|
26
|
-
* take advantage of React's reconciliation for styling and <title>
|
|
27
|
-
* management. So we just document it and throw in dangerous cases.
|
|
28
|
-
*
|
|
29
|
-
* @param {string} tag The tag to wrap
|
|
30
|
-
* @return {function} convenience constructor of new component
|
|
31
|
-
*/
|
|
32
|
-
function createFullPageComponent(tag) {
|
|
33
|
-
var elementFactory = ReactElement.createFactory(tag);
|
|
34
|
-
|
|
35
|
-
var FullPageComponent = ReactClass.createClass({
|
|
36
|
-
tagName: tag.toUpperCase(),
|
|
37
|
-
displayName: 'ReactFullPageComponent' + tag,
|
|
38
|
-
|
|
39
|
-
componentWillUnmount: function() {
|
|
40
|
-
("production" !== process.env.NODE_ENV ? invariant(
|
|
41
|
-
false,
|
|
42
|
-
'%s tried to unmount. Because of cross-browser quirks it is ' +
|
|
43
|
-
'impossible to unmount some top-level components (eg <html>, <head>, ' +
|
|
44
|
-
'and <body>) reliably and efficiently. To fix this, have a single ' +
|
|
45
|
-
'top-level component that never unmounts render these elements.',
|
|
46
|
-
this.constructor.displayName
|
|
47
|
-
) : invariant(false));
|
|
48
|
-
},
|
|
49
|
-
|
|
50
|
-
render: function() {
|
|
51
|
-
return elementFactory(this.props);
|
|
52
|
-
}
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
return FullPageComponent;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
module.exports = createFullPageComponent;
|
package/lib/cx.js
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
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 cx
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* This function is used to mark string literals representing CSS class names
|
|
14
|
-
* so that they can be transformed statically. This allows for modularization
|
|
15
|
-
* and minification of CSS class names.
|
|
16
|
-
*
|
|
17
|
-
* In static_upstream, this function is actually implemented, but it should
|
|
18
|
-
* eventually be replaced with something more descriptive, and the transform
|
|
19
|
-
* that is used in the main stack should be ported for use elsewhere.
|
|
20
|
-
*
|
|
21
|
-
* @param string|object className to modularize, or an object of key/values.
|
|
22
|
-
* In the object case, the values are conditions that
|
|
23
|
-
* determine if the className keys should be included.
|
|
24
|
-
* @param [string ...] Variable list of classNames in the string case.
|
|
25
|
-
* @return string Renderable space-separated CSS className.
|
|
26
|
-
*/
|
|
27
|
-
|
|
28
|
-
'use strict';
|
|
29
|
-
var warning = require("./warning");
|
|
30
|
-
|
|
31
|
-
var warned = false;
|
|
32
|
-
|
|
33
|
-
function cx(classNames) {
|
|
34
|
-
if ("production" !== process.env.NODE_ENV) {
|
|
35
|
-
("production" !== process.env.NODE_ENV ? warning(
|
|
36
|
-
warned,
|
|
37
|
-
'React.addons.classSet will be deprecated in a future version. See ' +
|
|
38
|
-
'http://fb.me/react-addons-classset'
|
|
39
|
-
) : null);
|
|
40
|
-
warned = true;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
if (typeof classNames == 'object') {
|
|
44
|
-
return Object.keys(classNames).filter(function(className) {
|
|
45
|
-
return classNames[className];
|
|
46
|
-
}).join(' ');
|
|
47
|
-
} else {
|
|
48
|
-
return Array.prototype.join.call(arguments, ' ');
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
module.exports = cx;
|
|
@@ -1,33 +0,0 @@
|
|
|
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 getReactRootElementInContainer
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
'use strict';
|
|
13
|
-
|
|
14
|
-
var DOC_NODE_TYPE = 9;
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* @param {DOMElement|DOMDocument} container DOM element that may contain
|
|
18
|
-
* a React component
|
|
19
|
-
* @return {?*} DOM element that may have the reactRoot ID, or null.
|
|
20
|
-
*/
|
|
21
|
-
function getReactRootElementInContainer(container) {
|
|
22
|
-
if (!container) {
|
|
23
|
-
return null;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
if (container.nodeType === DOC_NODE_TYPE) {
|
|
27
|
-
return container.documentElement;
|
|
28
|
-
} else {
|
|
29
|
-
return container.firstChild;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
module.exports = getReactRootElementInContainer;
|