react 0.9.0 → 0.11.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/README.md +3 -0
- package/dist/JSXTransformer.js +13448 -0
- package/dist/react-with-addons.js +20235 -0
- package/dist/react-with-addons.min.js +22 -0
- package/dist/react.js +18443 -0
- package/dist/react.min.js +21 -0
- package/lib/AutoFocusMixin.js +3 -1
- package/lib/BeforeInputEventPlugin.js +222 -0
- package/lib/CSSPropertyOperations.js +3 -3
- package/lib/{ReactMountReady.js → CallbackQueue.js} +32 -24
- package/lib/ChangeEventPlugin.js +1 -1
- package/lib/CompositionEventPlugin.js +5 -1
- package/lib/DOMChildrenOperations.js +33 -20
- package/lib/DOMProperty.js +51 -21
- package/lib/DOMPropertyOperations.js +28 -16
- package/lib/DefaultEventPluginOrder.js +1 -0
- package/lib/EventConstants.js +1 -0
- package/lib/EventListener.js +5 -2
- package/lib/EventPluginHub.js +2 -5
- package/lib/EventPluginRegistry.js +6 -4
- package/lib/EventPluginUtils.js +11 -1
- package/lib/ExecutionEnvironment.js +8 -2
- package/lib/{DefaultDOMPropertyConfig.js → HTMLDOMPropertyConfig.js} +41 -58
- package/lib/LinkedValueUtils.js +26 -28
- package/lib/LocalEventTrapMixin.js +52 -0
- package/lib/React.js +39 -3
- package/lib/ReactBrowserComponentMixin.js +46 -0
- package/lib/{ReactEventEmitter.js → ReactBrowserEventEmitter.js} +115 -94
- package/lib/ReactCSSTransitionGroup.js +12 -10
- package/lib/ReactCSSTransitionGroupChild.js +2 -5
- package/lib/ReactChildren.js +31 -10
- package/lib/ReactComponent.js +119 -223
- package/lib/ReactComponentBrowserEnvironment.js +3 -36
- package/lib/ReactComponentWithPureRenderMixin.js +54 -0
- package/lib/ReactCompositeComponent.js +249 -287
- package/lib/ReactDOM.js +25 -23
- package/lib/ReactDOMButton.js +2 -1
- package/lib/ReactDOMComponent.js +42 -23
- package/lib/ReactDOMForm.js +7 -12
- package/lib/ReactDOMIDOperations.js +2 -31
- package/lib/ReactDOMImg.js +7 -13
- package/lib/ReactDOMInput.js +2 -1
- package/lib/ReactDOMOption.js +11 -7
- package/lib/ReactDOMSelect.js +18 -16
- package/lib/ReactDOMSelection.js +35 -10
- package/lib/ReactDOMTextarea.js +9 -7
- package/lib/ReactDefaultBatchingStrategy.js +3 -3
- package/lib/ReactDefaultInjection.js +27 -14
- package/lib/ReactDefaultPerf.js +28 -11
- package/lib/ReactDefaultPerfAnalysis.js +4 -0
- package/lib/ReactDescriptor.js +251 -0
- package/lib/ReactDescriptorValidator.js +283 -0
- package/lib/ReactEmptyComponent.js +78 -0
- package/lib/ReactEventEmitterMixin.js +1 -3
- package/lib/ReactEventListener.js +189 -0
- package/lib/ReactInjection.js +8 -2
- package/lib/ReactInputSelection.js +2 -1
- package/lib/ReactLink.js +24 -0
- package/lib/ReactMount.js +61 -21
- package/lib/ReactMultiChild.js +18 -13
- package/lib/ReactOwner.js +6 -1
- package/lib/ReactPropTransferer.js +44 -29
- package/lib/ReactPropTypes.js +226 -242
- package/lib/ReactPutListenerQueue.js +2 -2
- package/lib/ReactReconcileTransaction.js +21 -20
- package/lib/ReactServerRendering.js +41 -11
- package/lib/ReactServerRenderingTransaction.js +115 -0
- package/lib/ReactTestUtils.js +39 -21
- package/lib/ReactTextComponent.js +21 -13
- package/lib/ReactTransitionChildMapping.js +2 -2
- package/lib/ReactTransitionEvents.js +19 -0
- package/lib/ReactTransitionGroup.js +9 -6
- package/lib/ReactUpdates.js +139 -22
- package/lib/ReactWithAddons.js +8 -3
- package/lib/SVGDOMPropertyConfig.js +97 -0
- package/lib/SimpleEventPlugin.js +7 -1
- package/lib/SyntheticInputEvent.js +52 -0
- package/lib/SyntheticKeyboardEvent.js +33 -4
- package/lib/SyntheticMouseEvent.js +3 -0
- package/lib/SyntheticTouchEvent.js +4 -1
- package/lib/SyntheticUIEvent.js +24 -2
- package/lib/Transaction.js +0 -32
- package/lib/cloneWithProps.js +10 -8
- package/lib/createFullPageComponent.js +1 -1
- package/lib/dangerousStyleValue.js +11 -5
- package/lib/{ReactComponentEnvironment.js → emptyObject.js} +6 -5
- package/lib/escapeTextForBrowser.js +2 -3
- package/lib/flattenChildren.js +9 -7
- package/lib/focusNode.js +33 -0
- package/lib/getEventKey.js +35 -5
- package/lib/getEventModifierState.js +52 -0
- package/lib/getMarkupWrap.js +2 -0
- package/lib/getTextContentAccessor.js +1 -1
- package/lib/hyphenate.js +3 -0
- package/lib/hyphenateStyleName.js +46 -0
- package/lib/instantiateReactComponent.js +62 -0
- package/lib/invariant.js +17 -19
- package/lib/isNode.js +1 -1
- package/lib/{objMap.js → mapObject.js} +8 -3
- package/lib/mergeHelpers.js +11 -0
- package/lib/mergeInto.js +3 -2
- package/lib/monitorCodeUse.js +37 -0
- package/lib/onlyChild.js +3 -3
- package/lib/performance.js +33 -0
- package/lib/performanceNow.js +5 -14
- package/lib/setInnerHTML.js +77 -0
- package/lib/shouldUpdateReactComponent.js +14 -28
- package/lib/toArray.js +1 -1
- package/lib/traverseAllChildren.js +9 -5
- package/lib/update.js +171 -0
- package/package.json +4 -3
- package/lib/ReactEventTopLevelCallback.js +0 -149
- package/lib/createObjectFrom.js +0 -61
- package/lib/objMapKeyVal.js +0 -47
|
@@ -70,7 +70,7 @@ var ReactTransitionChildMapping = {
|
|
|
70
70
|
|
|
71
71
|
var pendingKeys = [];
|
|
72
72
|
for (var prevKey in prev) {
|
|
73
|
-
if (next
|
|
73
|
+
if (next.hasOwnProperty(prevKey)) {
|
|
74
74
|
if (pendingKeys.length) {
|
|
75
75
|
nextKeysPending[prevKey] = pendingKeys;
|
|
76
76
|
pendingKeys = [];
|
|
@@ -83,7 +83,7 @@ var ReactTransitionChildMapping = {
|
|
|
83
83
|
var i;
|
|
84
84
|
var childMapping = {};
|
|
85
85
|
for (var nextKey in next) {
|
|
86
|
-
if (nextKeysPending
|
|
86
|
+
if (nextKeysPending.hasOwnProperty(nextKey)) {
|
|
87
87
|
for (i = 0; i < nextKeysPending[nextKey].length; i++) {
|
|
88
88
|
var pendingNextKey = nextKeysPending[nextKey][i];
|
|
89
89
|
childMapping[nextKeysPending[nextKey][i]] = getValueForKey(
|
|
@@ -20,6 +20,11 @@
|
|
|
20
20
|
|
|
21
21
|
var ExecutionEnvironment = require("./ExecutionEnvironment");
|
|
22
22
|
|
|
23
|
+
/**
|
|
24
|
+
* EVENT_NAME_MAP is used to determine which event fired when a
|
|
25
|
+
* transition/animation ends, based on the style property used to
|
|
26
|
+
* define that event.
|
|
27
|
+
*/
|
|
23
28
|
var EVENT_NAME_MAP = {
|
|
24
29
|
transitionend: {
|
|
25
30
|
'transition': 'transitionend',
|
|
@@ -43,6 +48,20 @@ var endEvents = [];
|
|
|
43
48
|
function detectEvents() {
|
|
44
49
|
var testEl = document.createElement('div');
|
|
45
50
|
var style = testEl.style;
|
|
51
|
+
|
|
52
|
+
// On some platforms, in particular some releases of Android 4.x,
|
|
53
|
+
// the un-prefixed "animation" and "transition" properties are defined on the
|
|
54
|
+
// style object but the events that fire will still be prefixed, so we need
|
|
55
|
+
// to check if the un-prefixed events are useable, and if not remove them
|
|
56
|
+
// from the map
|
|
57
|
+
if (!('AnimationEvent' in window)) {
|
|
58
|
+
delete EVENT_NAME_MAP.animationend.animation;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
if (!('TransitionEvent' in window)) {
|
|
62
|
+
delete EVENT_NAME_MAP.transitionend.transition;
|
|
63
|
+
}
|
|
64
|
+
|
|
46
65
|
for (var baseEventName in EVENT_NAME_MAP) {
|
|
47
66
|
var baseEvents = EVENT_NAME_MAP[baseEventName];
|
|
48
67
|
for (var styleName in baseEvents) {
|
|
@@ -26,6 +26,7 @@ var emptyFunction = require("./emptyFunction");
|
|
|
26
26
|
var merge = require("./merge");
|
|
27
27
|
|
|
28
28
|
var ReactTransitionGroup = React.createClass({
|
|
29
|
+
displayName: 'ReactTransitionGroup',
|
|
29
30
|
|
|
30
31
|
propTypes: {
|
|
31
32
|
component: React.PropTypes.func,
|
|
@@ -61,15 +62,17 @@ var ReactTransitionGroup = React.createClass({
|
|
|
61
62
|
var key;
|
|
62
63
|
|
|
63
64
|
for (key in nextChildMapping) {
|
|
64
|
-
|
|
65
|
-
|
|
65
|
+
var hasPrev = prevChildMapping && prevChildMapping.hasOwnProperty(key);
|
|
66
|
+
if (nextChildMapping[key] && !hasPrev &&
|
|
67
|
+
!this.currentlyTransitioningKeys[key]) {
|
|
66
68
|
this.keysToEnter.push(key);
|
|
67
69
|
}
|
|
68
70
|
}
|
|
69
71
|
|
|
70
72
|
for (key in prevChildMapping) {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
+
var hasNext = nextChildMapping && nextChildMapping.hasOwnProperty(key);
|
|
74
|
+
if (prevChildMapping[key] && !hasNext &&
|
|
75
|
+
!this.currentlyTransitioningKeys[key]) {
|
|
73
76
|
this.keysToLeave.push(key);
|
|
74
77
|
}
|
|
75
78
|
}
|
|
@@ -119,7 +122,7 @@ var ReactTransitionGroup = React.createClass({
|
|
|
119
122
|
this.props.children
|
|
120
123
|
);
|
|
121
124
|
|
|
122
|
-
if (!currentChildMapping.hasOwnProperty(key)) {
|
|
125
|
+
if (!currentChildMapping || !currentChildMapping.hasOwnProperty(key)) {
|
|
123
126
|
// This was removed before it had fully entered. Remove it.
|
|
124
127
|
this.performLeave(key);
|
|
125
128
|
}
|
|
@@ -152,7 +155,7 @@ var ReactTransitionGroup = React.createClass({
|
|
|
152
155
|
this.props.children
|
|
153
156
|
);
|
|
154
157
|
|
|
155
|
-
if (currentChildMapping.hasOwnProperty(key)) {
|
|
158
|
+
if (currentChildMapping && currentChildMapping.hasOwnProperty(key)) {
|
|
156
159
|
// This entered again before it fully left. Add it again.
|
|
157
160
|
this.performEnter(key);
|
|
158
161
|
} else {
|
package/lib/ReactUpdates.js
CHANGED
|
@@ -18,21 +18,99 @@
|
|
|
18
18
|
|
|
19
19
|
"use strict";
|
|
20
20
|
|
|
21
|
+
var CallbackQueue = require("./CallbackQueue");
|
|
22
|
+
var PooledClass = require("./PooledClass");
|
|
23
|
+
var ReactCurrentOwner = require("./ReactCurrentOwner");
|
|
21
24
|
var ReactPerf = require("./ReactPerf");
|
|
25
|
+
var Transaction = require("./Transaction");
|
|
22
26
|
|
|
23
27
|
var invariant = require("./invariant");
|
|
28
|
+
var mixInto = require("./mixInto");
|
|
29
|
+
var warning = require("./warning");
|
|
24
30
|
|
|
25
31
|
var dirtyComponents = [];
|
|
26
32
|
|
|
27
33
|
var batchingStrategy = null;
|
|
28
34
|
|
|
29
|
-
function
|
|
30
|
-
("production" !== process.env.NODE_ENV ? invariant(
|
|
35
|
+
function ensureInjected() {
|
|
36
|
+
("production" !== process.env.NODE_ENV ? invariant(
|
|
37
|
+
ReactUpdates.ReactReconcileTransaction && batchingStrategy,
|
|
38
|
+
'ReactUpdates: must inject a reconcile transaction class and batching ' +
|
|
39
|
+
'strategy'
|
|
40
|
+
) : invariant(ReactUpdates.ReactReconcileTransaction && batchingStrategy));
|
|
31
41
|
}
|
|
32
42
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
43
|
+
var NESTED_UPDATES = {
|
|
44
|
+
initialize: function() {
|
|
45
|
+
this.dirtyComponentsLength = dirtyComponents.length;
|
|
46
|
+
},
|
|
47
|
+
close: function() {
|
|
48
|
+
if (this.dirtyComponentsLength !== dirtyComponents.length) {
|
|
49
|
+
// Additional updates were enqueued by componentDidUpdate handlers or
|
|
50
|
+
// similar; before our own UPDATE_QUEUEING wrapper closes, we want to run
|
|
51
|
+
// these new updates so that if A's componentDidUpdate calls setState on
|
|
52
|
+
// B, B will update before the callback A's updater provided when calling
|
|
53
|
+
// setState.
|
|
54
|
+
dirtyComponents.splice(0, this.dirtyComponentsLength);
|
|
55
|
+
flushBatchedUpdates();
|
|
56
|
+
} else {
|
|
57
|
+
dirtyComponents.length = 0;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
var UPDATE_QUEUEING = {
|
|
63
|
+
initialize: function() {
|
|
64
|
+
this.callbackQueue.reset();
|
|
65
|
+
},
|
|
66
|
+
close: function() {
|
|
67
|
+
this.callbackQueue.notifyAll();
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
var TRANSACTION_WRAPPERS = [NESTED_UPDATES, UPDATE_QUEUEING];
|
|
72
|
+
|
|
73
|
+
function ReactUpdatesFlushTransaction() {
|
|
74
|
+
this.reinitializeTransaction();
|
|
75
|
+
this.dirtyComponentsLength = null;
|
|
76
|
+
this.callbackQueue = CallbackQueue.getPooled(null);
|
|
77
|
+
this.reconcileTransaction =
|
|
78
|
+
ReactUpdates.ReactReconcileTransaction.getPooled();
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
mixInto(ReactUpdatesFlushTransaction, Transaction.Mixin);
|
|
82
|
+
mixInto(ReactUpdatesFlushTransaction, {
|
|
83
|
+
getTransactionWrappers: function() {
|
|
84
|
+
return TRANSACTION_WRAPPERS;
|
|
85
|
+
},
|
|
86
|
+
|
|
87
|
+
destructor: function() {
|
|
88
|
+
this.dirtyComponentsLength = null;
|
|
89
|
+
CallbackQueue.release(this.callbackQueue);
|
|
90
|
+
this.callbackQueue = null;
|
|
91
|
+
ReactUpdates.ReactReconcileTransaction.release(this.reconcileTransaction);
|
|
92
|
+
this.reconcileTransaction = null;
|
|
93
|
+
},
|
|
94
|
+
|
|
95
|
+
perform: function(method, scope, a) {
|
|
96
|
+
// Essentially calls `this.reconcileTransaction.perform(method, scope, a)`
|
|
97
|
+
// with this transaction's wrappers around it.
|
|
98
|
+
return Transaction.Mixin.perform.call(
|
|
99
|
+
this,
|
|
100
|
+
this.reconcileTransaction.perform,
|
|
101
|
+
this.reconcileTransaction,
|
|
102
|
+
method,
|
|
103
|
+
scope,
|
|
104
|
+
a
|
|
105
|
+
);
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
PooledClass.addPoolingTo(ReactUpdatesFlushTransaction);
|
|
110
|
+
|
|
111
|
+
function batchedUpdates(callback, a, b) {
|
|
112
|
+
ensureInjected();
|
|
113
|
+
batchingStrategy.batchedUpdates(callback, a, b);
|
|
36
114
|
}
|
|
37
115
|
|
|
38
116
|
/**
|
|
@@ -46,14 +124,22 @@ function mountDepthComparator(c1, c2) {
|
|
|
46
124
|
return c1._mountDepth - c2._mountDepth;
|
|
47
125
|
}
|
|
48
126
|
|
|
49
|
-
function runBatchedUpdates() {
|
|
127
|
+
function runBatchedUpdates(transaction) {
|
|
128
|
+
var len = transaction.dirtyComponentsLength;
|
|
129
|
+
("production" !== process.env.NODE_ENV ? invariant(
|
|
130
|
+
len === dirtyComponents.length,
|
|
131
|
+
'Expected flush transaction\'s stored dirty-components length (%s) to ' +
|
|
132
|
+
'match dirty-components array length (%s).',
|
|
133
|
+
len,
|
|
134
|
+
dirtyComponents.length
|
|
135
|
+
) : invariant(len === dirtyComponents.length));
|
|
136
|
+
|
|
50
137
|
// Since reconciling a component higher in the owner hierarchy usually (not
|
|
51
138
|
// always -- see shouldComponentUpdate()) will reconcile children, reconcile
|
|
52
139
|
// them before their children by sorting the array.
|
|
53
|
-
|
|
54
140
|
dirtyComponents.sort(mountDepthComparator);
|
|
55
141
|
|
|
56
|
-
for (var i = 0; i <
|
|
142
|
+
for (var i = 0; i < len; i++) {
|
|
57
143
|
// If a component is unmounted before pending changes apply, ignore them
|
|
58
144
|
// TODO: Queue unmounts in the same list to avoid this happening at all
|
|
59
145
|
var component = dirtyComponents[i];
|
|
@@ -63,29 +149,32 @@ function runBatchedUpdates() {
|
|
|
63
149
|
// stash the callbacks first
|
|
64
150
|
var callbacks = component._pendingCallbacks;
|
|
65
151
|
component._pendingCallbacks = null;
|
|
66
|
-
component.performUpdateIfNecessary();
|
|
152
|
+
component.performUpdateIfNecessary(transaction.reconcileTransaction);
|
|
153
|
+
|
|
67
154
|
if (callbacks) {
|
|
68
155
|
for (var j = 0; j < callbacks.length; j++) {
|
|
69
|
-
|
|
156
|
+
transaction.callbackQueue.enqueue(
|
|
157
|
+
callbacks[j],
|
|
158
|
+
component
|
|
159
|
+
);
|
|
70
160
|
}
|
|
71
161
|
}
|
|
72
162
|
}
|
|
73
163
|
}
|
|
74
164
|
}
|
|
75
165
|
|
|
76
|
-
function clearDirtyComponents() {
|
|
77
|
-
dirtyComponents.length = 0;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
166
|
var flushBatchedUpdates = ReactPerf.measure(
|
|
81
167
|
'ReactUpdates',
|
|
82
168
|
'flushBatchedUpdates',
|
|
83
169
|
function() {
|
|
84
|
-
//
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
170
|
+
// ReactUpdatesFlushTransaction's wrappers will clear the dirtyComponents
|
|
171
|
+
// array and perform any updates enqueued by mount-ready handlers (i.e.,
|
|
172
|
+
// componentDidUpdate) but we need to check here too in order to catch
|
|
173
|
+
// updates enqueued by setState callbacks.
|
|
174
|
+
while (dirtyComponents.length) {
|
|
175
|
+
var transaction = ReactUpdatesFlushTransaction.getPooled();
|
|
176
|
+
transaction.perform(runBatchedUpdates, null, transaction);
|
|
177
|
+
ReactUpdatesFlushTransaction.release(transaction);
|
|
89
178
|
}
|
|
90
179
|
}
|
|
91
180
|
);
|
|
@@ -101,11 +190,23 @@ function enqueueUpdate(component, callback) {
|
|
|
101
190
|
'`setState`, `replaceState`, or `forceUpdate` with a callback that ' +
|
|
102
191
|
'isn\'t callable.'
|
|
103
192
|
) : invariant(!callback || typeof callback === "function"));
|
|
104
|
-
|
|
193
|
+
ensureInjected();
|
|
194
|
+
|
|
195
|
+
// Various parts of our code (such as ReactCompositeComponent's
|
|
196
|
+
// _renderValidatedComponent) assume that calls to render aren't nested;
|
|
197
|
+
// verify that that's the case. (This is called by each top-level update
|
|
198
|
+
// function, like setProps, setState, forceUpdate, etc.; creation and
|
|
199
|
+
// destruction of top-level components is guarded in ReactMount.)
|
|
200
|
+
("production" !== process.env.NODE_ENV ? warning(
|
|
201
|
+
ReactCurrentOwner.current == null,
|
|
202
|
+
'enqueueUpdate(): Render methods should be a pure function of props ' +
|
|
203
|
+
'and state; triggering nested component updates from render is not ' +
|
|
204
|
+
'allowed. If necessary, trigger nested updates in ' +
|
|
205
|
+
'componentDidUpdate.'
|
|
206
|
+
) : null);
|
|
105
207
|
|
|
106
208
|
if (!batchingStrategy.isBatchingUpdates) {
|
|
107
|
-
|
|
108
|
-
callback && callback.call(component);
|
|
209
|
+
batchingStrategy.batchedUpdates(enqueueUpdate, component, callback);
|
|
109
210
|
return;
|
|
110
211
|
}
|
|
111
212
|
|
|
@@ -121,6 +222,14 @@ function enqueueUpdate(component, callback) {
|
|
|
121
222
|
}
|
|
122
223
|
|
|
123
224
|
var ReactUpdatesInjection = {
|
|
225
|
+
injectReconcileTransaction: function(ReconcileTransaction) {
|
|
226
|
+
("production" !== process.env.NODE_ENV ? invariant(
|
|
227
|
+
ReconcileTransaction,
|
|
228
|
+
'ReactUpdates: must provide a reconcile transaction class'
|
|
229
|
+
) : invariant(ReconcileTransaction));
|
|
230
|
+
ReactUpdates.ReactReconcileTransaction = ReconcileTransaction;
|
|
231
|
+
},
|
|
232
|
+
|
|
124
233
|
injectBatchingStrategy: function(_batchingStrategy) {
|
|
125
234
|
("production" !== process.env.NODE_ENV ? invariant(
|
|
126
235
|
_batchingStrategy,
|
|
@@ -139,6 +248,14 @@ var ReactUpdatesInjection = {
|
|
|
139
248
|
};
|
|
140
249
|
|
|
141
250
|
var ReactUpdates = {
|
|
251
|
+
/**
|
|
252
|
+
* React references `ReactReconcileTransaction` using this property in order
|
|
253
|
+
* to allow dependency injection.
|
|
254
|
+
*
|
|
255
|
+
* @internal
|
|
256
|
+
*/
|
|
257
|
+
ReactReconcileTransaction: null,
|
|
258
|
+
|
|
142
259
|
batchedUpdates: batchedUpdates,
|
|
143
260
|
enqueueUpdate: enqueueUpdate,
|
|
144
261
|
flushBatchedUpdates: flushBatchedUpdates,
|
package/lib/ReactWithAddons.js
CHANGED
|
@@ -27,23 +27,28 @@
|
|
|
27
27
|
|
|
28
28
|
var LinkedStateMixin = require("./LinkedStateMixin");
|
|
29
29
|
var React = require("./React");
|
|
30
|
+
var ReactComponentWithPureRenderMixin =
|
|
31
|
+
require("./ReactComponentWithPureRenderMixin");
|
|
30
32
|
var ReactCSSTransitionGroup = require("./ReactCSSTransitionGroup");
|
|
31
33
|
var ReactTransitionGroup = require("./ReactTransitionGroup");
|
|
32
|
-
var ReactCSSTransitionGroup = require("./ReactCSSTransitionGroup");
|
|
33
34
|
|
|
34
35
|
var cx = require("./cx");
|
|
35
36
|
var cloneWithProps = require("./cloneWithProps");
|
|
37
|
+
var update = require("./update");
|
|
36
38
|
|
|
37
39
|
React.addons = {
|
|
38
|
-
LinkedStateMixin: LinkedStateMixin,
|
|
39
40
|
CSSTransitionGroup: ReactCSSTransitionGroup,
|
|
41
|
+
LinkedStateMixin: LinkedStateMixin,
|
|
42
|
+
PureRenderMixin: ReactComponentWithPureRenderMixin,
|
|
40
43
|
TransitionGroup: ReactTransitionGroup,
|
|
41
44
|
|
|
42
45
|
classSet: cx,
|
|
43
|
-
cloneWithProps: cloneWithProps
|
|
46
|
+
cloneWithProps: cloneWithProps,
|
|
47
|
+
update: update
|
|
44
48
|
};
|
|
45
49
|
|
|
46
50
|
if ("production" !== process.env.NODE_ENV) {
|
|
51
|
+
React.addons.Perf = require("./ReactDefaultPerf");
|
|
47
52
|
React.addons.TestUtils = require("./ReactTestUtils");
|
|
48
53
|
}
|
|
49
54
|
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2013-2014 Facebook, Inc.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*
|
|
16
|
+
* @providesModule SVGDOMPropertyConfig
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
/*jslint bitwise: true*/
|
|
20
|
+
|
|
21
|
+
"use strict";
|
|
22
|
+
|
|
23
|
+
var DOMProperty = require("./DOMProperty");
|
|
24
|
+
|
|
25
|
+
var MUST_USE_ATTRIBUTE = DOMProperty.injection.MUST_USE_ATTRIBUTE;
|
|
26
|
+
|
|
27
|
+
var SVGDOMPropertyConfig = {
|
|
28
|
+
Properties: {
|
|
29
|
+
cx: MUST_USE_ATTRIBUTE,
|
|
30
|
+
cy: MUST_USE_ATTRIBUTE,
|
|
31
|
+
d: MUST_USE_ATTRIBUTE,
|
|
32
|
+
dx: MUST_USE_ATTRIBUTE,
|
|
33
|
+
dy: MUST_USE_ATTRIBUTE,
|
|
34
|
+
fill: MUST_USE_ATTRIBUTE,
|
|
35
|
+
fillOpacity: MUST_USE_ATTRIBUTE,
|
|
36
|
+
fontFamily: MUST_USE_ATTRIBUTE,
|
|
37
|
+
fontSize: MUST_USE_ATTRIBUTE,
|
|
38
|
+
fx: MUST_USE_ATTRIBUTE,
|
|
39
|
+
fy: MUST_USE_ATTRIBUTE,
|
|
40
|
+
gradientTransform: MUST_USE_ATTRIBUTE,
|
|
41
|
+
gradientUnits: MUST_USE_ATTRIBUTE,
|
|
42
|
+
markerEnd: MUST_USE_ATTRIBUTE,
|
|
43
|
+
markerMid: MUST_USE_ATTRIBUTE,
|
|
44
|
+
markerStart: MUST_USE_ATTRIBUTE,
|
|
45
|
+
offset: MUST_USE_ATTRIBUTE,
|
|
46
|
+
opacity: MUST_USE_ATTRIBUTE,
|
|
47
|
+
patternContentUnits: MUST_USE_ATTRIBUTE,
|
|
48
|
+
patternUnits: MUST_USE_ATTRIBUTE,
|
|
49
|
+
points: MUST_USE_ATTRIBUTE,
|
|
50
|
+
preserveAspectRatio: MUST_USE_ATTRIBUTE,
|
|
51
|
+
r: MUST_USE_ATTRIBUTE,
|
|
52
|
+
rx: MUST_USE_ATTRIBUTE,
|
|
53
|
+
ry: MUST_USE_ATTRIBUTE,
|
|
54
|
+
spreadMethod: MUST_USE_ATTRIBUTE,
|
|
55
|
+
stopColor: MUST_USE_ATTRIBUTE,
|
|
56
|
+
stopOpacity: MUST_USE_ATTRIBUTE,
|
|
57
|
+
stroke: MUST_USE_ATTRIBUTE,
|
|
58
|
+
strokeDasharray: MUST_USE_ATTRIBUTE,
|
|
59
|
+
strokeLinecap: MUST_USE_ATTRIBUTE,
|
|
60
|
+
strokeOpacity: MUST_USE_ATTRIBUTE,
|
|
61
|
+
strokeWidth: MUST_USE_ATTRIBUTE,
|
|
62
|
+
textAnchor: MUST_USE_ATTRIBUTE,
|
|
63
|
+
transform: MUST_USE_ATTRIBUTE,
|
|
64
|
+
version: MUST_USE_ATTRIBUTE,
|
|
65
|
+
viewBox: MUST_USE_ATTRIBUTE,
|
|
66
|
+
x1: MUST_USE_ATTRIBUTE,
|
|
67
|
+
x2: MUST_USE_ATTRIBUTE,
|
|
68
|
+
x: MUST_USE_ATTRIBUTE,
|
|
69
|
+
y1: MUST_USE_ATTRIBUTE,
|
|
70
|
+
y2: MUST_USE_ATTRIBUTE,
|
|
71
|
+
y: MUST_USE_ATTRIBUTE
|
|
72
|
+
},
|
|
73
|
+
DOMAttributeNames: {
|
|
74
|
+
fillOpacity: 'fill-opacity',
|
|
75
|
+
fontFamily: 'font-family',
|
|
76
|
+
fontSize: 'font-size',
|
|
77
|
+
gradientTransform: 'gradientTransform',
|
|
78
|
+
gradientUnits: 'gradientUnits',
|
|
79
|
+
markerEnd: 'marker-end',
|
|
80
|
+
markerMid: 'marker-mid',
|
|
81
|
+
markerStart: 'marker-start',
|
|
82
|
+
patternContentUnits: 'patternContentUnits',
|
|
83
|
+
patternUnits: 'patternUnits',
|
|
84
|
+
preserveAspectRatio: 'preserveAspectRatio',
|
|
85
|
+
spreadMethod: 'spreadMethod',
|
|
86
|
+
stopColor: 'stop-color',
|
|
87
|
+
stopOpacity: 'stop-opacity',
|
|
88
|
+
strokeDasharray: 'stroke-dasharray',
|
|
89
|
+
strokeLinecap: 'stroke-linecap',
|
|
90
|
+
strokeOpacity: 'stroke-opacity',
|
|
91
|
+
strokeWidth: 'stroke-width',
|
|
92
|
+
textAnchor: 'text-anchor',
|
|
93
|
+
viewBox: 'viewBox'
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
module.exports = SVGDOMPropertyConfig;
|