react 0.12.2 → 0.13.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/JSXTransformer.js +986 -511
- package/dist/react-with-addons.js +6076 -4560
- package/dist/react-with-addons.min.js +6 -7
- package/dist/react.js +5386 -4170
- package/dist/react.min.js +6 -7
- package/lib/AutoFocusMixin.js +2 -2
- package/lib/BeforeInputEventPlugin.js +388 -115
- package/lib/CSSCore.js +1 -1
- package/lib/CSSProperty.js +2 -2
- package/lib/CSSPropertyOperations.js +58 -11
- package/lib/CallbackQueue.js +3 -3
- package/lib/ChangeEventPlugin.js +4 -4
- package/lib/ClientReactRootIndex.js +2 -2
- package/lib/DOMChildrenOperations.js +10 -47
- package/lib/DOMProperty.js +2 -2
- package/lib/DOMPropertyOperations.js +11 -16
- package/lib/Danger.js +8 -7
- package/lib/DefaultEventPluginOrder.js +3 -4
- package/lib/EnterLeaveEventPlugin.js +2 -2
- package/lib/EventConstants.js +2 -2
- package/lib/EventListener.js +1 -1
- package/lib/EventPluginHub.js +10 -8
- package/lib/EventPluginRegistry.js +2 -2
- package/lib/EventPluginUtils.js +4 -4
- package/lib/EventPropagators.js +2 -2
- package/lib/ExecutionEnvironment.js +3 -4
- package/lib/FallbackCompositionState.js +89 -0
- package/lib/HTMLDOMPropertyConfig.js +23 -10
- package/lib/LinkedStateMixin.js +2 -2
- package/lib/LinkedValueUtils.js +4 -4
- package/lib/LocalEventTrapMixin.js +10 -3
- package/lib/MobileSafariClickEventPlugin.js +2 -2
- package/lib/Object.assign.js +4 -2
- package/lib/PooledClass.js +2 -2
- package/lib/React.js +19 -58
- package/lib/ReactBrowserComponentMixin.js +4 -14
- package/lib/ReactBrowserEventEmitter.js +6 -8
- package/lib/ReactCSSTransitionGroup.js +5 -2
- package/lib/ReactCSSTransitionGroupChild.js +20 -7
- package/lib/ReactChildReconciler.js +125 -0
- package/lib/ReactChildren.js +13 -10
- package/lib/ReactClass.js +918 -0
- package/lib/ReactComponent.js +98 -406
- package/lib/ReactComponentBrowserEnvironment.js +11 -84
- package/lib/ReactComponentEnvironment.js +57 -0
- package/lib/ReactComponentWithPureRenderMixin.js +2 -2
- package/lib/ReactCompositeComponent.js +574 -1140
- package/lib/ReactContext.js +17 -3
- package/lib/ReactCurrentOwner.js +2 -2
- package/lib/ReactDOM.js +4 -9
- package/lib/ReactDOMButton.js +6 -7
- package/lib/ReactDOMComponent.js +123 -105
- package/lib/ReactDOMForm.js +6 -7
- package/lib/ReactDOMIDOperations.js +59 -77
- package/lib/ReactDOMIframe.js +43 -0
- package/lib/ReactDOMImg.js +5 -7
- package/lib/ReactDOMInput.js +6 -7
- package/lib/ReactDOMOption.js +6 -7
- package/lib/ReactDOMSelect.js +58 -66
- package/lib/ReactDOMSelection.js +7 -3
- package/lib/{ReactTextComponent.js → ReactDOMTextComponent.js} +48 -37
- package/lib/ReactDOMTextarea.js +6 -7
- package/lib/ReactDefaultBatchingStrategy.js +5 -5
- package/lib/ReactDefaultInjection.js +39 -9
- package/lib/ReactDefaultPerf.js +17 -8
- package/lib/ReactDefaultPerfAnalysis.js +2 -2
- package/lib/ReactElement.js +23 -15
- package/lib/ReactElementValidator.js +206 -89
- package/lib/ReactEmptyComponent.js +33 -15
- package/lib/ReactErrorUtils.js +1 -1
- package/lib/ReactEventEmitterMixin.js +2 -2
- package/lib/ReactEventListener.js +4 -5
- package/lib/ReactFragment.js +172 -0
- package/lib/ReactInjection.js +8 -6
- package/lib/ReactInputSelection.js +4 -5
- package/lib/ReactInstanceHandles.js +4 -3
- package/lib/ReactInstanceMap.js +47 -0
- package/lib/ReactLifeCycle.js +35 -0
- package/lib/ReactLink.js +2 -2
- package/lib/ReactMarkupChecksum.js +2 -2
- package/lib/ReactMount.js +264 -71
- package/lib/ReactMultiChild.js +50 -48
- package/lib/ReactMultiChildUpdateTypes.js +2 -2
- package/lib/ReactNativeComponent.js +59 -25
- package/lib/ReactOwner.js +5 -49
- package/lib/ReactPerf.js +22 -2
- package/lib/ReactPropTransferer.js +3 -58
- package/lib/ReactPropTypeLocationNames.js +2 -2
- package/lib/ReactPropTypeLocations.js +2 -2
- package/lib/ReactPropTypes.js +17 -25
- package/lib/ReactPutListenerQueue.js +2 -2
- package/lib/ReactReconcileTransaction.js +2 -2
- package/lib/ReactReconciler.js +121 -0
- package/lib/ReactRef.js +69 -0
- package/lib/ReactRootIndex.js +2 -2
- package/lib/ReactServerRendering.js +6 -4
- package/lib/ReactServerRenderingTransaction.js +2 -2
- package/lib/ReactStateSetters.js +2 -2
- package/lib/ReactTestUtils.js +113 -27
- package/lib/ReactTransitionChildMapping.js +8 -4
- package/lib/ReactTransitionEvents.js +2 -2
- package/lib/ReactTransitionGroup.js +53 -12
- package/lib/ReactUpdateQueue.js +295 -0
- package/lib/ReactUpdates.js +54 -62
- package/lib/ReactWithAddons.js +4 -2
- package/lib/SVGDOMPropertyConfig.js +2 -2
- package/lib/SelectEventPlugin.js +4 -4
- package/lib/ServerReactRootIndex.js +2 -2
- package/lib/SimpleEventPlugin.js +4 -4
- package/lib/SyntheticClipboardEvent.js +2 -3
- package/lib/SyntheticCompositionEvent.js +2 -3
- package/lib/SyntheticDragEvent.js +2 -2
- package/lib/SyntheticEvent.js +12 -4
- package/lib/SyntheticFocusEvent.js +2 -2
- package/lib/SyntheticInputEvent.js +2 -3
- package/lib/SyntheticKeyboardEvent.js +2 -2
- package/lib/SyntheticMouseEvent.js +3 -5
- package/lib/SyntheticTouchEvent.js +2 -2
- package/lib/SyntheticUIEvent.js +2 -2
- package/lib/SyntheticWheelEvent.js +2 -2
- package/lib/Transaction.js +4 -4
- package/lib/ViewportMetrics.js +3 -6
- package/lib/accumulateInto.js +2 -2
- package/lib/adler32.js +2 -2
- package/lib/camelize.js +1 -1
- package/lib/camelizeStyleName.js +1 -1
- package/lib/cloneWithProps.js +4 -4
- package/lib/containsNode.js +1 -1
- package/lib/{createArrayFrom.js → createArrayFromMixed.js} +6 -6
- package/lib/createFullPageComponent.js +4 -4
- package/lib/createNodesFromMarkup.js +4 -4
- package/lib/cx.js +1 -1
- package/lib/dangerousStyleValue.js +2 -2
- package/lib/emptyFunction.js +1 -1
- package/lib/emptyObject.js +1 -1
- package/lib/{escapeTextForBrowser.js → escapeTextContentForBrowser.js} +10 -11
- package/lib/findDOMNode.js +51 -0
- package/lib/flattenChildren.js +12 -23
- package/lib/focusNode.js +1 -1
- package/lib/forEachAccumulated.js +2 -2
- package/lib/getActiveElement.js +1 -1
- package/lib/getEventCharCode.js +2 -2
- package/lib/getEventKey.js +2 -2
- package/lib/getEventModifierState.js +2 -2
- package/lib/getEventTarget.js +2 -2
- package/lib/getIteratorFn.js +42 -0
- package/lib/getMarkupWrap.js +1 -1
- package/lib/getNodeForCharacterOffset.js +3 -3
- package/lib/getReactRootElementInContainer.js +2 -2
- package/lib/getTextContentAccessor.js +2 -2
- package/lib/getUnboundedScrollPosition.js +1 -1
- package/lib/hyphenate.js +1 -1
- package/lib/hyphenateStyleName.js +1 -1
- package/lib/instantiateReactComponent.js +90 -68
- package/lib/invariant.js +1 -1
- package/lib/isEventSupported.js +2 -2
- package/lib/isNode.js +4 -5
- package/lib/isTextInputElement.js +3 -4
- package/lib/isTextNode.js +1 -1
- package/lib/joinClasses.js +2 -2
- package/lib/keyMirror.js +2 -2
- package/lib/keyOf.js +1 -1
- package/lib/mapObject.js +1 -1
- package/lib/memoizeStringOnly.js +5 -6
- package/lib/onlyChild.js +2 -2
- package/lib/performance.js +1 -1
- package/lib/performanceNow.js +1 -1
- package/lib/quoteAttributeValueForBrowser.js +26 -0
- package/lib/setInnerHTML.js +13 -2
- package/lib/setTextContent.js +40 -0
- package/lib/shallowEqual.js +2 -2
- package/lib/shouldUpdateReactComponent.js +71 -7
- package/lib/toArray.js +2 -2
- package/lib/traverseAllChildren.js +114 -56
- package/lib/update.js +2 -2
- package/lib/warning.js +20 -2
- package/package.json +1 -1
- package/lib/CompositionEventPlugin.js +0 -257
- package/lib/ReactLegacyElement.js +0 -243
- package/lib/copyProperties.js +0 -54
- package/lib/deprecated.js +0 -47
- package/lib/merge.js +0 -34
- package/lib/mergeInto.js +0 -24
- package/lib/monitorCodeUse.js +0 -30
package/lib/ReactErrorUtils.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright 2013-
|
|
2
|
+
* Copyright 2013-2015, Facebook, Inc.
|
|
3
3
|
* All rights reserved.
|
|
4
4
|
*
|
|
5
5
|
* This source code is licensed under the BSD-style license found in the
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* @providesModule ReactEventEmitterMixin
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
'use strict';
|
|
13
13
|
|
|
14
14
|
var EventPluginHub = require("./EventPluginHub");
|
|
15
15
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright 2013-
|
|
2
|
+
* Copyright 2013-2015, Facebook, Inc.
|
|
3
3
|
* All rights reserved.
|
|
4
4
|
*
|
|
5
5
|
* This source code is licensed under the BSD-style license found in the
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* @typechecks static-only
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
'use strict';
|
|
14
14
|
|
|
15
15
|
var EventListener = require("./EventListener");
|
|
16
16
|
var ExecutionEnvironment = require("./ExecutionEnvironment");
|
|
@@ -123,7 +123,7 @@ var ReactEventListener = {
|
|
|
123
123
|
trapBubbledEvent: function(topLevelType, handlerBaseName, handle) {
|
|
124
124
|
var element = handle;
|
|
125
125
|
if (!element) {
|
|
126
|
-
return;
|
|
126
|
+
return null;
|
|
127
127
|
}
|
|
128
128
|
return EventListener.listen(
|
|
129
129
|
element,
|
|
@@ -145,7 +145,7 @@ var ReactEventListener = {
|
|
|
145
145
|
trapCapturedEvent: function(topLevelType, handlerBaseName, handle) {
|
|
146
146
|
var element = handle;
|
|
147
147
|
if (!element) {
|
|
148
|
-
return;
|
|
148
|
+
return null;
|
|
149
149
|
}
|
|
150
150
|
return EventListener.capture(
|
|
151
151
|
element,
|
|
@@ -157,7 +157,6 @@ var ReactEventListener = {
|
|
|
157
157
|
monitorScrollValue: function(refresh) {
|
|
158
158
|
var callback = scrollValueMonitor.bind(null, refresh);
|
|
159
159
|
EventListener.listen(window, 'scroll', callback);
|
|
160
|
-
EventListener.listen(window, 'resize', callback);
|
|
161
160
|
},
|
|
162
161
|
|
|
163
162
|
dispatchEvent: function(topLevelType, nativeEvent) {
|
|
@@ -0,0 +1,172 @@
|
|
|
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 ReactFragment
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
'use strict';
|
|
13
|
+
|
|
14
|
+
var ReactElement = require("./ReactElement");
|
|
15
|
+
|
|
16
|
+
var warning = require("./warning");
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* We used to allow keyed objects to serve as a collection of ReactElements,
|
|
20
|
+
* or nested sets. This allowed us a way to explicitly key a set a fragment of
|
|
21
|
+
* components. This is now being replaced with an opaque data structure.
|
|
22
|
+
* The upgrade path is to call React.addons.createFragment({ key: value }) to
|
|
23
|
+
* create a keyed fragment. The resulting data structure is opaque, for now.
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
if ("production" !== process.env.NODE_ENV) {
|
|
27
|
+
var fragmentKey = '_reactFragment';
|
|
28
|
+
var didWarnKey = '_reactDidWarn';
|
|
29
|
+
var canWarnForReactFragment = false;
|
|
30
|
+
|
|
31
|
+
try {
|
|
32
|
+
// Feature test. Don't even try to issue this warning if we can't use
|
|
33
|
+
// enumerable: false.
|
|
34
|
+
|
|
35
|
+
var dummy = function() {
|
|
36
|
+
return 1;
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
Object.defineProperty(
|
|
40
|
+
{},
|
|
41
|
+
fragmentKey,
|
|
42
|
+
{ enumerable: false, value: true }
|
|
43
|
+
);
|
|
44
|
+
|
|
45
|
+
Object.defineProperty(
|
|
46
|
+
{},
|
|
47
|
+
'key',
|
|
48
|
+
{ enumerable: true, get: dummy }
|
|
49
|
+
);
|
|
50
|
+
|
|
51
|
+
canWarnForReactFragment = true;
|
|
52
|
+
} catch (x) { }
|
|
53
|
+
|
|
54
|
+
var proxyPropertyAccessWithWarning = function(obj, key) {
|
|
55
|
+
Object.defineProperty(obj, key, {
|
|
56
|
+
enumerable: true,
|
|
57
|
+
get: function() {
|
|
58
|
+
("production" !== process.env.NODE_ENV ? warning(
|
|
59
|
+
this[didWarnKey],
|
|
60
|
+
'A ReactFragment is an opaque type. Accessing any of its ' +
|
|
61
|
+
'properties is deprecated. Pass it to one of the React.Children ' +
|
|
62
|
+
'helpers.'
|
|
63
|
+
) : null);
|
|
64
|
+
this[didWarnKey] = true;
|
|
65
|
+
return this[fragmentKey][key];
|
|
66
|
+
},
|
|
67
|
+
set: function(value) {
|
|
68
|
+
("production" !== process.env.NODE_ENV ? warning(
|
|
69
|
+
this[didWarnKey],
|
|
70
|
+
'A ReactFragment is an immutable opaque type. Mutating its ' +
|
|
71
|
+
'properties is deprecated.'
|
|
72
|
+
) : null);
|
|
73
|
+
this[didWarnKey] = true;
|
|
74
|
+
this[fragmentKey][key] = value;
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
var issuedWarnings = {};
|
|
80
|
+
|
|
81
|
+
var didWarnForFragment = function(fragment) {
|
|
82
|
+
// We use the keys and the type of the value as a heuristic to dedupe the
|
|
83
|
+
// warning to avoid spamming too much.
|
|
84
|
+
var fragmentCacheKey = '';
|
|
85
|
+
for (var key in fragment) {
|
|
86
|
+
fragmentCacheKey += key + ':' + (typeof fragment[key]) + ',';
|
|
87
|
+
}
|
|
88
|
+
var alreadyWarnedOnce = !!issuedWarnings[fragmentCacheKey];
|
|
89
|
+
issuedWarnings[fragmentCacheKey] = true;
|
|
90
|
+
return alreadyWarnedOnce;
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
var ReactFragment = {
|
|
95
|
+
// Wrap a keyed object in an opaque proxy that warns you if you access any
|
|
96
|
+
// of its properties.
|
|
97
|
+
create: function(object) {
|
|
98
|
+
if ("production" !== process.env.NODE_ENV) {
|
|
99
|
+
if (typeof object !== 'object' || !object) {
|
|
100
|
+
("production" !== process.env.NODE_ENV ? warning(
|
|
101
|
+
false,
|
|
102
|
+
'React.addons.createFragment only accepts a single object. Not %s',
|
|
103
|
+
object
|
|
104
|
+
) : null);
|
|
105
|
+
return object;
|
|
106
|
+
}
|
|
107
|
+
if (canWarnForReactFragment) {
|
|
108
|
+
var proxy = {};
|
|
109
|
+
Object.defineProperty(proxy, fragmentKey, {
|
|
110
|
+
enumerable: false,
|
|
111
|
+
value: object
|
|
112
|
+
});
|
|
113
|
+
Object.defineProperty(proxy, didWarnKey, {
|
|
114
|
+
writable: true,
|
|
115
|
+
enumerable: false,
|
|
116
|
+
value: false
|
|
117
|
+
});
|
|
118
|
+
for (var key in object) {
|
|
119
|
+
proxyPropertyAccessWithWarning(proxy, key);
|
|
120
|
+
}
|
|
121
|
+
Object.preventExtensions(proxy);
|
|
122
|
+
return proxy;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
return object;
|
|
126
|
+
},
|
|
127
|
+
// Extract the original keyed object from the fragment opaque type. Warn if
|
|
128
|
+
// a plain object is passed here.
|
|
129
|
+
extract: function(fragment) {
|
|
130
|
+
if ("production" !== process.env.NODE_ENV) {
|
|
131
|
+
if (canWarnForReactFragment) {
|
|
132
|
+
if (!fragment[fragmentKey]) {
|
|
133
|
+
("production" !== process.env.NODE_ENV ? warning(
|
|
134
|
+
didWarnForFragment(fragment),
|
|
135
|
+
'Any use of a keyed object should be wrapped in ' +
|
|
136
|
+
'React.addons.createFragment(object) before passed as a child.'
|
|
137
|
+
) : null);
|
|
138
|
+
return fragment;
|
|
139
|
+
}
|
|
140
|
+
return fragment[fragmentKey];
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
return fragment;
|
|
144
|
+
},
|
|
145
|
+
// Check if this is a fragment and if so, extract the keyed object. If it
|
|
146
|
+
// is a fragment-like object, warn that it should be wrapped. Ignore if we
|
|
147
|
+
// can't determine what kind of object this is.
|
|
148
|
+
extractIfFragment: function(fragment) {
|
|
149
|
+
if ("production" !== process.env.NODE_ENV) {
|
|
150
|
+
if (canWarnForReactFragment) {
|
|
151
|
+
// If it is the opaque type, return the keyed object.
|
|
152
|
+
if (fragment[fragmentKey]) {
|
|
153
|
+
return fragment[fragmentKey];
|
|
154
|
+
}
|
|
155
|
+
// Otherwise, check each property if it has an element, if it does
|
|
156
|
+
// it is probably meant as a fragment, so we can warn early. Defer,
|
|
157
|
+
// the warning to extract.
|
|
158
|
+
for (var key in fragment) {
|
|
159
|
+
if (fragment.hasOwnProperty(key) &&
|
|
160
|
+
ReactElement.isValidElement(fragment[key])) {
|
|
161
|
+
// This looks like a fragment object, we should provide an
|
|
162
|
+
// early warning.
|
|
163
|
+
return ReactFragment.extract(fragment);
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
return fragment;
|
|
169
|
+
}
|
|
170
|
+
};
|
|
171
|
+
|
|
172
|
+
module.exports = ReactFragment;
|
package/lib/ReactInjection.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright 2013-
|
|
2
|
+
* Copyright 2013-2015, Facebook, Inc.
|
|
3
3
|
* All rights reserved.
|
|
4
4
|
*
|
|
5
5
|
* This source code is licensed under the BSD-style license found in the
|
|
@@ -9,22 +9,24 @@
|
|
|
9
9
|
* @providesModule ReactInjection
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
'use strict';
|
|
13
13
|
|
|
14
14
|
var DOMProperty = require("./DOMProperty");
|
|
15
15
|
var EventPluginHub = require("./EventPluginHub");
|
|
16
|
-
var
|
|
17
|
-
var
|
|
16
|
+
var ReactComponentEnvironment = require("./ReactComponentEnvironment");
|
|
17
|
+
var ReactClass = require("./ReactClass");
|
|
18
18
|
var ReactEmptyComponent = require("./ReactEmptyComponent");
|
|
19
19
|
var ReactBrowserEventEmitter = require("./ReactBrowserEventEmitter");
|
|
20
20
|
var ReactNativeComponent = require("./ReactNativeComponent");
|
|
21
|
+
var ReactDOMComponent = require("./ReactDOMComponent");
|
|
21
22
|
var ReactPerf = require("./ReactPerf");
|
|
22
23
|
var ReactRootIndex = require("./ReactRootIndex");
|
|
23
24
|
var ReactUpdates = require("./ReactUpdates");
|
|
24
25
|
|
|
25
26
|
var ReactInjection = {
|
|
26
|
-
Component:
|
|
27
|
-
|
|
27
|
+
Component: ReactComponentEnvironment.injection,
|
|
28
|
+
Class: ReactClass.injection,
|
|
29
|
+
DOMComponent: ReactDOMComponent.injection,
|
|
28
30
|
DOMProperty: DOMProperty.injection,
|
|
29
31
|
EmptyComponent: ReactEmptyComponent.injection,
|
|
30
32
|
EventPluginHub: EventPluginHub.injection,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright 2013-
|
|
2
|
+
* Copyright 2013-2015, Facebook, Inc.
|
|
3
3
|
* All rights reserved.
|
|
4
4
|
*
|
|
5
5
|
* This source code is licensed under the BSD-style license found in the
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* @providesModule ReactInputSelection
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
'use strict';
|
|
13
13
|
|
|
14
14
|
var ReactDOMSelection = require("./ReactDOMSelection");
|
|
15
15
|
|
|
@@ -31,9 +31,8 @@ var ReactInputSelection = {
|
|
|
31
31
|
|
|
32
32
|
hasSelectionCapabilities: function(elem) {
|
|
33
33
|
return elem && (
|
|
34
|
-
(elem.nodeName === 'INPUT' && elem.type === 'text') ||
|
|
35
|
-
elem.nodeName === 'TEXTAREA' ||
|
|
36
|
-
elem.contentEditable === 'true'
|
|
34
|
+
((elem.nodeName === 'INPUT' && elem.type === 'text') ||
|
|
35
|
+
elem.nodeName === 'TEXTAREA' || elem.contentEditable === 'true')
|
|
37
36
|
);
|
|
38
37
|
},
|
|
39
38
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright 2013-
|
|
2
|
+
* Copyright 2013-2015, Facebook, Inc.
|
|
3
3
|
* All rights reserved.
|
|
4
4
|
*
|
|
5
5
|
* This source code is licensed under the BSD-style license found in the
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* @typechecks static-only
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
'use strict';
|
|
14
14
|
|
|
15
15
|
var ReactRootIndex = require("./ReactRootIndex");
|
|
16
16
|
|
|
@@ -115,7 +115,8 @@ function getNextDescendantID(ancestorID, destinationID) {
|
|
|
115
115
|
// Skip over the ancestor and the immediate separator. Traverse until we hit
|
|
116
116
|
// another separator or we reach the end of `destinationID`.
|
|
117
117
|
var start = ancestorID.length + SEPARATOR_LENGTH;
|
|
118
|
-
|
|
118
|
+
var i;
|
|
119
|
+
for (i = start; i < destinationID.length; i++) {
|
|
119
120
|
if (isBoundary(destinationID, i)) {
|
|
120
121
|
break;
|
|
121
122
|
}
|
|
@@ -0,0 +1,47 @@
|
|
|
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 ReactInstanceMap
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
'use strict';
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* `ReactInstanceMap` maintains a mapping from a public facing stateful
|
|
16
|
+
* instance (key) and the internal representation (value). This allows public
|
|
17
|
+
* methods to accept the user facing instance as an argument and map them back
|
|
18
|
+
* to internal methods.
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
// TODO: Replace this with ES6: var ReactInstanceMap = new Map();
|
|
22
|
+
var ReactInstanceMap = {
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* This API should be called `delete` but we'd have to make sure to always
|
|
26
|
+
* transform these to strings for IE support. When this transform is fully
|
|
27
|
+
* supported we can rename it.
|
|
28
|
+
*/
|
|
29
|
+
remove: function(key) {
|
|
30
|
+
key._reactInternalInstance = undefined;
|
|
31
|
+
},
|
|
32
|
+
|
|
33
|
+
get: function(key) {
|
|
34
|
+
return key._reactInternalInstance;
|
|
35
|
+
},
|
|
36
|
+
|
|
37
|
+
has: function(key) {
|
|
38
|
+
return key._reactInternalInstance !== undefined;
|
|
39
|
+
},
|
|
40
|
+
|
|
41
|
+
set: function(key, value) {
|
|
42
|
+
key._reactInternalInstance = value;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
module.exports = ReactInstanceMap;
|
|
@@ -0,0 +1,35 @@
|
|
|
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;
|
package/lib/ReactLink.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright 2013-
|
|
2
|
+
* Copyright 2013-2015, Facebook, Inc.
|
|
3
3
|
* All rights reserved.
|
|
4
4
|
*
|
|
5
5
|
* This source code is licensed under the BSD-style license found in the
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* @typechecks static-only
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
'use strict';
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
16
|
* ReactLink encapsulates a common pattern in which a component wants to modify
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright 2013-
|
|
2
|
+
* Copyright 2013-2015, Facebook, Inc.
|
|
3
3
|
* All rights reserved.
|
|
4
4
|
*
|
|
5
5
|
* This source code is licensed under the BSD-style license found in the
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* @providesModule ReactMarkupChecksum
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
'use strict';
|
|
13
13
|
|
|
14
14
|
var adler32 = require("./adler32");
|
|
15
15
|
|