react 0.13.1 → 0.13.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 +14 -19
- package/dist/react-with-addons.js +38 -14
- package/dist/react-with-addons.min.js +7 -6
- package/dist/react.js +29 -8
- package/dist/react.min.js +5 -5
- package/lib/CSSProperty.js +5 -1
- package/lib/HTMLDOMPropertyConfig.js +7 -1
- package/lib/React.js +1 -1
- package/lib/ReactCompositeComponent.js +9 -1
- package/lib/ReactDOMComponent.js +2 -0
- package/lib/ReactElementValidator.js +3 -3
- package/lib/instantiateReactComponent.js +1 -0
- package/lib/update.js +9 -6
- package/package.json +1 -1
package/lib/CSSProperty.js
CHANGED
|
@@ -20,7 +20,9 @@ var isUnitlessNumber = {
|
|
|
20
20
|
columnCount: true,
|
|
21
21
|
flex: true,
|
|
22
22
|
flexGrow: true,
|
|
23
|
+
flexPositive: true,
|
|
23
24
|
flexShrink: true,
|
|
25
|
+
flexNegative: true,
|
|
24
26
|
fontWeight: true,
|
|
25
27
|
lineClamp: true,
|
|
26
28
|
lineHeight: true,
|
|
@@ -33,7 +35,9 @@ var isUnitlessNumber = {
|
|
|
33
35
|
|
|
34
36
|
// SVG-related properties
|
|
35
37
|
fillOpacity: true,
|
|
36
|
-
|
|
38
|
+
strokeDashoffset: true,
|
|
39
|
+
strokeOpacity: true,
|
|
40
|
+
strokeWidth: true
|
|
37
41
|
};
|
|
38
42
|
|
|
39
43
|
/**
|
|
@@ -97,6 +97,7 @@ var HTMLDOMPropertyConfig = {
|
|
|
97
97
|
headers: null,
|
|
98
98
|
height: MUST_USE_ATTRIBUTE,
|
|
99
99
|
hidden: MUST_USE_ATTRIBUTE | HAS_BOOLEAN_VALUE,
|
|
100
|
+
high: null,
|
|
100
101
|
href: null,
|
|
101
102
|
hrefLang: null,
|
|
102
103
|
htmlFor: null,
|
|
@@ -107,6 +108,7 @@ var HTMLDOMPropertyConfig = {
|
|
|
107
108
|
lang: null,
|
|
108
109
|
list: MUST_USE_ATTRIBUTE,
|
|
109
110
|
loop: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,
|
|
111
|
+
low: null,
|
|
110
112
|
manifest: MUST_USE_ATTRIBUTE,
|
|
111
113
|
marginHeight: null,
|
|
112
114
|
marginWidth: null,
|
|
@@ -121,6 +123,7 @@ var HTMLDOMPropertyConfig = {
|
|
|
121
123
|
name: null,
|
|
122
124
|
noValidate: HAS_BOOLEAN_VALUE,
|
|
123
125
|
open: HAS_BOOLEAN_VALUE,
|
|
126
|
+
optimum: null,
|
|
124
127
|
pattern: null,
|
|
125
128
|
placeholder: null,
|
|
126
129
|
poster: null,
|
|
@@ -134,6 +137,7 @@ var HTMLDOMPropertyConfig = {
|
|
|
134
137
|
rowSpan: null,
|
|
135
138
|
sandbox: null,
|
|
136
139
|
scope: null,
|
|
140
|
+
scoped: HAS_BOOLEAN_VALUE,
|
|
137
141
|
scrolling: null,
|
|
138
142
|
seamless: MUST_USE_ATTRIBUTE | HAS_BOOLEAN_VALUE,
|
|
139
143
|
selected: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,
|
|
@@ -175,7 +179,9 @@ var HTMLDOMPropertyConfig = {
|
|
|
175
179
|
itemID: MUST_USE_ATTRIBUTE,
|
|
176
180
|
itemRef: MUST_USE_ATTRIBUTE,
|
|
177
181
|
// property is supported for OpenGraph in meta tags.
|
|
178
|
-
property: null
|
|
182
|
+
property: null,
|
|
183
|
+
// IE-only attribute that controls focus behavior
|
|
184
|
+
unselectable: MUST_USE_ATTRIBUTE
|
|
179
185
|
},
|
|
180
186
|
DOMAttributeNames: {
|
|
181
187
|
acceptCharset: 'accept-charset',
|
package/lib/React.js
CHANGED
|
@@ -174,6 +174,14 @@ var ReactCompositeComponentMixin = {
|
|
|
174
174
|
'Did you mean to define a state property instead?',
|
|
175
175
|
this.getName() || 'a component'
|
|
176
176
|
) : null);
|
|
177
|
+
("production" !== process.env.NODE_ENV ? warning(
|
|
178
|
+
!inst.getDefaultProps ||
|
|
179
|
+
inst.getDefaultProps.isReactClassApproved,
|
|
180
|
+
'getDefaultProps was defined on %s, a plain JavaScript class. ' +
|
|
181
|
+
'This is only supported for classes created using React.createClass. ' +
|
|
182
|
+
'Use a static property to define defaultProps instead.',
|
|
183
|
+
this.getName() || 'a component'
|
|
184
|
+
) : null);
|
|
177
185
|
("production" !== process.env.NODE_ENV ? warning(
|
|
178
186
|
!inst.propTypes,
|
|
179
187
|
'propTypes was defined as an instance property on %s. Use a static ' +
|
|
@@ -743,7 +751,7 @@ var ReactCompositeComponentMixin = {
|
|
|
743
751
|
this._renderedComponent,
|
|
744
752
|
thisID,
|
|
745
753
|
transaction,
|
|
746
|
-
context
|
|
754
|
+
this._processChildContext(context)
|
|
747
755
|
);
|
|
748
756
|
this._replaceNodeWithMarkupByID(prevComponentID, nextMarkup);
|
|
749
757
|
}
|
package/lib/ReactDOMComponent.js
CHANGED
|
@@ -373,6 +373,8 @@ ReactDOMComponent.Mixin = {
|
|
|
373
373
|
if (propKey === STYLE) {
|
|
374
374
|
if (nextProp) {
|
|
375
375
|
nextProp = this._previousStyleCopy = assign({}, nextProp);
|
|
376
|
+
} else {
|
|
377
|
+
this._previousStyleCopy = null;
|
|
376
378
|
}
|
|
377
379
|
if (lastProp) {
|
|
378
380
|
// Unset styles on `lastProp` but not on `nextProp`.
|
|
@@ -290,9 +290,9 @@ function warnForPropsMutation(propName, element) {
|
|
|
290
290
|
|
|
291
291
|
("production" !== process.env.NODE_ENV ? warning(
|
|
292
292
|
false,
|
|
293
|
-
'Don\'t set .props.%s of the React component%s. ' +
|
|
294
|
-
'
|
|
295
|
-
'
|
|
293
|
+
'Don\'t set .props.%s of the React component%s. Instead, specify the ' +
|
|
294
|
+
'correct value when initially creating the element or use ' +
|
|
295
|
+
'React.cloneElement to make a new element with updated props.%s',
|
|
296
296
|
propName,
|
|
297
297
|
elementInfo,
|
|
298
298
|
ownerInfo
|
package/lib/update.js
CHANGED
|
@@ -9,11 +9,14 @@
|
|
|
9
9
|
* @providesModule update
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
+
/* global hasOwnProperty:true */
|
|
13
|
+
|
|
12
14
|
'use strict';
|
|
13
15
|
|
|
14
16
|
var assign = require("./Object.assign");
|
|
15
17
|
var keyOf = require("./keyOf");
|
|
16
18
|
var invariant = require("./invariant");
|
|
19
|
+
var hasOwnProperty = {}.hasOwnProperty;
|
|
17
20
|
|
|
18
21
|
function shallowCopy(x) {
|
|
19
22
|
if (Array.isArray(x)) {
|
|
@@ -73,7 +76,7 @@ function update(value, spec) {
|
|
|
73
76
|
COMMAND_SET
|
|
74
77
|
) : invariant(typeof spec === 'object'));
|
|
75
78
|
|
|
76
|
-
if (
|
|
79
|
+
if (hasOwnProperty.call(spec, COMMAND_SET)) {
|
|
77
80
|
("production" !== process.env.NODE_ENV ? invariant(
|
|
78
81
|
Object.keys(spec).length === 1,
|
|
79
82
|
'Cannot have more than one key in an object with %s',
|
|
@@ -85,7 +88,7 @@ function update(value, spec) {
|
|
|
85
88
|
|
|
86
89
|
var nextValue = shallowCopy(value);
|
|
87
90
|
|
|
88
|
-
if (
|
|
91
|
+
if (hasOwnProperty.call(spec, COMMAND_MERGE)) {
|
|
89
92
|
var mergeObj = spec[COMMAND_MERGE];
|
|
90
93
|
("production" !== process.env.NODE_ENV ? invariant(
|
|
91
94
|
mergeObj && typeof mergeObj === 'object',
|
|
@@ -102,21 +105,21 @@ function update(value, spec) {
|
|
|
102
105
|
assign(nextValue, spec[COMMAND_MERGE]);
|
|
103
106
|
}
|
|
104
107
|
|
|
105
|
-
if (
|
|
108
|
+
if (hasOwnProperty.call(spec, COMMAND_PUSH)) {
|
|
106
109
|
invariantArrayCase(value, spec, COMMAND_PUSH);
|
|
107
110
|
spec[COMMAND_PUSH].forEach(function(item) {
|
|
108
111
|
nextValue.push(item);
|
|
109
112
|
});
|
|
110
113
|
}
|
|
111
114
|
|
|
112
|
-
if (
|
|
115
|
+
if (hasOwnProperty.call(spec, COMMAND_UNSHIFT)) {
|
|
113
116
|
invariantArrayCase(value, spec, COMMAND_UNSHIFT);
|
|
114
117
|
spec[COMMAND_UNSHIFT].forEach(function(item) {
|
|
115
118
|
nextValue.unshift(item);
|
|
116
119
|
});
|
|
117
120
|
}
|
|
118
121
|
|
|
119
|
-
if (
|
|
122
|
+
if (hasOwnProperty.call(spec, COMMAND_SPLICE)) {
|
|
120
123
|
("production" !== process.env.NODE_ENV ? invariant(
|
|
121
124
|
Array.isArray(value),
|
|
122
125
|
'Expected %s target to be an array; got %s',
|
|
@@ -142,7 +145,7 @@ function update(value, spec) {
|
|
|
142
145
|
});
|
|
143
146
|
}
|
|
144
147
|
|
|
145
|
-
if (
|
|
148
|
+
if (hasOwnProperty.call(spec, COMMAND_APPLY)) {
|
|
146
149
|
("production" !== process.env.NODE_ENV ? invariant(
|
|
147
150
|
typeof spec[COMMAND_APPLY] === 'function',
|
|
148
151
|
'update(): expected spec of %s to be a function; got %s.',
|