Created
March 18, 2014 18:11
-
-
Save zpao/9625952 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- build/react-with-addons.js 2014-03-18 11:00:26.000000000 -0700 | |
+++ build/react-with-addons.old.js 2014-03-18 11:00:08.000000000 -0700 | |
@@ -58,45 +58,45 @@ | |
}; | |
if ('production' !== 'development') { | |
React.addons.TestUtils = _require(8); | |
} | |
module.exports = React; | |
}, | |
function (module, exports) { | |
'use strict'; | |
- var ReactLink = _require(9); | |
- var ReactStateSetters = _require(10); | |
+ var ReactLink = _require(10); | |
+ var ReactStateSetters = _require(11); | |
var LinkedStateMixin = { | |
linkState: function (key) { | |
return new ReactLink(this.state[key], ReactStateSetters.createStateKeySetter(this, key)); | |
} | |
}; | |
module.exports = LinkedStateMixin; | |
}, | |
function (module, exports) { | |
'use strict'; | |
- var DOMPropertyOperations = _require(11); | |
- var EventPluginUtils = _require(12); | |
- var ReactChildren = _require(13); | |
- var ReactComponent = _require(14); | |
- var ReactCompositeComponent = _require(15); | |
- var ReactContext = _require(16); | |
- var ReactCurrentOwner = _require(17); | |
- var ReactDOM = _require(18); | |
- var ReactDOMComponent = _require(19); | |
- var ReactDefaultInjection = _require(20); | |
- var ReactInstanceHandles = _require(21); | |
- var ReactMount = _require(22); | |
- var ReactMultiChild = _require(23); | |
- var ReactPerf = _require(24); | |
- var ReactPropTypes = _require(25); | |
- var ReactServerRendering = _require(26); | |
- var ReactTextComponent = _require(27); | |
- var onlyChild = _require(28); | |
+ var DOMPropertyOperations = _require(12); | |
+ var EventPluginUtils = _require(13); | |
+ var ReactChildren = _require(14); | |
+ var ReactComponent = _require(15); | |
+ var ReactCompositeComponent = _require(16); | |
+ var ReactContext = _require(17); | |
+ var ReactCurrentOwner = _require(18); | |
+ var ReactDOM = _require(19); | |
+ var ReactDOMComponent = _require(20); | |
+ var ReactDefaultInjection = _require(21); | |
+ var ReactInstanceHandles = _require(22); | |
+ var ReactMount = _require(23); | |
+ var ReactMultiChild = _require(24); | |
+ var ReactPerf = _require(25); | |
+ var ReactPropTypes = _require(26); | |
+ var ReactServerRendering = _require(27); | |
+ var ReactTextComponent = _require(28); | |
+ var onlyChild = _require(29); | |
ReactDefaultInjection.inject(); | |
var React = { | |
Children: { | |
map: ReactChildren.map, | |
forEach: ReactChildren.forEach, | |
only: onlyChild | |
}, | |
DOM: ReactDOM, | |
@@ -121,29 +121,29 @@ | |
DOMPropertyOperations: DOMPropertyOperations, | |
InstanceHandles: ReactInstanceHandles, | |
Mount: ReactMount, | |
MultiChild: ReactMultiChild, | |
TextComponent: ReactTextComponent | |
} | |
}; | |
if ('production' !== 'development') { | |
- var ExecutionEnvironment = _require(29); | |
+ var ExecutionEnvironment = _require(30); | |
if (ExecutionEnvironment.canUseDOM && window.top === window.self && navigator.userAgent.indexOf('Chrome') > -1) { | |
console.debug('Download the React DevTools for a better development experience: ' + 'http://fb.me/react-devtools'); | |
} | |
} | |
React.version = '0.10.0-alpha'; | |
module.exports = React; | |
}, | |
function (module, exports) { | |
'use strict'; | |
var React = _require(2); | |
var ReactTransitionGroup = _require(4); | |
- var ReactCSSTransitionGroupChild = _require(30); | |
+ var ReactCSSTransitionGroupChild = _require(9); | |
var ReactCSSTransitionGroup = React.createClass({ | |
propTypes: { | |
transitionName: React.PropTypes.string.isRequired, | |
transitionEnter: React.PropTypes.bool, | |
transitionLeave: React.PropTypes.bool | |
}, | |
getDefaultProps: function () { | |
return { | |
@@ -298,19 +298,19 @@ | |
newProps.children = child.props.children; | |
} | |
return child.constructor.ConvenienceConstructor(newProps); | |
} | |
module.exports = cloneWithProps; | |
}, | |
function (module, exports) { | |
'use strict'; | |
- var copyProperties = _require(37); | |
+ var copyProperties = _require(44); | |
var keyOf = _require(35); | |
- var invariant = _require(38); | |
+ var invariant = _require(45); | |
function shallowCopy(x) { | |
if (Array.isArray(x)) { | |
return x.concat(); | |
} else if (x && typeof x === 'object') { | |
return copyProperties(new x.constructor(), x); | |
} else { | |
return x; | |
} | |
@@ -375,29 +375,29 @@ | |
} | |
} | |
return nextValue; | |
} | |
module.exports = update; | |
}, | |
function (module, exports) { | |
'use strict'; | |
- var EventConstants = _require(39); | |
- var EventPluginHub = _require(40); | |
- var EventPropagators = _require(41); | |
+ var EventConstants = _require(37); | |
+ var EventPluginHub = _require(38); | |
+ var EventPropagators = _require(39); | |
var React = _require(2); | |
- var ReactComponent = _require(14); | |
- var ReactDOM = _require(18); | |
- var ReactEventEmitter = _require(42); | |
- var ReactMount = _require(22); | |
- var ReactTextComponent = _require(27); | |
- var ReactUpdates = _require(43); | |
- var SyntheticEvent = _require(44); | |
- var mergeInto = _require(45); | |
- var copyProperties = _require(37); | |
+ var ReactComponent = _require(15); | |
+ var ReactDOM = _require(19); | |
+ var ReactEventEmitter = _require(40); | |
+ var ReactMount = _require(23); | |
+ var ReactTextComponent = _require(28); | |
+ var ReactUpdates = _require(41); | |
+ var SyntheticEvent = _require(42); | |
+ var mergeInto = _require(43); | |
+ var copyProperties = _require(44); | |
var topLevelTypes = EventConstants.topLevelTypes; | |
function Event(suffix) { | |
} | |
var ReactTestUtils = { | |
renderIntoDocument: function (instance) { | |
var div = document.createElement('div'); | |
return React.renderComponent(instance, div); | |
}, | |
@@ -558,16 +558,97 @@ | |
for (eventType in topLevelTypes) { | |
var convenienceName = eventType.indexOf('top') === 0 ? eventType.charAt(3).toLowerCase() + eventType.substr(4) : eventType; | |
ReactTestUtils.SimulateNative[convenienceName] = makeNativeSimulator(eventType); | |
} | |
module.exports = ReactTestUtils; | |
}, | |
function (module, exports) { | |
'use strict'; | |
+ var React = _require(2); | |
+ var CSSCore = _require(61); | |
+ var ReactTransitionEvents = _require(62); | |
+ var onlyChild = _require(29); | |
+ var TICK = 17; | |
+ var NO_EVENT_TIMEOUT = 5000; | |
+ var noEventListener = null; | |
+ if ('production' !== 'development') { | |
+ noEventListener = function () { | |
+ console.warn('transition(): tried to perform an animation without ' + 'an animationend or transitionend event after timeout (' + NO_EVENT_TIMEOUT + 'ms). You should either disable this ' + 'transition in JS or add a CSS animation/transition.'); | |
+ }; | |
+ } | |
+ var ReactCSSTransitionGroupChild = React.createClass({ | |
+ transition: function (animationType, finishCallback) { | |
+ var node = this.getDOMNode(); | |
+ var className = this.props.name + '-' + animationType; | |
+ var activeClassName = className + '-active'; | |
+ var noEventTimeout = null; | |
+ var endListener = function () { | |
+ if ('production' !== 'development') { | |
+ clearTimeout(noEventTimeout); | |
+ } | |
+ CSSCore.removeClass(node, className); | |
+ CSSCore.removeClass(node, activeClassName); | |
+ ReactTransitionEvents.removeEndEventListener(node, endListener); | |
+ finishCallback && finishCallback(); | |
+ }; | |
+ ReactTransitionEvents.addEndEventListener(node, endListener); | |
+ CSSCore.addClass(node, className); | |
+ this.queueClass(activeClassName); | |
+ if ('production' !== 'development') { | |
+ noEventTimeout = setTimeout(noEventListener, NO_EVENT_TIMEOUT); | |
+ } | |
+ }, | |
+ queueClass: function (className) { | |
+ this.classNameQueue.push(className); | |
+ if (this.props.runNextTick) { | |
+ this.props.runNextTick(this.flushClassNameQueue); | |
+ return; | |
+ } | |
+ if (!this.timeout) { | |
+ this.timeout = setTimeout(this.flushClassNameQueue, TICK); | |
+ } | |
+ }, | |
+ flushClassNameQueue: function () { | |
+ if (this.isMounted()) { | |
+ this.classNameQueue.forEach(CSSCore.addClass.bind(CSSCore, this.getDOMNode())); | |
+ } | |
+ this.classNameQueue.length = 0; | |
+ this.timeout = null; | |
+ }, | |
+ componentWillMount: function () { | |
+ this.classNameQueue = []; | |
+ }, | |
+ componentWillUnmount: function () { | |
+ if (this.timeout) { | |
+ clearTimeout(this.timeout); | |
+ } | |
+ }, | |
+ componentWillEnter: function (done) { | |
+ if (this.props.enter) { | |
+ this.transition('enter', done); | |
+ } else { | |
+ done(); | |
+ } | |
+ }, | |
+ componentWillLeave: function (done) { | |
+ if (this.props.leave) { | |
+ this.transition('leave', done); | |
+ } else { | |
+ done(); | |
+ } | |
+ }, | |
+ render: function () { | |
+ return onlyChild(this.props.children); | |
+ } | |
+ }); | |
+ module.exports = ReactCSSTransitionGroupChild; | |
+ }, | |
+ function (module, exports) { | |
+ 'use strict'; | |
function ReactLink(value, requestChange) { | |
this.value = value; | |
this.requestChange = requestChange; | |
} | |
module.exports = ReactLink; | |
}, | |
function (module, exports) { | |
'use strict'; | |
@@ -701,18 +782,18 @@ | |
warnUnknownProperty(name); | |
} | |
} | |
}; | |
module.exports = DOMPropertyOperations; | |
}, | |
function (module, exports) { | |
'use strict'; | |
- var EventConstants = _require(39); | |
- var invariant = _require(38); | |
+ var EventConstants = _require(37); | |
+ var invariant = _require(45); | |
var injection = { | |
Mount: null, | |
injectMount: function (InjectedMount) { | |
injection.Mount = InjectedMount; | |
if ('production' !== 'development') { | |
'production' !== 'development' ? invariant(InjectedMount && InjectedMount.getNode, 'EventPluginUtils.injection.injectMount(...): Injected Mount module ' + 'is missing getNode.') : invariant(InjectedMount && InjectedMount.getNode); | |
} | |
} | |
@@ -816,17 +897,17 @@ | |
injection: injection, | |
useTouchEvents: false | |
}; | |
module.exports = EventPluginUtils; | |
}, | |
function (module, exports) { | |
'use strict'; | |
var PooledClass = _require(49); | |
- var invariant = _require(38); | |
+ var invariant = _require(45); | |
var traverseAllChildren = _require(50); | |
var twoArgumentPooler = PooledClass.twoArgumentPooler; | |
var threeArgumentPooler = PooledClass.threeArgumentPooler; | |
function ForEachBookKeeping(forEachFunction, forEachContext) { | |
this.forEachFunction = forEachFunction; | |
this.forEachContext = forEachContext; | |
} | |
PooledClass.addPoolingTo(ForEachBookKeeping, twoArgumentPooler); | |
@@ -868,20 +949,20 @@ | |
var ReactChildren = { | |
forEach: forEachChildren, | |
map: mapChildren | |
}; | |
module.exports = ReactChildren; | |
}, | |
function (module, exports) { | |
'use strict'; | |
- var ReactCurrentOwner = _require(17); | |
+ var ReactCurrentOwner = _require(18); | |
var ReactOwner = _require(51); | |
- var ReactUpdates = _require(43); | |
- var invariant = _require(38); | |
+ var ReactUpdates = _require(41); | |
+ var invariant = _require(45); | |
var keyMirror = _require(52); | |
var merge = _require(33); | |
var monitorCodeUse = _require(53); | |
var ComponentLifeCycle = keyMirror({ | |
MOUNTED: null, | |
UNMOUNTED: null | |
}); | |
var ownerHasExplicitKeyWarning = {}; | |
@@ -1074,28 +1155,28 @@ | |
return owner.refs[ref]; | |
} | |
} | |
}; | |
module.exports = ReactComponent; | |
}, | |
function (module, exports) { | |
'use strict'; | |
- var ReactComponent = _require(14); | |
- var ReactContext = _require(16); | |
- var ReactCurrentOwner = _require(17); | |
+ var ReactComponent = _require(15); | |
+ var ReactContext = _require(17); | |
+ var ReactCurrentOwner = _require(18); | |
var ReactErrorUtils = _require(54); | |
var ReactOwner = _require(51); | |
- var ReactPerf = _require(24); | |
+ var ReactPerf = _require(25); | |
var ReactPropTransferer = _require(34); | |
var ReactPropTypeLocations = _require(55); | |
var ReactPropTypeLocationNames = _require(56); | |
- var ReactUpdates = _require(43); | |
+ var ReactUpdates = _require(41); | |
var instantiateReactComponent = _require(57); | |
- var invariant = _require(38); | |
+ var invariant = _require(45); | |
var keyMirror = _require(52); | |
var merge = _require(33); | |
var mixInto = _require(58); | |
var monitorCodeUse = _require(53); | |
var objMap = _require(59); | |
var shouldUpdateReactComponent = _require(60); | |
var warning = _require(36); | |
var SpecPolicy = keyMirror({ | |
@@ -1737,19 +1818,19 @@ | |
}, | |
function (module, exports) { | |
'use strict'; | |
var ReactCurrentOwner = { current: null }; | |
module.exports = ReactCurrentOwner; | |
}, | |
function (module, exports) { | |
'use strict'; | |
- var ReactDOMComponent = _require(19); | |
- var mergeInto = _require(45); | |
- var objMapKeyVal = _require(61); | |
+ var ReactDOMComponent = _require(20); | |
+ var mergeInto = _require(43); | |
+ var objMapKeyVal = _require(63); | |
function createDOMComponentClass(tag, omitClose) { | |
var Constructor = function () { | |
}; | |
Constructor.prototype = new ReactDOMComponent(tag, omitClose); | |
Constructor.prototype.constructor = Constructor; | |
Constructor.displayName = tag; | |
var ConvenienceConstructor = function (props, children) { | |
var instance = new Constructor(); | |
@@ -1892,27 +1973,27 @@ | |
mergeInto(ReactDOM, componentClasses); | |
} | |
}; | |
ReactDOM.injection = injection; | |
module.exports = ReactDOM; | |
}, | |
function (module, exports) { | |
'use strict'; | |
- var CSSPropertyOperations = _require(62); | |
+ var CSSPropertyOperations = _require(68); | |
var DOMProperty = _require(46); | |
- var DOMPropertyOperations = _require(11); | |
- var ReactBrowserComponentMixin = _require(63); | |
- var ReactComponent = _require(14); | |
- var ReactEventEmitter = _require(42); | |
- var ReactMount = _require(22); | |
- var ReactMultiChild = _require(23); | |
- var ReactPerf = _require(24); | |
+ var DOMPropertyOperations = _require(12); | |
+ var ReactBrowserComponentMixin = _require(69); | |
+ var ReactComponent = _require(15); | |
+ var ReactEventEmitter = _require(40); | |
+ var ReactMount = _require(23); | |
+ var ReactMultiChild = _require(24); | |
+ var ReactPerf = _require(25); | |
var escapeTextForBrowser = _require(47); | |
- var invariant = _require(38); | |
+ var invariant = _require(45); | |
var keyOf = _require(35); | |
var merge = _require(33); | |
var mixInto = _require(58); | |
var deleteListener = ReactEventEmitter.deleteListener; | |
var listenTo = ReactEventEmitter.listenTo; | |
var registrationNameModules = ReactEventEmitter.registrationNameModules; | |
var CONTENT_TYPES = { | |
'string': true, | |
@@ -2103,43 +2184,43 @@ | |
mixInto(ReactDOMComponent, ReactComponent.Mixin); | |
mixInto(ReactDOMComponent, ReactDOMComponent.Mixin); | |
mixInto(ReactDOMComponent, ReactMultiChild.Mixin); | |
mixInto(ReactDOMComponent, ReactBrowserComponentMixin); | |
module.exports = ReactDOMComponent; | |
}, | |
function (module, exports) { | |
'use strict'; | |
- var ReactInjection = _require(64); | |
- var ExecutionEnvironment = _require(29); | |
- var DefaultDOMPropertyConfig = _require(65); | |
- var ChangeEventPlugin = _require(66); | |
- var ClientReactRootIndex = _require(67); | |
- var CompositionEventPlugin = _require(68); | |
- var DefaultEventPluginOrder = _require(69); | |
- var EnterLeaveEventPlugin = _require(70); | |
- var MobileSafariClickEventPlugin = _require(71); | |
- var ReactBrowserComponentMixin = _require(63); | |
- var ReactComponentBrowserEnvironment = _require(72); | |
- var ReactEventTopLevelCallback = _require(73); | |
- var ReactDOM = _require(18); | |
- var ReactDOMButton = _require(74); | |
- var ReactDOMForm = _require(75); | |
- var ReactDOMImg = _require(76); | |
- var ReactDOMInput = _require(77); | |
- var ReactDOMOption = _require(78); | |
- var ReactDOMSelect = _require(79); | |
- var ReactDOMTextarea = _require(80); | |
- var ReactInstanceHandles = _require(21); | |
- var ReactMount = _require(22); | |
- var SelectEventPlugin = _require(81); | |
- var ServerReactRootIndex = _require(82); | |
- var SimpleEventPlugin = _require(83); | |
- var ReactDefaultBatchingStrategy = _require(84); | |
- var createFullPageComponent = _require(85); | |
+ var ReactInjection = _require(74); | |
+ var ExecutionEnvironment = _require(30); | |
+ var DefaultDOMPropertyConfig = _require(75); | |
+ var ChangeEventPlugin = _require(76); | |
+ var ClientReactRootIndex = _require(77); | |
+ var CompositionEventPlugin = _require(78); | |
+ var DefaultEventPluginOrder = _require(79); | |
+ var EnterLeaveEventPlugin = _require(80); | |
+ var MobileSafariClickEventPlugin = _require(81); | |
+ var ReactBrowserComponentMixin = _require(69); | |
+ var ReactComponentBrowserEnvironment = _require(82); | |
+ var ReactEventTopLevelCallback = _require(83); | |
+ var ReactDOM = _require(19); | |
+ var ReactDOMButton = _require(84); | |
+ var ReactDOMForm = _require(85); | |
+ var ReactDOMImg = _require(86); | |
+ var ReactDOMInput = _require(87); | |
+ var ReactDOMOption = _require(88); | |
+ var ReactDOMSelect = _require(89); | |
+ var ReactDOMTextarea = _require(90); | |
+ var ReactInstanceHandles = _require(22); | |
+ var ReactMount = _require(23); | |
+ var SelectEventPlugin = _require(91); | |
+ var ServerReactRootIndex = _require(92); | |
+ var SimpleEventPlugin = _require(93); | |
+ var ReactDefaultBatchingStrategy = _require(94); | |
+ var createFullPageComponent = _require(95); | |
function inject() { | |
ReactInjection.EventEmitter.injectTopLevelCallbackCreator(ReactEventTopLevelCallback); | |
ReactInjection.EventPluginHub.injectEventPluginOrder(DefaultEventPluginOrder); | |
ReactInjection.EventPluginHub.injectInstanceHandle(ReactInstanceHandles); | |
ReactInjection.EventPluginHub.injectMount(ReactMount); | |
ReactInjection.EventPluginHub.injectEventPluginsByName({ | |
SimpleEventPlugin: SimpleEventPlugin, | |
EnterLeaveEventPlugin: EnterLeaveEventPlugin, | |
@@ -2164,27 +2245,27 @@ | |
ReactInjection.CompositeComponent.injectMixin(ReactBrowserComponentMixin); | |
ReactInjection.DOMProperty.injectDOMPropertyConfig(DefaultDOMPropertyConfig); | |
ReactInjection.Updates.injectBatchingStrategy(ReactDefaultBatchingStrategy); | |
ReactInjection.RootIndex.injectCreateReactRootIndex(ExecutionEnvironment.canUseDOM ? ClientReactRootIndex.createReactRootIndex : ServerReactRootIndex.createReactRootIndex); | |
ReactInjection.Component.injectEnvironment(ReactComponentBrowserEnvironment); | |
if ('production' !== 'development') { | |
var url = ExecutionEnvironment.canUseDOM && window.location.href || ''; | |
if (/[?&]react_perf\b/.test(url)) { | |
- var ReactDefaultPerf = _require(86); | |
+ var ReactDefaultPerf = _require(96); | |
ReactDefaultPerf.start(); | |
} | |
} | |
} | |
module.exports = { inject: inject }; | |
}, | |
function (module, exports) { | |
'use strict'; | |
- var ReactRootIndex = _require(87); | |
- var invariant = _require(38); | |
+ var ReactRootIndex = _require(64); | |
+ var invariant = _require(45); | |
var SEPARATOR = '.'; | |
var SEPARATOR_LENGTH = SEPARATOR.length; | |
var MAX_TREE_DEPTH = 100; | |
function getReactRootIDString(index) { | |
return SEPARATOR + index.toString(36); | |
} | |
function isBoundary(id, index) { | |
return id.charAt(index) === SEPARATOR || index === id.length; | |
@@ -2285,23 +2366,23 @@ | |
isAncestorIDOf: isAncestorIDOf, | |
SEPARATOR: SEPARATOR | |
}; | |
module.exports = ReactInstanceHandles; | |
}, | |
function (module, exports) { | |
'use strict'; | |
var DOMProperty = _require(46); | |
- var ReactEventEmitter = _require(42); | |
- var ReactInstanceHandles = _require(21); | |
- var ReactPerf = _require(24); | |
- var containsNode = _require(88); | |
- var getReactRootElementInContainer = _require(89); | |
+ var ReactEventEmitter = _require(40); | |
+ var ReactInstanceHandles = _require(22); | |
+ var ReactPerf = _require(25); | |
+ var containsNode = _require(70); | |
+ var getReactRootElementInContainer = _require(71); | |
var instantiateReactComponent = _require(57); | |
- var invariant = _require(38); | |
+ var invariant = _require(45); | |
var shouldUpdateReactComponent = _require(60); | |
var SEPARATOR = ReactInstanceHandles.SEPARATOR; | |
var ATTR_NAME = DOMProperty.ID_ATTRIBUTE_NAME; | |
var nodeCache = {}; | |
var ELEMENT_NODE_TYPE = 1; | |
var DOC_NODE_TYPE = 9; | |
var instancesByReactRootID = {}; | |
var containersByReactRootID = {}; | |
@@ -2539,19 +2620,19 @@ | |
setID: setID, | |
getNode: getNode, | |
purgeID: purgeID | |
}; | |
module.exports = ReactMount; | |
}, | |
function (module, exports) { | |
'use strict'; | |
- var ReactComponent = _require(14); | |
- var ReactMultiChildUpdateTypes = _require(90); | |
- var flattenChildren = _require(91); | |
+ var ReactComponent = _require(15); | |
+ var ReactMultiChildUpdateTypes = _require(65); | |
+ var flattenChildren = _require(66); | |
var instantiateReactComponent = _require(57); | |
var shouldUpdateReactComponent = _require(60); | |
var updateDepth = 0; | |
var updateQueue = []; | |
var markupQueue = []; | |
function enqueueMarkup(parentID, markup, toIndex) { | |
updateQueue.push({ | |
parentID: parentID, | |
@@ -2767,20 +2848,20 @@ | |
}; | |
function _noMeasure(objName, fnName, func) { | |
return func; | |
} | |
module.exports = ReactPerf; | |
}, | |
function (module, exports) { | |
'use strict'; | |
- var ReactComponent = _require(14); | |
+ var ReactComponent = _require(15); | |
var ReactPropTypeLocationNames = _require(56); | |
var warning = _require(36); | |
- var createObjectFrom = _require(92); | |
+ var createObjectFrom = _require(67); | |
var Props = { | |
array: createPrimitiveTypeChecker('array'), | |
bool: createPrimitiveTypeChecker('boolean'), | |
func: createPrimitiveTypeChecker('function'), | |
number: createPrimitiveTypeChecker('number'), | |
object: createPrimitiveTypeChecker('object'), | |
string: createPrimitiveTypeChecker('string'), | |
shape: createShapeTypeChecker, | |
@@ -2952,22 +3033,22 @@ | |
checker.weak.isRequired = checkType.bind(null, true, false); | |
checker.isRequired.weak = checker.weak.isRequired; | |
return checker; | |
} | |
module.exports = Props; | |
}, | |
function (module, exports) { | |
'use strict'; | |
- var ReactComponent = _require(14); | |
- var ReactInstanceHandles = _require(21); | |
- var ReactMarkupChecksum = _require(93); | |
- var ReactServerRenderingTransaction = _require(94); | |
+ var ReactComponent = _require(15); | |
+ var ReactInstanceHandles = _require(22); | |
+ var ReactMarkupChecksum = _require(72); | |
+ var ReactServerRenderingTransaction = _require(73); | |
var instantiateReactComponent = _require(57); | |
- var invariant = _require(38); | |
+ var invariant = _require(45); | |
function renderComponentToString(component) { | |
'production' !== 'development' ? invariant(ReactComponent.isValidComponent(component), 'renderComponentToString(): You must pass a valid ReactComponent.') : invariant(ReactComponent.isValidComponent(component)); | |
'production' !== 'development' ? invariant(!(arguments.length === 2 && typeof arguments[1] === 'function'), 'renderComponentToString(): This function became synchronous and now ' + 'returns the generated markup. Please remove the second parameter.') : invariant(!(arguments.length === 2 && typeof arguments[1] === 'function')); | |
var transaction; | |
try { | |
var id = ReactInstanceHandles.createReactRootID(); | |
transaction = ReactServerRenderingTransaction.getPooled(false); | |
return transaction.perform(function () { | |
@@ -2995,19 +3076,19 @@ | |
} | |
module.exports = { | |
renderComponentToString: renderComponentToString, | |
renderComponentToStaticMarkup: renderComponentToStaticMarkup | |
}; | |
}, | |
function (module, exports) { | |
'use strict'; | |
- var DOMPropertyOperations = _require(11); | |
- var ReactBrowserComponentMixin = _require(63); | |
- var ReactComponent = _require(14); | |
+ var DOMPropertyOperations = _require(12); | |
+ var ReactBrowserComponentMixin = _require(69); | |
+ var ReactComponent = _require(15); | |
var escapeTextForBrowser = _require(47); | |
var mixInto = _require(58); | |
var ReactTextComponent = function (initialText) { | |
this.construct({ text: initialText }); | |
}; | |
ReactTextComponent.ConvenienceConstructor = function (props) { | |
return new ReactTextComponent(props.text); | |
}; | |
@@ -3031,18 +3112,18 @@ | |
} | |
}); | |
ReactTextComponent.type = ReactTextComponent; | |
ReactTextComponent.prototype.type = ReactTextComponent; | |
module.exports = ReactTextComponent; | |
}, | |
function (module, exports) { | |
'use strict'; | |
- var ReactComponent = _require(14); | |
- var invariant = _require(38); | |
+ var ReactComponent = _require(15); | |
+ var invariant = _require(45); | |
function onlyChild(children) { | |
'production' !== 'development' ? invariant(ReactComponent.isValidComponent(children), 'onlyChild must be passed a children with exactly one child.') : invariant(ReactComponent.isValidComponent(children)); | |
return children; | |
} | |
module.exports = onlyChild; | |
}, | |
function (module, exports) { | |
'use strict'; | |
@@ -3052,98 +3133,17 @@ | |
canUseWorkers: typeof Worker !== 'undefined', | |
canUseEventListeners: canUseDOM && (window.addEventListener || window.attachEvent), | |
isInWorker: !canUseDOM | |
}; | |
module.exports = ExecutionEnvironment; | |
}, | |
function (module, exports) { | |
'use strict'; | |
- var React = _require(2); | |
- var CSSCore = _require(95); | |
- var ReactTransitionEvents = _require(96); | |
- var onlyChild = _require(28); | |
- var TICK = 17; | |
- var NO_EVENT_TIMEOUT = 5000; | |
- var noEventListener = null; | |
- if ('production' !== 'development') { | |
- noEventListener = function () { | |
- console.warn('transition(): tried to perform an animation without ' + 'an animationend or transitionend event after timeout (' + NO_EVENT_TIMEOUT + 'ms). You should either disable this ' + 'transition in JS or add a CSS animation/transition.'); | |
- }; | |
- } | |
- var ReactCSSTransitionGroupChild = React.createClass({ | |
- transition: function (animationType, finishCallback) { | |
- var node = this.getDOMNode(); | |
- var className = this.props.name + '-' + animationType; | |
- var activeClassName = className + '-active'; | |
- var noEventTimeout = null; | |
- var endListener = function () { | |
- if ('production' !== 'development') { | |
- clearTimeout(noEventTimeout); | |
- } | |
- CSSCore.removeClass(node, className); | |
- CSSCore.removeClass(node, activeClassName); | |
- ReactTransitionEvents.removeEndEventListener(node, endListener); | |
- finishCallback && finishCallback(); | |
- }; | |
- ReactTransitionEvents.addEndEventListener(node, endListener); | |
- CSSCore.addClass(node, className); | |
- this.queueClass(activeClassName); | |
- if ('production' !== 'development') { | |
- noEventTimeout = setTimeout(noEventListener, NO_EVENT_TIMEOUT); | |
- } | |
- }, | |
- queueClass: function (className) { | |
- this.classNameQueue.push(className); | |
- if (this.props.runNextTick) { | |
- this.props.runNextTick(this.flushClassNameQueue); | |
- return; | |
- } | |
- if (!this.timeout) { | |
- this.timeout = setTimeout(this.flushClassNameQueue, TICK); | |
- } | |
- }, | |
- flushClassNameQueue: function () { | |
- if (this.isMounted()) { | |
- this.classNameQueue.forEach(CSSCore.addClass.bind(CSSCore, this.getDOMNode())); | |
- } | |
- this.classNameQueue.length = 0; | |
- this.timeout = null; | |
- }, | |
- componentWillMount: function () { | |
- this.classNameQueue = []; | |
- }, | |
- componentWillUnmount: function () { | |
- if (this.timeout) { | |
- clearTimeout(this.timeout); | |
- } | |
- }, | |
- componentWillEnter: function (done) { | |
- if (this.props.enter) { | |
- this.transition('enter', done); | |
- } else { | |
- done(); | |
- } | |
- }, | |
- componentWillLeave: function (done) { | |
- if (this.props.leave) { | |
- this.transition('leave', done); | |
- } else { | |
- done(); | |
- } | |
- }, | |
- render: function () { | |
- return onlyChild(this.props.children); | |
- } | |
- }); | |
- module.exports = ReactCSSTransitionGroupChild; | |
- }, | |
- function (module, exports) { | |
- 'use strict'; | |
- var ReactChildren = _require(13); | |
+ var ReactChildren = _require(14); | |
var ReactTransitionChildMapping = { | |
getChildMapping: function (children) { | |
return ReactChildren.map(children, function (child) { | |
return child; | |
}); | |
}, | |
mergeChildMappings: function (prev, next) { | |
prev = prev || {}; | |
@@ -3182,17 +3182,17 @@ | |
childMapping[pendingKeys[i]] = getValueForKey(pendingKeys[i]); | |
} | |
return childMapping; | |
} | |
}; | |
module.exports = ReactTransitionChildMapping; | |
}, | |
function (module, exports) { | |
- var copyProperties = _require(37); | |
+ var copyProperties = _require(44); | |
function makeEmptyFunction(arg) { | |
return function () { | |
return arg; | |
}; | |
} | |
function emptyFunction() { | |
} | |
copyProperties(emptyFunction, { | |
@@ -3206,29 +3206,29 @@ | |
thatReturnsArgument: function (arg) { | |
return arg; | |
} | |
}); | |
module.exports = emptyFunction; | |
}, | |
function (module, exports) { | |
'use strict'; | |
- var mergeInto = _require(45); | |
+ var mergeInto = _require(43); | |
var merge = function (one, two) { | |
var result = {}; | |
mergeInto(result, one); | |
mergeInto(result, two); | |
return result; | |
}; | |
module.exports = merge; | |
}, | |
function (module, exports) { | |
'use strict'; | |
var emptyFunction = _require(32); | |
- var invariant = _require(38); | |
+ var invariant = _require(45); | |
var joinClasses = _require(97); | |
var merge = _require(33); | |
function createTransferStrategy(mergeStrategy) { | |
return function (props, key, value) { | |
if (!props.hasOwnProperty(key)) { | |
props[key] = value; | |
} else { | |
props[key] = mergeStrategy(props[key], value); | |
@@ -3298,79 +3298,16 @@ | |
return args[argIndex++]; | |
})); | |
} | |
}; | |
} | |
module.exports = warning; | |
}, | |
function (module, exports) { | |
- function copyProperties(obj, a, b, c, d, e, f) { | |
- obj = obj || {}; | |
- if ('production' !== 'development') { | |
- if (f) { | |
- throw new Error('Too many arguments passed to copyProperties'); | |
- } | |
- } | |
- var args = [ | |
- a, | |
- b, | |
- c, | |
- d, | |
- e | |
- ]; | |
- var ii = 0, v; | |
- while (args[ii]) { | |
- v = args[ii++]; | |
- for (var k in v) { | |
- obj[k] = v[k]; | |
- } | |
- if (v.hasOwnProperty && v.hasOwnProperty('toString') && typeof v.toString != 'undefined' && obj.toString !== v.toString) { | |
- obj.toString = v.toString; | |
- } | |
- } | |
- return obj; | |
- } | |
- module.exports = copyProperties; | |
- }, | |
- function (module, exports) { | |
- 'use strict'; | |
- var invariant = function (condition) { | |
- if (!condition) { | |
- var error = new Error('Minified exception occured; use the non-minified dev environment for ' + 'the full error message and additional helpful warnings.'); | |
- error.framesToPop = 1; | |
- throw error; | |
- } | |
- }; | |
- if ('production' !== 'development') { | |
- invariant = function (condition, format, a, b, c, d, e, f) { | |
- if (format === undefined) { | |
- throw new Error('invariant requires an error message argument'); | |
- } | |
- if (!condition) { | |
- var args = [ | |
- a, | |
- b, | |
- c, | |
- d, | |
- e, | |
- f | |
- ]; | |
- var argIndex = 0; | |
- var error = new Error('Invariant Violation: ' + format.replace(/%s/g, function () { | |
- return args[argIndex++]; | |
- })); | |
- error.framesToPop = 1; | |
- throw error; | |
- } | |
- }; | |
- } | |
- module.exports = invariant; | |
- }, | |
- function (module, exports) { | |
'use strict'; | |
var keyMirror = _require(52); | |
var PropagationPhases = keyMirror({ | |
bubbled: null, | |
captured: null | |
}); | |
var topLevelTypes = keyMirror({ | |
topBlur: null, | |
@@ -3418,21 +3355,21 @@ | |
topLevelTypes: topLevelTypes, | |
PropagationPhases: PropagationPhases | |
}; | |
module.exports = EventConstants; | |
}, | |
function (module, exports) { | |
'use strict'; | |
var EventPluginRegistry = _require(98); | |
- var EventPluginUtils = _require(12); | |
- var ExecutionEnvironment = _require(29); | |
+ var EventPluginUtils = _require(13); | |
+ var ExecutionEnvironment = _require(30); | |
var accumulate = _require(99); | |
var forEachAccumulated = _require(100); | |
- var invariant = _require(38); | |
+ var invariant = _require(45); | |
var isEventSupported = _require(101); | |
var monitorCodeUse = _require(53); | |
var listenerBank = {}; | |
var eventQueue = null; | |
var executeDispatchesAndRelease = function (event) { | |
if (event) { | |
var executeDispatch = EventPluginUtils.executeDispatch; | |
var PluginModule = EventPluginRegistry.getPluginModuleForEvent(event); | |
@@ -3530,18 +3467,18 @@ | |
__getListenerBank: function () { | |
return listenerBank; | |
} | |
}; | |
module.exports = EventPluginHub; | |
}, | |
function (module, exports) { | |
'use strict'; | |
- var EventConstants = _require(39); | |
- var EventPluginHub = _require(40); | |
+ var EventConstants = _require(37); | |
+ var EventPluginHub = _require(38); | |
var accumulate = _require(99); | |
var forEachAccumulated = _require(100); | |
var PropagationPhases = EventConstants.PropagationPhases; | |
var getListener = EventPluginHub.getListener; | |
function listenerAtPhase(id, event, propagationPhase) { | |
var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase]; | |
return getListener(id, registrationName); | |
} | |
@@ -3591,24 +3528,24 @@ | |
accumulateTwoPhaseDispatches: accumulateTwoPhaseDispatches, | |
accumulateDirectDispatches: accumulateDirectDispatches, | |
accumulateEnterLeaveDispatches: accumulateEnterLeaveDispatches | |
}; | |
module.exports = EventPropagators; | |
}, | |
function (module, exports) { | |
'use strict'; | |
- var EventConstants = _require(39); | |
+ var EventConstants = _require(37); | |
var EventListener = _require(102); | |
- var EventPluginHub = _require(40); | |
+ var EventPluginHub = _require(38); | |
var EventPluginRegistry = _require(98); | |
- var ExecutionEnvironment = _require(29); | |
+ var ExecutionEnvironment = _require(30); | |
var ReactEventEmitterMixin = _require(103); | |
var ViewportMetrics = _require(104); | |
- var invariant = _require(38); | |
+ var invariant = _require(45); | |
var isEventSupported = _require(101); | |
var merge = _require(33); | |
var alreadyListeningTo = {}; | |
var isMonitoringScrollValue = false; | |
var reactTopListenersCounter = 0; | |
var topEventMapping = { | |
topBlur: 'blur', | |
topChange: 'change', | |
@@ -3733,18 +3670,18 @@ | |
deleteAllListeners: EventPluginHub.deleteAllListeners, | |
trapBubbledEvent: trapBubbledEvent, | |
trapCapturedEvent: trapCapturedEvent | |
}); | |
module.exports = ReactEventEmitter; | |
}, | |
function (module, exports) { | |
'use strict'; | |
- var ReactPerf = _require(24); | |
- var invariant = _require(38); | |
+ var ReactPerf = _require(25); | |
+ var invariant = _require(45); | |
var dirtyComponents = []; | |
var batchingStrategy = null; | |
function ensureBatchingStrategy() { | |
'production' !== 'development' ? invariant(batchingStrategy, 'ReactUpdates: must inject a batching strategy') : invariant(batchingStrategy); | |
} | |
function batchedUpdates(callback, param) { | |
ensureBatchingStrategy(); | |
batchingStrategy.batchedUpdates(callback, param); | |
@@ -3812,17 +3749,17 @@ | |
module.exports = ReactUpdates; | |
}, | |
function (module, exports) { | |
'use strict'; | |
var PooledClass = _require(49); | |
var emptyFunction = _require(32); | |
var getEventTarget = _require(105); | |
var merge = _require(33); | |
- var mergeInto = _require(45); | |
+ var mergeInto = _require(43); | |
var EventInterface = { | |
type: null, | |
target: getEventTarget, | |
currentTarget: emptyFunction.thatReturnsNull, | |
eventPhase: null, | |
bubbles: null, | |
cancelable: null, | |
timeStamp: function (event) { | |
@@ -3909,26 +3846,89 @@ | |
} | |
one[key] = two[key]; | |
} | |
} | |
} | |
module.exports = mergeInto; | |
}, | |
function (module, exports) { | |
+ function copyProperties(obj, a, b, c, d, e, f) { | |
+ obj = obj || {}; | |
+ if ('production' !== 'development') { | |
+ if (f) { | |
+ throw new Error('Too many arguments passed to copyProperties'); | |
+ } | |
+ } | |
+ var args = [ | |
+ a, | |
+ b, | |
+ c, | |
+ d, | |
+ e | |
+ ]; | |
+ var ii = 0, v; | |
+ while (args[ii]) { | |
+ v = args[ii++]; | |
+ for (var k in v) { | |
+ obj[k] = v[k]; | |
+ } | |
+ if (v.hasOwnProperty && v.hasOwnProperty('toString') && typeof v.toString != 'undefined' && obj.toString !== v.toString) { | |
+ obj.toString = v.toString; | |
+ } | |
+ } | |
+ return obj; | |
+ } | |
+ module.exports = copyProperties; | |
+ }, | |
+ function (module, exports) { | |
'use strict'; | |
- var invariant = _require(38); | |
- var DOMPropertyInjection = { | |
- MUST_USE_ATTRIBUTE: 1, | |
- MUST_USE_PROPERTY: 2, | |
- HAS_SIDE_EFFECTS: 4, | |
- HAS_BOOLEAN_VALUE: 8, | |
- HAS_POSITIVE_NUMERIC_VALUE: 16, | |
- injectDOMPropertyConfig: function (domPropertyConfig) { | |
- var Properties = domPropertyConfig.Properties || {}; | |
+ var invariant = function (condition) { | |
+ if (!condition) { | |
+ var error = new Error('Minified exception occured; use the non-minified dev environment for ' + 'the full error message and additional helpful warnings.'); | |
+ error.framesToPop = 1; | |
+ throw error; | |
+ } | |
+ }; | |
+ if ('production' !== 'development') { | |
+ invariant = function (condition, format, a, b, c, d, e, f) { | |
+ if (format === undefined) { | |
+ throw new Error('invariant requires an error message argument'); | |
+ } | |
+ if (!condition) { | |
+ var args = [ | |
+ a, | |
+ b, | |
+ c, | |
+ d, | |
+ e, | |
+ f | |
+ ]; | |
+ var argIndex = 0; | |
+ var error = new Error('Invariant Violation: ' + format.replace(/%s/g, function () { | |
+ return args[argIndex++]; | |
+ })); | |
+ error.framesToPop = 1; | |
+ throw error; | |
+ } | |
+ }; | |
+ } | |
+ module.exports = invariant; | |
+ }, | |
+ function (module, exports) { | |
+ 'use strict'; | |
+ var invariant = _require(45); | |
+ var DOMPropertyInjection = { | |
+ MUST_USE_ATTRIBUTE: 1, | |
+ MUST_USE_PROPERTY: 2, | |
+ HAS_SIDE_EFFECTS: 4, | |
+ HAS_BOOLEAN_VALUE: 8, | |
+ HAS_POSITIVE_NUMERIC_VALUE: 16, | |
+ injectDOMPropertyConfig: function (domPropertyConfig) { | |
+ var Properties = domPropertyConfig.Properties || {}; | |
var DOMAttributeNames = domPropertyConfig.DOMAttributeNames || {}; | |
var DOMPropertyNames = domPropertyConfig.DOMPropertyNames || {}; | |
var DOMMutationMethods = domPropertyConfig.DOMMutationMethods || {}; | |
if (domPropertyConfig.isCustomAttribute) { | |
DOMProperty._isCustomAttributeFunctions.push(domPropertyConfig.isCustomAttribute); | |
} | |
for (var propName in Properties) { | |
'production' !== 'development' ? invariant(!DOMProperty.isStandardName[propName], 'injectDOMPropertyConfig(...): You\'re trying to inject DOM property ' + '\'%s\' which has already been injected. You may be accidentally ' + 'injecting the same DOM property config twice, or you may be ' + 'injecting two configs that have conflicting property names.', propName) : invariant(!DOMProperty.isStandardName[propName]); | |
@@ -4022,17 +4022,17 @@ | |
return cache[string] = callback.call(this, string); | |
} | |
}; | |
} | |
module.exports = memoizeStringOnly; | |
}, | |
function (module, exports) { | |
'use strict'; | |
- var invariant = _require(38); | |
+ var invariant = _require(45); | |
var oneArgumentPooler = function (copyFieldsFrom) { | |
var Klass = this; | |
if (Klass.instancePool.length) { | |
var instance = Klass.instancePool.pop(); | |
Klass.call(instance, copyFieldsFrom); | |
return instance; | |
} else { | |
return new Klass(copyFieldsFrom); | |
@@ -4096,19 +4096,19 @@ | |
twoArgumentPooler: twoArgumentPooler, | |
threeArgumentPooler: threeArgumentPooler, | |
fiveArgumentPooler: fiveArgumentPooler | |
}; | |
module.exports = PooledClass; | |
}, | |
function (module, exports) { | |
'use strict'; | |
- var ReactInstanceHandles = _require(21); | |
- var ReactTextComponent = _require(27); | |
- var invariant = _require(38); | |
+ var ReactInstanceHandles = _require(22); | |
+ var ReactTextComponent = _require(28); | |
+ var invariant = _require(45); | |
var SEPARATOR = ReactInstanceHandles.SEPARATOR; | |
var SUBSEPARATOR = ':'; | |
var userProvidedKeyEscaperLookup = { | |
'=': '=0', | |
'.': '=1', | |
':': '=2' | |
}; | |
var userProvidedKeyEscapeRegex = /[=.:]/g; | |
@@ -4172,17 +4172,17 @@ | |
traverseAllChildrenImpl(children, '', 0, callback, traverseContext); | |
} | |
} | |
module.exports = traverseAllChildren; | |
}, | |
function (module, exports) { | |
'use strict'; | |
var emptyObject = _require(107); | |
- var invariant = _require(38); | |
+ var invariant = _require(45); | |
var ReactOwner = { | |
isValidOwner: function (object) { | |
return !!(object && typeof object.attachRef === 'function' && typeof object.detachRef === 'function'); | |
}, | |
addComponentAsRefTo: function (component, ref, owner) { | |
'production' !== 'development' ? invariant(ReactOwner.isValidOwner(owner), 'addComponentAsRefTo(...): Only a ReactOwner can have refs. This ' + 'usually means that you\'re trying to add a ref to a component that ' + 'doesn\'t have an owner (that is, was not created inside of another ' + 'component\'s `render` method). Try rendering this component inside of ' + 'a new top-level component which will hold the ref.') : invariant(ReactOwner.isValidOwner(owner)); | |
owner.attachRef(ref, component); | |
}, | |
@@ -4205,34 +4205,34 @@ | |
delete this.refs[ref]; | |
} | |
} | |
}; | |
module.exports = ReactOwner; | |
}, | |
function (module, exports) { | |
'use strict'; | |
- var invariant = _require(38); | |
+ var invariant = _require(45); | |
var keyMirror = function (obj) { | |
var ret = {}; | |
var key; | |
'production' !== 'development' ? invariant(obj instanceof Object && !Array.isArray(obj), 'keyMirror(...): Argument must be an object.') : invariant(obj instanceof Object && !Array.isArray(obj)); | |
for (key in obj) { | |
if (!obj.hasOwnProperty(key)) { | |
continue; | |
} | |
ret[key] = key; | |
} | |
return ret; | |
}; | |
module.exports = keyMirror; | |
}, | |
function (module, exports) { | |
'use strict'; | |
- var invariant = _require(38); | |
+ var invariant = _require(45); | |
function monitorCodeUse(eventName, data) { | |
'production' !== 'development' ? invariant(eventName && !/[^a-z0-9_]/.test(eventName), 'You must provide an eventName using only the characters [a-z0-9_]') : invariant(eventName && !/[^a-z0-9_]/.test(eventName)); | |
} | |
module.exports = monitorCodeUse; | |
}, | |
function (module, exports) { | |
'use strict'; | |
var ReactErrorUtils = { | |
@@ -4326,16 +4326,117 @@ | |
} | |
} | |
} | |
return false; | |
} | |
module.exports = shouldUpdateReactComponent; | |
}, | |
function (module, exports) { | |
+ var invariant = _require(45); | |
+ var CSSCore = { | |
+ addClass: function (element, className) { | |
+ 'production' !== 'development' ? invariant(!/\s/.test(className), 'CSSCore.addClass takes only a single class name. "%s" contains ' + 'multiple classes.', className) : invariant(!/\s/.test(className)); | |
+ if (className) { | |
+ if (element.classList) { | |
+ element.classList.add(className); | |
+ } else if (!CSSCore.hasClass(element, className)) { | |
+ element.className = element.className + ' ' + className; | |
+ } | |
+ } | |
+ return element; | |
+ }, | |
+ removeClass: function (element, className) { | |
+ 'production' !== 'development' ? invariant(!/\s/.test(className), 'CSSCore.removeClass takes only a single class name. "%s" contains ' + 'multiple classes.', className) : invariant(!/\s/.test(className)); | |
+ if (className) { | |
+ if (element.classList) { | |
+ element.classList.remove(className); | |
+ } else if (CSSCore.hasClass(element, className)) { | |
+ element.className = element.className.replace(new RegExp('(^|\\s)' + className + '(?:\\s|$)', 'g'), '$1').replace(/\s+/g, ' ').replace(/^\s*|\s*$/g, ''); | |
+ } | |
+ } | |
+ return element; | |
+ }, | |
+ conditionClass: function (element, className, bool) { | |
+ return (bool ? CSSCore.addClass : CSSCore.removeClass)(element, className); | |
+ }, | |
+ hasClass: function (element, className) { | |
+ 'production' !== 'development' ? invariant(!/\s/.test(className), 'CSS.hasClass takes only a single class name.') : invariant(!/\s/.test(className)); | |
+ if (element.classList) { | |
+ return !!className && element.classList.contains(className); | |
+ } | |
+ return (' ' + element.className + ' ').indexOf(' ' + className + ' ') > -1; | |
+ } | |
+ }; | |
+ module.exports = CSSCore; | |
+ }, | |
+ function (module, exports) { | |
+ 'use strict'; | |
+ var ExecutionEnvironment = _require(30); | |
+ var EVENT_NAME_MAP = { | |
+ transitionend: { | |
+ 'transition': 'transitionend', | |
+ 'WebkitTransition': 'webkitTransitionEnd', | |
+ 'MozTransition': 'mozTransitionEnd', | |
+ 'OTransition': 'oTransitionEnd', | |
+ 'msTransition': 'MSTransitionEnd' | |
+ }, | |
+ animationend: { | |
+ 'animation': 'animationend', | |
+ 'WebkitAnimation': 'webkitAnimationEnd', | |
+ 'MozAnimation': 'mozAnimationEnd', | |
+ 'OAnimation': 'oAnimationEnd', | |
+ 'msAnimation': 'MSAnimationEnd' | |
+ } | |
+ }; | |
+ var endEvents = []; | |
+ function detectEvents() { | |
+ var testEl = document.createElement('div'); | |
+ var style = testEl.style; | |
+ for (var baseEventName in EVENT_NAME_MAP) { | |
+ var baseEvents = EVENT_NAME_MAP[baseEventName]; | |
+ for (var styleName in baseEvents) { | |
+ if (styleName in style) { | |
+ endEvents.push(baseEvents[styleName]); | |
+ break; | |
+ } | |
+ } | |
+ } | |
+ } | |
+ if (ExecutionEnvironment.canUseDOM) { | |
+ detectEvents(); | |
+ } | |
+ function addEventListener(node, eventName, eventListener) { | |
+ node.addEventListener(eventName, eventListener, false); | |
+ } | |
+ function removeEventListener(node, eventName, eventListener) { | |
+ node.removeEventListener(eventName, eventListener, false); | |
+ } | |
+ var ReactTransitionEvents = { | |
+ addEndEventListener: function (node, eventListener) { | |
+ if (endEvents.length === 0) { | |
+ window.setTimeout(eventListener, 0); | |
+ return; | |
+ } | |
+ endEvents.forEach(function (endEvent) { | |
+ addEventListener(node, endEvent, eventListener); | |
+ }); | |
+ }, | |
+ removeEndEventListener: function (node, eventListener) { | |
+ if (endEvents.length === 0) { | |
+ return; | |
+ } | |
+ endEvents.forEach(function (endEvent) { | |
+ removeEventListener(node, endEvent, eventListener); | |
+ }); | |
+ } | |
+ }; | |
+ module.exports = ReactTransitionEvents; | |
+ }, | |
+ function (module, exports) { | |
'use strict'; | |
function objMapKeyVal(obj, func, context) { | |
if (!obj) { | |
return null; | |
} | |
var i = 0; | |
var ret = {}; | |
for (var key in obj) { | |
@@ -4344,16 +4445,80 @@ | |
} | |
} | |
return ret; | |
} | |
module.exports = objMapKeyVal; | |
}, | |
function (module, exports) { | |
'use strict'; | |
+ var ReactRootIndexInjection = { | |
+ injectCreateReactRootIndex: function (_createReactRootIndex) { | |
+ ReactRootIndex.createReactRootIndex = _createReactRootIndex; | |
+ } | |
+ }; | |
+ var ReactRootIndex = { | |
+ createReactRootIndex: null, | |
+ injection: ReactRootIndexInjection | |
+ }; | |
+ module.exports = ReactRootIndex; | |
+ }, | |
+ function (module, exports) { | |
+ 'use strict'; | |
+ var keyMirror = _require(52); | |
+ var ReactMultiChildUpdateTypes = keyMirror({ | |
+ INSERT_MARKUP: null, | |
+ MOVE_EXISTING: null, | |
+ REMOVE_NODE: null, | |
+ TEXT_CONTENT: null | |
+ }); | |
+ module.exports = ReactMultiChildUpdateTypes; | |
+ }, | |
+ function (module, exports) { | |
+ 'use strict'; | |
+ var invariant = _require(45); | |
+ var traverseAllChildren = _require(50); | |
+ function flattenSingleChildIntoContext(traverseContext, child, name) { | |
+ var result = traverseContext; | |
+ 'production' !== 'development' ? invariant(!result.hasOwnProperty(name), 'flattenChildren(...): Encountered two children with the same key, `%s`. ' + 'Children keys must be unique.', name) : invariant(!result.hasOwnProperty(name)); | |
+ if (child != null) { | |
+ result[name] = child; | |
+ } | |
+ } | |
+ function flattenChildren(children) { | |
+ if (children == null) { | |
+ return children; | |
+ } | |
+ var result = {}; | |
+ traverseAllChildren(children, flattenSingleChildIntoContext, result); | |
+ return result; | |
+ } | |
+ module.exports = flattenChildren; | |
+ }, | |
+ function (module, exports) { | |
+ function createObjectFrom(keys, values) { | |
+ if ('production' !== 'development') { | |
+ if (!Array.isArray(keys)) { | |
+ throw new TypeError('Must pass an array of keys.'); | |
+ } | |
+ } | |
+ var object = {}; | |
+ var isArray = Array.isArray(values); | |
+ if (typeof values == 'undefined') { | |
+ values = true; | |
+ } | |
+ for (var ii = keys.length; ii--;) { | |
+ object[keys[ii]] = isArray ? values[ii] : values; | |
+ } | |
+ return object; | |
+ } | |
+ module.exports = createObjectFrom; | |
+ }, | |
+ function (module, exports) { | |
+ 'use strict'; | |
var CSSProperty = _require(108); | |
var dangerousStyleValue = _require(109); | |
var escapeTextForBrowser = _require(47); | |
var hyphenate = _require(110); | |
var memoizeStringOnly = _require(48); | |
var processStyleName = memoizeStringOnly(function (styleName) { | |
return escapeTextForBrowser(hyphenate(styleName)); | |
}); | |
@@ -4393,59 +4558,165 @@ | |
} | |
} | |
} | |
}; | |
module.exports = CSSPropertyOperations; | |
}, | |
function (module, exports) { | |
'use strict'; | |
- var ReactMount = _require(22); | |
- var invariant = _require(38); | |
+ var ReactMount = _require(23); | |
+ var invariant = _require(45); | |
var ReactBrowserComponentMixin = { | |
getDOMNode: function () { | |
'production' !== 'development' ? invariant(this.isMounted(), 'getDOMNode(): A component must be mounted to have a DOM node.') : invariant(this.isMounted()); | |
return ReactMount.getNode(this._rootNodeID); | |
} | |
}; | |
module.exports = ReactBrowserComponentMixin; | |
}, | |
function (module, exports) { | |
+ var isTextNode = _require(111); | |
+ function containsNode(outerNode, innerNode) { | |
+ if (!outerNode || !innerNode) { | |
+ return false; | |
+ } else if (outerNode === innerNode) { | |
+ return true; | |
+ } else if (isTextNode(outerNode)) { | |
+ return false; | |
+ } else if (isTextNode(innerNode)) { | |
+ return containsNode(outerNode, innerNode.parentNode); | |
+ } else if (outerNode.contains) { | |
+ return outerNode.contains(innerNode); | |
+ } else if (outerNode.compareDocumentPosition) { | |
+ return !!(outerNode.compareDocumentPosition(innerNode) & 16); | |
+ } else { | |
+ return false; | |
+ } | |
+ } | |
+ module.exports = containsNode; | |
+ }, | |
+ function (module, exports) { | |
'use strict'; | |
- var DOMProperty = _require(46); | |
- var EventPluginHub = _require(40); | |
- var ReactComponent = _require(14); | |
- var ReactCompositeComponent = _require(15); | |
- var ReactDOM = _require(18); | |
- var ReactEventEmitter = _require(42); | |
- var ReactPerf = _require(24); | |
- var ReactRootIndex = _require(87); | |
- var ReactUpdates = _require(43); | |
- var ReactInjection = { | |
- Component: ReactComponent.injection, | |
- CompositeComponent: ReactCompositeComponent.injection, | |
- DOMProperty: DOMProperty.injection, | |
- EventPluginHub: EventPluginHub.injection, | |
- DOM: ReactDOM.injection, | |
- EventEmitter: ReactEventEmitter.injection, | |
- Perf: ReactPerf.injection, | |
- RootIndex: ReactRootIndex.injection, | |
- Updates: ReactUpdates.injection | |
- }; | |
- module.exports = ReactInjection; | |
+ var DOC_NODE_TYPE = 9; | |
+ function getReactRootElementInContainer(container) { | |
+ if (!container) { | |
+ return null; | |
+ } | |
+ if (container.nodeType === DOC_NODE_TYPE) { | |
+ return container.documentElement; | |
+ } else { | |
+ return container.firstChild; | |
+ } | |
+ } | |
+ module.exports = getReactRootElementInContainer; | |
}, | |
function (module, exports) { | |
'use strict'; | |
- var DOMProperty = _require(46); | |
- var MUST_USE_ATTRIBUTE = DOMProperty.injection.MUST_USE_ATTRIBUTE; | |
- var MUST_USE_PROPERTY = DOMProperty.injection.MUST_USE_PROPERTY; | |
- var HAS_BOOLEAN_VALUE = DOMProperty.injection.HAS_BOOLEAN_VALUE; | |
- var HAS_SIDE_EFFECTS = DOMProperty.injection.HAS_SIDE_EFFECTS; | |
- var HAS_POSITIVE_NUMERIC_VALUE = DOMProperty.injection.HAS_POSITIVE_NUMERIC_VALUE; | |
- var DefaultDOMPropertyConfig = { | |
+ var adler32 = _require(112); | |
+ var ReactMarkupChecksum = { | |
+ CHECKSUM_ATTR_NAME: 'data-react-checksum', | |
+ addChecksumToMarkup: function (markup) { | |
+ var checksum = adler32(markup); | |
+ return markup.replace('>', ' ' + ReactMarkupChecksum.CHECKSUM_ATTR_NAME + '="' + checksum + '">'); | |
+ }, | |
+ canReuseMarkup: function (markup, element) { | |
+ var existingChecksum = element.getAttribute(ReactMarkupChecksum.CHECKSUM_ATTR_NAME); | |
+ existingChecksum = existingChecksum && parseInt(existingChecksum, 10); | |
+ var markupChecksum = adler32(markup); | |
+ return markupChecksum === existingChecksum; | |
+ } | |
+ }; | |
+ module.exports = ReactMarkupChecksum; | |
+ }, | |
+ function (module, exports) { | |
+ 'use strict'; | |
+ var PooledClass = _require(49); | |
+ var ReactMountReady = _require(113); | |
+ var ReactPutListenerQueue = _require(114); | |
+ var Transaction = _require(115); | |
+ var emptyFunction = _require(32); | |
+ var mixInto = _require(58); | |
+ var ON_DOM_READY_QUEUEING = { | |
+ initialize: function () { | |
+ this.reactMountReady.reset(); | |
+ }, | |
+ close: emptyFunction | |
+ }; | |
+ var PUT_LISTENER_QUEUEING = { | |
+ initialize: function () { | |
+ this.putListenerQueue.reset(); | |
+ }, | |
+ close: emptyFunction | |
+ }; | |
+ var TRANSACTION_WRAPPERS = [ | |
+ PUT_LISTENER_QUEUEING, | |
+ ON_DOM_READY_QUEUEING | |
+ ]; | |
+ function ReactServerRenderingTransaction(renderToStaticMarkup) { | |
+ this.reinitializeTransaction(); | |
+ this.renderToStaticMarkup = renderToStaticMarkup; | |
+ this.reactMountReady = ReactMountReady.getPooled(null); | |
+ this.putListenerQueue = ReactPutListenerQueue.getPooled(); | |
+ } | |
+ var Mixin = { | |
+ getTransactionWrappers: function () { | |
+ return TRANSACTION_WRAPPERS; | |
+ }, | |
+ getReactMountReady: function () { | |
+ return this.reactMountReady; | |
+ }, | |
+ getPutListenerQueue: function () { | |
+ return this.putListenerQueue; | |
+ }, | |
+ destructor: function () { | |
+ ReactMountReady.release(this.reactMountReady); | |
+ this.reactMountReady = null; | |
+ ReactPutListenerQueue.release(this.putListenerQueue); | |
+ this.putListenerQueue = null; | |
+ } | |
+ }; | |
+ mixInto(ReactServerRenderingTransaction, Transaction.Mixin); | |
+ mixInto(ReactServerRenderingTransaction, Mixin); | |
+ PooledClass.addPoolingTo(ReactServerRenderingTransaction); | |
+ module.exports = ReactServerRenderingTransaction; | |
+ }, | |
+ function (module, exports) { | |
+ 'use strict'; | |
+ var DOMProperty = _require(46); | |
+ var EventPluginHub = _require(38); | |
+ var ReactComponent = _require(15); | |
+ var ReactCompositeComponent = _require(16); | |
+ var ReactDOM = _require(19); | |
+ var ReactEventEmitter = _require(40); | |
+ var ReactPerf = _require(25); | |
+ var ReactRootIndex = _require(64); | |
+ var ReactUpdates = _require(41); | |
+ var ReactInjection = { | |
+ Component: ReactComponent.injection, | |
+ CompositeComponent: ReactCompositeComponent.injection, | |
+ DOMProperty: DOMProperty.injection, | |
+ EventPluginHub: EventPluginHub.injection, | |
+ DOM: ReactDOM.injection, | |
+ EventEmitter: ReactEventEmitter.injection, | |
+ Perf: ReactPerf.injection, | |
+ RootIndex: ReactRootIndex.injection, | |
+ Updates: ReactUpdates.injection | |
+ }; | |
+ module.exports = ReactInjection; | |
+ }, | |
+ function (module, exports) { | |
+ 'use strict'; | |
+ var DOMProperty = _require(46); | |
+ var MUST_USE_ATTRIBUTE = DOMProperty.injection.MUST_USE_ATTRIBUTE; | |
+ var MUST_USE_PROPERTY = DOMProperty.injection.MUST_USE_PROPERTY; | |
+ var HAS_BOOLEAN_VALUE = DOMProperty.injection.HAS_BOOLEAN_VALUE; | |
+ var HAS_SIDE_EFFECTS = DOMProperty.injection.HAS_SIDE_EFFECTS; | |
+ var HAS_POSITIVE_NUMERIC_VALUE = DOMProperty.injection.HAS_POSITIVE_NUMERIC_VALUE; | |
+ var DefaultDOMPropertyConfig = { | |
isCustomAttribute: RegExp.prototype.test.bind(/^(data|aria)-[a-z_][a-z\d_.\-]*$/), | |
Properties: { | |
accept: null, | |
accessKey: null, | |
action: null, | |
allowFullScreen: MUST_USE_ATTRIBUTE | HAS_BOOLEAN_VALUE, | |
allowTransparency: MUST_USE_ATTRIBUTE, | |
alt: null, | |
@@ -4587,24 +4858,24 @@ | |
srcDoc: 'srcdoc', | |
srcSet: 'srcset' | |
} | |
}; | |
module.exports = DefaultDOMPropertyConfig; | |
}, | |
function (module, exports) { | |
'use strict'; | |
- var EventConstants = _require(39); | |
- var EventPluginHub = _require(40); | |
- var EventPropagators = _require(41); | |
- var ExecutionEnvironment = _require(29); | |
- var ReactUpdates = _require(43); | |
- var SyntheticEvent = _require(44); | |
+ var EventConstants = _require(37); | |
+ var EventPluginHub = _require(38); | |
+ var EventPropagators = _require(39); | |
+ var ExecutionEnvironment = _require(30); | |
+ var ReactUpdates = _require(41); | |
+ var SyntheticEvent = _require(42); | |
var isEventSupported = _require(101); | |
- var isTextInputElement = _require(111); | |
+ var isTextInputElement = _require(116); | |
var keyOf = _require(35); | |
var topLevelTypes = EventConstants.topLevelTypes; | |
var eventTypes = { | |
change: { | |
phasedRegistrationNames: { | |
bubbled: keyOf({ onChange: null }), | |
captured: keyOf({ onChangeCapture: null }) | |
}, | |
@@ -4780,22 +5051,22 @@ | |
createReactRootIndex: function () { | |
return nextReactRootIndex++; | |
} | |
}; | |
module.exports = ClientReactRootIndex; | |
}, | |
function (module, exports) { | |
'use strict'; | |
- var EventConstants = _require(39); | |
- var EventPropagators = _require(41); | |
- var ExecutionEnvironment = _require(29); | |
- var ReactInputSelection = _require(112); | |
- var SyntheticCompositionEvent = _require(113); | |
- var getTextContentAccessor = _require(114); | |
+ var EventConstants = _require(37); | |
+ var EventPropagators = _require(39); | |
+ var ExecutionEnvironment = _require(30); | |
+ var ReactInputSelection = _require(120); | |
+ var SyntheticCompositionEvent = _require(134); | |
+ var getTextContentAccessor = _require(135); | |
var keyOf = _require(35); | |
var END_KEYCODES = [ | |
9, | |
13, | |
27, | |
32 | |
]; | |
var START_KEYCODE = 229; | |
@@ -4937,20 +5208,20 @@ | |
keyOf({ CompositionEventPlugin: null }), | |
keyOf({ AnalyticsEventPlugin: null }), | |
keyOf({ MobileSafariClickEventPlugin: null }) | |
]; | |
module.exports = DefaultEventPluginOrder; | |
}, | |
function (module, exports) { | |
'use strict'; | |
- var EventConstants = _require(39); | |
- var EventPropagators = _require(41); | |
- var SyntheticMouseEvent = _require(115); | |
- var ReactMount = _require(22); | |
+ var EventConstants = _require(37); | |
+ var EventPropagators = _require(39); | |
+ var SyntheticMouseEvent = _require(117); | |
+ var ReactMount = _require(23); | |
var keyOf = _require(35); | |
var topLevelTypes = EventConstants.topLevelTypes; | |
var getFirstReactDOM = ReactMount.getFirstReactDOM; | |
var eventTypes = { | |
mouseEnter: { | |
registrationName: keyOf({ onMouseEnter: null }), | |
dependencies: [ | |
topLevelTypes.topMouseOut, | |
@@ -5015,17 +5286,17 @@ | |
extractedEvents[1] = enter; | |
return extractedEvents; | |
} | |
}; | |
module.exports = EnterLeaveEventPlugin; | |
}, | |
function (module, exports) { | |
'use strict'; | |
- var EventConstants = _require(39); | |
+ var EventConstants = _require(37); | |
var emptyFunction = _require(32); | |
var topLevelTypes = EventConstants.topLevelTypes; | |
var MobileSafariClickEventPlugin = { | |
eventTypes: null, | |
extractEvents: function (topLevelType, topLevelTarget, topLevelTargetID, nativeEvent) { | |
if (topLevelType === topLevelTypes.topTouchStart) { | |
var target = nativeEvent.target; | |
if (target && !target.onclick) { | |
@@ -5033,23 +5304,23 @@ | |
} | |
} | |
} | |
}; | |
module.exports = MobileSafariClickEventPlugin; | |
}, | |
function (module, exports) { | |
'use strict'; | |
- var ReactDOMIDOperations = _require(116); | |
- var ReactMarkupChecksum = _require(93); | |
- var ReactMount = _require(22); | |
- var ReactPerf = _require(24); | |
- var ReactReconcileTransaction = _require(117); | |
- var getReactRootElementInContainer = _require(89); | |
- var invariant = _require(38); | |
+ var ReactDOMIDOperations = _require(132); | |
+ var ReactMarkupChecksum = _require(72); | |
+ var ReactMount = _require(23); | |
+ var ReactPerf = _require(25); | |
+ var ReactReconcileTransaction = _require(133); | |
+ var getReactRootElementInContainer = _require(71); | |
+ var invariant = _require(45); | |
var ELEMENT_NODE_TYPE = 1; | |
var DOC_NODE_TYPE = 9; | |
var ReactComponentBrowserEnvironment = { | |
ReactReconcileTransaction: ReactReconcileTransaction, | |
BackendIDOperations: ReactDOMIDOperations, | |
unmountIDFromEnvironment: function (rootNodeID) { | |
ReactMount.purgeID(rootNodeID); | |
}, | |
@@ -5069,19 +5340,19 @@ | |
container.innerHTML = markup; | |
}) | |
}; | |
module.exports = ReactComponentBrowserEnvironment; | |
}, | |
function (module, exports) { | |
'use strict'; | |
var PooledClass = _require(49); | |
- var ReactEventEmitter = _require(42); | |
- var ReactInstanceHandles = _require(21); | |
- var ReactMount = _require(22); | |
+ var ReactEventEmitter = _require(40); | |
+ var ReactInstanceHandles = _require(22); | |
+ var ReactMount = _require(23); | |
var getEventTarget = _require(105); | |
var mixInto = _require(58); | |
var _topLevelListenersEnabled = true; | |
function findParent(node) { | |
var nodeID = ReactMount.getID(node); | |
var rootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID); | |
var container = ReactMount.findReactContainerForID(rootID); | |
var parent = ReactMount.getFirstReactDOM(container); | |
@@ -5130,19 +5401,19 @@ | |
}; | |
} | |
}; | |
module.exports = ReactEventTopLevelCallback; | |
}, | |
function (module, exports) { | |
'use strict'; | |
var AutoFocusMixin = _require(118); | |
- var ReactBrowserComponentMixin = _require(63); | |
- var ReactCompositeComponent = _require(15); | |
- var ReactDOM = _require(18); | |
+ var ReactBrowserComponentMixin = _require(69); | |
+ var ReactCompositeComponent = _require(16); | |
+ var ReactDOM = _require(19); | |
var keyMirror = _require(52); | |
var button = ReactDOM.button; | |
var mouseListenerNames = keyMirror({ | |
onClick: true, | |
onDoubleClick: true, | |
onMouseDown: true, | |
onMouseMove: true, | |
onMouseUp: true, | |
@@ -5167,42 +5438,42 @@ | |
} | |
return button(props, this.props.children); | |
} | |
}); | |
module.exports = ReactDOMButton; | |
}, | |
function (module, exports) { | |
'use strict'; | |
- var ReactBrowserComponentMixin = _require(63); | |
- var ReactCompositeComponent = _require(15); | |
- var ReactDOM = _require(18); | |
- var ReactEventEmitter = _require(42); | |
- var EventConstants = _require(39); | |
+ var ReactBrowserComponentMixin = _require(69); | |
+ var ReactCompositeComponent = _require(16); | |
+ var ReactDOM = _require(19); | |
+ var ReactEventEmitter = _require(40); | |
+ var EventConstants = _require(37); | |
var form = ReactDOM.form; | |
var ReactDOMForm = ReactCompositeComponent.createClass({ | |
displayName: 'ReactDOMForm', | |
mixins: [ReactBrowserComponentMixin], | |
render: function () { | |
return this.transferPropsTo(form(null, this.props.children)); | |
}, | |
componentDidMount: function () { | |
ReactEventEmitter.trapBubbledEvent(EventConstants.topLevelTypes.topReset, 'reset', this.getDOMNode()); | |
ReactEventEmitter.trapBubbledEvent(EventConstants.topLevelTypes.topSubmit, 'submit', this.getDOMNode()); | |
} | |
}); | |
module.exports = ReactDOMForm; | |
}, | |
function (module, exports) { | |
'use strict'; | |
- var ReactBrowserComponentMixin = _require(63); | |
- var ReactCompositeComponent = _require(15); | |
- var ReactDOM = _require(18); | |
- var ReactEventEmitter = _require(42); | |
- var EventConstants = _require(39); | |
+ var ReactBrowserComponentMixin = _require(69); | |
+ var ReactCompositeComponent = _require(16); | |
+ var ReactDOM = _require(19); | |
+ var ReactEventEmitter = _require(40); | |
+ var EventConstants = _require(37); | |
var img = ReactDOM.img; | |
var ReactDOMImg = ReactCompositeComponent.createClass({ | |
displayName: 'ReactDOMImg', | |
tagName: 'IMG', | |
mixins: [ReactBrowserComponentMixin], | |
render: function () { | |
return img(this.props); | |
}, | |
@@ -5212,23 +5483,23 @@ | |
ReactEventEmitter.trapBubbledEvent(EventConstants.topLevelTypes.topError, 'error', node); | |
} | |
}); | |
module.exports = ReactDOMImg; | |
}, | |
function (module, exports) { | |
'use strict'; | |
var AutoFocusMixin = _require(118); | |
- var DOMPropertyOperations = _require(11); | |
+ var DOMPropertyOperations = _require(12); | |
var LinkedValueUtils = _require(119); | |
- var ReactBrowserComponentMixin = _require(63); | |
- var ReactCompositeComponent = _require(15); | |
- var ReactDOM = _require(18); | |
- var ReactMount = _require(22); | |
- var invariant = _require(38); | |
+ var ReactBrowserComponentMixin = _require(69); | |
+ var ReactCompositeComponent = _require(16); | |
+ var ReactDOM = _require(19); | |
+ var ReactMount = _require(23); | |
+ var invariant = _require(45); | |
var merge = _require(33); | |
var input = ReactDOM.input; | |
var instancesByReactID = {}; | |
var ReactDOMInput = ReactCompositeComponent.createClass({ | |
displayName: 'ReactDOMInput', | |
mixins: [ | |
AutoFocusMixin, | |
LinkedValueUtils.Mixin, | |
@@ -5308,19 +5579,19 @@ | |
} | |
return returnValue; | |
} | |
}); | |
module.exports = ReactDOMInput; | |
}, | |
function (module, exports) { | |
'use strict'; | |
- var ReactBrowserComponentMixin = _require(63); | |
- var ReactCompositeComponent = _require(15); | |
- var ReactDOM = _require(18); | |
+ var ReactBrowserComponentMixin = _require(69); | |
+ var ReactCompositeComponent = _require(16); | |
+ var ReactDOM = _require(19); | |
var warning = _require(36); | |
var option = ReactDOM.option; | |
var ReactDOMOption = ReactCompositeComponent.createClass({ | |
displayName: 'ReactDOMOption', | |
mixins: [ReactBrowserComponentMixin], | |
componentWillMount: function () { | |
if ('production' !== 'development') { | |
'production' !== 'development' ? warning(this.props.selected == null, 'Use the `defaultValue` or `value` props on <select> instead of ' + 'setting `selected` on <option>.') : null; | |
@@ -5331,20 +5602,20 @@ | |
} | |
}); | |
module.exports = ReactDOMOption; | |
}, | |
function (module, exports) { | |
'use strict'; | |
var AutoFocusMixin = _require(118); | |
var LinkedValueUtils = _require(119); | |
- var ReactBrowserComponentMixin = _require(63); | |
- var ReactCompositeComponent = _require(15); | |
- var ReactDOM = _require(18); | |
- var invariant = _require(38); | |
+ var ReactBrowserComponentMixin = _require(69); | |
+ var ReactCompositeComponent = _require(16); | |
+ var ReactDOM = _require(19); | |
+ var invariant = _require(45); | |
var merge = _require(33); | |
var select = ReactDOM.select; | |
function selectValueType(props, propName, componentName) { | |
if (props[propName] == null) { | |
return; | |
} | |
if (props.multiple) { | |
'production' !== 'development' ? invariant(Array.isArray(props[propName]), 'The `%s` prop supplied to <select> must be an array if `multiple` is ' + 'true.', propName) : invariant(Array.isArray(props[propName])); | |
@@ -5435,22 +5706,22 @@ | |
return returnValue; | |
} | |
}); | |
module.exports = ReactDOMSelect; | |
}, | |
function (module, exports) { | |
'use strict'; | |
var AutoFocusMixin = _require(118); | |
- var DOMPropertyOperations = _require(11); | |
+ var DOMPropertyOperations = _require(12); | |
var LinkedValueUtils = _require(119); | |
- var ReactBrowserComponentMixin = _require(63); | |
- var ReactCompositeComponent = _require(15); | |
- var ReactDOM = _require(18); | |
- var invariant = _require(38); | |
+ var ReactBrowserComponentMixin = _require(69); | |
+ var ReactCompositeComponent = _require(16); | |
+ var ReactDOM = _require(19); | |
+ var invariant = _require(45); | |
var merge = _require(33); | |
var warning = _require(36); | |
var textarea = ReactDOM.textarea; | |
var ReactDOMTextarea = ReactCompositeComponent.createClass({ | |
displayName: 'ReactDOMTextarea', | |
mixins: [ | |
AutoFocusMixin, | |
LinkedValueUtils.Mixin, | |
@@ -5509,24 +5780,24 @@ | |
this.setState({ value: event.target.value }); | |
return returnValue; | |
} | |
}); | |
module.exports = ReactDOMTextarea; | |
}, | |
function (module, exports) { | |
'use strict'; | |
- var EventConstants = _require(39); | |
- var EventPropagators = _require(41); | |
- var ReactInputSelection = _require(112); | |
- var SyntheticEvent = _require(44); | |
- var getActiveElement = _require(120); | |
- var isTextInputElement = _require(111); | |
+ var EventConstants = _require(37); | |
+ var EventPropagators = _require(39); | |
+ var ReactInputSelection = _require(120); | |
+ var SyntheticEvent = _require(42); | |
+ var getActiveElement = _require(121); | |
+ var isTextInputElement = _require(116); | |
var keyOf = _require(35); | |
- var shallowEqual = _require(121); | |
+ var shallowEqual = _require(122); | |
var topLevelTypes = EventConstants.topLevelTypes; | |
var eventTypes = { | |
select: { | |
phasedRegistrationNames: { | |
bubbled: keyOf({ onSelect: null }), | |
captured: keyOf({ onSelectCapture: null }) | |
}, | |
dependencies: [ | |
@@ -5621,29 +5892,29 @@ | |
createReactRootIndex: function () { | |
return Math.ceil(Math.random() * GLOBAL_MOUNT_POINT_MAX); | |
} | |
}; | |
module.exports = ServerReactRootIndex; | |
}, | |
function (module, exports) { | |
'use strict'; | |
- var EventConstants = _require(39); | |
- var EventPluginUtils = _require(12); | |
- var EventPropagators = _require(41); | |
- var SyntheticClipboardEvent = _require(122); | |
- var SyntheticEvent = _require(44); | |
- var SyntheticFocusEvent = _require(123); | |
- var SyntheticKeyboardEvent = _require(124); | |
- var SyntheticMouseEvent = _require(115); | |
- var SyntheticDragEvent = _require(125); | |
- var SyntheticTouchEvent = _require(126); | |
- var SyntheticUIEvent = _require(127); | |
- var SyntheticWheelEvent = _require(128); | |
- var invariant = _require(38); | |
+ var EventConstants = _require(37); | |
+ var EventPluginUtils = _require(13); | |
+ var EventPropagators = _require(39); | |
+ var SyntheticClipboardEvent = _require(123); | |
+ var SyntheticEvent = _require(42); | |
+ var SyntheticFocusEvent = _require(124); | |
+ var SyntheticKeyboardEvent = _require(125); | |
+ var SyntheticMouseEvent = _require(117); | |
+ var SyntheticDragEvent = _require(126); | |
+ var SyntheticTouchEvent = _require(127); | |
+ var SyntheticUIEvent = _require(128); | |
+ var SyntheticWheelEvent = _require(129); | |
+ var invariant = _require(45); | |
var keyOf = _require(35); | |
var topLevelTypes = EventConstants.topLevelTypes; | |
var eventTypes = { | |
blur: { | |
phasedRegistrationNames: { | |
bubbled: keyOf({ onBlur: true }), | |
captured: keyOf({ onBlurCapture: true }) | |
} | |
@@ -5971,18 +6242,18 @@ | |
EventPropagators.accumulateTwoPhaseDispatches(event); | |
return event; | |
} | |
}; | |
module.exports = SimpleEventPlugin; | |
}, | |
function (module, exports) { | |
'use strict'; | |
- var ReactUpdates = _require(43); | |
- var Transaction = _require(129); | |
+ var ReactUpdates = _require(41); | |
+ var Transaction = _require(115); | |
var emptyFunction = _require(32); | |
var mixInto = _require(58); | |
var RESET_BATCHED_UPDATES = { | |
initialize: emptyFunction, | |
close: function () { | |
ReactDefaultBatchingStrategy.isBatchingUpdates = false; | |
} | |
}; | |
@@ -6015,18 +6286,18 @@ | |
transaction.perform(callback, null, param); | |
} | |
} | |
}; | |
module.exports = ReactDefaultBatchingStrategy; | |
}, | |
function (module, exports) { | |
'use strict'; | |
- var ReactCompositeComponent = _require(15); | |
- var invariant = _require(38); | |
+ var ReactCompositeComponent = _require(16); | |
+ var invariant = _require(45); | |
function createFullPageComponent(componentClass) { | |
var FullPageComponent = ReactCompositeComponent.createClass({ | |
displayName: 'ReactFullPageComponent' + (componentClass.componentConstructor.displayName || ''), | |
componentWillUnmount: function () { | |
'production' !== 'development' ? invariant(false, '%s tried to unmount. Because of cross-browser quirks it is ' + 'impossible to unmount some top-level components (eg <html>, <head>, ' + 'and <body>) reliably and efficiently. To fix this, have a single ' + 'top-level component that never unmounts render these elements.', this.constructor.displayName) : invariant(false); | |
}, | |
render: function () { | |
return this.transferPropsTo(componentClass(null, this.props.children)); | |
@@ -6035,18 +6306,18 @@ | |
return FullPageComponent; | |
} | |
module.exports = createFullPageComponent; | |
}, | |
function (module, exports) { | |
'use strict'; | |
var DOMProperty = _require(46); | |
var ReactDefaultPerfAnalysis = _require(130); | |
- var ReactMount = _require(22); | |
- var ReactPerf = _require(24); | |
+ var ReactMount = _require(23); | |
+ var ReactPerf = _require(25); | |
var performanceNow = _require(131); | |
function roundFloat(val) { | |
return Math.floor(val * 100) / 100; | |
} | |
var ReactDefaultPerf = { | |
_allMeasurements: [], | |
_injected: false, | |
start: function () { | |
@@ -6192,359 +6463,88 @@ | |
} | |
}; | |
} | |
}; | |
module.exports = ReactDefaultPerf; | |
}, | |
function (module, exports) { | |
'use strict'; | |
- var ReactRootIndexInjection = { | |
- injectCreateReactRootIndex: function (_createReactRootIndex) { | |
- ReactRootIndex.createReactRootIndex = _createReactRootIndex; | |
- } | |
- }; | |
- var ReactRootIndex = { | |
- createReactRootIndex: null, | |
- injection: ReactRootIndexInjection | |
- }; | |
- module.exports = ReactRootIndex; | |
- }, | |
- function (module, exports) { | |
- var isTextNode = _require(132); | |
- function containsNode(outerNode, innerNode) { | |
- if (!outerNode || !innerNode) { | |
- return false; | |
- } else if (outerNode === innerNode) { | |
- return true; | |
- } else if (isTextNode(outerNode)) { | |
- return false; | |
- } else if (isTextNode(innerNode)) { | |
- return containsNode(outerNode, innerNode.parentNode); | |
- } else if (outerNode.contains) { | |
- return outerNode.contains(innerNode); | |
- } else if (outerNode.compareDocumentPosition) { | |
- return !!(outerNode.compareDocumentPosition(innerNode) & 16); | |
- } else { | |
- return false; | |
- } | |
- } | |
- module.exports = containsNode; | |
- }, | |
- function (module, exports) { | |
- 'use strict'; | |
- var DOC_NODE_TYPE = 9; | |
- function getReactRootElementInContainer(container) { | |
- if (!container) { | |
- return null; | |
+ function joinClasses(className) { | |
+ if (!className) { | |
+ className = ''; | |
} | |
- if (container.nodeType === DOC_NODE_TYPE) { | |
- return container.documentElement; | |
- } else { | |
- return container.firstChild; | |
+ var nextClass; | |
+ var argLength = arguments.length; | |
+ if (argLength > 1) { | |
+ for (var ii = 1; ii < argLength; ii++) { | |
+ nextClass = arguments[ii]; | |
+ nextClass && (className += ' ' + nextClass); | |
+ } | |
} | |
+ return className; | |
} | |
- module.exports = getReactRootElementInContainer; | |
- }, | |
- function (module, exports) { | |
- 'use strict'; | |
- var keyMirror = _require(52); | |
- var ReactMultiChildUpdateTypes = keyMirror({ | |
- INSERT_MARKUP: null, | |
- MOVE_EXISTING: null, | |
- REMOVE_NODE: null, | |
- TEXT_CONTENT: null | |
- }); | |
- module.exports = ReactMultiChildUpdateTypes; | |
+ module.exports = joinClasses; | |
}, | |
function (module, exports) { | |
'use strict'; | |
- var invariant = _require(38); | |
- var traverseAllChildren = _require(50); | |
- function flattenSingleChildIntoContext(traverseContext, child, name) { | |
- var result = traverseContext; | |
- 'production' !== 'development' ? invariant(!result.hasOwnProperty(name), 'flattenChildren(...): Encountered two children with the same key, `%s`. ' + 'Children keys must be unique.', name) : invariant(!result.hasOwnProperty(name)); | |
- if (child != null) { | |
- result[name] = child; | |
+ var invariant = _require(45); | |
+ var EventPluginOrder = null; | |
+ var namesToPlugins = {}; | |
+ function recomputePluginOrdering() { | |
+ if (!EventPluginOrder) { | |
+ return; | |
} | |
- } | |
- function flattenChildren(children) { | |
- if (children == null) { | |
- return children; | |
+ for (var pluginName in namesToPlugins) { | |
+ var PluginModule = namesToPlugins[pluginName]; | |
+ var pluginIndex = EventPluginOrder.indexOf(pluginName); | |
+ 'production' !== 'development' ? invariant(pluginIndex > -1, 'EventPluginRegistry: Cannot inject event plugins that do not exist in ' + 'the plugin ordering, `%s`.', pluginName) : invariant(pluginIndex > -1); | |
+ if (EventPluginRegistry.plugins[pluginIndex]) { | |
+ continue; | |
+ } | |
+ 'production' !== 'development' ? invariant(PluginModule.extractEvents, 'EventPluginRegistry: Event plugins must implement an `extractEvents` ' + 'method, but `%s` does not.', pluginName) : invariant(PluginModule.extractEvents); | |
+ EventPluginRegistry.plugins[pluginIndex] = PluginModule; | |
+ var publishedEvents = PluginModule.eventTypes; | |
+ for (var eventName in publishedEvents) { | |
+ 'production' !== 'development' ? invariant(publishEventForPlugin(publishedEvents[eventName], PluginModule, eventName), 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : invariant(publishEventForPlugin(publishedEvents[eventName], PluginModule, eventName)); | |
+ } | |
} | |
- var result = {}; | |
- traverseAllChildren(children, flattenSingleChildIntoContext, result); | |
- return result; | |
} | |
- module.exports = flattenChildren; | |
- }, | |
- function (module, exports) { | |
- function createObjectFrom(keys, values) { | |
- if ('production' !== 'development') { | |
- if (!Array.isArray(keys)) { | |
- throw new TypeError('Must pass an array of keys.'); | |
+ function publishEventForPlugin(dispatchConfig, PluginModule, eventName) { | |
+ 'production' !== 'development' ? invariant(!EventPluginRegistry.eventNameDispatchConfigs[eventName], 'EventPluginHub: More than one plugin attempted to publish the same ' + 'event name, `%s`.', eventName) : invariant(!EventPluginRegistry.eventNameDispatchConfigs[eventName]); | |
+ EventPluginRegistry.eventNameDispatchConfigs[eventName] = dispatchConfig; | |
+ var phasedRegistrationNames = dispatchConfig.phasedRegistrationNames; | |
+ if (phasedRegistrationNames) { | |
+ for (var phaseName in phasedRegistrationNames) { | |
+ if (phasedRegistrationNames.hasOwnProperty(phaseName)) { | |
+ var phasedRegistrationName = phasedRegistrationNames[phaseName]; | |
+ publishRegistrationName(phasedRegistrationName, PluginModule, eventName); | |
+ } | |
} | |
+ return true; | |
+ } else if (dispatchConfig.registrationName) { | |
+ publishRegistrationName(dispatchConfig.registrationName, PluginModule, eventName); | |
+ return true; | |
} | |
- var object = {}; | |
- var isArray = Array.isArray(values); | |
- if (typeof values == 'undefined') { | |
- values = true; | |
- } | |
- for (var ii = keys.length; ii--;) { | |
- object[keys[ii]] = isArray ? values[ii] : values; | |
- } | |
- return object; | |
+ return false; | |
} | |
- module.exports = createObjectFrom; | |
- }, | |
- function (module, exports) { | |
- 'use strict'; | |
- var adler32 = _require(133); | |
- var ReactMarkupChecksum = { | |
- CHECKSUM_ATTR_NAME: 'data-react-checksum', | |
- addChecksumToMarkup: function (markup) { | |
- var checksum = adler32(markup); | |
- return markup.replace('>', ' ' + ReactMarkupChecksum.CHECKSUM_ATTR_NAME + '="' + checksum + '">'); | |
- }, | |
- canReuseMarkup: function (markup, element) { | |
- var existingChecksum = element.getAttribute(ReactMarkupChecksum.CHECKSUM_ATTR_NAME); | |
- existingChecksum = existingChecksum && parseInt(existingChecksum, 10); | |
- var markupChecksum = adler32(markup); | |
- return markupChecksum === existingChecksum; | |
- } | |
- }; | |
- module.exports = ReactMarkupChecksum; | |
- }, | |
- function (module, exports) { | |
- 'use strict'; | |
- var PooledClass = _require(49); | |
- var ReactMountReady = _require(134); | |
- var ReactPutListenerQueue = _require(135); | |
- var Transaction = _require(129); | |
- var emptyFunction = _require(32); | |
- var mixInto = _require(58); | |
- var ON_DOM_READY_QUEUEING = { | |
- initialize: function () { | |
- this.reactMountReady.reset(); | |
- }, | |
- close: emptyFunction | |
- }; | |
- var PUT_LISTENER_QUEUEING = { | |
- initialize: function () { | |
- this.putListenerQueue.reset(); | |
- }, | |
- close: emptyFunction | |
- }; | |
- var TRANSACTION_WRAPPERS = [ | |
- PUT_LISTENER_QUEUEING, | |
- ON_DOM_READY_QUEUEING | |
- ]; | |
- function ReactServerRenderingTransaction(renderToStaticMarkup) { | |
- this.reinitializeTransaction(); | |
- this.renderToStaticMarkup = renderToStaticMarkup; | |
- this.reactMountReady = ReactMountReady.getPooled(null); | |
- this.putListenerQueue = ReactPutListenerQueue.getPooled(); | |
- } | |
- var Mixin = { | |
- getTransactionWrappers: function () { | |
- return TRANSACTION_WRAPPERS; | |
- }, | |
- getReactMountReady: function () { | |
- return this.reactMountReady; | |
- }, | |
- getPutListenerQueue: function () { | |
- return this.putListenerQueue; | |
- }, | |
- destructor: function () { | |
- ReactMountReady.release(this.reactMountReady); | |
- this.reactMountReady = null; | |
- ReactPutListenerQueue.release(this.putListenerQueue); | |
- this.putListenerQueue = null; | |
- } | |
- }; | |
- mixInto(ReactServerRenderingTransaction, Transaction.Mixin); | |
- mixInto(ReactServerRenderingTransaction, Mixin); | |
- PooledClass.addPoolingTo(ReactServerRenderingTransaction); | |
- module.exports = ReactServerRenderingTransaction; | |
- }, | |
- function (module, exports) { | |
- var invariant = _require(38); | |
- var CSSCore = { | |
- addClass: function (element, className) { | |
- 'production' !== 'development' ? invariant(!/\s/.test(className), 'CSSCore.addClass takes only a single class name. "%s" contains ' + 'multiple classes.', className) : invariant(!/\s/.test(className)); | |
- if (className) { | |
- if (element.classList) { | |
- element.classList.add(className); | |
- } else if (!CSSCore.hasClass(element, className)) { | |
- element.className = element.className + ' ' + className; | |
- } | |
- } | |
- return element; | |
- }, | |
- removeClass: function (element, className) { | |
- 'production' !== 'development' ? invariant(!/\s/.test(className), 'CSSCore.removeClass takes only a single class name. "%s" contains ' + 'multiple classes.', className) : invariant(!/\s/.test(className)); | |
- if (className) { | |
- if (element.classList) { | |
- element.classList.remove(className); | |
- } else if (CSSCore.hasClass(element, className)) { | |
- element.className = element.className.replace(new RegExp('(^|\\s)' + className + '(?:\\s|$)', 'g'), '$1').replace(/\s+/g, ' ').replace(/^\s*|\s*$/g, ''); | |
- } | |
- } | |
- return element; | |
- }, | |
- conditionClass: function (element, className, bool) { | |
- return (bool ? CSSCore.addClass : CSSCore.removeClass)(element, className); | |
- }, | |
- hasClass: function (element, className) { | |
- 'production' !== 'development' ? invariant(!/\s/.test(className), 'CSS.hasClass takes only a single class name.') : invariant(!/\s/.test(className)); | |
- if (element.classList) { | |
- return !!className && element.classList.contains(className); | |
- } | |
- return (' ' + element.className + ' ').indexOf(' ' + className + ' ') > -1; | |
- } | |
- }; | |
- module.exports = CSSCore; | |
- }, | |
- function (module, exports) { | |
- 'use strict'; | |
- var ExecutionEnvironment = _require(29); | |
- var EVENT_NAME_MAP = { | |
- transitionend: { | |
- 'transition': 'transitionend', | |
- 'WebkitTransition': 'webkitTransitionEnd', | |
- 'MozTransition': 'mozTransitionEnd', | |
- 'OTransition': 'oTransitionEnd', | |
- 'msTransition': 'MSTransitionEnd' | |
- }, | |
- animationend: { | |
- 'animation': 'animationend', | |
- 'WebkitAnimation': 'webkitAnimationEnd', | |
- 'MozAnimation': 'mozAnimationEnd', | |
- 'OAnimation': 'oAnimationEnd', | |
- 'msAnimation': 'MSAnimationEnd' | |
- } | |
- }; | |
- var endEvents = []; | |
- function detectEvents() { | |
- var testEl = document.createElement('div'); | |
- var style = testEl.style; | |
- for (var baseEventName in EVENT_NAME_MAP) { | |
- var baseEvents = EVENT_NAME_MAP[baseEventName]; | |
- for (var styleName in baseEvents) { | |
- if (styleName in style) { | |
- endEvents.push(baseEvents[styleName]); | |
- break; | |
- } | |
- } | |
- } | |
- } | |
- if (ExecutionEnvironment.canUseDOM) { | |
- detectEvents(); | |
- } | |
- function addEventListener(node, eventName, eventListener) { | |
- node.addEventListener(eventName, eventListener, false); | |
- } | |
- function removeEventListener(node, eventName, eventListener) { | |
- node.removeEventListener(eventName, eventListener, false); | |
- } | |
- var ReactTransitionEvents = { | |
- addEndEventListener: function (node, eventListener) { | |
- if (endEvents.length === 0) { | |
- window.setTimeout(eventListener, 0); | |
- return; | |
- } | |
- endEvents.forEach(function (endEvent) { | |
- addEventListener(node, endEvent, eventListener); | |
- }); | |
- }, | |
- removeEndEventListener: function (node, eventListener) { | |
- if (endEvents.length === 0) { | |
- return; | |
- } | |
- endEvents.forEach(function (endEvent) { | |
- removeEventListener(node, endEvent, eventListener); | |
- }); | |
- } | |
- }; | |
- module.exports = ReactTransitionEvents; | |
- }, | |
- function (module, exports) { | |
- 'use strict'; | |
- function joinClasses(className) { | |
- if (!className) { | |
- className = ''; | |
- } | |
- var nextClass; | |
- var argLength = arguments.length; | |
- if (argLength > 1) { | |
- for (var ii = 1; ii < argLength; ii++) { | |
- nextClass = arguments[ii]; | |
- nextClass && (className += ' ' + nextClass); | |
- } | |
- } | |
- return className; | |
- } | |
- module.exports = joinClasses; | |
- }, | |
- function (module, exports) { | |
- 'use strict'; | |
- var invariant = _require(38); | |
- var EventPluginOrder = null; | |
- var namesToPlugins = {}; | |
- function recomputePluginOrdering() { | |
- if (!EventPluginOrder) { | |
- return; | |
- } | |
- for (var pluginName in namesToPlugins) { | |
- var PluginModule = namesToPlugins[pluginName]; | |
- var pluginIndex = EventPluginOrder.indexOf(pluginName); | |
- 'production' !== 'development' ? invariant(pluginIndex > -1, 'EventPluginRegistry: Cannot inject event plugins that do not exist in ' + 'the plugin ordering, `%s`.', pluginName) : invariant(pluginIndex > -1); | |
- if (EventPluginRegistry.plugins[pluginIndex]) { | |
- continue; | |
- } | |
- 'production' !== 'development' ? invariant(PluginModule.extractEvents, 'EventPluginRegistry: Event plugins must implement an `extractEvents` ' + 'method, but `%s` does not.', pluginName) : invariant(PluginModule.extractEvents); | |
- EventPluginRegistry.plugins[pluginIndex] = PluginModule; | |
- var publishedEvents = PluginModule.eventTypes; | |
- for (var eventName in publishedEvents) { | |
- 'production' !== 'development' ? invariant(publishEventForPlugin(publishedEvents[eventName], PluginModule, eventName), 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : invariant(publishEventForPlugin(publishedEvents[eventName], PluginModule, eventName)); | |
- } | |
- } | |
- } | |
- function publishEventForPlugin(dispatchConfig, PluginModule, eventName) { | |
- 'production' !== 'development' ? invariant(!EventPluginRegistry.eventNameDispatchConfigs[eventName], 'EventPluginHub: More than one plugin attempted to publish the same ' + 'event name, `%s`.', eventName) : invariant(!EventPluginRegistry.eventNameDispatchConfigs[eventName]); | |
- EventPluginRegistry.eventNameDispatchConfigs[eventName] = dispatchConfig; | |
- var phasedRegistrationNames = dispatchConfig.phasedRegistrationNames; | |
- if (phasedRegistrationNames) { | |
- for (var phaseName in phasedRegistrationNames) { | |
- if (phasedRegistrationNames.hasOwnProperty(phaseName)) { | |
- var phasedRegistrationName = phasedRegistrationNames[phaseName]; | |
- publishRegistrationName(phasedRegistrationName, PluginModule, eventName); | |
- } | |
- } | |
- return true; | |
- } else if (dispatchConfig.registrationName) { | |
- publishRegistrationName(dispatchConfig.registrationName, PluginModule, eventName); | |
- return true; | |
- } | |
- return false; | |
- } | |
- function publishRegistrationName(registrationName, PluginModule, eventName) { | |
- 'production' !== 'development' ? invariant(!EventPluginRegistry.registrationNameModules[registrationName], 'EventPluginHub: More than one plugin attempted to publish the same ' + 'registration name, `%s`.', registrationName) : invariant(!EventPluginRegistry.registrationNameModules[registrationName]); | |
- EventPluginRegistry.registrationNameModules[registrationName] = PluginModule; | |
- EventPluginRegistry.registrationNameDependencies[registrationName] = PluginModule.eventTypes[eventName].dependencies; | |
- } | |
- var EventPluginRegistry = { | |
- plugins: [], | |
- eventNameDispatchConfigs: {}, | |
- registrationNameModules: {}, | |
- registrationNameDependencies: {}, | |
- injectEventPluginOrder: function (InjectedEventPluginOrder) { | |
- 'production' !== 'development' ? invariant(!EventPluginOrder, 'EventPluginRegistry: Cannot inject event plugin ordering more than once.') : invariant(!EventPluginOrder); | |
- EventPluginOrder = Array.prototype.slice.call(InjectedEventPluginOrder); | |
- recomputePluginOrdering(); | |
+ function publishRegistrationName(registrationName, PluginModule, eventName) { | |
+ 'production' !== 'development' ? invariant(!EventPluginRegistry.registrationNameModules[registrationName], 'EventPluginHub: More than one plugin attempted to publish the same ' + 'registration name, `%s`.', registrationName) : invariant(!EventPluginRegistry.registrationNameModules[registrationName]); | |
+ EventPluginRegistry.registrationNameModules[registrationName] = PluginModule; | |
+ EventPluginRegistry.registrationNameDependencies[registrationName] = PluginModule.eventTypes[eventName].dependencies; | |
+ } | |
+ var EventPluginRegistry = { | |
+ plugins: [], | |
+ eventNameDispatchConfigs: {}, | |
+ registrationNameModules: {}, | |
+ registrationNameDependencies: {}, | |
+ injectEventPluginOrder: function (InjectedEventPluginOrder) { | |
+ 'production' !== 'development' ? invariant(!EventPluginOrder, 'EventPluginRegistry: Cannot inject event plugin ordering more than once.') : invariant(!EventPluginOrder); | |
+ EventPluginOrder = Array.prototype.slice.call(InjectedEventPluginOrder); | |
+ recomputePluginOrdering(); | |
}, | |
injectEventPluginsByName: function (injectedNamesToPlugins) { | |
var isOrderingDirty = false; | |
for (var pluginName in injectedNamesToPlugins) { | |
if (!injectedNamesToPlugins.hasOwnProperty(pluginName)) { | |
continue; | |
} | |
var PluginModule = injectedNamesToPlugins[pluginName]; | |
@@ -6595,17 +6595,17 @@ | |
} | |
} | |
} | |
}; | |
module.exports = EventPluginRegistry; | |
}, | |
function (module, exports) { | |
'use strict'; | |
- var invariant = _require(38); | |
+ var invariant = _require(45); | |
function accumulate(current, next) { | |
'production' !== 'development' ? invariant(next != null, 'accumulate(...): Accumulated items must be not be null or undefined.') : invariant(next != null); | |
if (current == null) { | |
return next; | |
} else { | |
var currentIsArray = Array.isArray(current); | |
var nextIsArray = Array.isArray(next); | |
if (currentIsArray) { | |
@@ -6632,17 +6632,17 @@ | |
} else if (arr) { | |
cb.call(scope, arr); | |
} | |
}; | |
module.exports = forEachAccumulated; | |
}, | |
function (module, exports) { | |
'use strict'; | |
- var ExecutionEnvironment = _require(29); | |
+ var ExecutionEnvironment = _require(30); | |
var useHasFeature; | |
if (ExecutionEnvironment.canUseDOM) { | |
useHasFeature = document.implementation && document.implementation.hasFeature && document.implementation.hasFeature('', '') !== true; | |
} | |
function isEventSupported(eventNameSuffix, capture) { | |
if (!ExecutionEnvironment.canUseDOM || capture && !('addEventListener' in document)) { | |
return false; | |
} | |
@@ -6695,18 +6695,18 @@ | |
}; | |
} | |
} | |
}; | |
module.exports = EventListener; | |
}, | |
function (module, exports) { | |
'use strict'; | |
- var EventPluginHub = _require(40); | |
- var ReactUpdates = _require(43); | |
+ var EventPluginHub = _require(38); | |
+ var ReactUpdates = _require(41); | |
function runEventQueueInBatch(events) { | |
EventPluginHub.enqueueEvents(events); | |
EventPluginHub.processEventQueue(); | |
} | |
var ReactEventEmitterMixin = { | |
handleTopLevel: function (topLevelType, topLevelTarget, topLevelTargetID, nativeEvent) { | |
var events = EventPluginHub.extractEvents(topLevelType, topLevelTarget, topLevelTargetID, nativeEvent); | |
ReactUpdates.batchedUpdates(runEventQueueInBatch, events); | |
@@ -6733,17 +6733,17 @@ | |
function getEventTarget(nativeEvent) { | |
var target = nativeEvent.target || nativeEvent.srcElement || window; | |
return target.nodeType === 3 ? target.parentNode : target; | |
} | |
module.exports = getEventTarget; | |
}, | |
function (module, exports) { | |
'use strict'; | |
- var invariant = _require(38); | |
+ var invariant = _require(45); | |
var keyMirror = _require(52); | |
var MAX_MERGE_DEPTH = 36; | |
var isTerminal = function (o) { | |
return typeof o !== 'object' || o === null; | |
}; | |
var mergeHelpers = { | |
MAX_MERGE_DEPTH: MAX_MERGE_DEPTH, | |
isTerminal: isTerminal, | |
@@ -6879,541 +6879,108 @@ | |
function (module, exports) { | |
var _uppercasePattern = /([A-Z])/g; | |
function hyphenate(string) { | |
return string.replace(_uppercasePattern, '-$1').toLowerCase(); | |
} | |
module.exports = hyphenate; | |
}, | |
function (module, exports) { | |
- 'use strict'; | |
- var supportedInputTypes = { | |
- 'color': true, | |
- 'date': true, | |
- 'datetime': true, | |
- 'datetime-local': true, | |
- 'email': true, | |
- 'month': true, | |
- 'number': true, | |
- 'password': true, | |
- 'range': true, | |
- 'search': true, | |
- 'tel': true, | |
- 'text': true, | |
- 'time': true, | |
- 'url': true, | |
- 'week': true | |
- }; | |
- function isTextInputElement(elem) { | |
- return elem && (elem.nodeName === 'INPUT' && supportedInputTypes[elem.type] || elem.nodeName === 'TEXTAREA'); | |
+ var isNode = _require(137); | |
+ function isTextNode(object) { | |
+ return isNode(object) && object.nodeType == 3; | |
} | |
- module.exports = isTextInputElement; | |
+ module.exports = isTextNode; | |
}, | |
function (module, exports) { | |
'use strict'; | |
- var ReactDOMSelection = _require(137); | |
- var containsNode = _require(88); | |
- var focusNode = _require(138); | |
- var getActiveElement = _require(120); | |
- function isInDocument(node) { | |
- return containsNode(document.documentElement, node); | |
+ var MOD = 65521; | |
+ function adler32(data) { | |
+ var a = 1; | |
+ var b = 0; | |
+ for (var i = 0; i < data.length; i++) { | |
+ a = (a + data.charCodeAt(i)) % MOD; | |
+ b = (b + a) % MOD; | |
+ } | |
+ return a | b << 16; | |
} | |
- var ReactInputSelection = { | |
- hasSelectionCapabilities: function (elem) { | |
- return elem && (elem.nodeName === 'INPUT' && elem.type === 'text' || elem.nodeName === 'TEXTAREA' || elem.contentEditable === 'true'); | |
- }, | |
- getSelectionInformation: function () { | |
- var focusedElem = getActiveElement(); | |
- return { | |
- focusedElem: focusedElem, | |
- selectionRange: ReactInputSelection.hasSelectionCapabilities(focusedElem) ? ReactInputSelection.getSelection(focusedElem) : null | |
- }; | |
- }, | |
- restoreSelection: function (priorSelectionInformation) { | |
- var curFocusedElem = getActiveElement(); | |
- var priorFocusedElem = priorSelectionInformation.focusedElem; | |
- var priorSelectionRange = priorSelectionInformation.selectionRange; | |
- if (curFocusedElem !== priorFocusedElem && isInDocument(priorFocusedElem)) { | |
- if (ReactInputSelection.hasSelectionCapabilities(priorFocusedElem)) { | |
- ReactInputSelection.setSelection(priorFocusedElem, priorSelectionRange); | |
- } | |
- focusNode(priorFocusedElem); | |
- } | |
- }, | |
- getSelection: function (input) { | |
- var selection; | |
- if ('selectionStart' in input) { | |
- selection = { | |
- start: input.selectionStart, | |
- end: input.selectionEnd | |
- }; | |
- } else if (document.selection && input.nodeName === 'INPUT') { | |
- var range = document.selection.createRange(); | |
- if (range.parentElement() === input) { | |
- selection = { | |
- start: -range.moveStart('character', -input.value.length), | |
- end: -range.moveEnd('character', -input.value.length) | |
- }; | |
- } | |
- } else { | |
- selection = ReactDOMSelection.getOffsets(input); | |
- } | |
- return selection || { | |
- start: 0, | |
- end: 0 | |
- }; | |
- }, | |
- setSelection: function (input, offsets) { | |
- var start = offsets.start; | |
- var end = offsets.end; | |
- if (typeof end === 'undefined') { | |
- end = start; | |
- } | |
- if ('selectionStart' in input) { | |
- input.selectionStart = start; | |
- input.selectionEnd = Math.min(end, input.value.length); | |
- } else if (document.selection && input.nodeName === 'INPUT') { | |
- var range = input.createTextRange(); | |
- range.collapse(true); | |
- range.moveStart('character', start); | |
- range.moveEnd('character', end - start); | |
- range.select(); | |
- } else { | |
- ReactDOMSelection.setOffsets(input, offsets); | |
- } | |
- } | |
- }; | |
- module.exports = ReactInputSelection; | |
- }, | |
- function (module, exports) { | |
- 'use strict'; | |
- var SyntheticEvent = _require(44); | |
- var CompositionEventInterface = { data: null }; | |
- function SyntheticCompositionEvent(dispatchConfig, dispatchMarker, nativeEvent) { | |
- SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent); | |
- } | |
- SyntheticEvent.augmentClass(SyntheticCompositionEvent, CompositionEventInterface); | |
- module.exports = SyntheticCompositionEvent; | |
- }, | |
- function (module, exports) { | |
- 'use strict'; | |
- var ExecutionEnvironment = _require(29); | |
- var contentKey = null; | |
- function getTextContentAccessor() { | |
- if (!contentKey && ExecutionEnvironment.canUseDOM) { | |
- contentKey = 'textContent' in document.createElement('div') ? 'textContent' : 'innerText'; | |
- } | |
- return contentKey; | |
- } | |
- module.exports = getTextContentAccessor; | |
- }, | |
- function (module, exports) { | |
- 'use strict'; | |
- var SyntheticUIEvent = _require(127); | |
- var ViewportMetrics = _require(104); | |
- var MouseEventInterface = { | |
- screenX: null, | |
- screenY: null, | |
- clientX: null, | |
- clientY: null, | |
- ctrlKey: null, | |
- shiftKey: null, | |
- altKey: null, | |
- metaKey: null, | |
- button: function (event) { | |
- var button = event.button; | |
- if ('which' in event) { | |
- return button; | |
- } | |
- return button === 2 ? 2 : button === 4 ? 1 : 0; | |
- }, | |
- buttons: null, | |
- relatedTarget: function (event) { | |
- return event.relatedTarget || (event.fromElement === event.srcElement ? event.toElement : event.fromElement); | |
- }, | |
- pageX: function (event) { | |
- return 'pageX' in event ? event.pageX : event.clientX + ViewportMetrics.currentScrollLeft; | |
- }, | |
- pageY: function (event) { | |
- return 'pageY' in event ? event.pageY : event.clientY + ViewportMetrics.currentScrollTop; | |
- } | |
- }; | |
- function SyntheticMouseEvent(dispatchConfig, dispatchMarker, nativeEvent) { | |
- SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent); | |
- } | |
- SyntheticUIEvent.augmentClass(SyntheticMouseEvent, MouseEventInterface); | |
- module.exports = SyntheticMouseEvent; | |
- }, | |
- function (module, exports) { | |
- 'use strict'; | |
- var CSSPropertyOperations = _require(62); | |
- var DOMChildrenOperations = _require(139); | |
- var DOMPropertyOperations = _require(11); | |
- var ReactMount = _require(22); | |
- var ReactPerf = _require(24); | |
- var invariant = _require(38); | |
- var INVALID_PROPERTY_ERRORS = { | |
- dangerouslySetInnerHTML: '`dangerouslySetInnerHTML` must be set using `updateInnerHTMLByID()`.', | |
- style: '`style` must be set using `updateStylesByID()`.' | |
- }; | |
- var useWhitespaceWorkaround; | |
- var ReactDOMIDOperations = { | |
- updatePropertyByID: ReactPerf.measure('ReactDOMIDOperations', 'updatePropertyByID', function (id, name, value) { | |
- var node = ReactMount.getNode(id); | |
- 'production' !== 'development' ? invariant(!INVALID_PROPERTY_ERRORS.hasOwnProperty(name), 'updatePropertyByID(...): %s', INVALID_PROPERTY_ERRORS[name]) : invariant(!INVALID_PROPERTY_ERRORS.hasOwnProperty(name)); | |
- if (value != null) { | |
- DOMPropertyOperations.setValueForProperty(node, name, value); | |
- } else { | |
- DOMPropertyOperations.deleteValueForProperty(node, name); | |
- } | |
- }), | |
- deletePropertyByID: ReactPerf.measure('ReactDOMIDOperations', 'deletePropertyByID', function (id, name, value) { | |
- var node = ReactMount.getNode(id); | |
- 'production' !== 'development' ? invariant(!INVALID_PROPERTY_ERRORS.hasOwnProperty(name), 'updatePropertyByID(...): %s', INVALID_PROPERTY_ERRORS[name]) : invariant(!INVALID_PROPERTY_ERRORS.hasOwnProperty(name)); | |
- DOMPropertyOperations.deleteValueForProperty(node, name, value); | |
- }), | |
- updateStylesByID: ReactPerf.measure('ReactDOMIDOperations', 'updateStylesByID', function (id, styles) { | |
- var node = ReactMount.getNode(id); | |
- CSSPropertyOperations.setValueForStyles(node, styles); | |
- }), | |
- updateInnerHTMLByID: ReactPerf.measure('ReactDOMIDOperations', 'updateInnerHTMLByID', function (id, html) { | |
- var node = ReactMount.getNode(id); | |
- if (useWhitespaceWorkaround === undefined) { | |
- var temp = document.createElement('div'); | |
- temp.innerHTML = ' '; | |
- useWhitespaceWorkaround = temp.innerHTML === ''; | |
- } | |
- if (useWhitespaceWorkaround) { | |
- node.parentNode.replaceChild(node, node); | |
- } | |
- if (useWhitespaceWorkaround && html.match(/^[ \r\n\t\f]/)) { | |
- node.innerHTML = '\uFEFF' + html; | |
- node.firstChild.deleteData(0, 1); | |
- } else { | |
- node.innerHTML = html; | |
- } | |
- }), | |
- updateTextContentByID: ReactPerf.measure('ReactDOMIDOperations', 'updateTextContentByID', function (id, content) { | |
- var node = ReactMount.getNode(id); | |
- DOMChildrenOperations.updateTextContent(node, content); | |
- }), | |
- dangerouslyReplaceNodeWithMarkupByID: ReactPerf.measure('ReactDOMIDOperations', 'dangerouslyReplaceNodeWithMarkupByID', function (id, markup) { | |
- var node = ReactMount.getNode(id); | |
- DOMChildrenOperations.dangerouslyReplaceNodeWithMarkup(node, markup); | |
- }), | |
- dangerouslyProcessChildrenUpdates: ReactPerf.measure('ReactDOMIDOperations', 'dangerouslyProcessChildrenUpdates', function (updates, markup) { | |
- for (var i = 0; i < updates.length; i++) { | |
- updates[i].parentNode = ReactMount.getNode(updates[i].parentID); | |
- } | |
- DOMChildrenOperations.processUpdates(updates, markup); | |
- }) | |
- }; | |
- module.exports = ReactDOMIDOperations; | |
+ module.exports = adler32; | |
}, | |
function (module, exports) { | |
'use strict'; | |
var PooledClass = _require(49); | |
- var ReactEventEmitter = _require(42); | |
- var ReactInputSelection = _require(112); | |
- var ReactMountReady = _require(134); | |
- var ReactPutListenerQueue = _require(135); | |
- var Transaction = _require(129); | |
var mixInto = _require(58); | |
- var SELECTION_RESTORATION = { | |
- initialize: ReactInputSelection.getSelectionInformation, | |
- close: ReactInputSelection.restoreSelection | |
- }; | |
- var EVENT_SUPPRESSION = { | |
- initialize: function () { | |
- var currentlyEnabled = ReactEventEmitter.isEnabled(); | |
- ReactEventEmitter.setEnabled(false); | |
- return currentlyEnabled; | |
- }, | |
- close: function (previouslyEnabled) { | |
- ReactEventEmitter.setEnabled(previouslyEnabled); | |
- } | |
- }; | |
- var ON_DOM_READY_QUEUEING = { | |
- initialize: function () { | |
- this.reactMountReady.reset(); | |
- }, | |
- close: function () { | |
- this.reactMountReady.notifyAll(); | |
- } | |
- }; | |
- var PUT_LISTENER_QUEUEING = { | |
- initialize: function () { | |
- this.putListenerQueue.reset(); | |
- }, | |
- close: function () { | |
- this.putListenerQueue.putListeners(); | |
- } | |
- }; | |
- var TRANSACTION_WRAPPERS = [ | |
- PUT_LISTENER_QUEUEING, | |
- SELECTION_RESTORATION, | |
- EVENT_SUPPRESSION, | |
- ON_DOM_READY_QUEUEING | |
- ]; | |
- function ReactReconcileTransaction() { | |
- this.reinitializeTransaction(); | |
- this.renderToStaticMarkup = false; | |
- this.reactMountReady = ReactMountReady.getPooled(null); | |
- this.putListenerQueue = ReactPutListenerQueue.getPooled(); | |
- } | |
- var Mixin = { | |
- getTransactionWrappers: function () { | |
- return TRANSACTION_WRAPPERS; | |
- }, | |
- getReactMountReady: function () { | |
- return this.reactMountReady; | |
- }, | |
- getPutListenerQueue: function () { | |
- return this.putListenerQueue; | |
- }, | |
- destructor: function () { | |
- ReactMountReady.release(this.reactMountReady); | |
- this.reactMountReady = null; | |
- ReactPutListenerQueue.release(this.putListenerQueue); | |
- this.putListenerQueue = null; | |
- } | |
- }; | |
- mixInto(ReactReconcileTransaction, Transaction.Mixin); | |
- mixInto(ReactReconcileTransaction, Mixin); | |
- PooledClass.addPoolingTo(ReactReconcileTransaction); | |
- module.exports = ReactReconcileTransaction; | |
- }, | |
- function (module, exports) { | |
- 'use strict'; | |
- var focusNode = _require(138); | |
- var AutoFocusMixin = { | |
- componentDidMount: function () { | |
- if (this.props.autoFocus) { | |
- focusNode(this.getDOMNode()); | |
- } | |
- } | |
- }; | |
- module.exports = AutoFocusMixin; | |
- }, | |
- function (module, exports) { | |
- 'use strict'; | |
- var ReactPropTypes = _require(25); | |
- var invariant = _require(38); | |
- var warning = _require(36); | |
- var hasReadOnlyValue = { | |
- 'button': true, | |
- 'checkbox': true, | |
- 'image': true, | |
- 'hidden': true, | |
- 'radio': true, | |
- 'reset': true, | |
- 'submit': true | |
- }; | |
- function _assertSingleLink(input) { | |
- 'production' !== 'development' ? invariant(input.props.checkedLink == null || input.props.valueLink == null, 'Cannot provide a checkedLink and a valueLink. If you want to use ' + 'checkedLink, you probably don\'t want to use valueLink and vice versa.') : invariant(input.props.checkedLink == null || input.props.valueLink == null); | |
- } | |
- function _assertValueLink(input) { | |
- _assertSingleLink(input); | |
- 'production' !== 'development' ? invariant(input.props.value == null && input.props.onChange == null, 'Cannot provide a valueLink and a value or onChange event. If you want ' + 'to use value or onChange, you probably don\'t want to use valueLink.') : invariant(input.props.value == null && input.props.onChange == null); | |
- } | |
- function _assertCheckedLink(input) { | |
- _assertSingleLink(input); | |
- 'production' !== 'development' ? invariant(input.props.checked == null && input.props.onChange == null, 'Cannot provide a checkedLink and a checked property or onChange event. ' + 'If you want to use checked or onChange, you probably don\'t want to ' + 'use checkedLink') : invariant(input.props.checked == null && input.props.onChange == null); | |
- } | |
- function _handleLinkedValueChange(e) { | |
- this.props.valueLink.requestChange(e.target.value); | |
- } | |
- function _handleLinkedCheckChange(e) { | |
- this.props.checkedLink.requestChange(e.target.checked); | |
+ function ReactMountReady(initialCollection) { | |
+ this._queue = initialCollection || null; | |
} | |
- var LinkedValueUtils = { | |
- Mixin: { | |
- propTypes: { | |
- value: function (props, propName, componentName) { | |
- if ('production' !== 'development') { | |
- 'production' !== 'development' ? warning(!props[propName] || hasReadOnlyValue[props.type] || props.onChange || props.readOnly || props.disabled, 'You provided a `value` prop to a form field without an ' + '`onChange` handler. This will render a read-only field. If ' + 'the field should be mutable use `defaultValue`. Otherwise, ' + 'set either `onChange` or `readOnly`.') : null; | |
- } | |
- }, | |
- checked: function (props, propName, componentName) { | |
- if ('production' !== 'development') { | |
- 'production' !== 'development' ? warning(!props[propName] || props.onChange || props.readOnly || props.disabled, 'You provided a `checked` prop to a form field without an ' + '`onChange` handler. This will render a read-only field. If ' + 'the field should be mutable use `defaultChecked`. Otherwise, ' + 'set either `onChange` or `readOnly`.') : null; | |
- } | |
- }, | |
- onChange: ReactPropTypes.func | |
- } | |
- }, | |
- getValue: function (input) { | |
- if (input.props.valueLink) { | |
- _assertValueLink(input); | |
- return input.props.valueLink.value; | |
- } | |
- return input.props.value; | |
- }, | |
- getChecked: function (input) { | |
- if (input.props.checkedLink) { | |
- _assertCheckedLink(input); | |
- return input.props.checkedLink.value; | |
- } | |
- return input.props.checked; | |
- }, | |
- getOnChange: function (input) { | |
- if (input.props.valueLink) { | |
- _assertValueLink(input); | |
- return _handleLinkedValueChange; | |
- } else if (input.props.checkedLink) { | |
- _assertCheckedLink(input); | |
- return _handleLinkedCheckChange; | |
+ mixInto(ReactMountReady, { | |
+ enqueue: function (component, callback) { | |
+ this._queue = this._queue || []; | |
+ this._queue.push({ | |
+ component: component, | |
+ callback: callback | |
+ }); | |
+ }, | |
+ notifyAll: function () { | |
+ var queue = this._queue; | |
+ if (queue) { | |
+ this._queue = null; | |
+ for (var i = 0, l = queue.length; i < l; i++) { | |
+ var component = queue[i].component; | |
+ var callback = queue[i].callback; | |
+ callback.call(component); | |
} | |
- return input.props.onChange; | |
- } | |
- }; | |
- module.exports = LinkedValueUtils; | |
- }, | |
- function (module, exports) { | |
- function getActiveElement() { | |
- try { | |
- return document.activeElement || document.body; | |
- } catch (e) { | |
- return document.body; | |
- } | |
- } | |
- module.exports = getActiveElement; | |
- }, | |
- function (module, exports) { | |
- 'use strict'; | |
- function shallowEqual(objA, objB) { | |
- if (objA === objB) { | |
- return true; | |
- } | |
- var key; | |
- for (key in objA) { | |
- if (objA.hasOwnProperty(key) && (!objB.hasOwnProperty(key) || objA[key] !== objB[key])) { | |
- return false; | |
- } | |
- } | |
- for (key in objB) { | |
- if (objB.hasOwnProperty(key) && !objA.hasOwnProperty(key)) { | |
- return false; | |
+ queue.length = 0; | |
} | |
+ }, | |
+ reset: function () { | |
+ this._queue = null; | |
+ }, | |
+ destructor: function () { | |
+ this.reset(); | |
} | |
- return true; | |
- } | |
- module.exports = shallowEqual; | |
- }, | |
- function (module, exports) { | |
- 'use strict'; | |
- var SyntheticEvent = _require(44); | |
- var ClipboardEventInterface = { | |
- clipboardData: function (event) { | |
- return 'clipboardData' in event ? event.clipboardData : window.clipboardData; | |
- } | |
- }; | |
- function SyntheticClipboardEvent(dispatchConfig, dispatchMarker, nativeEvent) { | |
- SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent); | |
- } | |
- SyntheticEvent.augmentClass(SyntheticClipboardEvent, ClipboardEventInterface); | |
- module.exports = SyntheticClipboardEvent; | |
- }, | |
- function (module, exports) { | |
- 'use strict'; | |
- var SyntheticUIEvent = _require(127); | |
- var FocusEventInterface = { relatedTarget: null }; | |
- function SyntheticFocusEvent(dispatchConfig, dispatchMarker, nativeEvent) { | |
- SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent); | |
- } | |
- SyntheticUIEvent.augmentClass(SyntheticFocusEvent, FocusEventInterface); | |
- module.exports = SyntheticFocusEvent; | |
- }, | |
- function (module, exports) { | |
- 'use strict'; | |
- var SyntheticUIEvent = _require(127); | |
- var getEventKey = _require(140); | |
- var KeyboardEventInterface = { | |
- key: getEventKey, | |
- location: null, | |
- ctrlKey: null, | |
- shiftKey: null, | |
- altKey: null, | |
- metaKey: null, | |
- repeat: null, | |
- locale: null, | |
- 'char': null, | |
- charCode: null, | |
- keyCode: null, | |
- which: null | |
- }; | |
- function SyntheticKeyboardEvent(dispatchConfig, dispatchMarker, nativeEvent) { | |
- SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent); | |
- } | |
- SyntheticUIEvent.augmentClass(SyntheticKeyboardEvent, KeyboardEventInterface); | |
- module.exports = SyntheticKeyboardEvent; | |
- }, | |
- function (module, exports) { | |
- 'use strict'; | |
- var SyntheticMouseEvent = _require(115); | |
- var DragEventInterface = { dataTransfer: null }; | |
- function SyntheticDragEvent(dispatchConfig, dispatchMarker, nativeEvent) { | |
- SyntheticMouseEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent); | |
- } | |
- SyntheticMouseEvent.augmentClass(SyntheticDragEvent, DragEventInterface); | |
- module.exports = SyntheticDragEvent; | |
- }, | |
- function (module, exports) { | |
- 'use strict'; | |
- var SyntheticUIEvent = _require(127); | |
- var TouchEventInterface = { | |
- touches: null, | |
- targetTouches: null, | |
- changedTouches: null, | |
- altKey: null, | |
- metaKey: null, | |
- ctrlKey: null, | |
- shiftKey: null | |
- }; | |
- function SyntheticTouchEvent(dispatchConfig, dispatchMarker, nativeEvent) { | |
- SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent); | |
- } | |
- SyntheticUIEvent.augmentClass(SyntheticTouchEvent, TouchEventInterface); | |
- module.exports = SyntheticTouchEvent; | |
- }, | |
- function (module, exports) { | |
- 'use strict'; | |
- var SyntheticEvent = _require(44); | |
- var UIEventInterface = { | |
- view: null, | |
- detail: null | |
- }; | |
- function SyntheticUIEvent(dispatchConfig, dispatchMarker, nativeEvent) { | |
- SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent); | |
- } | |
- SyntheticEvent.augmentClass(SyntheticUIEvent, UIEventInterface); | |
- module.exports = SyntheticUIEvent; | |
+ }); | |
+ PooledClass.addPoolingTo(ReactMountReady); | |
+ module.exports = ReactMountReady; | |
}, | |
function (module, exports) { | |
'use strict'; | |
- var SyntheticMouseEvent = _require(115); | |
- var WheelEventInterface = { | |
- deltaX: function (event) { | |
- return 'deltaX' in event ? event.deltaX : 'wheelDeltaX' in event ? -event.wheelDeltaX : 0; | |
- }, | |
- deltaY: function (event) { | |
- return 'deltaY' in event ? event.deltaY : 'wheelDeltaY' in event ? -event.wheelDeltaY : 'wheelDelta' in event ? -event.wheelDelta : 0; | |
- }, | |
- deltaZ: null, | |
- deltaMode: null | |
- }; | |
- function SyntheticWheelEvent(dispatchConfig, dispatchMarker, nativeEvent) { | |
- SyntheticMouseEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent); | |
+ var PooledClass = _require(49); | |
+ var ReactEventEmitter = _require(40); | |
+ var mixInto = _require(58); | |
+ function ReactPutListenerQueue() { | |
+ this.listenersToPut = []; | |
} | |
- SyntheticMouseEvent.augmentClass(SyntheticWheelEvent, WheelEventInterface); | |
- module.exports = SyntheticWheelEvent; | |
+ mixInto(ReactPutListenerQueue, { | |
+ enqueuePutListener: function (rootNodeID, propKey, propValue) { | |
+ this.listenersToPut.push({ | |
+ rootNodeID: rootNodeID, | |
+ propKey: propKey, | |
+ propValue: propValue | |
+ }); | |
+ }, | |
+ putListeners: function () { | |
+ for (var i = 0; i < this.listenersToPut.length; i++) { | |
+ var listenerToPut = this.listenersToPut[i]; | |
+ ReactEventEmitter.putListener(listenerToPut.rootNodeID, listenerToPut.propKey, listenerToPut.propValue); | |
+ } | |
+ }, | |
+ reset: function () { | |
+ this.listenersToPut.length = 0; | |
+ }, | |
+ destructor: function () { | |
+ this.reset(); | |
+ } | |
+ }); | |
+ PooledClass.addPoolingTo(ReactPutListenerQueue); | |
+ module.exports = ReactPutListenerQueue; | |
}, | |
function (module, exports) { | |
'use strict'; | |
- var invariant = _require(38); | |
+ var invariant = _require(45); | |
var Mixin = { | |
reinitializeTransaction: function () { | |
this.transactionWrappers = this.getTransactionWrappers(); | |
if (!this.wrapperInitData) { | |
this.wrapperInitData = []; | |
} else { | |
this.wrapperInitData.length = 0; | |
} | |
@@ -7514,21 +7081,383 @@ | |
} catch (e) { | |
} | |
} | |
} | |
} | |
this.wrapperInitData.length = 0; | |
} | |
}; | |
- var Transaction = { | |
- Mixin: Mixin, | |
- OBSERVED_ERROR: {} | |
+ var Transaction = { | |
+ Mixin: Mixin, | |
+ OBSERVED_ERROR: {} | |
+ }; | |
+ module.exports = Transaction; | |
+ }, | |
+ function (module, exports) { | |
+ 'use strict'; | |
+ var supportedInputTypes = { | |
+ 'color': true, | |
+ 'date': true, | |
+ 'datetime': true, | |
+ 'datetime-local': true, | |
+ 'email': true, | |
+ 'month': true, | |
+ 'number': true, | |
+ 'password': true, | |
+ 'range': true, | |
+ 'search': true, | |
+ 'tel': true, | |
+ 'text': true, | |
+ 'time': true, | |
+ 'url': true, | |
+ 'week': true | |
+ }; | |
+ function isTextInputElement(elem) { | |
+ return elem && (elem.nodeName === 'INPUT' && supportedInputTypes[elem.type] || elem.nodeName === 'TEXTAREA'); | |
+ } | |
+ module.exports = isTextInputElement; | |
+ }, | |
+ function (module, exports) { | |
+ 'use strict'; | |
+ var SyntheticUIEvent = _require(128); | |
+ var ViewportMetrics = _require(104); | |
+ var MouseEventInterface = { | |
+ screenX: null, | |
+ screenY: null, | |
+ clientX: null, | |
+ clientY: null, | |
+ ctrlKey: null, | |
+ shiftKey: null, | |
+ altKey: null, | |
+ metaKey: null, | |
+ button: function (event) { | |
+ var button = event.button; | |
+ if ('which' in event) { | |
+ return button; | |
+ } | |
+ return button === 2 ? 2 : button === 4 ? 1 : 0; | |
+ }, | |
+ buttons: null, | |
+ relatedTarget: function (event) { | |
+ return event.relatedTarget || (event.fromElement === event.srcElement ? event.toElement : event.fromElement); | |
+ }, | |
+ pageX: function (event) { | |
+ return 'pageX' in event ? event.pageX : event.clientX + ViewportMetrics.currentScrollLeft; | |
+ }, | |
+ pageY: function (event) { | |
+ return 'pageY' in event ? event.pageY : event.clientY + ViewportMetrics.currentScrollTop; | |
+ } | |
+ }; | |
+ function SyntheticMouseEvent(dispatchConfig, dispatchMarker, nativeEvent) { | |
+ SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent); | |
+ } | |
+ SyntheticUIEvent.augmentClass(SyntheticMouseEvent, MouseEventInterface); | |
+ module.exports = SyntheticMouseEvent; | |
+ }, | |
+ function (module, exports) { | |
+ 'use strict'; | |
+ var focusNode = _require(138); | |
+ var AutoFocusMixin = { | |
+ componentDidMount: function () { | |
+ if (this.props.autoFocus) { | |
+ focusNode(this.getDOMNode()); | |
+ } | |
+ } | |
+ }; | |
+ module.exports = AutoFocusMixin; | |
+ }, | |
+ function (module, exports) { | |
+ 'use strict'; | |
+ var ReactPropTypes = _require(26); | |
+ var invariant = _require(45); | |
+ var warning = _require(36); | |
+ var hasReadOnlyValue = { | |
+ 'button': true, | |
+ 'checkbox': true, | |
+ 'image': true, | |
+ 'hidden': true, | |
+ 'radio': true, | |
+ 'reset': true, | |
+ 'submit': true | |
+ }; | |
+ function _assertSingleLink(input) { | |
+ 'production' !== 'development' ? invariant(input.props.checkedLink == null || input.props.valueLink == null, 'Cannot provide a checkedLink and a valueLink. If you want to use ' + 'checkedLink, you probably don\'t want to use valueLink and vice versa.') : invariant(input.props.checkedLink == null || input.props.valueLink == null); | |
+ } | |
+ function _assertValueLink(input) { | |
+ _assertSingleLink(input); | |
+ 'production' !== 'development' ? invariant(input.props.value == null && input.props.onChange == null, 'Cannot provide a valueLink and a value or onChange event. If you want ' + 'to use value or onChange, you probably don\'t want to use valueLink.') : invariant(input.props.value == null && input.props.onChange == null); | |
+ } | |
+ function _assertCheckedLink(input) { | |
+ _assertSingleLink(input); | |
+ 'production' !== 'development' ? invariant(input.props.checked == null && input.props.onChange == null, 'Cannot provide a checkedLink and a checked property or onChange event. ' + 'If you want to use checked or onChange, you probably don\'t want to ' + 'use checkedLink') : invariant(input.props.checked == null && input.props.onChange == null); | |
+ } | |
+ function _handleLinkedValueChange(e) { | |
+ this.props.valueLink.requestChange(e.target.value); | |
+ } | |
+ function _handleLinkedCheckChange(e) { | |
+ this.props.checkedLink.requestChange(e.target.checked); | |
+ } | |
+ var LinkedValueUtils = { | |
+ Mixin: { | |
+ propTypes: { | |
+ value: function (props, propName, componentName) { | |
+ if ('production' !== 'development') { | |
+ 'production' !== 'development' ? warning(!props[propName] || hasReadOnlyValue[props.type] || props.onChange || props.readOnly || props.disabled, 'You provided a `value` prop to a form field without an ' + '`onChange` handler. This will render a read-only field. If ' + 'the field should be mutable use `defaultValue`. Otherwise, ' + 'set either `onChange` or `readOnly`.') : null; | |
+ } | |
+ }, | |
+ checked: function (props, propName, componentName) { | |
+ if ('production' !== 'development') { | |
+ 'production' !== 'development' ? warning(!props[propName] || props.onChange || props.readOnly || props.disabled, 'You provided a `checked` prop to a form field without an ' + '`onChange` handler. This will render a read-only field. If ' + 'the field should be mutable use `defaultChecked`. Otherwise, ' + 'set either `onChange` or `readOnly`.') : null; | |
+ } | |
+ }, | |
+ onChange: ReactPropTypes.func | |
+ } | |
+ }, | |
+ getValue: function (input) { | |
+ if (input.props.valueLink) { | |
+ _assertValueLink(input); | |
+ return input.props.valueLink.value; | |
+ } | |
+ return input.props.value; | |
+ }, | |
+ getChecked: function (input) { | |
+ if (input.props.checkedLink) { | |
+ _assertCheckedLink(input); | |
+ return input.props.checkedLink.value; | |
+ } | |
+ return input.props.checked; | |
+ }, | |
+ getOnChange: function (input) { | |
+ if (input.props.valueLink) { | |
+ _assertValueLink(input); | |
+ return _handleLinkedValueChange; | |
+ } else if (input.props.checkedLink) { | |
+ _assertCheckedLink(input); | |
+ return _handleLinkedCheckChange; | |
+ } | |
+ return input.props.onChange; | |
+ } | |
+ }; | |
+ module.exports = LinkedValueUtils; | |
+ }, | |
+ function (module, exports) { | |
+ 'use strict'; | |
+ var ReactDOMSelection = _require(139); | |
+ var containsNode = _require(70); | |
+ var focusNode = _require(138); | |
+ var getActiveElement = _require(121); | |
+ function isInDocument(node) { | |
+ return containsNode(document.documentElement, node); | |
+ } | |
+ var ReactInputSelection = { | |
+ hasSelectionCapabilities: function (elem) { | |
+ return elem && (elem.nodeName === 'INPUT' && elem.type === 'text' || elem.nodeName === 'TEXTAREA' || elem.contentEditable === 'true'); | |
+ }, | |
+ getSelectionInformation: function () { | |
+ var focusedElem = getActiveElement(); | |
+ return { | |
+ focusedElem: focusedElem, | |
+ selectionRange: ReactInputSelection.hasSelectionCapabilities(focusedElem) ? ReactInputSelection.getSelection(focusedElem) : null | |
+ }; | |
+ }, | |
+ restoreSelection: function (priorSelectionInformation) { | |
+ var curFocusedElem = getActiveElement(); | |
+ var priorFocusedElem = priorSelectionInformation.focusedElem; | |
+ var priorSelectionRange = priorSelectionInformation.selectionRange; | |
+ if (curFocusedElem !== priorFocusedElem && isInDocument(priorFocusedElem)) { | |
+ if (ReactInputSelection.hasSelectionCapabilities(priorFocusedElem)) { | |
+ ReactInputSelection.setSelection(priorFocusedElem, priorSelectionRange); | |
+ } | |
+ focusNode(priorFocusedElem); | |
+ } | |
+ }, | |
+ getSelection: function (input) { | |
+ var selection; | |
+ if ('selectionStart' in input) { | |
+ selection = { | |
+ start: input.selectionStart, | |
+ end: input.selectionEnd | |
+ }; | |
+ } else if (document.selection && input.nodeName === 'INPUT') { | |
+ var range = document.selection.createRange(); | |
+ if (range.parentElement() === input) { | |
+ selection = { | |
+ start: -range.moveStart('character', -input.value.length), | |
+ end: -range.moveEnd('character', -input.value.length) | |
+ }; | |
+ } | |
+ } else { | |
+ selection = ReactDOMSelection.getOffsets(input); | |
+ } | |
+ return selection || { | |
+ start: 0, | |
+ end: 0 | |
+ }; | |
+ }, | |
+ setSelection: function (input, offsets) { | |
+ var start = offsets.start; | |
+ var end = offsets.end; | |
+ if (typeof end === 'undefined') { | |
+ end = start; | |
+ } | |
+ if ('selectionStart' in input) { | |
+ input.selectionStart = start; | |
+ input.selectionEnd = Math.min(end, input.value.length); | |
+ } else if (document.selection && input.nodeName === 'INPUT') { | |
+ var range = input.createTextRange(); | |
+ range.collapse(true); | |
+ range.moveStart('character', start); | |
+ range.moveEnd('character', end - start); | |
+ range.select(); | |
+ } else { | |
+ ReactDOMSelection.setOffsets(input, offsets); | |
+ } | |
+ } | |
+ }; | |
+ module.exports = ReactInputSelection; | |
+ }, | |
+ function (module, exports) { | |
+ function getActiveElement() { | |
+ try { | |
+ return document.activeElement || document.body; | |
+ } catch (e) { | |
+ return document.body; | |
+ } | |
+ } | |
+ module.exports = getActiveElement; | |
+ }, | |
+ function (module, exports) { | |
+ 'use strict'; | |
+ function shallowEqual(objA, objB) { | |
+ if (objA === objB) { | |
+ return true; | |
+ } | |
+ var key; | |
+ for (key in objA) { | |
+ if (objA.hasOwnProperty(key) && (!objB.hasOwnProperty(key) || objA[key] !== objB[key])) { | |
+ return false; | |
+ } | |
+ } | |
+ for (key in objB) { | |
+ if (objB.hasOwnProperty(key) && !objA.hasOwnProperty(key)) { | |
+ return false; | |
+ } | |
+ } | |
+ return true; | |
+ } | |
+ module.exports = shallowEqual; | |
+ }, | |
+ function (module, exports) { | |
+ 'use strict'; | |
+ var SyntheticEvent = _require(42); | |
+ var ClipboardEventInterface = { | |
+ clipboardData: function (event) { | |
+ return 'clipboardData' in event ? event.clipboardData : window.clipboardData; | |
+ } | |
+ }; | |
+ function SyntheticClipboardEvent(dispatchConfig, dispatchMarker, nativeEvent) { | |
+ SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent); | |
+ } | |
+ SyntheticEvent.augmentClass(SyntheticClipboardEvent, ClipboardEventInterface); | |
+ module.exports = SyntheticClipboardEvent; | |
+ }, | |
+ function (module, exports) { | |
+ 'use strict'; | |
+ var SyntheticUIEvent = _require(128); | |
+ var FocusEventInterface = { relatedTarget: null }; | |
+ function SyntheticFocusEvent(dispatchConfig, dispatchMarker, nativeEvent) { | |
+ SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent); | |
+ } | |
+ SyntheticUIEvent.augmentClass(SyntheticFocusEvent, FocusEventInterface); | |
+ module.exports = SyntheticFocusEvent; | |
+ }, | |
+ function (module, exports) { | |
+ 'use strict'; | |
+ var SyntheticUIEvent = _require(128); | |
+ var getEventKey = _require(140); | |
+ var KeyboardEventInterface = { | |
+ key: getEventKey, | |
+ location: null, | |
+ ctrlKey: null, | |
+ shiftKey: null, | |
+ altKey: null, | |
+ metaKey: null, | |
+ repeat: null, | |
+ locale: null, | |
+ 'char': null, | |
+ charCode: null, | |
+ keyCode: null, | |
+ which: null | |
}; | |
- module.exports = Transaction; | |
+ function SyntheticKeyboardEvent(dispatchConfig, dispatchMarker, nativeEvent) { | |
+ SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent); | |
+ } | |
+ SyntheticUIEvent.augmentClass(SyntheticKeyboardEvent, KeyboardEventInterface); | |
+ module.exports = SyntheticKeyboardEvent; | |
+ }, | |
+ function (module, exports) { | |
+ 'use strict'; | |
+ var SyntheticMouseEvent = _require(117); | |
+ var DragEventInterface = { dataTransfer: null }; | |
+ function SyntheticDragEvent(dispatchConfig, dispatchMarker, nativeEvent) { | |
+ SyntheticMouseEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent); | |
+ } | |
+ SyntheticMouseEvent.augmentClass(SyntheticDragEvent, DragEventInterface); | |
+ module.exports = SyntheticDragEvent; | |
+ }, | |
+ function (module, exports) { | |
+ 'use strict'; | |
+ var SyntheticUIEvent = _require(128); | |
+ var TouchEventInterface = { | |
+ touches: null, | |
+ targetTouches: null, | |
+ changedTouches: null, | |
+ altKey: null, | |
+ metaKey: null, | |
+ ctrlKey: null, | |
+ shiftKey: null | |
+ }; | |
+ function SyntheticTouchEvent(dispatchConfig, dispatchMarker, nativeEvent) { | |
+ SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent); | |
+ } | |
+ SyntheticUIEvent.augmentClass(SyntheticTouchEvent, TouchEventInterface); | |
+ module.exports = SyntheticTouchEvent; | |
+ }, | |
+ function (module, exports) { | |
+ 'use strict'; | |
+ var SyntheticEvent = _require(42); | |
+ var UIEventInterface = { | |
+ view: null, | |
+ detail: null | |
+ }; | |
+ function SyntheticUIEvent(dispatchConfig, dispatchMarker, nativeEvent) { | |
+ SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent); | |
+ } | |
+ SyntheticEvent.augmentClass(SyntheticUIEvent, UIEventInterface); | |
+ module.exports = SyntheticUIEvent; | |
+ }, | |
+ function (module, exports) { | |
+ 'use strict'; | |
+ var SyntheticMouseEvent = _require(117); | |
+ var WheelEventInterface = { | |
+ deltaX: function (event) { | |
+ return 'deltaX' in event ? event.deltaX : 'wheelDeltaX' in event ? -event.wheelDeltaX : 0; | |
+ }, | |
+ deltaY: function (event) { | |
+ return 'deltaY' in event ? event.deltaY : 'wheelDeltaY' in event ? -event.wheelDeltaY : 'wheelDelta' in event ? -event.wheelDelta : 0; | |
+ }, | |
+ deltaZ: null, | |
+ deltaMode: null | |
+ }; | |
+ function SyntheticWheelEvent(dispatchConfig, dispatchMarker, nativeEvent) { | |
+ SyntheticMouseEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent); | |
+ } | |
+ SyntheticMouseEvent.augmentClass(SyntheticWheelEvent, WheelEventInterface); | |
+ module.exports = SyntheticWheelEvent; | |
}, | |
function (module, exports) { | |
var merge = _require(33); | |
var DONT_CARE_THRESHOLD = 1.2; | |
var DOM_OPERATION_TYPES = { | |
'mountImageIntoNode': 'set innerHTML', | |
INSERT_MARKUP: 'set innerHTML', | |
MOVE_EXISTING: 'move', | |
@@ -7651,129 +7580,200 @@ | |
if (dirtyLeafIDs[i].indexOf(id) === 0) { | |
isDirty = true; | |
break; | |
} | |
} | |
if (!isDirty && measurement.counts[id] > 0) { | |
cleanComponents[id] = true; | |
} | |
- } | |
- return cleanComponents; | |
- } | |
- var ReactDefaultPerfAnalysis = { | |
- getExclusiveSummary: getExclusiveSummary, | |
- getInclusiveSummary: getInclusiveSummary, | |
- getDOMSummary: getDOMSummary, | |
- getTotalTime: getTotalTime | |
+ } | |
+ return cleanComponents; | |
+ } | |
+ var ReactDefaultPerfAnalysis = { | |
+ getExclusiveSummary: getExclusiveSummary, | |
+ getInclusiveSummary: getInclusiveSummary, | |
+ getDOMSummary: getDOMSummary, | |
+ getTotalTime: getTotalTime | |
+ }; | |
+ module.exports = ReactDefaultPerfAnalysis; | |
+ }, | |
+ function (module, exports) { | |
+ 'use strict'; | |
+ var ExecutionEnvironment = _require(30); | |
+ var performance = null; | |
+ if (ExecutionEnvironment.canUseDOM) { | |
+ performance = window.performance || window.webkitPerformance; | |
+ } | |
+ if (!performance || !performance.now) { | |
+ performance = Date; | |
+ } | |
+ var performanceNow = performance.now.bind(performance); | |
+ module.exports = performanceNow; | |
+ }, | |
+ function (module, exports) { | |
+ 'use strict'; | |
+ var CSSPropertyOperations = _require(68); | |
+ var DOMChildrenOperations = _require(141); | |
+ var DOMPropertyOperations = _require(12); | |
+ var ReactMount = _require(23); | |
+ var ReactPerf = _require(25); | |
+ var invariant = _require(45); | |
+ var INVALID_PROPERTY_ERRORS = { | |
+ dangerouslySetInnerHTML: '`dangerouslySetInnerHTML` must be set using `updateInnerHTMLByID()`.', | |
+ style: '`style` must be set using `updateStylesByID()`.' | |
+ }; | |
+ var useWhitespaceWorkaround; | |
+ var ReactDOMIDOperations = { | |
+ updatePropertyByID: ReactPerf.measure('ReactDOMIDOperations', 'updatePropertyByID', function (id, name, value) { | |
+ var node = ReactMount.getNode(id); | |
+ 'production' !== 'development' ? invariant(!INVALID_PROPERTY_ERRORS.hasOwnProperty(name), 'updatePropertyByID(...): %s', INVALID_PROPERTY_ERRORS[name]) : invariant(!INVALID_PROPERTY_ERRORS.hasOwnProperty(name)); | |
+ if (value != null) { | |
+ DOMPropertyOperations.setValueForProperty(node, name, value); | |
+ } else { | |
+ DOMPropertyOperations.deleteValueForProperty(node, name); | |
+ } | |
+ }), | |
+ deletePropertyByID: ReactPerf.measure('ReactDOMIDOperations', 'deletePropertyByID', function (id, name, value) { | |
+ var node = ReactMount.getNode(id); | |
+ 'production' !== 'development' ? invariant(!INVALID_PROPERTY_ERRORS.hasOwnProperty(name), 'updatePropertyByID(...): %s', INVALID_PROPERTY_ERRORS[name]) : invariant(!INVALID_PROPERTY_ERRORS.hasOwnProperty(name)); | |
+ DOMPropertyOperations.deleteValueForProperty(node, name, value); | |
+ }), | |
+ updateStylesByID: ReactPerf.measure('ReactDOMIDOperations', 'updateStylesByID', function (id, styles) { | |
+ var node = ReactMount.getNode(id); | |
+ CSSPropertyOperations.setValueForStyles(node, styles); | |
+ }), | |
+ updateInnerHTMLByID: ReactPerf.measure('ReactDOMIDOperations', 'updateInnerHTMLByID', function (id, html) { | |
+ var node = ReactMount.getNode(id); | |
+ if (useWhitespaceWorkaround === undefined) { | |
+ var temp = document.createElement('div'); | |
+ temp.innerHTML = ' '; | |
+ useWhitespaceWorkaround = temp.innerHTML === ''; | |
+ } | |
+ if (useWhitespaceWorkaround) { | |
+ node.parentNode.replaceChild(node, node); | |
+ } | |
+ if (useWhitespaceWorkaround && html.match(/^[ \r\n\t\f]/)) { | |
+ node.innerHTML = '\uFEFF' + html; | |
+ node.firstChild.deleteData(0, 1); | |
+ } else { | |
+ node.innerHTML = html; | |
+ } | |
+ }), | |
+ updateTextContentByID: ReactPerf.measure('ReactDOMIDOperations', 'updateTextContentByID', function (id, content) { | |
+ var node = ReactMount.getNode(id); | |
+ DOMChildrenOperations.updateTextContent(node, content); | |
+ }), | |
+ dangerouslyReplaceNodeWithMarkupByID: ReactPerf.measure('ReactDOMIDOperations', 'dangerouslyReplaceNodeWithMarkupByID', function (id, markup) { | |
+ var node = ReactMount.getNode(id); | |
+ DOMChildrenOperations.dangerouslyReplaceNodeWithMarkup(node, markup); | |
+ }), | |
+ dangerouslyProcessChildrenUpdates: ReactPerf.measure('ReactDOMIDOperations', 'dangerouslyProcessChildrenUpdates', function (updates, markup) { | |
+ for (var i = 0; i < updates.length; i++) { | |
+ updates[i].parentNode = ReactMount.getNode(updates[i].parentID); | |
+ } | |
+ DOMChildrenOperations.processUpdates(updates, markup); | |
+ }) | |
+ }; | |
+ module.exports = ReactDOMIDOperations; | |
+ }, | |
+ function (module, exports) { | |
+ 'use strict'; | |
+ var PooledClass = _require(49); | |
+ var ReactEventEmitter = _require(40); | |
+ var ReactInputSelection = _require(120); | |
+ var ReactMountReady = _require(113); | |
+ var ReactPutListenerQueue = _require(114); | |
+ var Transaction = _require(115); | |
+ var mixInto = _require(58); | |
+ var SELECTION_RESTORATION = { | |
+ initialize: ReactInputSelection.getSelectionInformation, | |
+ close: ReactInputSelection.restoreSelection | |
+ }; | |
+ var EVENT_SUPPRESSION = { | |
+ initialize: function () { | |
+ var currentlyEnabled = ReactEventEmitter.isEnabled(); | |
+ ReactEventEmitter.setEnabled(false); | |
+ return currentlyEnabled; | |
+ }, | |
+ close: function (previouslyEnabled) { | |
+ ReactEventEmitter.setEnabled(previouslyEnabled); | |
+ } | |
+ }; | |
+ var ON_DOM_READY_QUEUEING = { | |
+ initialize: function () { | |
+ this.reactMountReady.reset(); | |
+ }, | |
+ close: function () { | |
+ this.reactMountReady.notifyAll(); | |
+ } | |
+ }; | |
+ var PUT_LISTENER_QUEUEING = { | |
+ initialize: function () { | |
+ this.putListenerQueue.reset(); | |
+ }, | |
+ close: function () { | |
+ this.putListenerQueue.putListeners(); | |
+ } | |
+ }; | |
+ var TRANSACTION_WRAPPERS = [ | |
+ PUT_LISTENER_QUEUEING, | |
+ SELECTION_RESTORATION, | |
+ EVENT_SUPPRESSION, | |
+ ON_DOM_READY_QUEUEING | |
+ ]; | |
+ function ReactReconcileTransaction() { | |
+ this.reinitializeTransaction(); | |
+ this.renderToStaticMarkup = false; | |
+ this.reactMountReady = ReactMountReady.getPooled(null); | |
+ this.putListenerQueue = ReactPutListenerQueue.getPooled(); | |
+ } | |
+ var Mixin = { | |
+ getTransactionWrappers: function () { | |
+ return TRANSACTION_WRAPPERS; | |
+ }, | |
+ getReactMountReady: function () { | |
+ return this.reactMountReady; | |
+ }, | |
+ getPutListenerQueue: function () { | |
+ return this.putListenerQueue; | |
+ }, | |
+ destructor: function () { | |
+ ReactMountReady.release(this.reactMountReady); | |
+ this.reactMountReady = null; | |
+ ReactPutListenerQueue.release(this.putListenerQueue); | |
+ this.putListenerQueue = null; | |
+ } | |
}; | |
- module.exports = ReactDefaultPerfAnalysis; | |
- }, | |
- function (module, exports) { | |
- 'use strict'; | |
- var ExecutionEnvironment = _require(29); | |
- var performance = null; | |
- if (ExecutionEnvironment.canUseDOM) { | |
- performance = window.performance || window.webkitPerformance; | |
- } | |
- if (!performance || !performance.now) { | |
- performance = Date; | |
- } | |
- var performanceNow = performance.now.bind(performance); | |
- module.exports = performanceNow; | |
- }, | |
- function (module, exports) { | |
- var isNode = _require(141); | |
- function isTextNode(object) { | |
- return isNode(object) && object.nodeType == 3; | |
- } | |
- module.exports = isTextNode; | |
+ mixInto(ReactReconcileTransaction, Transaction.Mixin); | |
+ mixInto(ReactReconcileTransaction, Mixin); | |
+ PooledClass.addPoolingTo(ReactReconcileTransaction); | |
+ module.exports = ReactReconcileTransaction; | |
}, | |
function (module, exports) { | |
'use strict'; | |
- var MOD = 65521; | |
- function adler32(data) { | |
- var a = 1; | |
- var b = 0; | |
- for (var i = 0; i < data.length; i++) { | |
- a = (a + data.charCodeAt(i)) % MOD; | |
- b = (b + a) % MOD; | |
- } | |
- return a | b << 16; | |
+ var SyntheticEvent = _require(42); | |
+ var CompositionEventInterface = { data: null }; | |
+ function SyntheticCompositionEvent(dispatchConfig, dispatchMarker, nativeEvent) { | |
+ SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent); | |
} | |
- module.exports = adler32; | |
+ SyntheticEvent.augmentClass(SyntheticCompositionEvent, CompositionEventInterface); | |
+ module.exports = SyntheticCompositionEvent; | |
}, | |
function (module, exports) { | |
'use strict'; | |
- var PooledClass = _require(49); | |
- var mixInto = _require(58); | |
- function ReactMountReady(initialCollection) { | |
- this._queue = initialCollection || null; | |
- } | |
- mixInto(ReactMountReady, { | |
- enqueue: function (component, callback) { | |
- this._queue = this._queue || []; | |
- this._queue.push({ | |
- component: component, | |
- callback: callback | |
- }); | |
- }, | |
- notifyAll: function () { | |
- var queue = this._queue; | |
- if (queue) { | |
- this._queue = null; | |
- for (var i = 0, l = queue.length; i < l; i++) { | |
- var component = queue[i].component; | |
- var callback = queue[i].callback; | |
- callback.call(component); | |
- } | |
- queue.length = 0; | |
- } | |
- }, | |
- reset: function () { | |
- this._queue = null; | |
- }, | |
- destructor: function () { | |
- this.reset(); | |
+ var ExecutionEnvironment = _require(30); | |
+ var contentKey = null; | |
+ function getTextContentAccessor() { | |
+ if (!contentKey && ExecutionEnvironment.canUseDOM) { | |
+ contentKey = 'textContent' in document.createElement('div') ? 'textContent' : 'innerText'; | |
} | |
- }); | |
- PooledClass.addPoolingTo(ReactMountReady); | |
- module.exports = ReactMountReady; | |
- }, | |
- function (module, exports) { | |
- 'use strict'; | |
- var PooledClass = _require(49); | |
- var ReactEventEmitter = _require(42); | |
- var mixInto = _require(58); | |
- function ReactPutListenerQueue() { | |
- this.listenersToPut = []; | |
+ return contentKey; | |
} | |
- mixInto(ReactPutListenerQueue, { | |
- enqueuePutListener: function (rootNodeID, propKey, propValue) { | |
- this.listenersToPut.push({ | |
- rootNodeID: rootNodeID, | |
- propKey: propKey, | |
- propValue: propValue | |
- }); | |
- }, | |
- putListeners: function () { | |
- for (var i = 0; i < this.listenersToPut.length; i++) { | |
- var listenerToPut = this.listenersToPut[i]; | |
- ReactEventEmitter.putListener(listenerToPut.rootNodeID, listenerToPut.propKey, listenerToPut.propValue); | |
- } | |
- }, | |
- reset: function () { | |
- this.listenersToPut.length = 0; | |
- }, | |
- destructor: function () { | |
- this.reset(); | |
- } | |
- }); | |
- PooledClass.addPoolingTo(ReactPutListenerQueue); | |
- module.exports = ReactPutListenerQueue; | |
+ module.exports = getTextContentAccessor; | |
}, | |
function (module, exports) { | |
'use strict'; | |
function getUnboundedScrollPosition(scrollable) { | |
if (scrollable === window) { | |
return { | |
x: window.pageXOffset || document.documentElement.scrollLeft, | |
y: window.pageYOffset || document.documentElement.scrollTop | |
@@ -7782,19 +7782,34 @@ | |
return { | |
x: scrollable.scrollLeft, | |
y: scrollable.scrollTop | |
}; | |
} | |
module.exports = getUnboundedScrollPosition; | |
}, | |
function (module, exports) { | |
+ function isNode(object) { | |
+ return !!(object && (typeof Node === 'function' ? object instanceof Node : typeof object === 'object' && typeof object.nodeType === 'number' && typeof object.nodeName === 'string')); | |
+ } | |
+ module.exports = isNode; | |
+ }, | |
+ function (module, exports) { | |
+ 'use strict'; | |
+ function focusNode(node) { | |
+ if (!node.disabled) { | |
+ node.focus(); | |
+ } | |
+ } | |
+ module.exports = focusNode; | |
+ }, | |
+ function (module, exports) { | |
'use strict'; | |
var getNodeForCharacterOffset = _require(142); | |
- var getTextContentAccessor = _require(114); | |
+ var getTextContentAccessor = _require(135); | |
function getIEOffsets(node) { | |
var selection = document.selection; | |
var selectedRange = selection.createRange(); | |
var selectedLength = selectedRange.text.length; | |
var fromStart = selectedRange.duplicate(); | |
fromStart.moveToElementText(node); | |
fromStart.setEndPoint('EndToStart', selectedRange); | |
var startOffset = fromStart.text.length; | |
@@ -7884,28 +7899,78 @@ | |
var setOffsets = document.selection ? setIEOffsets : setModernOffsets; | |
setOffsets(node, offsets); | |
} | |
}; | |
module.exports = ReactDOMSelection; | |
}, | |
function (module, exports) { | |
'use strict'; | |
- function focusNode(node) { | |
- if (!node.disabled) { | |
- node.focus(); | |
- } | |
+ var normalizeKey = { | |
+ 'Esc': 'Escape', | |
+ 'Spacebar': ' ', | |
+ 'Left': 'ArrowLeft', | |
+ 'Up': 'ArrowUp', | |
+ 'Right': 'ArrowRight', | |
+ 'Down': 'ArrowDown', | |
+ 'Del': 'Delete', | |
+ 'Win': 'OS', | |
+ 'Menu': 'ContextMenu', | |
+ 'Apps': 'ContextMenu', | |
+ 'Scroll': 'ScrollLock', | |
+ 'MozPrintableKey': 'Unidentified' | |
+ }; | |
+ var translateToKey = { | |
+ 8: 'Backspace', | |
+ 9: 'Tab', | |
+ 12: 'Clear', | |
+ 13: 'Enter', | |
+ 16: 'Shift', | |
+ 17: 'Control', | |
+ 18: 'Alt', | |
+ 19: 'Pause', | |
+ 20: 'CapsLock', | |
+ 27: 'Escape', | |
+ 32: ' ', | |
+ 33: 'PageUp', | |
+ 34: 'PageDown', | |
+ 35: 'End', | |
+ 36: 'Home', | |
+ 37: 'ArrowLeft', | |
+ 38: 'ArrowUp', | |
+ 39: 'ArrowRight', | |
+ 40: 'ArrowDown', | |
+ 45: 'Insert', | |
+ 46: 'Delete', | |
+ 112: 'F1', | |
+ 113: 'F2', | |
+ 114: 'F3', | |
+ 115: 'F4', | |
+ 116: 'F5', | |
+ 117: 'F6', | |
+ 118: 'F7', | |
+ 119: 'F8', | |
+ 120: 'F9', | |
+ 121: 'F10', | |
+ 122: 'F11', | |
+ 123: 'F12', | |
+ 144: 'NumLock', | |
+ 145: 'ScrollLock', | |
+ 224: 'Meta' | |
+ }; | |
+ function getEventKey(nativeEvent) { | |
+ return 'key' in nativeEvent ? normalizeKey[nativeEvent.key] || nativeEvent.key : translateToKey[nativeEvent.which || nativeEvent.keyCode] || 'Unidentified'; | |
} | |
- module.exports = focusNode; | |
+ module.exports = getEventKey; | |
}, | |
function (module, exports) { | |
'use strict'; | |
var Danger = _require(143); | |
- var ReactMultiChildUpdateTypes = _require(90); | |
- var getTextContentAccessor = _require(114); | |
+ var ReactMultiChildUpdateTypes = _require(65); | |
+ var getTextContentAccessor = _require(135); | |
var textContentAccessor = getTextContentAccessor(); | |
function insertChildAt(parentNode, childNode, index) { | |
var childNodes = parentNode.childNodes; | |
if (childNodes[index] === childNode) { | |
return; | |
} | |
if (childNode.parentNode === parentNode) { | |
parentNode.removeChild(childNode); | |
@@ -7973,81 +8038,16 @@ | |
} | |
} | |
} | |
}; | |
module.exports = DOMChildrenOperations; | |
}, | |
function (module, exports) { | |
'use strict'; | |
- var normalizeKey = { | |
- 'Esc': 'Escape', | |
- 'Spacebar': ' ', | |
- 'Left': 'ArrowLeft', | |
- 'Up': 'ArrowUp', | |
- 'Right': 'ArrowRight', | |
- 'Down': 'ArrowDown', | |
- 'Del': 'Delete', | |
- 'Win': 'OS', | |
- 'Menu': 'ContextMenu', | |
- 'Apps': 'ContextMenu', | |
- 'Scroll': 'ScrollLock', | |
- 'MozPrintableKey': 'Unidentified' | |
- }; | |
- var translateToKey = { | |
- 8: 'Backspace', | |
- 9: 'Tab', | |
- 12: 'Clear', | |
- 13: 'Enter', | |
- 16: 'Shift', | |
- 17: 'Control', | |
- 18: 'Alt', | |
- 19: 'Pause', | |
- 20: 'CapsLock', | |
- 27: 'Escape', | |
- 32: ' ', | |
- 33: 'PageUp', | |
- 34: 'PageDown', | |
- 35: 'End', | |
- 36: 'Home', | |
- 37: 'ArrowLeft', | |
- 38: 'ArrowUp', | |
- 39: 'ArrowRight', | |
- 40: 'ArrowDown', | |
- 45: 'Insert', | |
- 46: 'Delete', | |
- 112: 'F1', | |
- 113: 'F2', | |
- 114: 'F3', | |
- 115: 'F4', | |
- 116: 'F5', | |
- 117: 'F6', | |
- 118: 'F7', | |
- 119: 'F8', | |
- 120: 'F9', | |
- 121: 'F10', | |
- 122: 'F11', | |
- 123: 'F12', | |
- 144: 'NumLock', | |
- 145: 'ScrollLock', | |
- 224: 'Meta' | |
- }; | |
- function getEventKey(nativeEvent) { | |
- return 'key' in nativeEvent ? normalizeKey[nativeEvent.key] || nativeEvent.key : translateToKey[nativeEvent.which || nativeEvent.keyCode] || 'Unidentified'; | |
- } | |
- module.exports = getEventKey; | |
- }, | |
- function (module, exports) { | |
- function isNode(object) { | |
- return !!(object && (typeof Node === 'function' ? object instanceof Node : typeof object === 'object' && typeof object.nodeType === 'number' && typeof object.nodeName === 'string')); | |
- } | |
- module.exports = isNode; | |
- }, | |
- function (module, exports) { | |
- 'use strict'; | |
function getLeafNode(node) { | |
while (node && node.firstChild) { | |
node = node.firstChild; | |
} | |
return node; | |
} | |
function getSiblingNode(node) { | |
while (node) { | |
@@ -8074,21 +8074,21 @@ | |
} | |
node = getLeafNode(getSiblingNode(node)); | |
} | |
} | |
module.exports = getNodeForCharacterOffset; | |
}, | |
function (module, exports) { | |
'use strict'; | |
- var ExecutionEnvironment = _require(29); | |
+ var ExecutionEnvironment = _require(30); | |
var createNodesFromMarkup = _require(144); | |
var emptyFunction = _require(32); | |
var getMarkupWrap = _require(145); | |
- var invariant = _require(38); | |
+ var invariant = _require(45); | |
var OPEN_TAG_NAME_EXP = /^(<[^ \/>]+)/; | |
var RESULT_INDEX_ATTR = 'data-danger-index'; | |
function getNodeName(markup) { | |
return markup.substring(1, markup.indexOf(' ')); | |
} | |
var Danger = { | |
dangerouslyRenderMarkup: function (markupList) { | |
'production' !== 'development' ? invariant(ExecutionEnvironment.canUseDOM, 'dangerouslyRenderMarkup(...): Cannot render markup in a Worker ' + 'thread. This is likely a bug in the framework. Please report ' + 'immediately.') : invariant(ExecutionEnvironment.canUseDOM); | |
@@ -8138,20 +8138,20 @@ | |
'production' !== 'development' ? invariant(oldChild.tagName.toLowerCase() !== 'html', 'dangerouslyReplaceNodeWithMarkup(...): Cannot replace markup of the ' + '<html> node. This is because browser quirks make this unreliable ' + 'and/or slow. If you want to render to the root you must use ' + 'server rendering. See renderComponentToString().') : invariant(oldChild.tagName.toLowerCase() !== 'html'); | |
var newChild = createNodesFromMarkup(markup, emptyFunction)[0]; | |
oldChild.parentNode.replaceChild(newChild, oldChild); | |
} | |
}; | |
module.exports = Danger; | |
}, | |
function (module, exports) { | |
- var ExecutionEnvironment = _require(29); | |
+ var ExecutionEnvironment = _require(30); | |
var createArrayFrom = _require(146); | |
var getMarkupWrap = _require(145); | |
- var invariant = _require(38); | |
+ var invariant = _require(45); | |
var dummyNode = ExecutionEnvironment.canUseDOM ? document.createElement('div') : null; | |
var nodeNamePattern = /^\s*<(\w+)/; | |
function getNodeName(markup) { | |
var nodeNameMatch = markup.match(nodeNamePattern); | |
return nodeNameMatch && nodeNameMatch[1].toLowerCase(); | |
} | |
function createNodesFromMarkup(markup, handleScript) { | |
var node = dummyNode; | |
@@ -8176,18 +8176,18 @@ | |
while (node.lastChild) { | |
node.removeChild(node.lastChild); | |
} | |
return nodes; | |
} | |
module.exports = createNodesFromMarkup; | |
}, | |
function (module, exports) { | |
- var ExecutionEnvironment = _require(29); | |
- var invariant = _require(38); | |
+ var ExecutionEnvironment = _require(30); | |
+ var invariant = _require(45); | |
var dummyNode = ExecutionEnvironment.canUseDOM ? document.createElement('div') : null; | |
var shouldWrap = { | |
'circle': true, | |
'defs': true, | |
'g': true, | |
'line': true, | |
'linearGradient': true, | |
'path': true, | |
@@ -8300,17 +8300,17 @@ | |
return obj.slice(); | |
} else { | |
return toArray(obj); | |
} | |
} | |
module.exports = createArrayFrom; | |
}, | |
function (module, exports) { | |
- var invariant = _require(38); | |
+ var invariant = _require(45); | |
function toArray(obj) { | |
var length = obj.length; | |
'production' !== 'development' ? invariant(!Array.isArray(obj) && (typeof obj === 'object' || typeof obj === 'function'), 'toArray: Array-like object expected') : invariant(!Array.isArray(obj) && (typeof obj === 'object' || typeof obj === 'function')); | |
'production' !== 'development' ? invariant(typeof length === 'number', 'toArray: Object needs a length property') : invariant(typeof length === 'number'); | |
'production' !== 'development' ? invariant(length === 0 || length - 1 in obj, 'toArray: Object should have keys for indices') : invariant(length === 0 || length - 1 in obj); | |
if (obj.hasOwnProperty) { | |
try { | |
return Array.prototype.slice.call(obj); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment