react 0.14.10 → 0.15.0-alpha.1
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/LICENSE +1 -1
- package/dist/react-with-addons.js +2944 -3425
- package/dist/react-with-addons.min.js +7 -7
- package/dist/react.js +2769 -3045
- package/dist/react.min.js +7 -7
- package/lib/AutoFocusUtils.js +3 -15
- package/lib/BeforeInputEventPlugin.js +8 -25
- package/lib/CSSProperty.js +3 -1
- package/lib/CSSPropertyOperations.js +20 -6
- package/lib/CallbackQueue.js +12 -1
- package/lib/ChangeEventPlugin.js +58 -54
- package/lib/DOMChildrenOperations.js +21 -60
- package/lib/DOMLazyTree.js +95 -0
- package/lib/{ClientReactRootIndex.js → DOMNamespaces.js} +7 -10
- package/lib/DOMProperty.js +7 -2
- package/lib/DOMPropertyOperations.js +66 -36
- package/lib/Danger.js +6 -7
- package/lib/DefaultEventPluginOrder.js +1 -1
- package/lib/EnterLeaveEventPlugin.js +24 -43
- package/lib/EventConstants.js +2 -1
- package/lib/EventPluginHub.js +15 -59
- package/lib/EventPluginRegistry.js +23 -2
- package/lib/EventPluginUtils.js +60 -35
- package/lib/EventPropagators.js +19 -17
- package/lib/FallbackCompositionState.js +1 -2
- package/lib/HTMLDOMPropertyConfig.js +21 -23
- package/lib/LinkedInput.js +49 -0
- package/lib/LinkedStateMixin.js +1 -2
- package/lib/LinkedValueUtils.js +2 -3
- package/lib/MetaMatchers.js +2 -2
- package/lib/Object.assign.js +1 -1
- package/lib/OrderedMap.js +1 -1
- package/lib/PooledClass.js +1 -1
- package/lib/React.js +1 -13
- package/lib/ReactBrowserEventEmitter.js +3 -23
- package/lib/ReactCSSTransitionGroup.js +1 -2
- package/lib/ReactCSSTransitionGroupChild.js +1 -6
- package/lib/ReactChildReconciler.js +12 -10
- package/lib/ReactChildren.js +3 -3
- package/lib/ReactClass.js +18 -67
- package/lib/ReactComponent.js +2 -5
- package/lib/ReactComponentBrowserEnvironment.js +9 -6
- package/lib/ReactComponentEnvironment.js +3 -3
- package/lib/ReactComponentWithPureRenderMixin.js +2 -2
- package/lib/ReactCompositeComponent.js +95 -30
- package/lib/ReactCurrentOwner.js +1 -1
- package/lib/ReactDOM.js +26 -14
- package/lib/ReactDOMButton.js +2 -2
- package/lib/ReactDOMComponent.js +156 -218
- package/lib/ReactDOMComponentFlags.js +18 -0
- package/lib/ReactDOMComponentTree.js +186 -0
- package/lib/ReactDOMContainerInfo.js +32 -0
- package/lib/ReactDOMDebugTool.js +69 -0
- package/lib/ReactDOMEmptyComponent.js +61 -0
- package/lib/ReactDOMFactories.js +1 -2
- package/lib/ReactDOMFeatureFlags.js +2 -2
- package/lib/ReactDOMIDOperations.js +5 -60
- package/lib/ReactDOMInput.js +52 -23
- package/lib/ReactDOMInstrumentation.js +16 -0
- package/lib/ReactDOMOption.js +9 -8
- package/lib/ReactDOMSVGDeprecatedAttributeDevtool.js +57 -0
- package/lib/ReactDOMSelect.js +35 -14
- package/lib/ReactDOMSelection.js +2 -2
- package/lib/ReactDOMServer.js +1 -1
- package/lib/ReactDOMTextComponent.js +41 -21
- package/lib/ReactDOMTextarea.js +32 -5
- package/lib/ReactDOMTreeTraversal.js +134 -0
- package/lib/ReactDOMUnknownPropertyDevtool.js +64 -0
- package/lib/ReactDefaultBatchingStrategy.js +1 -1
- package/lib/ReactDefaultInjection.js +11 -15
- package/lib/ReactDefaultPerf.js +49 -19
- package/lib/ReactDefaultPerfAnalysis.js +16 -9
- package/lib/ReactElement.js +9 -5
- package/lib/ReactElementValidator.js +2 -2
- package/lib/ReactEmptyComponent.js +8 -33
- package/lib/ReactErrorUtils.js +1 -2
- package/lib/ReactEventEmitterMixin.js +3 -8
- package/lib/ReactEventListener.js +20 -75
- package/lib/ReactFeatureFlags.js +21 -0
- package/lib/ReactFragment.js +2 -2
- package/lib/ReactInjection.js +3 -3
- package/lib/ReactInputSelection.js +3 -3
- package/lib/ReactInstanceHandles.js +4 -6
- package/lib/ReactInstanceMap.js +1 -1
- package/lib/ReactIsomorphic.js +1 -1
- package/lib/ReactLink.js +1 -2
- package/lib/ReactMarkupChecksum.js +1 -1
- package/lib/ReactMount.js +67 -445
- package/lib/ReactMultiChild.js +104 -198
- package/lib/ReactMultiChildUpdateTypes.js +1 -1
- package/lib/ReactNativeComponent.js +1 -1
- package/lib/ReactNodeTypes.js +37 -0
- package/lib/ReactNoopUpdateQueue.js +1 -24
- package/lib/ReactOwner.js +1 -1
- package/lib/ReactPerf.js +1 -2
- package/lib/ReactPropTransferer.js +1 -1
- package/lib/ReactPropTypeLocationNames.js +1 -1
- package/lib/ReactPropTypeLocations.js +1 -1
- package/lib/ReactPropTypes.js +12 -6
- package/lib/ReactReconcileTransaction.js +17 -6
- package/lib/ReactReconciler.js +14 -5
- package/lib/ReactRef.js +1 -1
- package/lib/ReactServerBatchingStrategy.js +1 -2
- package/lib/ReactServerRendering.js +15 -33
- package/lib/ReactServerRenderingTransaction.js +8 -26
- package/lib/ReactSimpleEmptyComponent.js +37 -0
- package/lib/ReactStateSetters.js +1 -1
- package/lib/ReactTestUtils.js +25 -15
- package/lib/ReactTransitionChildMapping.js +1 -2
- package/lib/ReactTransitionEvents.js +1 -1
- package/lib/ReactTransitionGroup.js +1 -1
- package/lib/ReactUpdateQueue.js +4 -4
- package/lib/ReactUpdates.js +19 -2
- package/lib/ReactVersion.js +2 -2
- package/lib/ReactWithAddons.js +1 -3
- package/lib/ResponderEventPlugin.js +53 -65
- package/lib/ResponderSyntheticEvent.js +1 -2
- package/lib/ResponderTouchHistoryStore.js +1 -1
- package/lib/SVGDOMPropertyConfig.js +2 -39
- package/lib/SelectEventPlugin.js +13 -18
- package/lib/SimpleEventPlugin.js +18 -16
- package/lib/SyntheticClipboardEvent.js +1 -2
- package/lib/SyntheticCompositionEvent.js +1 -2
- package/lib/SyntheticDragEvent.js +1 -2
- package/lib/SyntheticEvent.js +10 -7
- package/lib/SyntheticFocusEvent.js +1 -2
- package/lib/SyntheticInputEvent.js +1 -2
- package/lib/SyntheticKeyboardEvent.js +1 -2
- package/lib/SyntheticMouseEvent.js +1 -2
- package/lib/SyntheticTouchEvent.js +1 -2
- package/lib/SyntheticUIEvent.js +1 -2
- package/lib/SyntheticWheelEvent.js +1 -2
- package/lib/TapEventPlugin.js +3 -12
- package/lib/Transaction.js +1 -1
- package/lib/ViewportMetrics.js +1 -1
- package/lib/accumulate.js +1 -1
- package/lib/accumulateInto.js +1 -1
- package/lib/adler32.js +3 -2
- package/lib/canDefineProperty.js +1 -1
- package/lib/createHierarchyRenderer.js +1 -1
- package/lib/dangerousStyleValue.js +25 -3
- package/lib/deprecated.js +1 -1
- package/lib/escapeTextContentForBrowser.js +1 -1
- package/lib/findDOMNode.js +15 -8
- package/lib/flattenChildren.js +1 -1
- package/lib/forEachAccumulated.js +1 -1
- package/lib/getEventCharCode.js +1 -2
- package/lib/getEventKey.js +1 -2
- package/lib/getEventModifierState.js +1 -2
- package/lib/getEventTarget.js +1 -2
- package/lib/getIteratorFn.js +1 -2
- package/lib/getNativeComponentFromComposite.js +30 -0
- package/lib/getNodeForCharacterOffset.js +1 -1
- package/lib/getTestDocument.js +1 -1
- package/lib/getTextContentAccessor.js +1 -1
- package/lib/instantiateReactComponent.js +3 -4
- package/lib/isEventSupported.js +1 -1
- package/lib/isTextInputElement.js +1 -1
- package/lib/onlyChild.js +1 -1
- package/lib/quoteAttributeValueForBrowser.js +1 -1
- package/lib/reactComponentExpect.js +1 -1
- package/lib/renderSubtreeIntoContainer.js +1 -1
- package/lib/setInnerHTML.js +1 -1
- package/lib/setTextContent.js +1 -1
- package/lib/shallowCompare.js +1 -1
- package/lib/shouldUpdateReactComponent.js +1 -3
- package/lib/sliceChildren.js +1 -1
- package/lib/traverseAllChildren.js +6 -6
- package/lib/update.js +1 -1
- package/lib/validateDOMNesting.js +8 -9
- package/package.json +22 -32
- package/cjs/react-jsx-dev-runtime.development.js +0 -861
- package/cjs/react-jsx-dev-runtime.production.min.js +0 -9
- package/cjs/react-jsx-runtime.development.js +0 -883
- package/cjs/react-jsx-runtime.production.min.js +0 -10
- package/jsx-dev-runtime.js +0 -7
- package/jsx-runtime.js +0 -7
- package/lib/ReactBrowserComponentMixin.js +0 -36
- package/lib/ReactEmptyComponentRegistry.js +0 -48
- package/lib/ReactRootIndex.js +0 -29
- package/lib/ServerReactRootIndex.js +0 -29
- package/lib/cloneWithProps.js +0 -54
- package/lib/webcomponents.js +0 -6379
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright 2013-
|
|
2
|
+
* Copyright 2013-present, Facebook, Inc.
|
|
3
3
|
* All rights reserved.
|
|
4
4
|
*
|
|
5
5
|
* This source code is licensed under the BSD-style license found in the
|
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
8
8
|
*
|
|
9
9
|
* @providesModule SyntheticTouchEvent
|
|
10
|
-
* @typechecks static-only
|
|
11
10
|
*/
|
|
12
11
|
|
|
13
12
|
'use strict';
|
package/lib/SyntheticUIEvent.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright 2013-
|
|
2
|
+
* Copyright 2013-present, Facebook, Inc.
|
|
3
3
|
* All rights reserved.
|
|
4
4
|
*
|
|
5
5
|
* This source code is licensed under the BSD-style license found in the
|
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
8
8
|
*
|
|
9
9
|
* @providesModule SyntheticUIEvent
|
|
10
|
-
* @typechecks static-only
|
|
11
10
|
*/
|
|
12
11
|
|
|
13
12
|
'use strict';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright 2013-
|
|
2
|
+
* Copyright 2013-present, Facebook, Inc.
|
|
3
3
|
* All rights reserved.
|
|
4
4
|
*
|
|
5
5
|
* This source code is licensed under the BSD-style license found in the
|
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
8
8
|
*
|
|
9
9
|
* @providesModule SyntheticWheelEvent
|
|
10
|
-
* @typechecks static-only
|
|
11
10
|
*/
|
|
12
11
|
|
|
13
12
|
'use strict';
|
package/lib/TapEventPlugin.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright 2013-
|
|
2
|
+
* Copyright 2013-present, Facebook, Inc.
|
|
3
3
|
* All rights reserved.
|
|
4
4
|
*
|
|
5
5
|
* This source code is licensed under the BSD-style license found in the
|
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
8
8
|
*
|
|
9
9
|
* @providesModule TapEventPlugin
|
|
10
|
-
* @typechecks static-only
|
|
11
10
|
*/
|
|
12
11
|
|
|
13
12
|
'use strict';
|
|
@@ -75,15 +74,7 @@ var TapEventPlugin = {
|
|
|
75
74
|
|
|
76
75
|
eventTypes: eventTypes,
|
|
77
76
|
|
|
78
|
-
|
|
79
|
-
* @param {string} topLevelType Record from `EventConstants`.
|
|
80
|
-
* @param {DOMEventTarget} topLevelTarget The listening component root node.
|
|
81
|
-
* @param {string} topLevelTargetID ID of `topLevelTarget`.
|
|
82
|
-
* @param {object} nativeEvent Native browser event.
|
|
83
|
-
* @return {*} An accumulation of synthetic events.
|
|
84
|
-
* @see {EventPluginHub.extractEvents}
|
|
85
|
-
*/
|
|
86
|
-
extractEvents: function (topLevelType, topLevelTarget, topLevelTargetID, nativeEvent, nativeEventTarget) {
|
|
77
|
+
extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {
|
|
87
78
|
if (!isStartish(topLevelType) && !isEndish(topLevelType)) {
|
|
88
79
|
return null;
|
|
89
80
|
}
|
|
@@ -101,7 +92,7 @@ var TapEventPlugin = {
|
|
|
101
92
|
var event = null;
|
|
102
93
|
var distance = getDistance(startCoords, nativeEvent);
|
|
103
94
|
if (isEndish(topLevelType) && distance < tapMoveThreshold) {
|
|
104
|
-
event = SyntheticUIEvent.getPooled(eventTypes.touchTap,
|
|
95
|
+
event = SyntheticUIEvent.getPooled(eventTypes.touchTap, targetInst, nativeEvent, nativeEventTarget);
|
|
105
96
|
}
|
|
106
97
|
if (isStartish(topLevelType)) {
|
|
107
98
|
startCoords.x = getAxisCoordOfEvent(Axis.x, nativeEvent);
|
package/lib/Transaction.js
CHANGED
package/lib/ViewportMetrics.js
CHANGED
package/lib/accumulate.js
CHANGED
package/lib/accumulateInto.js
CHANGED
package/lib/adler32.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright 2013-
|
|
2
|
+
* Copyright 2013-present, Facebook, Inc.
|
|
3
3
|
* All rights reserved.
|
|
4
4
|
*
|
|
5
5
|
* This source code is licensed under the BSD-style license found in the
|
|
@@ -25,7 +25,8 @@ function adler32(data) {
|
|
|
25
25
|
var l = data.length;
|
|
26
26
|
var m = l & ~0x3;
|
|
27
27
|
while (i < m) {
|
|
28
|
-
|
|
28
|
+
var n = Math.min(i + 4096, m);
|
|
29
|
+
for (; i < n; i += 4) {
|
|
29
30
|
b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));
|
|
30
31
|
}
|
|
31
32
|
a %= MOD;
|
package/lib/canDefineProperty.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright 2013-
|
|
2
|
+
* Copyright 2013-present, Facebook, Inc.
|
|
3
3
|
* All rights reserved.
|
|
4
4
|
*
|
|
5
5
|
* This source code is licensed under the BSD-style license found in the
|
|
@@ -7,14 +7,15 @@
|
|
|
7
7
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
8
8
|
*
|
|
9
9
|
* @providesModule dangerousStyleValue
|
|
10
|
-
* @typechecks static-only
|
|
11
10
|
*/
|
|
12
11
|
|
|
13
12
|
'use strict';
|
|
14
13
|
|
|
15
14
|
var CSSProperty = require('./CSSProperty');
|
|
15
|
+
var warning = require('fbjs/lib/warning');
|
|
16
16
|
|
|
17
17
|
var isUnitlessNumber = CSSProperty.isUnitlessNumber;
|
|
18
|
+
var styleWarnings = {};
|
|
18
19
|
|
|
19
20
|
/**
|
|
20
21
|
* Convert a value into the proper css writable value. The style name `name`
|
|
@@ -23,9 +24,10 @@ var isUnitlessNumber = CSSProperty.isUnitlessNumber;
|
|
|
23
24
|
*
|
|
24
25
|
* @param {string} name CSS property name such as `topMargin`.
|
|
25
26
|
* @param {*} value CSS property value such as `10px`.
|
|
27
|
+
* @param {ReactDOMComponent} component
|
|
26
28
|
* @return {string} Normalized style value with dimensions applied.
|
|
27
29
|
*/
|
|
28
|
-
function dangerousStyleValue(name, value) {
|
|
30
|
+
function dangerousStyleValue(name, value, component) {
|
|
29
31
|
// Note that we've removed escapeTextForBrowser() calls here since the
|
|
30
32
|
// whole string will be escaped when the attribute is injected into
|
|
31
33
|
// the markup. If you provide unsafe user data here they can inject
|
|
@@ -47,6 +49,26 @@ function dangerousStyleValue(name, value) {
|
|
|
47
49
|
}
|
|
48
50
|
|
|
49
51
|
if (typeof value === 'string') {
|
|
52
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
53
|
+
if (component) {
|
|
54
|
+
var owner = component._currentElement._owner;
|
|
55
|
+
var ownerName = owner ? owner.getName() : null;
|
|
56
|
+
if (ownerName && !styleWarnings[ownerName]) {
|
|
57
|
+
styleWarnings[ownerName] = {};
|
|
58
|
+
}
|
|
59
|
+
var warned = false;
|
|
60
|
+
if (ownerName) {
|
|
61
|
+
var warnings = styleWarnings[ownerName];
|
|
62
|
+
warned = warnings[name];
|
|
63
|
+
if (!warned) {
|
|
64
|
+
warnings[name] = true;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
if (!warned) {
|
|
68
|
+
process.env.NODE_ENV !== 'production' ? warning(false, 'a `%s` tag (owner: `%s`) was passed a numeric string value ' + 'for CSS property `%s` (value: `%s`) which will be treated ' + 'as a unitless number in a future version of React.', component._currentElement.type, ownerName || 'unknown', name, value) : undefined;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
50
72
|
value = value.trim();
|
|
51
73
|
}
|
|
52
74
|
return value + 'px';
|
package/lib/deprecated.js
CHANGED
package/lib/findDOMNode.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright 2013-
|
|
2
|
+
* Copyright 2013-present, Facebook, Inc.
|
|
3
3
|
* All rights reserved.
|
|
4
4
|
*
|
|
5
5
|
* This source code is licensed under the BSD-style license found in the
|
|
@@ -7,15 +7,15 @@
|
|
|
7
7
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
8
8
|
*
|
|
9
9
|
* @providesModule findDOMNode
|
|
10
|
-
* @typechecks static-only
|
|
11
10
|
*/
|
|
12
11
|
|
|
13
12
|
'use strict';
|
|
14
13
|
|
|
15
14
|
var ReactCurrentOwner = require('./ReactCurrentOwner');
|
|
15
|
+
var ReactDOMComponentTree = require('./ReactDOMComponentTree');
|
|
16
16
|
var ReactInstanceMap = require('./ReactInstanceMap');
|
|
17
|
-
var ReactMount = require('./ReactMount');
|
|
18
17
|
|
|
18
|
+
var getNativeComponentFromComposite = require('./getNativeComponentFromComposite');
|
|
19
19
|
var invariant = require('fbjs/lib/invariant');
|
|
20
20
|
var warning = require('fbjs/lib/warning');
|
|
21
21
|
|
|
@@ -29,7 +29,7 @@ function findDOMNode(componentOrElement) {
|
|
|
29
29
|
if (process.env.NODE_ENV !== 'production') {
|
|
30
30
|
var owner = ReactCurrentOwner.current;
|
|
31
31
|
if (owner !== null) {
|
|
32
|
-
process.env.NODE_ENV !== 'production' ? warning(owner._warnedAboutRefsInRender, '%s is accessing
|
|
32
|
+
process.env.NODE_ENV !== 'production' ? warning(owner._warnedAboutRefsInRender, '%s is accessing findDOMNode inside its render(). ' + 'render() should be a pure function of props and state. It should ' + 'never access something that requires stale data from the previous ' + 'render, such as refs. Move this logic to componentDidMount and ' + 'componentDidUpdate instead.', owner.getName() || 'A component') : undefined;
|
|
33
33
|
owner._warnedAboutRefsInRender = true;
|
|
34
34
|
}
|
|
35
35
|
}
|
|
@@ -39,11 +39,18 @@ function findDOMNode(componentOrElement) {
|
|
|
39
39
|
if (componentOrElement.nodeType === 1) {
|
|
40
40
|
return componentOrElement;
|
|
41
41
|
}
|
|
42
|
-
|
|
43
|
-
|
|
42
|
+
|
|
43
|
+
var inst = ReactInstanceMap.get(componentOrElement);
|
|
44
|
+
if (inst) {
|
|
45
|
+
inst = getNativeComponentFromComposite(inst);
|
|
46
|
+
return inst ? ReactDOMComponentTree.getNodeFromInstance(inst) : null;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
if (typeof componentOrElement.render === 'function') {
|
|
50
|
+
!false ? process.env.NODE_ENV !== 'production' ? invariant(false, 'findDOMNode was called on an unmounted component.') : invariant(false) : undefined;
|
|
51
|
+
} else {
|
|
52
|
+
!false ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Element appears to be neither ReactComponent nor DOMNode (keys: %s)', Object.keys(componentOrElement)) : invariant(false) : undefined;
|
|
44
53
|
}
|
|
45
|
-
!(componentOrElement.render == null || typeof componentOrElement.render !== 'function') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'findDOMNode was called on an unmounted component.') : invariant(false) : undefined;
|
|
46
|
-
!false ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Element appears to be neither ReactComponent nor DOMNode (keys: %s)', Object.keys(componentOrElement)) : invariant(false) : undefined;
|
|
47
54
|
}
|
|
48
55
|
|
|
49
56
|
module.exports = findDOMNode;
|
package/lib/flattenChildren.js
CHANGED
package/lib/getEventCharCode.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright 2013-
|
|
2
|
+
* Copyright 2013-present, Facebook, Inc.
|
|
3
3
|
* All rights reserved.
|
|
4
4
|
*
|
|
5
5
|
* This source code is licensed under the BSD-style license found in the
|
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
8
8
|
*
|
|
9
9
|
* @providesModule getEventCharCode
|
|
10
|
-
* @typechecks static-only
|
|
11
10
|
*/
|
|
12
11
|
|
|
13
12
|
'use strict';
|
package/lib/getEventKey.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright 2013-
|
|
2
|
+
* Copyright 2013-present, Facebook, Inc.
|
|
3
3
|
* All rights reserved.
|
|
4
4
|
*
|
|
5
5
|
* This source code is licensed under the BSD-style license found in the
|
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
8
8
|
*
|
|
9
9
|
* @providesModule getEventKey
|
|
10
|
-
* @typechecks static-only
|
|
11
10
|
*/
|
|
12
11
|
|
|
13
12
|
'use strict';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright 2013-
|
|
2
|
+
* Copyright 2013-present, Facebook, Inc.
|
|
3
3
|
* All rights reserved.
|
|
4
4
|
*
|
|
5
5
|
* This source code is licensed under the BSD-style license found in the
|
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
8
8
|
*
|
|
9
9
|
* @providesModule getEventModifierState
|
|
10
|
-
* @typechecks static-only
|
|
11
10
|
*/
|
|
12
11
|
|
|
13
12
|
'use strict';
|
package/lib/getEventTarget.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright 2013-
|
|
2
|
+
* Copyright 2013-present, Facebook, Inc.
|
|
3
3
|
* All rights reserved.
|
|
4
4
|
*
|
|
5
5
|
* This source code is licensed under the BSD-style license found in the
|
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
8
8
|
*
|
|
9
9
|
* @providesModule getEventTarget
|
|
10
|
-
* @typechecks static-only
|
|
11
10
|
*/
|
|
12
11
|
|
|
13
12
|
'use strict';
|
package/lib/getIteratorFn.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright 2013-
|
|
2
|
+
* Copyright 2013-present, Facebook, Inc.
|
|
3
3
|
* All rights reserved.
|
|
4
4
|
*
|
|
5
5
|
* This source code is licensed under the BSD-style license found in the
|
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
8
8
|
*
|
|
9
9
|
* @providesModule getIteratorFn
|
|
10
|
-
* @typechecks static-only
|
|
11
10
|
*/
|
|
12
11
|
|
|
13
12
|
'use strict';
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2013-present, 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 getNativeComponentFromComposite
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
'use strict';
|
|
13
|
+
|
|
14
|
+
var ReactNodeTypes = require('./ReactNodeTypes');
|
|
15
|
+
|
|
16
|
+
function getNativeComponentFromComposite(inst) {
|
|
17
|
+
var type;
|
|
18
|
+
|
|
19
|
+
while ((type = inst._renderedNodeType) === ReactNodeTypes.COMPOSITE) {
|
|
20
|
+
inst = inst._renderedComponent;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
if (type === ReactNodeTypes.NATIVE) {
|
|
24
|
+
return inst._renderedComponent;
|
|
25
|
+
} else if (type === ReactNodeTypes.EMPTY) {
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
module.exports = getNativeComponentFromComposite;
|
package/lib/getTestDocument.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright 2013-
|
|
2
|
+
* Copyright 2013-present, Facebook, Inc.
|
|
3
3
|
* All rights reserved.
|
|
4
4
|
*
|
|
5
5
|
* This source code is licensed under the BSD-style license found in the
|
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
8
8
|
*
|
|
9
9
|
* @providesModule instantiateReactComponent
|
|
10
|
-
* @typechecks static-only
|
|
11
10
|
*/
|
|
12
11
|
|
|
13
12
|
'use strict';
|
|
@@ -58,7 +57,7 @@ function instantiateReactComponent(node) {
|
|
|
58
57
|
var instance;
|
|
59
58
|
|
|
60
59
|
if (node === null || node === false) {
|
|
61
|
-
instance =
|
|
60
|
+
instance = ReactEmptyComponent.create(instantiateReactComponent);
|
|
62
61
|
} else if (typeof node === 'object') {
|
|
63
62
|
var element = node;
|
|
64
63
|
!(element && (typeof element.type === 'function' || typeof element.type === 'string')) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Element type is invalid: expected a string (for built-in components) ' + 'or a class/function (for composite components) but got: %s.%s', element.type == null ? element.type : typeof element.type, getDeclarationErrorAddendum(element._owner)) : invariant(false) : undefined;
|
|
@@ -81,7 +80,7 @@ function instantiateReactComponent(node) {
|
|
|
81
80
|
}
|
|
82
81
|
|
|
83
82
|
if (process.env.NODE_ENV !== 'production') {
|
|
84
|
-
process.env.NODE_ENV !== 'production' ? warning(typeof instance.construct === 'function' && typeof instance.mountComponent === 'function' && typeof instance.receiveComponent === 'function' && typeof instance.unmountComponent === 'function', 'Only React Components can be mounted.') : undefined;
|
|
83
|
+
process.env.NODE_ENV !== 'production' ? warning(typeof instance.construct === 'function' && typeof instance.mountComponent === 'function' && typeof instance.receiveComponent === 'function' && typeof instance.getNativeNode === 'function' && typeof instance.unmountComponent === 'function', 'Only React Components can be mounted.') : undefined;
|
|
85
84
|
}
|
|
86
85
|
|
|
87
86
|
// Sets up the instance. This can probably just move into the constructor now.
|