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/warning.js
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* @providesModule warning
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
'use strict';
|
|
13
13
|
|
|
14
14
|
var emptyFunction = require("./emptyFunction");
|
|
15
15
|
|
|
@@ -22,20 +22,14 @@ var emptyFunction = require("./emptyFunction");
|
|
|
22
22
|
|
|
23
23
|
var warning = emptyFunction;
|
|
24
24
|
|
|
25
|
-
if (
|
|
26
|
-
warning = function(condition, format
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
'`warning(condition, format, ...args)` requires a warning ' +
|
|
30
|
-
'message argument'
|
|
31
|
-
);
|
|
25
|
+
if ('production' !== process.env.NODE_ENV) {
|
|
26
|
+
warning = function (condition, format) {
|
|
27
|
+
for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
|
28
|
+
args[_key - 2] = arguments[_key];
|
|
32
29
|
}
|
|
33
30
|
|
|
34
|
-
if (format
|
|
35
|
-
throw new Error(
|
|
36
|
-
'The warning format should be able to uniquely identify this ' +
|
|
37
|
-
'warning. Please, use a more descriptive format than: ' + format
|
|
38
|
-
);
|
|
31
|
+
if (format === undefined) {
|
|
32
|
+
throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument');
|
|
39
33
|
}
|
|
40
34
|
|
|
41
35
|
if (format.indexOf('Failed Composite propType: ') === 0) {
|
|
@@ -44,16 +38,20 @@ if ("production" !== process.env.NODE_ENV) {
|
|
|
44
38
|
|
|
45
39
|
if (!condition) {
|
|
46
40
|
var argIndex = 0;
|
|
47
|
-
var message = 'Warning: ' + format.replace(/%s/g, function()
|
|
48
|
-
|
|
41
|
+
var message = 'Warning: ' + format.replace(/%s/g, function () {
|
|
42
|
+
return args[argIndex++];
|
|
43
|
+
});
|
|
44
|
+
if (typeof console !== 'undefined') {
|
|
45
|
+
console.error(message);
|
|
46
|
+
}
|
|
49
47
|
try {
|
|
50
48
|
// --- Welcome to debugging React ---
|
|
51
49
|
// This error was thrown as a convenience so that you can use this stack
|
|
52
50
|
// to find the callsite that caused this warning to fire.
|
|
53
51
|
throw new Error(message);
|
|
54
|
-
} catch(x) {}
|
|
52
|
+
} catch (x) {}
|
|
55
53
|
}
|
|
56
54
|
};
|
|
57
55
|
}
|
|
58
56
|
|
|
59
|
-
module.exports = warning;
|
|
57
|
+
module.exports = warning;
|
package/package.json
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react",
|
|
3
3
|
"description": "React is a JavaScript library for building user interfaces.",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.14.0-beta1",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react"
|
|
7
7
|
],
|
|
8
8
|
"homepage": "https://github.com/facebook/react/tree/master/npm-react",
|
|
9
|
-
"bugs": "https://github.com/facebook/react/issues
|
|
9
|
+
"bugs": "https://github.com/facebook/react/issues",
|
|
10
10
|
"license": "BSD-3-Clause",
|
|
11
11
|
"files": [
|
|
12
|
-
"README.md",
|
|
13
12
|
"addons.js",
|
|
14
13
|
"react.js",
|
|
14
|
+
"addons/",
|
|
15
15
|
"dist/",
|
|
16
16
|
"lib/"
|
|
17
17
|
],
|
package/react.js
CHANGED
|
@@ -1 +1,53 @@
|
|
|
1
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var React = require('./lib/React');
|
|
4
|
+
|
|
5
|
+
var assign = require('./lib/Object.assign');
|
|
6
|
+
var deprecated = require('./lib/deprecated');
|
|
7
|
+
|
|
8
|
+
// We want to warn once when any of these methods are used.
|
|
9
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
10
|
+
var deprecations = {
|
|
11
|
+
// ReactDOMClient
|
|
12
|
+
findDOMNode: deprecated(
|
|
13
|
+
'findDOMNode',
|
|
14
|
+
'react-dom',
|
|
15
|
+
React,
|
|
16
|
+
React.findDOMNode
|
|
17
|
+
),
|
|
18
|
+
render: deprecated(
|
|
19
|
+
'render',
|
|
20
|
+
'react-dom',
|
|
21
|
+
React,
|
|
22
|
+
React.render
|
|
23
|
+
),
|
|
24
|
+
unmountComponentAtNode: deprecated(
|
|
25
|
+
'unmountComponentAtNode',
|
|
26
|
+
'react-dom',
|
|
27
|
+
React,
|
|
28
|
+
React.unmountComponentAtNode
|
|
29
|
+
),
|
|
30
|
+
// ReactDOMServer
|
|
31
|
+
renderToString: deprecated(
|
|
32
|
+
'renderToString',
|
|
33
|
+
'react-dom/server',
|
|
34
|
+
React,
|
|
35
|
+
React.renderToString
|
|
36
|
+
),
|
|
37
|
+
renderToStaticMarkup: deprecated(
|
|
38
|
+
'renderToStaticMarkup',
|
|
39
|
+
'react-dom/server',
|
|
40
|
+
React,
|
|
41
|
+
React.renderToStaticMarkup
|
|
42
|
+
),
|
|
43
|
+
};
|
|
44
|
+
// Export a wrapped object. We'll use assign and take advantage of the fact
|
|
45
|
+
// that this will override the original methods in React.
|
|
46
|
+
module.exports = assign(
|
|
47
|
+
{},
|
|
48
|
+
React,
|
|
49
|
+
deprecations
|
|
50
|
+
);
|
|
51
|
+
} else {
|
|
52
|
+
module.exports = React;
|
|
53
|
+
}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright 2014-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 LocalEventTrapMixin
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
'use strict';
|
|
13
|
-
|
|
14
|
-
var ReactBrowserEventEmitter = require("./ReactBrowserEventEmitter");
|
|
15
|
-
|
|
16
|
-
var accumulateInto = require("./accumulateInto");
|
|
17
|
-
var forEachAccumulated = require("./forEachAccumulated");
|
|
18
|
-
var invariant = require("./invariant");
|
|
19
|
-
|
|
20
|
-
function remove(event) {
|
|
21
|
-
event.remove();
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
var LocalEventTrapMixin = {
|
|
25
|
-
trapBubbledEvent:function(topLevelType, handlerBaseName) {
|
|
26
|
-
("production" !== process.env.NODE_ENV ? invariant(this.isMounted(), 'Must be mounted to trap events') : invariant(this.isMounted()));
|
|
27
|
-
// If a component renders to null or if another component fatals and causes
|
|
28
|
-
// the state of the tree to be corrupted, `node` here can be null.
|
|
29
|
-
var node = this.getDOMNode();
|
|
30
|
-
("production" !== process.env.NODE_ENV ? invariant(
|
|
31
|
-
node,
|
|
32
|
-
'LocalEventTrapMixin.trapBubbledEvent(...): Requires node to be rendered.'
|
|
33
|
-
) : invariant(node));
|
|
34
|
-
var listener = ReactBrowserEventEmitter.trapBubbledEvent(
|
|
35
|
-
topLevelType,
|
|
36
|
-
handlerBaseName,
|
|
37
|
-
node
|
|
38
|
-
);
|
|
39
|
-
this._localEventListeners =
|
|
40
|
-
accumulateInto(this._localEventListeners, listener);
|
|
41
|
-
},
|
|
42
|
-
|
|
43
|
-
// trapCapturedEvent would look nearly identical. We don't implement that
|
|
44
|
-
// method because it isn't currently needed.
|
|
45
|
-
|
|
46
|
-
componentWillUnmount:function() {
|
|
47
|
-
if (this._localEventListeners) {
|
|
48
|
-
forEachAccumulated(this._localEventListeners, remove);
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
module.exports = LocalEventTrapMixin;
|
|
@@ -1,56 +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 MobileSafariClickEventPlugin
|
|
10
|
-
* @typechecks static-only
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
'use strict';
|
|
14
|
-
|
|
15
|
-
var EventConstants = require("./EventConstants");
|
|
16
|
-
|
|
17
|
-
var emptyFunction = require("./emptyFunction");
|
|
18
|
-
|
|
19
|
-
var topLevelTypes = EventConstants.topLevelTypes;
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* Mobile Safari does not fire properly bubble click events on non-interactive
|
|
23
|
-
* elements, which means delegated click listeners do not fire. The workaround
|
|
24
|
-
* for this bug involves attaching an empty click listener on the target node.
|
|
25
|
-
*
|
|
26
|
-
* This particular plugin works around the bug by attaching an empty click
|
|
27
|
-
* listener on `touchstart` (which does fire on every element).
|
|
28
|
-
*/
|
|
29
|
-
var MobileSafariClickEventPlugin = {
|
|
30
|
-
|
|
31
|
-
eventTypes: null,
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* @param {string} topLevelType Record from `EventConstants`.
|
|
35
|
-
* @param {DOMEventTarget} topLevelTarget The listening component root node.
|
|
36
|
-
* @param {string} topLevelTargetID ID of `topLevelTarget`.
|
|
37
|
-
* @param {object} nativeEvent Native browser event.
|
|
38
|
-
* @return {*} An accumulation of synthetic events.
|
|
39
|
-
* @see {EventPluginHub.extractEvents}
|
|
40
|
-
*/
|
|
41
|
-
extractEvents: function(
|
|
42
|
-
topLevelType,
|
|
43
|
-
topLevelTarget,
|
|
44
|
-
topLevelTargetID,
|
|
45
|
-
nativeEvent) {
|
|
46
|
-
if (topLevelType === topLevelTypes.topTouchStart) {
|
|
47
|
-
var target = nativeEvent.target;
|
|
48
|
-
if (target && !target.onclick) {
|
|
49
|
-
target.onclick = emptyFunction;
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
module.exports = MobileSafariClickEventPlugin;
|
package/lib/ReactContext.js
DELETED
|
@@ -1,74 +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 ReactContext
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
'use strict';
|
|
13
|
-
|
|
14
|
-
var assign = require("./Object.assign");
|
|
15
|
-
var emptyObject = require("./emptyObject");
|
|
16
|
-
var warning = require("./warning");
|
|
17
|
-
|
|
18
|
-
var didWarn = false;
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* Keeps track of the current context.
|
|
22
|
-
*
|
|
23
|
-
* The context is automatically passed down the component ownership hierarchy
|
|
24
|
-
* and is accessible via `this.context` on ReactCompositeComponents.
|
|
25
|
-
*/
|
|
26
|
-
var ReactContext = {
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* @internal
|
|
30
|
-
* @type {object}
|
|
31
|
-
*/
|
|
32
|
-
current: emptyObject,
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* Temporarily extends the current context while executing scopedCallback.
|
|
36
|
-
*
|
|
37
|
-
* A typical use case might look like
|
|
38
|
-
*
|
|
39
|
-
* render: function() {
|
|
40
|
-
* var children = ReactContext.withContext({foo: 'foo'}, () => (
|
|
41
|
-
*
|
|
42
|
-
* ));
|
|
43
|
-
* return <div>{children}</div>;
|
|
44
|
-
* }
|
|
45
|
-
*
|
|
46
|
-
* @param {object} newContext New context to merge into the existing context
|
|
47
|
-
* @param {function} scopedCallback Callback to run with the new context
|
|
48
|
-
* @return {ReactComponent|array<ReactComponent>}
|
|
49
|
-
*/
|
|
50
|
-
withContext: function(newContext, scopedCallback) {
|
|
51
|
-
if ("production" !== process.env.NODE_ENV) {
|
|
52
|
-
("production" !== process.env.NODE_ENV ? warning(
|
|
53
|
-
didWarn,
|
|
54
|
-
'withContext is deprecated and will be removed in a future version. ' +
|
|
55
|
-
'Use a wrapper component with getChildContext instead.'
|
|
56
|
-
) : null);
|
|
57
|
-
|
|
58
|
-
didWarn = true;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
var result;
|
|
62
|
-
var previousContext = ReactContext.current;
|
|
63
|
-
ReactContext.current = assign({}, previousContext, newContext);
|
|
64
|
-
try {
|
|
65
|
-
result = scopedCallback();
|
|
66
|
-
} finally {
|
|
67
|
-
ReactContext.current = previousContext;
|
|
68
|
-
}
|
|
69
|
-
return result;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
};
|
|
73
|
-
|
|
74
|
-
module.exports = ReactContext;
|
package/lib/ReactDOMForm.js
DELETED
|
@@ -1,47 +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 ReactDOMForm
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
'use strict';
|
|
13
|
-
|
|
14
|
-
var EventConstants = require("./EventConstants");
|
|
15
|
-
var LocalEventTrapMixin = require("./LocalEventTrapMixin");
|
|
16
|
-
var ReactBrowserComponentMixin = require("./ReactBrowserComponentMixin");
|
|
17
|
-
var ReactClass = require("./ReactClass");
|
|
18
|
-
var ReactElement = require("./ReactElement");
|
|
19
|
-
|
|
20
|
-
var form = ReactElement.createFactory('form');
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Since onSubmit doesn't bubble OR capture on the top level in IE8, we need
|
|
24
|
-
* to capture it on the <form> element itself. There are lots of hacks we could
|
|
25
|
-
* do to accomplish this, but the most reliable is to make <form> a
|
|
26
|
-
* composite component and use `componentDidMount` to attach the event handlers.
|
|
27
|
-
*/
|
|
28
|
-
var ReactDOMForm = ReactClass.createClass({
|
|
29
|
-
displayName: 'ReactDOMForm',
|
|
30
|
-
tagName: 'FORM',
|
|
31
|
-
|
|
32
|
-
mixins: [ReactBrowserComponentMixin, LocalEventTrapMixin],
|
|
33
|
-
|
|
34
|
-
render: function() {
|
|
35
|
-
// TODO: Instead of using `ReactDOM` directly, we should use JSX. However,
|
|
36
|
-
// `jshint` fails to parse JSX so in order for linting to work in the open
|
|
37
|
-
// source repo, we need to just use `ReactDOM.form`.
|
|
38
|
-
return form(this.props);
|
|
39
|
-
},
|
|
40
|
-
|
|
41
|
-
componentDidMount: function() {
|
|
42
|
-
this.trapBubbledEvent(EventConstants.topLevelTypes.topReset, 'reset');
|
|
43
|
-
this.trapBubbledEvent(EventConstants.topLevelTypes.topSubmit, 'submit');
|
|
44
|
-
}
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
module.exports = ReactDOMForm;
|
package/lib/ReactDOMIframe.js
DELETED
|
@@ -1,43 +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 ReactDOMIframe
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
'use strict';
|
|
13
|
-
|
|
14
|
-
var EventConstants = require("./EventConstants");
|
|
15
|
-
var LocalEventTrapMixin = require("./LocalEventTrapMixin");
|
|
16
|
-
var ReactBrowserComponentMixin = require("./ReactBrowserComponentMixin");
|
|
17
|
-
var ReactClass = require("./ReactClass");
|
|
18
|
-
var ReactElement = require("./ReactElement");
|
|
19
|
-
|
|
20
|
-
var iframe = ReactElement.createFactory('iframe');
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Since onLoad doesn't bubble OR capture on the top level in IE8, we need to
|
|
24
|
-
* capture it on the <iframe> element itself. There are lots of hacks we could
|
|
25
|
-
* do to accomplish this, but the most reliable is to make <iframe> a composite
|
|
26
|
-
* component and use `componentDidMount` to attach the event handlers.
|
|
27
|
-
*/
|
|
28
|
-
var ReactDOMIframe = ReactClass.createClass({
|
|
29
|
-
displayName: 'ReactDOMIframe',
|
|
30
|
-
tagName: 'IFRAME',
|
|
31
|
-
|
|
32
|
-
mixins: [ReactBrowserComponentMixin, LocalEventTrapMixin],
|
|
33
|
-
|
|
34
|
-
render: function() {
|
|
35
|
-
return iframe(this.props);
|
|
36
|
-
},
|
|
37
|
-
|
|
38
|
-
componentDidMount: function() {
|
|
39
|
-
this.trapBubbledEvent(EventConstants.topLevelTypes.topLoad, 'load');
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
module.exports = ReactDOMIframe;
|
package/lib/ReactDOMImg.js
DELETED
|
@@ -1,44 +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 ReactDOMImg
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
'use strict';
|
|
13
|
-
|
|
14
|
-
var EventConstants = require("./EventConstants");
|
|
15
|
-
var LocalEventTrapMixin = require("./LocalEventTrapMixin");
|
|
16
|
-
var ReactBrowserComponentMixin = require("./ReactBrowserComponentMixin");
|
|
17
|
-
var ReactClass = require("./ReactClass");
|
|
18
|
-
var ReactElement = require("./ReactElement");
|
|
19
|
-
|
|
20
|
-
var img = ReactElement.createFactory('img');
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Since onLoad doesn't bubble OR capture on the top level in IE8, we need to
|
|
24
|
-
* capture it on the <img> element itself. There are lots of hacks we could do
|
|
25
|
-
* to accomplish this, but the most reliable is to make <img> a composite
|
|
26
|
-
* component and use `componentDidMount` to attach the event handlers.
|
|
27
|
-
*/
|
|
28
|
-
var ReactDOMImg = ReactClass.createClass({
|
|
29
|
-
displayName: 'ReactDOMImg',
|
|
30
|
-
tagName: 'IMG',
|
|
31
|
-
|
|
32
|
-
mixins: [ReactBrowserComponentMixin, LocalEventTrapMixin],
|
|
33
|
-
|
|
34
|
-
render: function() {
|
|
35
|
-
return img(this.props);
|
|
36
|
-
},
|
|
37
|
-
|
|
38
|
-
componentDidMount: function() {
|
|
39
|
-
this.trapBubbledEvent(EventConstants.topLevelTypes.topLoad, 'load');
|
|
40
|
-
this.trapBubbledEvent(EventConstants.topLevelTypes.topError, 'error');
|
|
41
|
-
}
|
|
42
|
-
});
|
|
43
|
-
|
|
44
|
-
module.exports = ReactDOMImg;
|