react 0.14.0-beta1 → 0.14.0
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/addons.js +8 -3
- package/dist/react-with-addons.js +5048 -4095
- package/dist/react-with-addons.min.js +6 -6
- package/dist/react.js +4555 -3729
- package/dist/react.min.js +6 -5
- package/lib/AutoFocusUtils.js +3 -3
- package/lib/BeforeInputEventPlugin.js +13 -13
- package/lib/CSSProperty.js +18 -3
- package/lib/CSSPropertyOperations.js +27 -14
- package/lib/CallbackQueue.js +4 -4
- package/lib/ChangeEventPlugin.js +15 -14
- package/lib/DOMChildrenOperations.js +22 -7
- package/lib/DOMProperty.js +8 -8
- package/lib/DOMPropertyOperations.js +23 -10
- package/lib/Danger.js +21 -16
- package/lib/DefaultEventPluginOrder.js +2 -2
- package/lib/EnterLeaveEventPlugin.js +18 -10
- package/lib/EventConstants.js +23 -1
- package/lib/EventPluginHub.js +29 -21
- package/lib/EventPluginRegistry.js +8 -8
- package/lib/EventPluginUtils.js +34 -38
- package/lib/EventPropagators.js +8 -8
- package/lib/FallbackCompositionState.js +9 -3
- package/lib/HTMLDOMPropertyConfig.js +24 -4
- package/lib/LinkedStateMixin.js +2 -2
- package/lib/LinkedValueUtils.js +8 -8
- package/lib/MetaMatchers.js +118 -0
- package/lib/OrderedMap.js +453 -0
- package/lib/PooledClass.js +3 -5
- package/lib/React.js +18 -7
- package/lib/ReactBrowserComponentMixin.js +4 -4
- package/lib/ReactBrowserEventEmitter.js +36 -7
- package/lib/ReactCSSTransitionGroup.js +35 -9
- package/lib/ReactCSSTransitionGroupChild.js +48 -30
- package/lib/ReactChildReconciler.js +24 -19
- package/lib/ReactChildren.js +72 -32
- package/lib/ReactClass.js +46 -46
- package/lib/ReactComponent.js +18 -16
- package/lib/ReactComponentBrowserEnvironment.js +2 -2
- package/lib/ReactComponentEnvironment.js +2 -2
- package/lib/ReactComponentWithPureRenderMixin.js +1 -1
- package/lib/ReactCompositeComponent.js +95 -44
- package/lib/ReactDOM.js +74 -159
- package/lib/ReactDOMComponent.js +235 -93
- package/lib/ReactDOMFactories.js +177 -0
- package/lib/{emptyObject.js → ReactDOMFeatureFlags.js} +6 -8
- package/lib/ReactDOMIDOperations.js +8 -81
- package/lib/ReactDOMInput.js +18 -9
- package/lib/ReactDOMOption.js +7 -7
- package/lib/ReactDOMSelect.js +9 -9
- package/lib/ReactDOMSelection.js +19 -3
- package/lib/ReactDOMServer.js +5 -3
- package/lib/ReactDOMTextComponent.js +33 -20
- package/lib/ReactDOMTextarea.js +14 -12
- package/lib/ReactDefaultBatchingStrategy.js +4 -4
- package/lib/ReactDefaultInjection.js +23 -25
- package/lib/ReactDefaultPerf.js +17 -11
- package/lib/ReactDefaultPerfAnalysis.js +13 -12
- package/lib/ReactElement.js +85 -39
- package/lib/ReactElementValidator.js +47 -90
- package/lib/ReactEmptyComponent.js +26 -62
- package/lib/ReactEmptyComponentRegistry.js +48 -0
- package/lib/ReactErrorUtils.js +53 -9
- package/lib/ReactEventEmitterMixin.js +2 -2
- package/lib/ReactEventListener.js +33 -21
- package/lib/ReactFragment.js +27 -118
- package/lib/ReactInjection.js +10 -12
- package/lib/ReactInputSelection.js +4 -4
- package/lib/ReactInstanceHandles.js +10 -11
- package/lib/ReactIsomorphic.js +15 -11
- package/lib/ReactLink.js +2 -2
- package/lib/ReactMarkupChecksum.js +6 -2
- package/lib/ReactMount.js +186 -85
- package/lib/ReactMultiChild.js +119 -25
- package/lib/ReactMultiChildUpdateTypes.js +2 -1
- package/lib/ReactNativeComponent.js +3 -3
- package/lib/ReactNoopUpdateQueue.js +3 -3
- package/lib/ReactOwner.js +3 -3
- package/lib/ReactPerf.js +2 -2
- package/lib/ReactPropTransferer.js +3 -3
- package/lib/ReactPropTypeLocationNames.js +1 -1
- package/lib/ReactPropTypeLocations.js +1 -1
- package/lib/ReactPropTypes.js +38 -9
- package/lib/ReactReconcileTransaction.js +10 -8
- package/lib/ReactReconciler.js +5 -6
- package/lib/ReactRef.js +14 -2
- package/lib/ReactServerBatchingStrategy.js +5 -5
- package/lib/ReactServerRendering.js +12 -12
- package/lib/ReactServerRenderingTransaction.js +6 -5
- package/lib/ReactTestUtils.js +47 -39
- package/lib/ReactTransitionChildMapping.js +3 -6
- package/lib/ReactTransitionEvents.js +1 -1
- package/lib/ReactTransitionGroup.js +5 -6
- package/lib/ReactUpdateQueue.js +19 -19
- package/lib/ReactUpdates.js +15 -15
- package/lib/{performance.js → ReactVersion.js} +3 -12
- package/lib/ReactWithAddons.js +24 -15
- package/lib/ResponderEventPlugin.js +514 -0
- package/lib/ResponderSyntheticEvent.js +40 -0
- package/lib/ResponderTouchHistoryStore.js +180 -0
- package/lib/SVGDOMPropertyConfig.js +1 -1
- package/lib/SelectEventPlugin.js +19 -9
- package/lib/SimpleEventPlugin.js +198 -43
- package/lib/SyntheticClipboardEvent.js +1 -1
- package/lib/SyntheticCompositionEvent.js +1 -1
- package/lib/SyntheticDragEvent.js +1 -1
- package/lib/SyntheticEvent.js +18 -4
- package/lib/SyntheticFocusEvent.js +1 -1
- package/lib/SyntheticInputEvent.js +1 -1
- package/lib/SyntheticKeyboardEvent.js +4 -4
- package/lib/SyntheticMouseEvent.js +3 -3
- package/lib/SyntheticTouchEvent.js +2 -2
- package/lib/SyntheticUIEvent.js +2 -2
- package/lib/SyntheticWheelEvent.js +1 -1
- package/lib/TapEventPlugin.js +119 -0
- package/lib/Transaction.js +7 -7
- package/lib/accumulate.js +44 -0
- package/lib/accumulateInto.js +2 -2
- package/lib/adler32.js +19 -7
- package/lib/cloneWithProps.js +11 -6
- package/lib/createHierarchyRenderer.js +85 -0
- package/lib/dangerousStyleValue.js +1 -1
- package/lib/deprecated.js +7 -6
- package/lib/findDOMNode.js +9 -9
- package/lib/flattenChildren.js +4 -4
- package/lib/getEventKey.js +1 -1
- package/lib/{isTextNode.js → getTestDocument.js} +7 -11
- package/lib/getTextContentAccessor.js +1 -1
- package/lib/instantiateReactComponent.js +15 -17
- package/lib/isEventSupported.js +1 -1
- package/lib/onlyChild.js +3 -3
- package/lib/quoteAttributeValueForBrowser.js +1 -1
- package/lib/reactComponentExpect.js +216 -0
- package/lib/renderSubtreeIntoContainer.js +1 -1
- package/lib/setInnerHTML.js +1 -1
- package/lib/setTextContent.js +3 -3
- package/lib/shallowCompare.js +1 -1
- package/lib/shouldUpdateReactComponent.js +12 -8
- package/lib/sliceChildren.js +34 -0
- package/lib/traverseAllChildren.js +25 -18
- package/lib/update.js +13 -13
- package/lib/validateDOMNesting.js +6 -6
- package/lib/webcomponents.js +6379 -0
- package/package.json +4 -6
- package/react.js +1 -51
- package/dist/JSXTransformer.js +0 -17588
- package/lib/CSSCore.js +0 -97
- package/lib/EventListener.js +0 -84
- package/lib/ExecutionEnvironment.js +0 -38
- package/lib/ReactDOMClient.js +0 -90
- package/lib/camelize.js +0 -32
- package/lib/camelizeStyleName.js +0 -40
- package/lib/containsNode.js +0 -55
- package/lib/createArrayFromMixed.js +0 -85
- package/lib/createNodesFromMarkup.js +0 -84
- package/lib/emptyFunction.js +0 -38
- package/lib/focusNode.js +0 -26
- package/lib/getActiveElement.js +0 -29
- package/lib/getMarkupWrap.js +0 -93
- package/lib/getUnboundedScrollPosition.js +0 -38
- package/lib/hyphenate.js +0 -33
- package/lib/hyphenateStyleName.js +0 -39
- package/lib/invariant.js +0 -49
- package/lib/isNode.js +0 -23
- package/lib/joinClasses.js +0 -39
- package/lib/keyMirror.js +0 -48
- package/lib/keyOf.js +0 -35
- package/lib/mapObject.js +0 -51
- package/lib/memoizeStringOnly.js +0 -31
- package/lib/performanceNow.js +0 -28
- package/lib/shallowEqual.js +0 -48
- package/lib/toArray.js +0 -57
- package/lib/warning.js +0 -57
|
@@ -11,11 +11,11 @@
|
|
|
11
11
|
|
|
12
12
|
'use strict';
|
|
13
13
|
|
|
14
|
-
var EventPluginHub = require(
|
|
14
|
+
var EventPluginHub = require('./EventPluginHub');
|
|
15
15
|
|
|
16
16
|
function runEventQueueInBatch(events) {
|
|
17
17
|
EventPluginHub.enqueueEvents(events);
|
|
18
|
-
EventPluginHub.processEventQueue();
|
|
18
|
+
EventPluginHub.processEventQueue(false);
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
var ReactEventEmitterMixin = {
|
|
@@ -12,16 +12,16 @@
|
|
|
12
12
|
|
|
13
13
|
'use strict';
|
|
14
14
|
|
|
15
|
-
var EventListener = require(
|
|
16
|
-
var ExecutionEnvironment = require(
|
|
17
|
-
var PooledClass = require(
|
|
18
|
-
var ReactInstanceHandles = require(
|
|
19
|
-
var ReactMount = require(
|
|
20
|
-
var ReactUpdates = require(
|
|
15
|
+
var EventListener = require('fbjs/lib/EventListener');
|
|
16
|
+
var ExecutionEnvironment = require('fbjs/lib/ExecutionEnvironment');
|
|
17
|
+
var PooledClass = require('./PooledClass');
|
|
18
|
+
var ReactInstanceHandles = require('./ReactInstanceHandles');
|
|
19
|
+
var ReactMount = require('./ReactMount');
|
|
20
|
+
var ReactUpdates = require('./ReactUpdates');
|
|
21
21
|
|
|
22
|
-
var assign = require(
|
|
23
|
-
var getEventTarget = require(
|
|
24
|
-
var getUnboundedScrollPosition = require(
|
|
22
|
+
var assign = require('./Object.assign');
|
|
23
|
+
var getEventTarget = require('./getEventTarget');
|
|
24
|
+
var getUnboundedScrollPosition = require('fbjs/lib/getUnboundedScrollPosition');
|
|
25
25
|
|
|
26
26
|
var DOCUMENT_FRAGMENT_NODE_TYPE = 11;
|
|
27
27
|
|
|
@@ -59,13 +59,18 @@ assign(TopLevelCallbackBookKeeping.prototype, {
|
|
|
59
59
|
PooledClass.addPoolingTo(TopLevelCallbackBookKeeping, PooledClass.twoArgumentPooler);
|
|
60
60
|
|
|
61
61
|
function handleTopLevelImpl(bookKeeping) {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
62
|
+
// TODO: Re-enable event.path handling
|
|
63
|
+
//
|
|
64
|
+
// if (bookKeeping.nativeEvent.path && bookKeeping.nativeEvent.path.length > 1) {
|
|
65
|
+
// // New browsers have a path attribute on native events
|
|
66
|
+
// handleTopLevelWithPath(bookKeeping);
|
|
67
|
+
// } else {
|
|
68
|
+
// // Legacy browsers don't have a path attribute on native events
|
|
69
|
+
// handleTopLevelWithoutPath(bookKeeping);
|
|
70
|
+
// }
|
|
71
|
+
|
|
72
|
+
void handleTopLevelWithPath; // temporarily unused
|
|
73
|
+
handleTopLevelWithoutPath(bookKeeping);
|
|
69
74
|
}
|
|
70
75
|
|
|
71
76
|
// Legacy browsers don't have a path attribute on native events
|
|
@@ -93,27 +98,34 @@ function handleTopLevelWithoutPath(bookKeeping) {
|
|
|
93
98
|
function handleTopLevelWithPath(bookKeeping) {
|
|
94
99
|
var path = bookKeeping.nativeEvent.path;
|
|
95
100
|
var currentNativeTarget = path[0];
|
|
101
|
+
var eventsFired = 0;
|
|
96
102
|
for (var i = 0; i < path.length; i++) {
|
|
97
103
|
var currentPathElement = path[i];
|
|
98
|
-
var currentPathElemenId = ReactMount.getID(currentPathElement);
|
|
99
104
|
if (currentPathElement.nodeType === DOCUMENT_FRAGMENT_NODE_TYPE) {
|
|
100
105
|
currentNativeTarget = path[i + 1];
|
|
101
106
|
}
|
|
102
|
-
|
|
103
|
-
|
|
107
|
+
// TODO: slow
|
|
108
|
+
var reactParent = ReactMount.getFirstReactDOM(currentPathElement);
|
|
109
|
+
if (reactParent === currentPathElement) {
|
|
110
|
+
var currentPathElementID = ReactMount.getID(currentPathElement);
|
|
111
|
+
var newRootID = ReactInstanceHandles.getReactRootIDFromNodeID(currentPathElementID);
|
|
104
112
|
bookKeeping.ancestors.push(currentPathElement);
|
|
105
113
|
|
|
106
114
|
var topLevelTargetID = ReactMount.getID(currentPathElement) || '';
|
|
115
|
+
eventsFired++;
|
|
107
116
|
ReactEventListener._handleTopLevel(bookKeeping.topLevelType, currentPathElement, topLevelTargetID, bookKeeping.nativeEvent, currentNativeTarget);
|
|
108
117
|
|
|
109
118
|
// Jump to the root of this React render tree
|
|
110
|
-
while (
|
|
119
|
+
while (currentPathElementID !== newRootID) {
|
|
111
120
|
i++;
|
|
112
121
|
currentPathElement = path[i];
|
|
113
|
-
|
|
122
|
+
currentPathElementID = ReactMount.getID(currentPathElement);
|
|
114
123
|
}
|
|
115
124
|
}
|
|
116
125
|
}
|
|
126
|
+
if (eventsFired === 0) {
|
|
127
|
+
ReactEventListener._handleTopLevel(bookKeeping.topLevelType, window, '', bookKeeping.nativeEvent, getEventTarget(bookKeeping.nativeEvent));
|
|
128
|
+
}
|
|
117
129
|
}
|
|
118
130
|
|
|
119
131
|
function scrollValueMonitor(cb) {
|
package/lib/ReactFragment.js
CHANGED
|
@@ -11,144 +11,53 @@
|
|
|
11
11
|
|
|
12
12
|
'use strict';
|
|
13
13
|
|
|
14
|
-
var
|
|
14
|
+
var ReactChildren = require('./ReactChildren');
|
|
15
|
+
var ReactElement = require('./ReactElement');
|
|
15
16
|
|
|
16
|
-
var
|
|
17
|
+
var emptyFunction = require('fbjs/lib/emptyFunction');
|
|
18
|
+
var invariant = require('fbjs/lib/invariant');
|
|
19
|
+
var warning = require('fbjs/lib/warning');
|
|
17
20
|
|
|
18
21
|
/**
|
|
19
22
|
* We used to allow keyed objects to serve as a collection of ReactElements,
|
|
20
23
|
* or nested sets. This allowed us a way to explicitly key a set a fragment of
|
|
21
24
|
* components. This is now being replaced with an opaque data structure.
|
|
22
25
|
* The upgrade path is to call React.addons.createFragment({ key: value }) to
|
|
23
|
-
* create a keyed fragment. The resulting data structure is
|
|
26
|
+
* create a keyed fragment. The resulting data structure is an array.
|
|
24
27
|
*/
|
|
25
28
|
|
|
26
|
-
var
|
|
27
|
-
var didWarnKey;
|
|
28
|
-
var canWarnForReactFragment;
|
|
29
|
+
var numericPropertyRegex = /^\d+$/;
|
|
29
30
|
|
|
30
|
-
|
|
31
|
-
fragmentKey = '_reactFragment';
|
|
32
|
-
didWarnKey = '_reactDidWarn';
|
|
33
|
-
|
|
34
|
-
try {
|
|
35
|
-
// Feature test. Don't even try to issue this warning if we can't use
|
|
36
|
-
// enumerable: false.
|
|
37
|
-
|
|
38
|
-
var dummy = function () {
|
|
39
|
-
return 1;
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
Object.defineProperty({}, fragmentKey, { enumerable: false, value: true });
|
|
43
|
-
|
|
44
|
-
Object.defineProperty({}, 'key', { enumerable: true, get: dummy });
|
|
45
|
-
|
|
46
|
-
canWarnForReactFragment = true;
|
|
47
|
-
} catch (x) {
|
|
48
|
-
canWarnForReactFragment = false;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
var proxyPropertyAccessWithWarning = function (obj, key) {
|
|
52
|
-
Object.defineProperty(obj, key, {
|
|
53
|
-
enumerable: true,
|
|
54
|
-
get: function () {
|
|
55
|
-
'production' !== process.env.NODE_ENV ? warning(this[didWarnKey], 'A ReactFragment is an opaque type. Accessing any of its ' + 'properties is deprecated. Pass it to one of the React.Children ' + 'helpers.') : undefined;
|
|
56
|
-
this[didWarnKey] = true;
|
|
57
|
-
return this[fragmentKey][key];
|
|
58
|
-
},
|
|
59
|
-
set: function (value) {
|
|
60
|
-
'production' !== process.env.NODE_ENV ? warning(this[didWarnKey], 'A ReactFragment is an immutable opaque type. Mutating its ' + 'properties is deprecated.') : undefined;
|
|
61
|
-
this[didWarnKey] = true;
|
|
62
|
-
this[fragmentKey][key] = value;
|
|
63
|
-
}
|
|
64
|
-
});
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
var issuedWarnings = {};
|
|
68
|
-
|
|
69
|
-
var didWarnForFragment = function (fragment) {
|
|
70
|
-
// We use the keys and the type of the value as a heuristic to dedupe the
|
|
71
|
-
// warning to avoid spamming too much.
|
|
72
|
-
var fragmentCacheKey = '';
|
|
73
|
-
for (var key in fragment) {
|
|
74
|
-
fragmentCacheKey += key + ':' + typeof fragment[key] + ',';
|
|
75
|
-
}
|
|
76
|
-
var alreadyWarnedOnce = !!issuedWarnings[fragmentCacheKey];
|
|
77
|
-
issuedWarnings[fragmentCacheKey] = true;
|
|
78
|
-
return alreadyWarnedOnce;
|
|
79
|
-
};
|
|
80
|
-
}
|
|
31
|
+
var warnedAboutNumeric = false;
|
|
81
32
|
|
|
82
33
|
var ReactFragment = {
|
|
83
34
|
// Wrap a keyed object in an opaque proxy that warns you if you access any
|
|
84
35
|
// of its properties.
|
|
85
36
|
create: function (object) {
|
|
86
|
-
if ('
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
return object;
|
|
90
|
-
}
|
|
91
|
-
if (ReactElement.isValidElement(object)) {
|
|
92
|
-
'production' !== process.env.NODE_ENV ? warning(false, 'React.addons.createFragment does not accept a ReactElement ' + 'without a wrapper object.') : undefined;
|
|
93
|
-
return object;
|
|
94
|
-
}
|
|
95
|
-
if (canWarnForReactFragment) {
|
|
96
|
-
var proxy = {};
|
|
97
|
-
Object.defineProperty(proxy, fragmentKey, {
|
|
98
|
-
enumerable: false,
|
|
99
|
-
value: object
|
|
100
|
-
});
|
|
101
|
-
Object.defineProperty(proxy, didWarnKey, {
|
|
102
|
-
writable: true,
|
|
103
|
-
enumerable: false,
|
|
104
|
-
value: false
|
|
105
|
-
});
|
|
106
|
-
for (var key in object) {
|
|
107
|
-
proxyPropertyAccessWithWarning(proxy, key);
|
|
108
|
-
}
|
|
109
|
-
Object.preventExtensions(proxy);
|
|
110
|
-
return proxy;
|
|
111
|
-
}
|
|
37
|
+
if (typeof object !== 'object' || !object || Array.isArray(object)) {
|
|
38
|
+
process.env.NODE_ENV !== 'production' ? warning(false, 'React.addons.createFragment only accepts a single object. Got: %s', object) : undefined;
|
|
39
|
+
return object;
|
|
112
40
|
}
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
// a plain object is passed here.
|
|
117
|
-
extract: function (fragment) {
|
|
118
|
-
if ('production' !== process.env.NODE_ENV) {
|
|
119
|
-
if (canWarnForReactFragment) {
|
|
120
|
-
if (!fragment[fragmentKey]) {
|
|
121
|
-
'production' !== process.env.NODE_ENV ? warning(didWarnForFragment(fragment), 'Any use of a keyed object should be wrapped in ' + 'React.addons.createFragment(object) before being passed as a ' + 'child.') : undefined;
|
|
122
|
-
return fragment;
|
|
123
|
-
}
|
|
124
|
-
return fragment[fragmentKey];
|
|
125
|
-
}
|
|
41
|
+
if (ReactElement.isValidElement(object)) {
|
|
42
|
+
process.env.NODE_ENV !== 'production' ? warning(false, 'React.addons.createFragment does not accept a ReactElement ' + 'without a wrapper object.') : undefined;
|
|
43
|
+
return object;
|
|
126
44
|
}
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
return fragment[fragmentKey];
|
|
138
|
-
}
|
|
139
|
-
// Otherwise, check each property if it has an element, if it does
|
|
140
|
-
// it is probably meant as a fragment, so we can warn early. Defer,
|
|
141
|
-
// the warning to extract.
|
|
142
|
-
for (var key in fragment) {
|
|
143
|
-
if (fragment.hasOwnProperty(key) && ReactElement.isValidElement(fragment[key])) {
|
|
144
|
-
// This looks like a fragment object, we should provide an
|
|
145
|
-
// early warning.
|
|
146
|
-
return ReactFragment.extract(fragment);
|
|
147
|
-
}
|
|
45
|
+
|
|
46
|
+
!(object.nodeType !== 1) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'React.addons.createFragment(...): Encountered an invalid child; DOM ' + 'elements are not valid children of React components.') : invariant(false) : undefined;
|
|
47
|
+
|
|
48
|
+
var result = [];
|
|
49
|
+
|
|
50
|
+
for (var key in object) {
|
|
51
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
52
|
+
if (!warnedAboutNumeric && numericPropertyRegex.test(key)) {
|
|
53
|
+
process.env.NODE_ENV !== 'production' ? warning(false, 'React.addons.createFragment(...): Child objects should have ' + 'non-numeric keys so ordering is preserved.') : undefined;
|
|
54
|
+
warnedAboutNumeric = true;
|
|
148
55
|
}
|
|
149
56
|
}
|
|
57
|
+
ReactChildren.mapIntoWithKeyPrefixInternal(object[key], result, key, emptyFunction.thatReturnsArgument);
|
|
150
58
|
}
|
|
151
|
-
|
|
59
|
+
|
|
60
|
+
return result;
|
|
152
61
|
}
|
|
153
62
|
};
|
|
154
63
|
|
package/lib/ReactInjection.js
CHANGED
|
@@ -11,22 +11,20 @@
|
|
|
11
11
|
|
|
12
12
|
'use strict';
|
|
13
13
|
|
|
14
|
-
var DOMProperty = require(
|
|
15
|
-
var EventPluginHub = require(
|
|
16
|
-
var ReactComponentEnvironment = require(
|
|
17
|
-
var ReactClass = require(
|
|
18
|
-
var ReactEmptyComponent = require(
|
|
19
|
-
var ReactBrowserEventEmitter = require(
|
|
20
|
-
var ReactNativeComponent = require(
|
|
21
|
-
var
|
|
22
|
-
var
|
|
23
|
-
var
|
|
24
|
-
var ReactUpdates = require("./ReactUpdates");
|
|
14
|
+
var DOMProperty = require('./DOMProperty');
|
|
15
|
+
var EventPluginHub = require('./EventPluginHub');
|
|
16
|
+
var ReactComponentEnvironment = require('./ReactComponentEnvironment');
|
|
17
|
+
var ReactClass = require('./ReactClass');
|
|
18
|
+
var ReactEmptyComponent = require('./ReactEmptyComponent');
|
|
19
|
+
var ReactBrowserEventEmitter = require('./ReactBrowserEventEmitter');
|
|
20
|
+
var ReactNativeComponent = require('./ReactNativeComponent');
|
|
21
|
+
var ReactPerf = require('./ReactPerf');
|
|
22
|
+
var ReactRootIndex = require('./ReactRootIndex');
|
|
23
|
+
var ReactUpdates = require('./ReactUpdates');
|
|
25
24
|
|
|
26
25
|
var ReactInjection = {
|
|
27
26
|
Component: ReactComponentEnvironment.injection,
|
|
28
27
|
Class: ReactClass.injection,
|
|
29
|
-
DOMComponent: ReactDOMComponent.injection,
|
|
30
28
|
DOMProperty: DOMProperty.injection,
|
|
31
29
|
EmptyComponent: ReactEmptyComponent.injection,
|
|
32
30
|
EventPluginHub: EventPluginHub.injection,
|
|
@@ -11,11 +11,11 @@
|
|
|
11
11
|
|
|
12
12
|
'use strict';
|
|
13
13
|
|
|
14
|
-
var ReactDOMSelection = require(
|
|
14
|
+
var ReactDOMSelection = require('./ReactDOMSelection');
|
|
15
15
|
|
|
16
|
-
var containsNode = require(
|
|
17
|
-
var focusNode = require(
|
|
18
|
-
var getActiveElement = require(
|
|
16
|
+
var containsNode = require('fbjs/lib/containsNode');
|
|
17
|
+
var focusNode = require('fbjs/lib/focusNode');
|
|
18
|
+
var getActiveElement = require('fbjs/lib/getActiveElement');
|
|
19
19
|
|
|
20
20
|
function isInDocument(node) {
|
|
21
21
|
return containsNode(document.documentElement, node);
|
|
@@ -12,9 +12,9 @@
|
|
|
12
12
|
|
|
13
13
|
'use strict';
|
|
14
14
|
|
|
15
|
-
var ReactRootIndex = require(
|
|
15
|
+
var ReactRootIndex = require('./ReactRootIndex');
|
|
16
16
|
|
|
17
|
-
var invariant = require(
|
|
17
|
+
var invariant = require('fbjs/lib/invariant');
|
|
18
18
|
|
|
19
19
|
var SEPARATOR = '.';
|
|
20
20
|
var SEPARATOR_LENGTH = SEPARATOR.length;
|
|
@@ -91,8 +91,8 @@ function getParentID(id) {
|
|
|
91
91
|
* @private
|
|
92
92
|
*/
|
|
93
93
|
function getNextDescendantID(ancestorID, destinationID) {
|
|
94
|
-
!(isValidID(ancestorID) && isValidID(destinationID)) ?
|
|
95
|
-
!isAncestorIDOf(ancestorID, destinationID) ?
|
|
94
|
+
!(isValidID(ancestorID) && isValidID(destinationID)) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'getNextDescendantID(%s, %s): Received an invalid React DOM ID.', ancestorID, destinationID) : invariant(false) : undefined;
|
|
95
|
+
!isAncestorIDOf(ancestorID, destinationID) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'getNextDescendantID(...): React has made an invalid assumption about ' + 'the DOM hierarchy. Expected `%s` to be an ancestor of `%s`.', ancestorID, destinationID) : invariant(false) : undefined;
|
|
96
96
|
if (ancestorID === destinationID) {
|
|
97
97
|
return ancestorID;
|
|
98
98
|
}
|
|
@@ -134,7 +134,7 @@ function getFirstCommonAncestorID(oneID, twoID) {
|
|
|
134
134
|
}
|
|
135
135
|
}
|
|
136
136
|
var longestCommonID = oneID.substr(0, lastCommonMarkerIndex);
|
|
137
|
-
!isValidID(longestCommonID) ?
|
|
137
|
+
!isValidID(longestCommonID) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'getFirstCommonAncestorID(%s, %s): Expected a valid React DOM ID: %s', oneID, twoID, longestCommonID) : invariant(false) : undefined;
|
|
138
138
|
return longestCommonID;
|
|
139
139
|
}
|
|
140
140
|
|
|
@@ -154,13 +154,13 @@ function getFirstCommonAncestorID(oneID, twoID) {
|
|
|
154
154
|
function traverseParentPath(start, stop, cb, arg, skipFirst, skipLast) {
|
|
155
155
|
start = start || '';
|
|
156
156
|
stop = stop || '';
|
|
157
|
-
!(start !== stop) ?
|
|
157
|
+
!(start !== stop) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'traverseParentPath(...): Cannot traverse from and to the same ID, `%s`.', start) : invariant(false) : undefined;
|
|
158
158
|
var traverseUp = isAncestorIDOf(stop, start);
|
|
159
|
-
!(traverseUp || isAncestorIDOf(start, stop)) ?
|
|
159
|
+
!(traverseUp || isAncestorIDOf(start, stop)) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'traverseParentPath(%s, %s, ...): Cannot traverse from two IDs that do ' + 'not have a parent path.', start, stop) : invariant(false) : undefined;
|
|
160
160
|
// Traverse from `start` to `stop` one depth at a time.
|
|
161
161
|
var depth = 0;
|
|
162
162
|
var traverse = traverseUp ? getParentID : getNextDescendantID;
|
|
163
|
-
for (var id = start;; id = traverse(id, stop)) {
|
|
163
|
+
for (var id = start;; /* until break */id = traverse(id, stop)) {
|
|
164
164
|
var ret;
|
|
165
165
|
if ((!skipFirst || id !== start) && (!skipLast || id !== stop)) {
|
|
166
166
|
ret = cb(id, traverseUp, arg);
|
|
@@ -169,7 +169,7 @@ function traverseParentPath(start, stop, cb, arg, skipFirst, skipLast) {
|
|
|
169
169
|
// Only break //after// visiting `stop`.
|
|
170
170
|
break;
|
|
171
171
|
}
|
|
172
|
-
!(depth++ < MAX_TREE_DEPTH) ?
|
|
172
|
+
!(depth++ < MAX_TREE_DEPTH) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'traverseParentPath(%s, %s, ...): Detected an infinite loop while ' + 'traversing the React DOM ID tree. This may be due to malformed IDs: %s', start, stop, id) : invariant(false) : undefined;
|
|
173
173
|
}
|
|
174
174
|
}
|
|
175
175
|
|
|
@@ -299,5 +299,4 @@ var ReactInstanceHandles = {
|
|
|
299
299
|
|
|
300
300
|
};
|
|
301
301
|
|
|
302
|
-
module.exports = ReactInstanceHandles;
|
|
303
|
-
/* until break */
|
|
302
|
+
module.exports = ReactInstanceHandles;
|
package/lib/ReactIsomorphic.js
CHANGED
|
@@ -11,22 +11,23 @@
|
|
|
11
11
|
|
|
12
12
|
'use strict';
|
|
13
13
|
|
|
14
|
-
var ReactChildren = require(
|
|
15
|
-
var ReactComponent = require(
|
|
16
|
-
var ReactClass = require(
|
|
17
|
-
var
|
|
18
|
-
var ReactElement = require(
|
|
19
|
-
var ReactElementValidator = require(
|
|
20
|
-
var ReactPropTypes = require(
|
|
14
|
+
var ReactChildren = require('./ReactChildren');
|
|
15
|
+
var ReactComponent = require('./ReactComponent');
|
|
16
|
+
var ReactClass = require('./ReactClass');
|
|
17
|
+
var ReactDOMFactories = require('./ReactDOMFactories');
|
|
18
|
+
var ReactElement = require('./ReactElement');
|
|
19
|
+
var ReactElementValidator = require('./ReactElementValidator');
|
|
20
|
+
var ReactPropTypes = require('./ReactPropTypes');
|
|
21
|
+
var ReactVersion = require('./ReactVersion');
|
|
21
22
|
|
|
22
|
-
var assign = require(
|
|
23
|
-
var onlyChild = require(
|
|
23
|
+
var assign = require('./Object.assign');
|
|
24
|
+
var onlyChild = require('./onlyChild');
|
|
24
25
|
|
|
25
26
|
var createElement = ReactElement.createElement;
|
|
26
27
|
var createFactory = ReactElement.createFactory;
|
|
27
28
|
var cloneElement = ReactElement.cloneElement;
|
|
28
29
|
|
|
29
|
-
if (
|
|
30
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
30
31
|
createElement = ReactElementValidator.createElement;
|
|
31
32
|
createFactory = ReactElementValidator.createFactory;
|
|
32
33
|
cloneElement = ReactElementValidator.cloneElement;
|
|
@@ -40,6 +41,7 @@ var React = {
|
|
|
40
41
|
map: ReactChildren.map,
|
|
41
42
|
forEach: ReactChildren.forEach,
|
|
42
43
|
count: ReactChildren.count,
|
|
44
|
+
toArray: ReactChildren.toArray,
|
|
43
45
|
only: onlyChild
|
|
44
46
|
},
|
|
45
47
|
|
|
@@ -61,7 +63,9 @@ var React = {
|
|
|
61
63
|
|
|
62
64
|
// This looks DOM specific but these are actually isomorphic helpers
|
|
63
65
|
// since they are just generating DOM strings.
|
|
64
|
-
DOM:
|
|
66
|
+
DOM: ReactDOMFactories,
|
|
67
|
+
|
|
68
|
+
version: ReactVersion,
|
|
65
69
|
|
|
66
70
|
// Hook for JSX spread, don't use this for anything else.
|
|
67
71
|
__spread: assign
|
package/lib/ReactLink.js
CHANGED
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
* var valueLink = new ReactLink(this.state.value, this._handleValueChange);
|
|
27
27
|
* return <input valueLink={valueLink} />;
|
|
28
28
|
* },
|
|
29
|
-
*
|
|
29
|
+
* _handleValueChange: function(newValue) {
|
|
30
30
|
* this.setState({value: newValue});
|
|
31
31
|
* }
|
|
32
32
|
* });
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
* consumption of ReactLink easier; see LinkedValueUtils and LinkedStateMixin.
|
|
36
36
|
*/
|
|
37
37
|
|
|
38
|
-
var React = require(
|
|
38
|
+
var React = require('./React');
|
|
39
39
|
|
|
40
40
|
/**
|
|
41
41
|
* @param {*} value current value of the link
|