react 15.3.2 → 15.4.0-rc.4
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/react-with-addons.js +3864 -21390
- package/dist/react-with-addons.min.js +3 -6
- package/dist/react.js +2639 -19486
- package/dist/react.min.js +2 -6
- package/lib/KeyEscapeUtils.js +0 -1
- package/lib/LinkedStateMixin.js +1 -3
- package/lib/PooledClass.js +3 -1
- package/lib/React.js +0 -1
- package/lib/ReactAddonsDOMDependencies.js +35 -0
- package/lib/ReactAddonsDOMDependenciesUMDShim.js +31 -0
- package/lib/ReactCSSTransitionGroup.js +60 -43
- package/lib/ReactCSSTransitionGroupChild.js +2 -3
- package/lib/ReactChildren.js +0 -1
- package/lib/ReactClass.js +38 -54
- package/lib/ReactComponent.js +0 -1
- package/lib/ReactComponentTreeDevtool.js +0 -1
- package/lib/ReactComponentTreeHook.js +84 -101
- package/lib/{DOMNamespaces.js → ReactComponentTreeHookUMDShim.js} +4 -7
- package/lib/ReactComponentWithPureRenderMixin.js +0 -1
- package/lib/ReactCurrentOwner.js +1 -2
- package/lib/{renderSubtreeIntoContainer.js → ReactCurrentOwnerUMDShim.js} +5 -4
- package/lib/ReactDOMFactories.js +0 -1
- package/lib/ReactElement.js +6 -14
- package/lib/ReactElementSymbol.js +19 -0
- package/lib/{ReactDOMComponentFlags.js → ReactElementType.js} +3 -9
- package/lib/ReactElementValidator.js +1 -3
- package/lib/ReactFragment.js +0 -1
- package/lib/ReactLink.js +0 -1
- package/lib/ReactNoopUpdateQueue.js +0 -1
- package/lib/ReactPropTypeLocationNames.js +1 -1
- package/lib/ReactPropTypeLocations.js +2 -12
- package/lib/ReactPropTypes.js +5 -3
- package/lib/ReactPropTypesSecret.js +1 -1
- package/lib/ReactPureComponent.js +0 -1
- package/lib/ReactStateSetters.js +0 -1
- package/lib/ReactTransitionChildMapping.js +0 -1
- package/lib/ReactTransitionEvents.js +1 -2
- package/lib/ReactTransitionGroup.js +145 -142
- package/lib/ReactUMDEntry.js +11 -6
- package/lib/{ReactDOMFeatureFlags.js → ReactUMDShim.js} +3 -6
- package/lib/ReactVersion.js +1 -2
- package/lib/ReactWithAddons.js +15 -3
- package/lib/ReactWithAddonsUMDEntry.js +11 -6
- package/lib/canDefineProperty.js +2 -1
- package/lib/checkReactTypeSpec.js +0 -1
- package/lib/deprecated.js +0 -1
- package/lib/flattenChildren.js +0 -1
- package/lib/getIteratorFn.js +0 -1
- package/lib/onlyChild.js +0 -1
- package/lib/reactProdInvariant.js +0 -1
- package/lib/shallowCompare.js +1 -2
- package/lib/sliceChildren.js +0 -1
- package/lib/traverseAllChildren.js +11 -3
- package/lib/update.js +6 -8
- package/package.json +1 -1
- package/lib/AutoFocusUtils.js +0 -24
- package/lib/BeforeInputEventPlugin.js +0 -390
- package/lib/CSSProperty.js +0 -148
- package/lib/CSSPropertyOperations.js +0 -205
- package/lib/CallbackQueue.js +0 -106
- package/lib/ChangeEventPlugin.js +0 -325
- package/lib/DOMChildrenOperations.js +0 -194
- package/lib/DOMLazyTree.js +0 -118
- package/lib/DOMProperty.js +0 -206
- package/lib/DOMPropertyOperations.js +0 -221
- package/lib/Danger.js +0 -48
- package/lib/DefaultEventPluginOrder.js +0 -27
- package/lib/DisabledInputUtils.js +0 -50
- package/lib/EnterLeaveEventPlugin.js +0 -105
- package/lib/EventConstants.js +0 -97
- package/lib/EventPluginHub.js +0 -251
- package/lib/EventPluginRegistry.js +0 -247
- package/lib/EventPluginUtils.js +0 -229
- package/lib/EventPropagators.js +0 -137
- package/lib/FallbackCompositionState.js +0 -95
- package/lib/HTMLDOMPropertyConfig.js +0 -212
- package/lib/LinkedValueUtils.js +0 -136
- package/lib/NativeMethodsMixin.js +0 -167
- package/lib/ReactBrowserEventEmitter.js +0 -330
- package/lib/ReactChildReconciler.js +0 -154
- package/lib/ReactChildrenMutationWarningHook.js +0 -54
- package/lib/ReactComponentBrowserEnvironment.js +0 -30
- package/lib/ReactComponentEnvironment.js +0 -45
- package/lib/ReactComponentTreeTestUtils.js +0 -87
- package/lib/ReactCompositeComponent.js +0 -904
- package/lib/ReactDOM.js +0 -110
- package/lib/ReactDOMButton.js +0 -24
- package/lib/ReactDOMComponent.js +0 -1006
- package/lib/ReactDOMComponentTree.js +0 -188
- package/lib/ReactDOMContainerInfo.js +0 -33
- package/lib/ReactDOMEmptyComponent.js +0 -60
- package/lib/ReactDOMFiber.js +0 -76
- package/lib/ReactDOMIDOperations.js +0 -34
- package/lib/ReactDOMInput.js +0 -269
- package/lib/ReactDOMNullInputValuePropHook.js +0 -43
- package/lib/ReactDOMOption.js +0 -123
- package/lib/ReactDOMSelect.js +0 -201
- package/lib/ReactDOMSelection.js +0 -212
- package/lib/ReactDOMServer.js +0 -26
- package/lib/ReactDOMTextComponent.js +0 -164
- package/lib/ReactDOMTextarea.js +0 -155
- package/lib/ReactDOMTreeTraversal.js +0 -136
- package/lib/ReactDOMUnknownPropertyHook.js +0 -112
- package/lib/ReactDebugTool.js +0 -301
- package/lib/ReactDefaultBatchingStrategy.js +0 -68
- package/lib/ReactDefaultInjection.js +0 -84
- package/lib/ReactEmptyComponent.js +0 -30
- package/lib/ReactErrorUtils.js +0 -76
- package/lib/ReactEventEmitterMixin.js +0 -33
- package/lib/ReactEventListener.js +0 -157
- package/lib/ReactFeatureFlags.js +0 -22
- package/lib/ReactHostComponent.js +0 -76
- package/lib/ReactHostOperationHistoryHook.js +0 -37
- package/lib/ReactInjection.js +0 -36
- package/lib/ReactInputSelection.js +0 -124
- package/lib/ReactInstanceHandles.js +0 -302
- package/lib/ReactInstanceMap.js +0 -48
- package/lib/ReactInstrumentation.js +0 -21
- package/lib/ReactInvalidSetStateWarningHook.js +0 -36
- package/lib/ReactMarkupChecksum.js +0 -50
- package/lib/ReactMount.js +0 -534
- package/lib/ReactMultiChild.js +0 -451
- package/lib/ReactMultiChildUpdateTypes.js +0 -32
- package/lib/ReactNative.js +0 -71
- package/lib/ReactNativeAttributePayload.js +0 -371
- package/lib/ReactNativeBaseComponent.js +0 -198
- package/lib/ReactNativeBridgeEventPlugin.js +0 -60
- package/lib/ReactNativeComponentEnvironment.js +0 -31
- package/lib/ReactNativeComponentTree.js +0 -68
- package/lib/ReactNativeContainerInfo.js +0 -21
- package/lib/ReactNativeDOMIDOperations.js +0 -79
- package/lib/ReactNativeDefaultInjection.js +0 -101
- package/lib/ReactNativeEventEmitter.js +0 -191
- package/lib/ReactNativeEventPluginOrder.js +0 -16
- package/lib/ReactNativeGlobalResponderHandler.js +0 -25
- package/lib/ReactNativeMount.js +0 -193
- package/lib/ReactNativePropRegistry.js +0 -52
- package/lib/ReactNativeReconcileTransaction.js +0 -129
- package/lib/ReactNativeTagHandles.js +0 -56
- package/lib/ReactNativeTextComponent.js +0 -71
- package/lib/ReactNativeTreeTraversal.js +0 -127
- package/lib/ReactNodeTypes.js +0 -40
- package/lib/ReactNoop.js +0 -173
- package/lib/ReactOwner.js +0 -94
- package/lib/ReactPerf.js +0 -494
- package/lib/ReactReconcileTransaction.js +0 -178
- package/lib/ReactReconciler.js +0 -168
- package/lib/ReactRef.js +0 -80
- package/lib/ReactServerBatchingStrategy.js +0 -22
- package/lib/ReactServerRendering.js +0 -90
- package/lib/ReactServerRenderingTransaction.js +0 -90
- package/lib/ReactServerUpdateQueue.js +0 -141
- package/lib/ReactSimpleEmptyComponent.js +0 -37
- package/lib/ReactTestMount.js +0 -126
- package/lib/ReactTestReconcileTransaction.js +0 -121
- package/lib/ReactTestRenderer.js +0 -144
- package/lib/ReactTestUtils.js +0 -518
- package/lib/ReactUpdateQueue.js +0 -226
- package/lib/ReactUpdates.js +0 -251
- package/lib/ResponderEventPlugin.js +0 -510
- package/lib/ResponderSyntheticEvent.js +0 -39
- package/lib/ResponderTouchHistoryStore.js +0 -184
- package/lib/SVGDOMPropertyConfig.js +0 -302
- package/lib/SelectEventPlugin.js +0 -196
- package/lib/SimpleEventPlugin.js +0 -635
- package/lib/SyntheticAnimationEvent.js +0 -39
- package/lib/SyntheticClipboardEvent.js +0 -38
- package/lib/SyntheticCompositionEvent.js +0 -36
- package/lib/SyntheticDragEvent.js +0 -36
- package/lib/SyntheticEvent.js +0 -268
- package/lib/SyntheticFocusEvent.js +0 -36
- package/lib/SyntheticInputEvent.js +0 -37
- package/lib/SyntheticKeyboardEvent.js +0 -84
- package/lib/SyntheticMouseEvent.js +0 -72
- package/lib/SyntheticTouchEvent.js +0 -45
- package/lib/SyntheticTransitionEvent.js +0 -39
- package/lib/SyntheticUIEvent.js +0 -59
- package/lib/SyntheticWheelEvent.js +0 -54
- package/lib/TapEventPlugin.js +0 -110
- package/lib/TouchHistoryMath.js +0 -99
- package/lib/Transaction.js +0 -233
- package/lib/ViewportMetrics.js +0 -27
- package/lib/accumulate.js +0 -46
- package/lib/accumulateInto.js +0 -58
- package/lib/adler32.js +0 -44
- package/lib/createMicrosoftUnsafeLocalFunction.js +0 -32
- package/lib/createReactNativeComponentClass.js +0 -42
- package/lib/dangerousStyleValue.js +0 -79
- package/lib/escapeTextContentForBrowser.js +0 -123
- package/lib/findDOMNode.js +0 -60
- package/lib/findNodeHandle.js +0 -91
- package/lib/forEachAccumulated.js +0 -31
- package/lib/getEventCharCode.js +0 -50
- package/lib/getEventKey.js +0 -102
- package/lib/getEventModifierState.js +0 -43
- package/lib/getEventTarget.js +0 -35
- package/lib/getHostComponentFromComposite.js +0 -30
- package/lib/getNodeForCharacterOffset.js +0 -74
- package/lib/getTestDocument.js +0 -21
- package/lib/getTextContentAccessor.js +0 -33
- package/lib/getVendorPrefixedEventName.js +0 -101
- package/lib/instantiateReactComponent.js +0 -119
- package/lib/isEventSupported.js +0 -60
- package/lib/isTextInputElement.js +0 -51
- package/lib/quoteAttributeValueForBrowser.js +0 -26
- package/lib/reactComponentExpect.js +0 -217
- package/lib/setInnerHTML.js +0 -98
- package/lib/setTextContent.js +0 -48
- package/lib/shouldUpdateReactComponent.js +0 -42
- package/lib/validateDOMNesting.js +0 -382
package/lib/CSSProperty.js
DELETED
|
@@ -1,148 +0,0 @@
|
|
|
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 CSSProperty
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
'use strict';
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* CSS properties which accept numbers but are not in units of "px".
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
|
-
var isUnitlessNumber = {
|
|
19
|
-
animationIterationCount: true,
|
|
20
|
-
borderImageOutset: true,
|
|
21
|
-
borderImageSlice: true,
|
|
22
|
-
borderImageWidth: true,
|
|
23
|
-
boxFlex: true,
|
|
24
|
-
boxFlexGroup: true,
|
|
25
|
-
boxOrdinalGroup: true,
|
|
26
|
-
columnCount: true,
|
|
27
|
-
flex: true,
|
|
28
|
-
flexGrow: true,
|
|
29
|
-
flexPositive: true,
|
|
30
|
-
flexShrink: true,
|
|
31
|
-
flexNegative: true,
|
|
32
|
-
flexOrder: true,
|
|
33
|
-
gridRow: true,
|
|
34
|
-
gridColumn: true,
|
|
35
|
-
fontWeight: true,
|
|
36
|
-
lineClamp: true,
|
|
37
|
-
lineHeight: true,
|
|
38
|
-
opacity: true,
|
|
39
|
-
order: true,
|
|
40
|
-
orphans: true,
|
|
41
|
-
tabSize: true,
|
|
42
|
-
widows: true,
|
|
43
|
-
zIndex: true,
|
|
44
|
-
zoom: true,
|
|
45
|
-
|
|
46
|
-
// SVG-related properties
|
|
47
|
-
fillOpacity: true,
|
|
48
|
-
floodOpacity: true,
|
|
49
|
-
stopOpacity: true,
|
|
50
|
-
strokeDasharray: true,
|
|
51
|
-
strokeDashoffset: true,
|
|
52
|
-
strokeMiterlimit: true,
|
|
53
|
-
strokeOpacity: true,
|
|
54
|
-
strokeWidth: true
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
/**
|
|
58
|
-
* @param {string} prefix vendor-specific prefix, eg: Webkit
|
|
59
|
-
* @param {string} key style name, eg: transitionDuration
|
|
60
|
-
* @return {string} style name prefixed with `prefix`, properly camelCased, eg:
|
|
61
|
-
* WebkitTransitionDuration
|
|
62
|
-
*/
|
|
63
|
-
function prefixKey(prefix, key) {
|
|
64
|
-
return prefix + key.charAt(0).toUpperCase() + key.substring(1);
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
/**
|
|
68
|
-
* Support style names that may come passed in prefixed by adding permutations
|
|
69
|
-
* of vendor prefixes.
|
|
70
|
-
*/
|
|
71
|
-
var prefixes = ['Webkit', 'ms', 'Moz', 'O'];
|
|
72
|
-
|
|
73
|
-
// Using Object.keys here, or else the vanilla for-in loop makes IE8 go into an
|
|
74
|
-
// infinite loop, because it iterates over the newly added props too.
|
|
75
|
-
Object.keys(isUnitlessNumber).forEach(function (prop) {
|
|
76
|
-
prefixes.forEach(function (prefix) {
|
|
77
|
-
isUnitlessNumber[prefixKey(prefix, prop)] = isUnitlessNumber[prop];
|
|
78
|
-
});
|
|
79
|
-
});
|
|
80
|
-
|
|
81
|
-
/**
|
|
82
|
-
* Most style properties can be unset by doing .style[prop] = '' but IE8
|
|
83
|
-
* doesn't like doing that with shorthand properties so for the properties that
|
|
84
|
-
* IE8 breaks on, which are listed here, we instead unset each of the
|
|
85
|
-
* individual properties. See http://bugs.jquery.com/ticket/12385.
|
|
86
|
-
* The 4-value 'clock' properties like margin, padding, border-width seem to
|
|
87
|
-
* behave without any problems. Curiously, list-style works too without any
|
|
88
|
-
* special prodding.
|
|
89
|
-
*/
|
|
90
|
-
var shorthandPropertyExpansions = {
|
|
91
|
-
background: {
|
|
92
|
-
backgroundAttachment: true,
|
|
93
|
-
backgroundColor: true,
|
|
94
|
-
backgroundImage: true,
|
|
95
|
-
backgroundPositionX: true,
|
|
96
|
-
backgroundPositionY: true,
|
|
97
|
-
backgroundRepeat: true
|
|
98
|
-
},
|
|
99
|
-
backgroundPosition: {
|
|
100
|
-
backgroundPositionX: true,
|
|
101
|
-
backgroundPositionY: true
|
|
102
|
-
},
|
|
103
|
-
border: {
|
|
104
|
-
borderWidth: true,
|
|
105
|
-
borderStyle: true,
|
|
106
|
-
borderColor: true
|
|
107
|
-
},
|
|
108
|
-
borderBottom: {
|
|
109
|
-
borderBottomWidth: true,
|
|
110
|
-
borderBottomStyle: true,
|
|
111
|
-
borderBottomColor: true
|
|
112
|
-
},
|
|
113
|
-
borderLeft: {
|
|
114
|
-
borderLeftWidth: true,
|
|
115
|
-
borderLeftStyle: true,
|
|
116
|
-
borderLeftColor: true
|
|
117
|
-
},
|
|
118
|
-
borderRight: {
|
|
119
|
-
borderRightWidth: true,
|
|
120
|
-
borderRightStyle: true,
|
|
121
|
-
borderRightColor: true
|
|
122
|
-
},
|
|
123
|
-
borderTop: {
|
|
124
|
-
borderTopWidth: true,
|
|
125
|
-
borderTopStyle: true,
|
|
126
|
-
borderTopColor: true
|
|
127
|
-
},
|
|
128
|
-
font: {
|
|
129
|
-
fontStyle: true,
|
|
130
|
-
fontVariant: true,
|
|
131
|
-
fontWeight: true,
|
|
132
|
-
fontSize: true,
|
|
133
|
-
lineHeight: true,
|
|
134
|
-
fontFamily: true
|
|
135
|
-
},
|
|
136
|
-
outline: {
|
|
137
|
-
outlineWidth: true,
|
|
138
|
-
outlineStyle: true,
|
|
139
|
-
outlineColor: true
|
|
140
|
-
}
|
|
141
|
-
};
|
|
142
|
-
|
|
143
|
-
var CSSProperty = {
|
|
144
|
-
isUnitlessNumber: isUnitlessNumber,
|
|
145
|
-
shorthandPropertyExpansions: shorthandPropertyExpansions
|
|
146
|
-
};
|
|
147
|
-
|
|
148
|
-
module.exports = CSSProperty;
|
|
@@ -1,205 +0,0 @@
|
|
|
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 CSSPropertyOperations
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
'use strict';
|
|
13
|
-
|
|
14
|
-
var CSSProperty = require('./CSSProperty');
|
|
15
|
-
var ExecutionEnvironment = require('fbjs/lib/ExecutionEnvironment');
|
|
16
|
-
var ReactInstrumentation = require('./ReactInstrumentation');
|
|
17
|
-
|
|
18
|
-
var camelizeStyleName = require('fbjs/lib/camelizeStyleName');
|
|
19
|
-
var dangerousStyleValue = require('./dangerousStyleValue');
|
|
20
|
-
var hyphenateStyleName = require('fbjs/lib/hyphenateStyleName');
|
|
21
|
-
var memoizeStringOnly = require('fbjs/lib/memoizeStringOnly');
|
|
22
|
-
var warning = require('fbjs/lib/warning');
|
|
23
|
-
|
|
24
|
-
var processStyleName = memoizeStringOnly(function (styleName) {
|
|
25
|
-
return hyphenateStyleName(styleName);
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
var hasShorthandPropertyBug = false;
|
|
29
|
-
var styleFloatAccessor = 'cssFloat';
|
|
30
|
-
if (ExecutionEnvironment.canUseDOM) {
|
|
31
|
-
var tempStyle = document.createElement('div').style;
|
|
32
|
-
try {
|
|
33
|
-
// IE8 throws "Invalid argument." if resetting shorthand style properties.
|
|
34
|
-
tempStyle.font = '';
|
|
35
|
-
} catch (e) {
|
|
36
|
-
hasShorthandPropertyBug = true;
|
|
37
|
-
}
|
|
38
|
-
// IE8 only supports accessing cssFloat (standard) as styleFloat
|
|
39
|
-
if (document.documentElement.style.cssFloat === undefined) {
|
|
40
|
-
styleFloatAccessor = 'styleFloat';
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
45
|
-
// 'msTransform' is correct, but the other prefixes should be capitalized
|
|
46
|
-
var badVendoredStyleNamePattern = /^(?:webkit|moz|o)[A-Z]/;
|
|
47
|
-
|
|
48
|
-
// style values shouldn't contain a semicolon
|
|
49
|
-
var badStyleValueWithSemicolonPattern = /;\s*$/;
|
|
50
|
-
|
|
51
|
-
var warnedStyleNames = {};
|
|
52
|
-
var warnedStyleValues = {};
|
|
53
|
-
var warnedForNaNValue = false;
|
|
54
|
-
|
|
55
|
-
var warnHyphenatedStyleName = function (name, owner) {
|
|
56
|
-
if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) {
|
|
57
|
-
return;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
warnedStyleNames[name] = true;
|
|
61
|
-
process.env.NODE_ENV !== 'production' ? warning(false, 'Unsupported style property %s. Did you mean %s?%s', name, camelizeStyleName(name), checkRenderMessage(owner)) : void 0;
|
|
62
|
-
};
|
|
63
|
-
|
|
64
|
-
var warnBadVendoredStyleName = function (name, owner) {
|
|
65
|
-
if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) {
|
|
66
|
-
return;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
warnedStyleNames[name] = true;
|
|
70
|
-
process.env.NODE_ENV !== 'production' ? warning(false, 'Unsupported vendor-prefixed style property %s. Did you mean %s?%s', name, name.charAt(0).toUpperCase() + name.slice(1), checkRenderMessage(owner)) : void 0;
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
var warnStyleValueWithSemicolon = function (name, value, owner) {
|
|
74
|
-
if (warnedStyleValues.hasOwnProperty(value) && warnedStyleValues[value]) {
|
|
75
|
-
return;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
warnedStyleValues[value] = true;
|
|
79
|
-
process.env.NODE_ENV !== 'production' ? warning(false, 'Style property values shouldn\'t contain a semicolon.%s ' + 'Try "%s: %s" instead.', checkRenderMessage(owner), name, value.replace(badStyleValueWithSemicolonPattern, '')) : void 0;
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
var warnStyleValueIsNaN = function (name, value, owner) {
|
|
83
|
-
if (warnedForNaNValue) {
|
|
84
|
-
return;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
warnedForNaNValue = true;
|
|
88
|
-
process.env.NODE_ENV !== 'production' ? warning(false, '`NaN` is an invalid value for the `%s` css style property.%s', name, checkRenderMessage(owner)) : void 0;
|
|
89
|
-
};
|
|
90
|
-
|
|
91
|
-
var checkRenderMessage = function (owner) {
|
|
92
|
-
if (owner) {
|
|
93
|
-
var name = owner.getName();
|
|
94
|
-
if (name) {
|
|
95
|
-
return ' Check the render method of `' + name + '`.';
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
return '';
|
|
99
|
-
};
|
|
100
|
-
|
|
101
|
-
/**
|
|
102
|
-
* @param {string} name
|
|
103
|
-
* @param {*} value
|
|
104
|
-
* @param {ReactDOMComponent} component
|
|
105
|
-
*/
|
|
106
|
-
var warnValidStyle = function (name, value, component) {
|
|
107
|
-
var owner;
|
|
108
|
-
if (component) {
|
|
109
|
-
owner = component._currentElement._owner;
|
|
110
|
-
}
|
|
111
|
-
if (name.indexOf('-') > -1) {
|
|
112
|
-
warnHyphenatedStyleName(name, owner);
|
|
113
|
-
} else if (badVendoredStyleNamePattern.test(name)) {
|
|
114
|
-
warnBadVendoredStyleName(name, owner);
|
|
115
|
-
} else if (badStyleValueWithSemicolonPattern.test(value)) {
|
|
116
|
-
warnStyleValueWithSemicolon(name, value, owner);
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
if (typeof value === 'number' && isNaN(value)) {
|
|
120
|
-
warnStyleValueIsNaN(name, value, owner);
|
|
121
|
-
}
|
|
122
|
-
};
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
/**
|
|
126
|
-
* Operations for dealing with CSS properties.
|
|
127
|
-
*/
|
|
128
|
-
var CSSPropertyOperations = {
|
|
129
|
-
|
|
130
|
-
/**
|
|
131
|
-
* Serializes a mapping of style properties for use as inline styles:
|
|
132
|
-
*
|
|
133
|
-
* > createMarkupForStyles({width: '200px', height: 0})
|
|
134
|
-
* "width:200px;height:0;"
|
|
135
|
-
*
|
|
136
|
-
* Undefined values are ignored so that declarative programming is easier.
|
|
137
|
-
* The result should be HTML-escaped before insertion into the DOM.
|
|
138
|
-
*
|
|
139
|
-
* @param {object} styles
|
|
140
|
-
* @param {ReactDOMComponent} component
|
|
141
|
-
* @return {?string}
|
|
142
|
-
*/
|
|
143
|
-
createMarkupForStyles: function (styles, component) {
|
|
144
|
-
var serialized = '';
|
|
145
|
-
for (var styleName in styles) {
|
|
146
|
-
if (!styles.hasOwnProperty(styleName)) {
|
|
147
|
-
continue;
|
|
148
|
-
}
|
|
149
|
-
var styleValue = styles[styleName];
|
|
150
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
151
|
-
warnValidStyle(styleName, styleValue, component);
|
|
152
|
-
}
|
|
153
|
-
if (styleValue != null) {
|
|
154
|
-
serialized += processStyleName(styleName) + ':';
|
|
155
|
-
serialized += dangerousStyleValue(styleName, styleValue, component) + ';';
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
return serialized || null;
|
|
159
|
-
},
|
|
160
|
-
|
|
161
|
-
/**
|
|
162
|
-
* Sets the value for multiple styles on a node. If a value is specified as
|
|
163
|
-
* '' (empty string), the corresponding style property will be unset.
|
|
164
|
-
*
|
|
165
|
-
* @param {DOMElement} node
|
|
166
|
-
* @param {object} styles
|
|
167
|
-
* @param {ReactDOMComponent} component
|
|
168
|
-
*/
|
|
169
|
-
setValueForStyles: function (node, styles, component) {
|
|
170
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
171
|
-
ReactInstrumentation.debugTool.onHostOperation(component._debugID, 'update styles', styles);
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
var style = node.style;
|
|
175
|
-
for (var styleName in styles) {
|
|
176
|
-
if (!styles.hasOwnProperty(styleName)) {
|
|
177
|
-
continue;
|
|
178
|
-
}
|
|
179
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
180
|
-
warnValidStyle(styleName, styles[styleName], component);
|
|
181
|
-
}
|
|
182
|
-
var styleValue = dangerousStyleValue(styleName, styles[styleName], component);
|
|
183
|
-
if (styleName === 'float' || styleName === 'cssFloat') {
|
|
184
|
-
styleName = styleFloatAccessor;
|
|
185
|
-
}
|
|
186
|
-
if (styleValue) {
|
|
187
|
-
style[styleName] = styleValue;
|
|
188
|
-
} else {
|
|
189
|
-
var expansion = hasShorthandPropertyBug && CSSProperty.shorthandPropertyExpansions[styleName];
|
|
190
|
-
if (expansion) {
|
|
191
|
-
// Shorthand property that IE8 won't like unsetting, so unset each
|
|
192
|
-
// component to placate it
|
|
193
|
-
for (var individualStyleName in expansion) {
|
|
194
|
-
style[individualStyleName] = '';
|
|
195
|
-
}
|
|
196
|
-
} else {
|
|
197
|
-
style[styleName] = '';
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
};
|
|
204
|
-
|
|
205
|
-
module.exports = CSSPropertyOperations;
|
package/lib/CallbackQueue.js
DELETED
|
@@ -1,106 +0,0 @@
|
|
|
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 CallbackQueue
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
'use strict';
|
|
13
|
-
|
|
14
|
-
var _prodInvariant = require('./reactProdInvariant'),
|
|
15
|
-
_assign = require('object-assign');
|
|
16
|
-
|
|
17
|
-
var PooledClass = require('./PooledClass');
|
|
18
|
-
|
|
19
|
-
var invariant = require('fbjs/lib/invariant');
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* A specialized pseudo-event module to help keep track of components waiting to
|
|
23
|
-
* be notified when their DOM representations are available for use.
|
|
24
|
-
*
|
|
25
|
-
* This implements `PooledClass`, so you should never need to instantiate this.
|
|
26
|
-
* Instead, use `CallbackQueue.getPooled()`.
|
|
27
|
-
*
|
|
28
|
-
* @class ReactMountReady
|
|
29
|
-
* @implements PooledClass
|
|
30
|
-
* @internal
|
|
31
|
-
*/
|
|
32
|
-
function CallbackQueue() {
|
|
33
|
-
this._callbacks = null;
|
|
34
|
-
this._contexts = null;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
_assign(CallbackQueue.prototype, {
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* Enqueues a callback to be invoked when `notifyAll` is invoked.
|
|
41
|
-
*
|
|
42
|
-
* @param {function} callback Invoked when `notifyAll` is invoked.
|
|
43
|
-
* @param {?object} context Context to call `callback` with.
|
|
44
|
-
* @internal
|
|
45
|
-
*/
|
|
46
|
-
enqueue: function (callback, context) {
|
|
47
|
-
this._callbacks = this._callbacks || [];
|
|
48
|
-
this._contexts = this._contexts || [];
|
|
49
|
-
this._callbacks.push(callback);
|
|
50
|
-
this._contexts.push(context);
|
|
51
|
-
},
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* Invokes all enqueued callbacks and clears the queue. This is invoked after
|
|
55
|
-
* the DOM representation of a component has been created or updated.
|
|
56
|
-
*
|
|
57
|
-
* @internal
|
|
58
|
-
*/
|
|
59
|
-
notifyAll: function () {
|
|
60
|
-
var callbacks = this._callbacks;
|
|
61
|
-
var contexts = this._contexts;
|
|
62
|
-
if (callbacks) {
|
|
63
|
-
!(callbacks.length === contexts.length) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Mismatched list of contexts in callback queue') : _prodInvariant('24') : void 0;
|
|
64
|
-
this._callbacks = null;
|
|
65
|
-
this._contexts = null;
|
|
66
|
-
for (var i = 0; i < callbacks.length; i++) {
|
|
67
|
-
callbacks[i].call(contexts[i]);
|
|
68
|
-
}
|
|
69
|
-
callbacks.length = 0;
|
|
70
|
-
contexts.length = 0;
|
|
71
|
-
}
|
|
72
|
-
},
|
|
73
|
-
|
|
74
|
-
checkpoint: function () {
|
|
75
|
-
return this._callbacks ? this._callbacks.length : 0;
|
|
76
|
-
},
|
|
77
|
-
|
|
78
|
-
rollback: function (len) {
|
|
79
|
-
if (this._callbacks) {
|
|
80
|
-
this._callbacks.length = len;
|
|
81
|
-
this._contexts.length = len;
|
|
82
|
-
}
|
|
83
|
-
},
|
|
84
|
-
|
|
85
|
-
/**
|
|
86
|
-
* Resets the internal queue.
|
|
87
|
-
*
|
|
88
|
-
* @internal
|
|
89
|
-
*/
|
|
90
|
-
reset: function () {
|
|
91
|
-
this._callbacks = null;
|
|
92
|
-
this._contexts = null;
|
|
93
|
-
},
|
|
94
|
-
|
|
95
|
-
/**
|
|
96
|
-
* `PooledClass` looks for this.
|
|
97
|
-
*/
|
|
98
|
-
destructor: function () {
|
|
99
|
-
this.reset();
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
});
|
|
103
|
-
|
|
104
|
-
PooledClass.addPoolingTo(CallbackQueue);
|
|
105
|
-
|
|
106
|
-
module.exports = CallbackQueue;
|