From a4947d17782968e2b370c7ad4b6cc631f304eb48 Mon Sep 17 00:00:00 2001 From: Brian Vaughn Date: Thu, 8 Jun 2017 19:01:23 -0700 Subject: [PATCH] React Native sync Reviewed By: sebmarkbage Differential Revision: D5214576 fbshipit-source-id: 41f350ce8961851c7404257df8295d505471d9f4 --- Libraries/Renderer/REVISION | 2 +- Libraries/Renderer/ReactNativeFiber-dev.js | 1009 ++++++++++-------- Libraries/Renderer/ReactNativeFiber-prod.js | 855 ++++++++------- Libraries/Renderer/ReactNativeStack-dev.js | 643 ++++++----- Libraries/Renderer/ReactNativeStack-prod.js | 494 +++++---- Libraries/Renderer/shims/PooledClass.js | 6 +- Libraries/Renderer/shims/ReactNativeTypes.js | 7 +- 7 files changed, 1660 insertions(+), 1356 deletions(-) diff --git a/Libraries/Renderer/REVISION b/Libraries/Renderer/REVISION index d26be66a2..50cbbd0ee 100644 --- a/Libraries/Renderer/REVISION +++ b/Libraries/Renderer/REVISION @@ -1 +1 @@ -3630bf3559b72d66437187901fb5eab3f976c6a4 +a37012a6b5fb5a1c0c19c962737189aeaebe3684 diff --git a/Libraries/Renderer/ReactNativeFiber-dev.js b/Libraries/Renderer/ReactNativeFiber-dev.js index fda6b8e5b..b1e8b1d57 100644 --- a/Libraries/Renderer/ReactNativeFiber-dev.js +++ b/Libraries/Renderer/ReactNativeFiber-dev.js @@ -19,7 +19,7 @@ var RCTEventEmitter = require("RCTEventEmitter"), emptyFunction = require("fbjs/ require("ReactNativeFeatureFlags"); -var ExecutionEnvironment = require("fbjs/lib/ExecutionEnvironment"), performanceNow = require("fbjs/lib/performanceNow"), defaultShowDialog = function() { +var ExecutionEnvironment = require("fbjs/lib/ExecutionEnvironment"), performanceNow = require("fbjs/lib/performanceNow"), defaultShowDialog = function(capturedError) { return !0; }, showDialog = defaultShowDialog; @@ -30,15 +30,15 @@ function logCapturedError(capturedError) { return "\n " + line.trim(); }).join(); var errorBoundaryMessage = void 0; - errorBoundaryMessage = errorBoundaryFound && errorBoundaryName ? willRetry ? "React will try to recreate this component tree from scratch " + "using the error boundary you provided, " + errorBoundaryName + "." : "This error was initially handled by the error boundary " + errorBoundaryName + ". " + "Recreating the tree from scratch failed so React will unmount the tree." : "Consider adding an error boundary to your tree to customize error handling behavior.", + errorBoundaryMessage = errorBoundaryFound && errorBoundaryName ? willRetry ? "React will try to recreate this component tree from scratch " + "using the error boundary you provided, " + errorBoundaryName + "." : "This error was initially handled by the error boundary " + errorBoundaryName + ". " + "Recreating the tree from scratch failed so React will unmount the tree." : "Consider adding an error boundary to your tree to customize error handling behavior.", console.error(componentNameMessage + " You should fix this error in your code. " + errorBoundaryMessage + "\n\n" + errorSummary + "\n\n" + "The error is located at: " + componentStack + "\n\n" + "The error was thrown at: " + formattedCallStack); } } var injection = { injectDialog: function(fn) { - invariant(showDialog === defaultShowDialog, "The custom dialog was already injected."), - invariant("function" == typeof fn, "Injected showDialog() must be a function."), + invariant(showDialog === defaultShowDialog, "The custom dialog was already injected."), + invariant("function" == typeof fn, "Injected showDialog() must be a function."), showDialog = fn; } }, logCapturedError_1 = logCapturedError, ReactFiberErrorLogger = { @@ -65,7 +65,7 @@ if ("undefined" != typeof window && "function" == typeof window.dispatchEvent && }, evtType = "react-" + (name || "invokeguardedcallback") + "-" + depth; window.addEventListener("error", onFakeEventError), fakeNode.addEventListener(evtType, boundFunc, !1); var evt = document.createEvent("Event"); - return evt.initEvent(evtType, !1, !1), fakeNode.dispatchEvent(evt), fakeNode.removeEventListener(evtType, boundFunc, !1), + return evt.initEvent(evtType, !1, !1), fakeNode.dispatchEvent(evt), fakeNode.removeEventListener(evtType, boundFunc, !1), window.removeEventListener("error", onFakeEventError), depth--, fakeEventError; }; } @@ -78,7 +78,7 @@ var rethrowCaughtError = function() { }, ReactErrorUtils = { injection: { injectErrorUtils: function(injectedErrorUtils) { - invariant("function" == typeof injectedErrorUtils.invokeGuardedCallback, "Injected invokeGuardedCallback() must be a function."), + invariant("function" == typeof injectedErrorUtils.invokeGuardedCallback, "Injected invokeGuardedCallback() must be a function."), invokeGuardedCallback = injectedErrorUtils.invokeGuardedCallback; } }, @@ -119,7 +119,7 @@ validateEventDispatches = function(event) { function executeDispatch(event, simulated, listener, inst) { var type = event.type || "unknown-event"; - event.currentTarget = EventPluginUtils.getNodeFromInstance(inst), ReactErrorUtils_1.invokeGuardedCallbackAndCatchFirstError(type, listener, void 0, event), + event.currentTarget = EventPluginUtils.getNodeFromInstance(inst), ReactErrorUtils_1.invokeGuardedCallbackAndCatchFirstError(type, listener, void 0, event), event.currentTarget = null; } @@ -145,10 +145,10 @@ function executeDispatchesInOrderStopAtTrue(event) { function executeDirectDispatch(event) { validateEventDispatches(event); var dispatchListener = event._dispatchListeners, dispatchInstance = event._dispatchInstances; - invariant(!Array.isArray(dispatchListener), "executeDirectDispatch(...): Invalid `event`."), + invariant(!Array.isArray(dispatchListener), "executeDirectDispatch(...): Invalid `event`."), event.currentTarget = dispatchListener ? EventPluginUtils.getNodeFromInstance(dispatchInstance) : null; var res = dispatchListener ? dispatchListener(event) : null; - return event.currentTarget = null, event._dispatchListeners = null, event._dispatchInstances = null, + return event.currentTarget = null, event._dispatchListeners = null, event._dispatchInstances = null, res; } @@ -188,7 +188,7 @@ function restoreStateOfTarget(target) { var props = EventPluginUtils_1.getFiberCurrentPropsFromNode(internalInstance.stateNode); return void fiberHostComponent.restoreControlledState(internalInstance.stateNode, internalInstance.type, props); } - invariant("function" == typeof internalInstance.restoreControlledState, "The internal instance must be a React host component."), + invariant("function" == typeof internalInstance.restoreControlledState, "The internal instance must be a React host component."), internalInstance.restoreControlledState(); } } @@ -246,12 +246,12 @@ function ReactNativeFiberErrorDialog(capturedError) { var componentStack = capturedError.componentStack, error = capturedError.error, errorMessage = void 0, errorStack = void 0, errorType = void 0; if (error && "object" == typeof error) { var message = error.message, name = error.name; - errorMessage = (message ? name + ": " + message : name) + "\n\nThis error is located at:" + componentStack, + errorMessage = (message ? name + ": " + message : name) + "\n\nThis error is located at:" + componentStack, errorStack = error.stack, errorType = error.constructor; - } else errorMessage = "Unspecified error at:" + componentStack, errorStack = "", + } else errorMessage = "Unspecified error at:" + componentStack, errorStack = "", errorType = Error; var newError = new errorType(errorMessage); - return newError.stack = errorStack, ExceptionsManager.handleException(newError, !1), + return newError.stack = errorStack, ExceptionsManager.handleException(newError, !1), !1; } @@ -262,9 +262,9 @@ var showDialog$1 = ReactNativeFiberErrorDialog, ReactNativeFiberErrorDialog_1 = function recomputePluginOrdering() { if (eventPluginOrder) for (var pluginName in namesToPlugins) { var pluginModule = namesToPlugins[pluginName], pluginIndex = eventPluginOrder.indexOf(pluginName); - if (invariant(pluginIndex > -1, "EventPluginRegistry: Cannot inject event plugins that do not exist in " + "the plugin ordering, `%s`.", pluginName), + if (invariant(pluginIndex > -1, "EventPluginRegistry: Cannot inject event plugins that do not exist in " + "the plugin ordering, `%s`.", pluginName), !EventPluginRegistry.plugins[pluginIndex]) { - invariant(pluginModule.extractEvents, "EventPluginRegistry: Event plugins must implement an `extractEvents` " + "method, but `%s` does not.", pluginName), + invariant(pluginModule.extractEvents, "EventPluginRegistry: Event plugins must implement an `extractEvents` " + "method, but `%s` does not.", pluginName), EventPluginRegistry.plugins[pluginIndex] = pluginModule; var publishedEvents = pluginModule.eventTypes; for (var eventName in publishedEvents) invariant(publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName), "EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.", eventName, pluginName); @@ -273,7 +273,7 @@ function recomputePluginOrdering() { } function publishEventForPlugin(dispatchConfig, pluginModule, eventName) { - invariant(!EventPluginRegistry.eventNameDispatchConfigs.hasOwnProperty(eventName), "EventPluginHub: More than one plugin attempted to publish the same " + "event name, `%s`.", eventName), + invariant(!EventPluginRegistry.eventNameDispatchConfigs.hasOwnProperty(eventName), "EventPluginHub: More than one plugin attempted to publish the same " + "event name, `%s`.", eventName), EventPluginRegistry.eventNameDispatchConfigs[eventName] = dispatchConfig; var phasedRegistrationNames = dispatchConfig.phasedRegistrationNames; if (phasedRegistrationNames) { @@ -283,15 +283,15 @@ function publishEventForPlugin(dispatchConfig, pluginModule, eventName) { } return !0; } - return !!dispatchConfig.registrationName && (publishRegistrationName(dispatchConfig.registrationName, pluginModule, eventName), + return !!dispatchConfig.registrationName && (publishRegistrationName(dispatchConfig.registrationName, pluginModule, eventName), !0); } function publishRegistrationName(registrationName, pluginModule, eventName) { - invariant(!EventPluginRegistry.registrationNameModules[registrationName], "EventPluginHub: More than one plugin attempted to publish the same " + "registration name, `%s`.", registrationName), + invariant(!EventPluginRegistry.registrationNameModules[registrationName], "EventPluginHub: More than one plugin attempted to publish the same " + "registration name, `%s`.", registrationName), EventPluginRegistry.registrationNameModules[registrationName] = pluginModule, EventPluginRegistry.registrationNameDependencies[registrationName] = pluginModule.eventTypes[eventName].dependencies; var lowerCasedName = registrationName.toLowerCase(); - EventPluginRegistry.possibleRegistrationNames[lowerCasedName] = registrationName, + EventPluginRegistry.possibleRegistrationNames[lowerCasedName] = registrationName, "onDoubleClick" === registrationName && (EventPluginRegistry.possibleRegistrationNames.ondblclick = registrationName); } @@ -302,14 +302,14 @@ var EventPluginRegistry = { registrationNameDependencies: {}, possibleRegistrationNames: {}, injectEventPluginOrder: function(injectedEventPluginOrder) { - invariant(!eventPluginOrder, "EventPluginRegistry: Cannot inject event plugin ordering more than " + "once. You are likely trying to load more than one copy of React."), + invariant(!eventPluginOrder, "EventPluginRegistry: Cannot inject event plugin ordering more than " + "once. You are likely trying to load more than one copy of React."), eventPluginOrder = Array.prototype.slice.call(injectedEventPluginOrder), recomputePluginOrdering(); }, injectEventPluginsByName: function(injectedNamesToPlugins) { var isOrderingDirty = !1; for (var pluginName in injectedNamesToPlugins) if (injectedNamesToPlugins.hasOwnProperty(pluginName)) { var pluginModule = injectedNamesToPlugins[pluginName]; - namesToPlugins.hasOwnProperty(pluginName) && namesToPlugins[pluginName] === pluginModule || (invariant(!namesToPlugins[pluginName], "EventPluginRegistry: Cannot inject two different event plugins " + "using the same name, `%s`.", pluginName), + namesToPlugins.hasOwnProperty(pluginName) && namesToPlugins[pluginName] === pluginModule || (invariant(!namesToPlugins[pluginName], "EventPluginRegistry: Cannot inject two different event plugins " + "using the same name, `%s`.", pluginName), namesToPlugins[pluginName] = pluginModule, isOrderingDirty = !0); } isOrderingDirty && recomputePluginOrdering(); @@ -317,8 +317,8 @@ var EventPluginRegistry = { }, EventPluginRegistry_1 = EventPluginRegistry; function accumulateInto(current, next) { - return invariant(null != next, "accumulateInto(...): Accumulated items must not be null or undefined."), - null == current ? next : Array.isArray(current) ? Array.isArray(next) ? (current.push.apply(current, next), + return invariant(null != next, "accumulateInto(...): Accumulated items must not be null or undefined."), + null == current ? next : Array.isArray(current) ? Array.isArray(next) ? (current.push.apply(current, next), current) : (current.push(next), current) : Array.isArray(next) ? [ current ].concat(next) : [ current, next ]; } @@ -379,7 +379,7 @@ var EventPluginHub = { var _props = currentElement.props; if (listener = _props[registrationName], shouldPreventMouseEvent(registrationName, currentElement.type, _props)) return null; } - return invariant(!listener || "function" == typeof listener, "Expected %s listener to be a function, instead got type %s", registrationName, typeof listener), + return invariant(!listener || "function" == typeof listener, "Expected %s listener to be a function, instead got type %s", registrationName, typeof listener), listener; }, extractEvents: function(topLevelType, targetInst, nativeEvent, nativeEventTarget) { @@ -397,8 +397,8 @@ var EventPluginHub = { }, processEventQueue: function(simulated) { var processingEventQueue = eventQueue; - eventQueue = null, simulated ? forEachAccumulated_1(processingEventQueue, executeDispatchesAndReleaseSimulated) : forEachAccumulated_1(processingEventQueue, executeDispatchesAndReleaseTopLevel), - invariant(!eventQueue, "processEventQueue(): Additional events were enqueued while processing " + "an event queue. Support for this has not yet been implemented."), + eventQueue = null, simulated ? forEachAccumulated_1(processingEventQueue, executeDispatchesAndReleaseSimulated) : forEachAccumulated_1(processingEventQueue, executeDispatchesAndReleaseTopLevel), + invariant(!eventQueue, "processEventQueue(): Additional events were enqueued while processing " + "an event queue. Support for this has not yet been implemented."), ReactErrorUtils_1.rethrowCaughtError(); } }, EventPluginHub_1 = EventPluginHub, ReactTypeOfWork = { @@ -458,7 +458,7 @@ function traverseTwoPhase(inst, fn, arg) { } function traverseEnterLeave(from, to, fn, argFrom, argTo) { - for (var common = from && to ? getLowestCommonAncestor(from, to) : null, pathFrom = []; from && from !== common; ) pathFrom.push(from), + for (var common = from && to ? getLowestCommonAncestor(from, to) : null, pathFrom = []; from && from !== common; ) pathFrom.push(from), from = getParent(from); for (var pathTo = []; to && to !== common; ) pathTo.push(to), to = getParent(to); var i; @@ -482,7 +482,7 @@ function listenerAtPhase(inst, event, propagationPhase) { function accumulateDirectionalDispatches(inst, phase, event) { warning(inst, "Dispatching inst must not be null"); var listener = listenerAtPhase(inst, event, phase); - listener && (event._dispatchListeners = accumulateInto_1(event._dispatchListeners, listener), + listener && (event._dispatchListeners = accumulateInto_1(event._dispatchListeners, listener), event._dispatchInstances = accumulateInto_1(event._dispatchInstances, inst)); } @@ -500,7 +500,7 @@ function accumulateTwoPhaseDispatchesSingleSkipTarget(event) { function accumulateDispatches(inst, ignoredDirection, event) { if (inst && event && event.dispatchConfig.registrationName) { var registrationName = event.dispatchConfig.registrationName, listener = getListener(inst, registrationName); - listener && (event._dispatchListeners = accumulateInto_1(event._dispatchListeners, listener), + listener && (event._dispatchListeners = accumulateInto_1(event._dispatchListeners, listener), event._dispatchInstances = accumulateInto_1(event._dispatchInstances, inst)); } } @@ -560,12 +560,12 @@ var EventPropagators = { return new Klass(a1, a2, a3, a4); }, standardReleaser = function(instance) { var Klass = this; - invariant(instance instanceof Klass, "Trying to release an instance into a pool of a different type."), + invariant(instance instanceof Klass, "Trying to release an instance into a pool of a different type."), instance.destructor(), Klass.instancePool.length < Klass.poolSize && Klass.instancePool.push(instance); }, DEFAULT_POOL_SIZE = 10, DEFAULT_POOLER = oneArgumentPooler, addPoolingTo = function(CopyConstructor, pooler) { var NewKlass = CopyConstructor; - return NewKlass.instancePool = [], NewKlass.getPooled = pooler || DEFAULT_POOLER, - NewKlass.poolSize || (NewKlass.poolSize = DEFAULT_POOL_SIZE), NewKlass.release = standardReleaser, + return NewKlass.instancePool = [], NewKlass.getPooled = pooler || DEFAULT_POOLER, + NewKlass.poolSize || (NewKlass.poolSize = DEFAULT_POOL_SIZE), NewKlass.release = standardReleaser, NewKlass; }, PooledClass = { addPoolingTo: addPoolingTo, @@ -588,7 +588,7 @@ var EventPropagators = { }; function SyntheticEvent(dispatchConfig, targetInst, nativeEvent, nativeEventTarget) { - delete this.nativeEvent, delete this.preventDefault, delete this.stopPropagation, + delete this.nativeEvent, delete this.preventDefault, delete this.stopPropagation, this.dispatchConfig = dispatchConfig, this._targetInst = targetInst, this.nativeEvent = nativeEvent; var Interface = this.constructor.Interface; for (var propName in Interface) if (Interface.hasOwnProperty(propName)) { @@ -597,7 +597,7 @@ function SyntheticEvent(dispatchConfig, targetInst, nativeEvent, nativeEventTarg normalize ? this[propName] = normalize(nativeEvent) : "target" === propName ? this.target = nativeEventTarget : this[propName] = nativeEvent[propName]; } var defaultPrevented = null != nativeEvent.defaultPrevented ? nativeEvent.defaultPrevented : !1 === nativeEvent.returnValue; - return this.isDefaultPrevented = defaultPrevented ? emptyFunction.thatReturnsTrue : emptyFunction.thatReturnsFalse, + return this.isDefaultPrevented = defaultPrevented ? emptyFunction.thatReturnsTrue : emptyFunction.thatReturnsFalse, this.isPropagationStopped = emptyFunction.thatReturnsFalse, this; } @@ -605,12 +605,12 @@ Object.assign(SyntheticEvent.prototype, { preventDefault: function() { this.defaultPrevented = !0; var event = this.nativeEvent; - event && (event.preventDefault ? event.preventDefault() : "unknown" != typeof event.returnValue && (event.returnValue = !1), + event && (event.preventDefault ? event.preventDefault() : "unknown" != typeof event.returnValue && (event.returnValue = !1), this.isDefaultPrevented = emptyFunction.thatReturnsTrue); }, stopPropagation: function() { var event = this.nativeEvent; - event && (event.stopPropagation ? event.stopPropagation() : "unknown" != typeof event.cancelBubble && (event.cancelBubble = !0), + event && (event.stopPropagation ? event.stopPropagation() : "unknown" != typeof event.cancelBubble && (event.cancelBubble = !0), this.isPropagationStopped = emptyFunction.thatReturnsTrue); }, persist: function() { @@ -621,8 +621,8 @@ Object.assign(SyntheticEvent.prototype, { var Interface = this.constructor.Interface; for (var propName in Interface) Object.defineProperty(this, propName, getPooledWarningPropertyDefinition(propName, Interface[propName])); for (var i = 0; i < shouldBeReleasedProperties.length; i++) this[shouldBeReleasedProperties[i]] = null; - Object.defineProperty(this, "nativeEvent", getPooledWarningPropertyDefinition("nativeEvent", null)), - Object.defineProperty(this, "preventDefault", getPooledWarningPropertyDefinition("preventDefault", emptyFunction)), + Object.defineProperty(this, "nativeEvent", getPooledWarningPropertyDefinition("nativeEvent", null)), + Object.defineProperty(this, "preventDefault", getPooledWarningPropertyDefinition("preventDefault", emptyFunction)), Object.defineProperty(this, "stopPropagation", getPooledWarningPropertyDefinition("stopPropagation", emptyFunction)); } }), SyntheticEvent.Interface = EventInterface, isProxySupported && (SyntheticEvent = new Proxy(SyntheticEvent, { @@ -632,7 +632,7 @@ Object.assign(SyntheticEvent.prototype, { apply: function(constructor, that, args) { return new Proxy(constructor.apply(that, args), { set: function(target, prop, value) { - return "isPersistent" === prop || target.constructor.Interface.hasOwnProperty(prop) || -1 !== shouldBeReleasedProperties.indexOf(prop) || (warning(didWarnForAddedNewProperty || target.isPersistent(), "This synthetic event is reused for performance reasons. If you're " + "seeing this, you're adding a new property in the synthetic event object. " + "The property is never released. See " + "https://fb.me/react-event-pooling for more information."), + return "isPersistent" === prop || target.constructor.Interface.hasOwnProperty(prop) || -1 !== shouldBeReleasedProperties.indexOf(prop) || (warning(didWarnForAddedNewProperty || target.isPersistent(), "This synthetic event is reused for performance reasons. If you're " + "seeing this, you're adding a new property in the synthetic event object. " + "The property is never released. See " + "https://fb.me/react-event-pooling for more information."), didWarnForAddedNewProperty = !0), target[prop] = value, !0; } }); @@ -641,8 +641,8 @@ Object.assign(SyntheticEvent.prototype, { var Super = this, E = function() {}; E.prototype = Super.prototype; var prototype = new E(); - Object.assign(prototype, Class.prototype), Class.prototype = prototype, Class.prototype.constructor = Class, - Class.Interface = Object.assign({}, Super.Interface, Interface), Class.augmentClass = Super.augmentClass, + Object.assign(prototype, Class.prototype), Class.prototype = prototype, Class.prototype.constructor = Class, + Class.Interface = Object.assign({}, Super.Interface, Interface), Class.augmentClass = Super.augmentClass, PooledClass_1.addPoolingTo(Class, PooledClass_1.fourArgumentPooler); }, PooledClass_1.addPoolingTo(SyntheticEvent, PooledClass_1.fourArgumentPooler); @@ -656,11 +656,11 @@ function getPooledWarningPropertyDefinition(propName, getVal) { get: get }; function set(val) { - return warn(isFunction ? "setting the method" : "setting the property", "This is effectively a no-op"), + return warn(isFunction ? "setting the method" : "setting the property", "This is effectively a no-op"), val; } function get() { - return warn(isFunction ? "accessing the method" : "accessing the property", isFunction ? "This is a no-op function" : "This is set to null"), + return warn(isFunction ? "accessing the method" : "accessing the property", isFunction ? "This is a no-op function" : "This is set to null"), getVal; } function warn(action, result) { @@ -678,7 +678,7 @@ var _extends = Object.assign || function(target) { for (var bubblingTypeName in customBubblingEventTypes) allTypesByEventName[bubblingTypeName] = customBubblingEventTypes[bubblingTypeName]; -for (var directTypeName in customDirectEventTypes) warning(!customBubblingEventTypes[directTypeName], "Event cannot be both direct and bubbling: %s", directTypeName), +for (var directTypeName in customDirectEventTypes) warning(!customBubblingEventTypes[directTypeName], "Event cannot be both direct and bubbling: %s", directTypeName), allTypesByEventName[directTypeName] = customDirectEventTypes[directTypeName]; var ReactNativeBridgeEventPlugin = { @@ -804,7 +804,7 @@ var ReactEventEmitterMixin = { var touch = changedTouches[jj]; touch.changedTouches = changedTouches, touch.touches = touches; var nativeEvent = touch, rootNodeID = null, target = nativeEvent.target; - null !== target && void 0 !== target && (target < ReactNativeTagHandles_1.tagsStartAt ? warning(!1, "A view is reporting that a touch occurred on tag zero.") : rootNodeID = target), + null !== target && void 0 !== target && (target < ReactNativeTagHandles_1.tagsStartAt ? warning(!1, "A view is reporting that a touch occurred on tag zero.") : rootNodeID = target), ReactNativeEventEmitter._receiveRootNodeIDEvent(rootNodeID, eventTopLevelType, nativeEvent); } } @@ -854,38 +854,38 @@ function createTouchRecord(touch) { } function resetTouchRecord(touchRecord, touch) { - touchRecord.touchActive = !0, touchRecord.startPageX = touch.pageX, touchRecord.startPageY = touch.pageY, - touchRecord.startTimeStamp = timestampForTouch(touch), touchRecord.currentPageX = touch.pageX, - touchRecord.currentPageY = touch.pageY, touchRecord.currentTimeStamp = timestampForTouch(touch), - touchRecord.previousPageX = touch.pageX, touchRecord.previousPageY = touch.pageY, + touchRecord.touchActive = !0, touchRecord.startPageX = touch.pageX, touchRecord.startPageY = touch.pageY, + touchRecord.startTimeStamp = timestampForTouch(touch), touchRecord.currentPageX = touch.pageX, + touchRecord.currentPageY = touch.pageY, touchRecord.currentTimeStamp = timestampForTouch(touch), + touchRecord.previousPageX = touch.pageX, touchRecord.previousPageY = touch.pageY, touchRecord.previousTimeStamp = timestampForTouch(touch); } function getTouchIdentifier(_ref) { var identifier = _ref.identifier; - return invariant(null != identifier, "Touch object is missing identifier."), warning(identifier <= MAX_TOUCH_BANK, "Touch identifier %s is greater than maximum supported %s which causes " + "performance issues backfilling array locations for all of the indices.", identifier, MAX_TOUCH_BANK), + return invariant(null != identifier, "Touch object is missing identifier."), warning(identifier <= MAX_TOUCH_BANK, "Touch identifier %s is greater than maximum supported %s which causes " + "performance issues backfilling array locations for all of the indices.", identifier, MAX_TOUCH_BANK), identifier; } function recordTouchStart(touch) { var identifier = getTouchIdentifier(touch), touchRecord = touchBank[identifier]; - touchRecord ? resetTouchRecord(touchRecord, touch) : touchBank[identifier] = createTouchRecord(touch), + touchRecord ? resetTouchRecord(touchRecord, touch) : touchBank[identifier] = createTouchRecord(touch), touchHistory.mostRecentTimeStamp = timestampForTouch(touch); } function recordTouchMove(touch) { var touchRecord = touchBank[getTouchIdentifier(touch)]; - touchRecord ? (touchRecord.touchActive = !0, touchRecord.previousPageX = touchRecord.currentPageX, - touchRecord.previousPageY = touchRecord.currentPageY, touchRecord.previousTimeStamp = touchRecord.currentTimeStamp, - touchRecord.currentPageX = touch.pageX, touchRecord.currentPageY = touch.pageY, + touchRecord ? (touchRecord.touchActive = !0, touchRecord.previousPageX = touchRecord.currentPageX, + touchRecord.previousPageY = touchRecord.currentPageY, touchRecord.previousTimeStamp = touchRecord.currentTimeStamp, + touchRecord.currentPageX = touch.pageX, touchRecord.currentPageY = touch.pageY, touchRecord.currentTimeStamp = timestampForTouch(touch), touchHistory.mostRecentTimeStamp = timestampForTouch(touch)) : console.error("Cannot record touch move without a touch start.\n" + "Touch Move: %s\n", "Touch Bank: %s", printTouch(touch), printTouchBank()); } function recordTouchEnd(touch) { var touchRecord = touchBank[getTouchIdentifier(touch)]; - touchRecord ? (touchRecord.touchActive = !1, touchRecord.previousPageX = touchRecord.currentPageX, - touchRecord.previousPageY = touchRecord.currentPageY, touchRecord.previousTimeStamp = touchRecord.currentTimeStamp, - touchRecord.currentPageX = touch.pageX, touchRecord.currentPageY = touch.pageY, + touchRecord ? (touchRecord.touchActive = !1, touchRecord.previousPageX = touchRecord.currentPageX, + touchRecord.previousPageY = touchRecord.currentPageY, touchRecord.previousTimeStamp = touchRecord.currentTimeStamp, + touchRecord.currentPageX = touch.pageX, touchRecord.currentPageY = touch.pageY, touchRecord.currentTimeStamp = timestampForTouch(touch), touchHistory.mostRecentTimeStamp = timestampForTouch(touch)) : console.error("Cannot record touch end without a touch start.\n" + "Touch End: %s\n", "Touch Bank: %s", printTouch(touch), printTouchBank()); } @@ -900,14 +900,14 @@ function printTouch(touch) { function printTouchBank() { var printed = JSON.stringify(touchBank.slice(0, MAX_TOUCH_BANK)); - return touchBank.length > MAX_TOUCH_BANK && (printed += " (original size: " + touchBank.length + ")"), + return touchBank.length > MAX_TOUCH_BANK && (printed += " (original size: " + touchBank.length + ")"), printed; } var ResponderTouchHistoryStore = { recordTouchTrack: function(topLevelType, nativeEvent) { - if (isMoveish$2(topLevelType)) nativeEvent.changedTouches.forEach(recordTouchMove); else if (isStartish$2(topLevelType)) nativeEvent.changedTouches.forEach(recordTouchStart), - touchHistory.numberActiveTouches = nativeEvent.touches.length, 1 === touchHistory.numberActiveTouches && (touchHistory.indexOfSingleActiveTouch = nativeEvent.touches[0].identifier); else if (isEndish$2(topLevelType) && (nativeEvent.changedTouches.forEach(recordTouchEnd), + if (isMoveish$2(topLevelType)) nativeEvent.changedTouches.forEach(recordTouchMove); else if (isStartish$2(topLevelType)) nativeEvent.changedTouches.forEach(recordTouchStart), + touchHistory.numberActiveTouches = nativeEvent.touches.length, 1 === touchHistory.numberActiveTouches && (touchHistory.indexOfSingleActiveTouch = nativeEvent.touches[0].identifier); else if (isEndish$2(topLevelType) && (nativeEvent.changedTouches.forEach(recordTouchEnd), touchHistory.numberActiveTouches = nativeEvent.touches.length, 1 === touchHistory.numberActiveTouches)) { for (var i = 0; i < touchBank.length; i++) { var touchTrackToCheck = touchBank[i]; @@ -924,7 +924,7 @@ var ResponderTouchHistoryStore = { }, ResponderTouchHistoryStore_1 = ResponderTouchHistoryStore; function accumulate(current, next) { - return invariant(null != next, "accumulate(...): Accumulated items must be not be null or undefined."), + return invariant(null != next, "accumulate(...): Accumulated items must be not be null or undefined."), null == current ? next : Array.isArray(current) ? current.concat(next) : Array.isArray(next) ? [ current ].concat(next) : [ current, next ]; } @@ -986,24 +986,24 @@ function setResponderAndExtractTransfer(topLevelType, targetInst, nativeEvent, n var shouldSetEventType = isStartish$1(topLevelType) ? eventTypes.startShouldSetResponder : isMoveish$1(topLevelType) ? eventTypes.moveShouldSetResponder : "topSelectionChange" === topLevelType ? eventTypes.selectionChangeShouldSetResponder : eventTypes.scrollShouldSetResponder, bubbleShouldSetFrom = responderInst ? ReactTreeTraversal.getLowestCommonAncestor(responderInst, targetInst) : targetInst, skipOverBubbleShouldSetFrom = bubbleShouldSetFrom === responderInst, shouldSetEvent = ResponderSyntheticEvent_1.getPooled(shouldSetEventType, bubbleShouldSetFrom, nativeEvent, nativeEventTarget); shouldSetEvent.touchHistory = ResponderTouchHistoryStore_1.touchHistory, skipOverBubbleShouldSetFrom ? EventPropagators_1.accumulateTwoPhaseDispatchesSkipTarget(shouldSetEvent) : EventPropagators_1.accumulateTwoPhaseDispatches(shouldSetEvent); var wantsResponderInst = executeDispatchesInOrderStopAtTrue$1(shouldSetEvent); - if (shouldSetEvent.isPersistent() || shouldSetEvent.constructor.release(shouldSetEvent), + if (shouldSetEvent.isPersistent() || shouldSetEvent.constructor.release(shouldSetEvent), !wantsResponderInst || wantsResponderInst === responderInst) return null; var extracted, grantEvent = ResponderSyntheticEvent_1.getPooled(eventTypes.responderGrant, wantsResponderInst, nativeEvent, nativeEventTarget); grantEvent.touchHistory = ResponderTouchHistoryStore_1.touchHistory, EventPropagators_1.accumulateDirectDispatches(grantEvent); var blockHostResponder = !0 === executeDirectDispatch$1(grantEvent); if (responderInst) { var terminationRequestEvent = ResponderSyntheticEvent_1.getPooled(eventTypes.responderTerminationRequest, responderInst, nativeEvent, nativeEventTarget); - terminationRequestEvent.touchHistory = ResponderTouchHistoryStore_1.touchHistory, + terminationRequestEvent.touchHistory = ResponderTouchHistoryStore_1.touchHistory, EventPropagators_1.accumulateDirectDispatches(terminationRequestEvent); var shouldSwitch = !hasDispatches$1(terminationRequestEvent) || executeDirectDispatch$1(terminationRequestEvent); - if (terminationRequestEvent.isPersistent() || terminationRequestEvent.constructor.release(terminationRequestEvent), + if (terminationRequestEvent.isPersistent() || terminationRequestEvent.constructor.release(terminationRequestEvent), shouldSwitch) { var terminateEvent = ResponderSyntheticEvent_1.getPooled(eventTypes.responderTerminate, responderInst, nativeEvent, nativeEventTarget); - terminateEvent.touchHistory = ResponderTouchHistoryStore_1.touchHistory, EventPropagators_1.accumulateDirectDispatches(terminateEvent), + terminateEvent.touchHistory = ResponderTouchHistoryStore_1.touchHistory, EventPropagators_1.accumulateDirectDispatches(terminateEvent), extracted = accumulate_1(extracted, [ grantEvent, terminateEvent ]), changeResponder(wantsResponderInst, blockHostResponder); } else { var rejectEvent = ResponderSyntheticEvent_1.getPooled(eventTypes.responderReject, wantsResponderInst, nativeEvent, nativeEventTarget); - rejectEvent.touchHistory = ResponderTouchHistoryStore_1.touchHistory, EventPropagators_1.accumulateDirectDispatches(rejectEvent), + rejectEvent.touchHistory = ResponderTouchHistoryStore_1.touchHistory, EventPropagators_1.accumulateDirectDispatches(rejectEvent), extracted = accumulate_1(extracted, rejectEvent); } } else extracted = accumulate_1(extracted, grantEvent), changeResponder(wantsResponderInst, blockHostResponder); @@ -1034,7 +1034,7 @@ var ResponderEventPlugin = { eventTypes: eventTypes, extractEvents: function(topLevelType, targetInst, nativeEvent, nativeEventTarget) { if (isStartish$1(topLevelType)) trackedTouchCount += 1; else if (isEndish$1(topLevelType)) { - if (!(trackedTouchCount >= 0)) return console.error("Ended a touch event which was not counted in `trackedTouchCount`."), + if (!(trackedTouchCount >= 0)) return console.error("Ended a touch event which was not counted in `trackedTouchCount`."), null; trackedTouchCount -= 1; } @@ -1042,17 +1042,17 @@ var ResponderEventPlugin = { var extracted = canTriggerTransfer(topLevelType, targetInst, nativeEvent) ? setResponderAndExtractTransfer(topLevelType, targetInst, nativeEvent, nativeEventTarget) : null, isResponderTouchStart = responderInst && isStartish$1(topLevelType), isResponderTouchMove = responderInst && isMoveish$1(topLevelType), isResponderTouchEnd = responderInst && isEndish$1(topLevelType), incrementalTouch = isResponderTouchStart ? eventTypes.responderStart : isResponderTouchMove ? eventTypes.responderMove : isResponderTouchEnd ? eventTypes.responderEnd : null; if (incrementalTouch) { var gesture = ResponderSyntheticEvent_1.getPooled(incrementalTouch, responderInst, nativeEvent, nativeEventTarget); - gesture.touchHistory = ResponderTouchHistoryStore_1.touchHistory, EventPropagators_1.accumulateDirectDispatches(gesture), + gesture.touchHistory = ResponderTouchHistoryStore_1.touchHistory, EventPropagators_1.accumulateDirectDispatches(gesture), extracted = accumulate_1(extracted, gesture); } var isResponderTerminate = responderInst && "topTouchCancel" === topLevelType, isResponderRelease = responderInst && !isResponderTerminate && isEndish$1(topLevelType) && noResponderTouches(nativeEvent), finalTouch = isResponderTerminate ? eventTypes.responderTerminate : isResponderRelease ? eventTypes.responderRelease : null; if (finalTouch) { var finalEvent = ResponderSyntheticEvent_1.getPooled(finalTouch, responderInst, nativeEvent, nativeEventTarget); - finalEvent.touchHistory = ResponderTouchHistoryStore_1.touchHistory, EventPropagators_1.accumulateDirectDispatches(finalEvent), + finalEvent.touchHistory = ResponderTouchHistoryStore_1.touchHistory, EventPropagators_1.accumulateDirectDispatches(finalEvent), extracted = accumulate_1(extracted, finalEvent), changeResponder(null); } var numberActiveTouches = ResponderTouchHistoryStore_1.touchHistory.numberActiveTouches; - return ResponderEventPlugin.GlobalInteractionHandler && numberActiveTouches !== previousActiveTouches && ResponderEventPlugin.GlobalInteractionHandler.onChange(numberActiveTouches), + return ResponderEventPlugin.GlobalInteractionHandler && numberActiveTouches !== previousActiveTouches && ResponderEventPlugin.GlobalInteractionHandler.onChange(numberActiveTouches), previousActiveTouches = numberActiveTouches, extracted; }, GlobalResponderHandler: null, @@ -1068,8 +1068,8 @@ var ResponderEventPlugin = { }, ResponderEventPlugin_1 = ResponderEventPlugin; function inject() { - RCTEventEmitter.register(ReactNativeEventEmitter_1), EventPluginHub_1.injection.injectEventPluginOrder(ReactNativeEventPluginOrder_1), - EventPluginUtils_1.injection.injectComponentTree(ReactNativeComponentTree_1), ResponderEventPlugin_1.injection.injectGlobalResponderHandler(ReactNativeGlobalResponderHandler_1), + RCTEventEmitter.register(ReactNativeEventEmitter_1), EventPluginHub_1.injection.injectEventPluginOrder(ReactNativeEventPluginOrder_1), + EventPluginUtils_1.injection.injectComponentTree(ReactNativeComponentTree_1), ResponderEventPlugin_1.injection.injectGlobalResponderHandler(ReactNativeGlobalResponderHandler_1), EventPluginHub_1.injection.injectEventPluginsByName({ ResponderEventPlugin: ResponderEventPlugin_1, ReactNativeBridgeEventPlugin: ReactNativeBridgeEventPlugin_1 @@ -1094,20 +1094,19 @@ var ReactNativeInjection = { isPortal: isPortal, REACT_PORTAL_TYPE: REACT_PORTAL_TYPE_1 }, commonjsGlobal = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof self ? self : {}, ReactFeatureFlags = { - logTopLevelRenders: !1, - prepareNewChildrenBeforeUnmountInStack: !0, disableNewFiberFeatures: !1, enableAsyncSubtreeAPI: !1 }, ReactFeatureFlags_1 = ReactFeatureFlags, ReactTypeOfSideEffect = { NoEffect: 0, - Placement: 1, - Update: 2, - PlacementAndUpdate: 3, - Deletion: 4, - ContentReset: 8, - Callback: 16, - Err: 32, - Ref: 64 + PerformedWork: 1, + Placement: 2, + Update: 4, + PlacementAndUpdate: 6, + Deletion: 8, + ContentReset: 16, + Callback: 32, + Err: 64, + Ref: 128 }, ReactPriorityLevel = { NoWork: 0, SynchronousPriority: 1, @@ -1138,8 +1137,8 @@ function cloneUpdateQueue(current, workInProgress) { var currentQueue = current.updateQueue; if (null === currentQueue) return workInProgress.updateQueue = null, null; var altQueue = null !== workInProgress.updateQueue ? workInProgress.updateQueue : {}; - return altQueue.first = currentQueue.first, altQueue.last = currentQueue.last, altQueue.hasForceUpdate = !1, - altQueue.callbackList = null, altQueue.isProcessing = !1, workInProgress.updateQueue = altQueue, + return altQueue.first = currentQueue.first, altQueue.last = currentQueue.last, altQueue.hasForceUpdate = !1, + altQueue.callbackList = null, altQueue.isProcessing = !1, workInProgress.updateQueue = altQueue, altQueue; } @@ -1158,13 +1157,13 @@ function cloneUpdate(update) { } function insertUpdateIntoQueue(queue, update, insertAfter, insertBefore) { - null !== insertAfter ? insertAfter.next = update : (update.next = queue.first, queue.first = update), + null !== insertAfter ? insertAfter.next = update : (update.next = queue.first, queue.first = update), null !== insertBefore ? update.next = insertBefore : queue.last = update; } function findInsertionPosition(queue, update) { var priorityLevel = update.priorityLevel, insertAfter = null, insertBefore = null; - if (null !== queue.last && comparePriority(queue.last.priorityLevel, priorityLevel) <= 0) insertAfter = queue.last; else for (insertBefore = queue.first; null !== insertBefore && comparePriority(insertBefore.priorityLevel, priorityLevel) <= 0; ) insertAfter = insertBefore, + if (null !== queue.last && comparePriority(queue.last.priorityLevel, priorityLevel) <= 0) insertAfter = queue.last; else for (insertBefore = queue.first; null !== insertBefore && comparePriority(insertBefore.priorityLevel, priorityLevel) <= 0; ) insertAfter = insertBefore, insertBefore = insertBefore.next; return insertAfter; } @@ -1173,14 +1172,14 @@ function insertUpdate(fiber, update) { var queue1 = ensureUpdateQueue(fiber), queue2 = null !== fiber.alternate ? ensureUpdateQueue(fiber.alternate) : null; (queue1.isProcessing || null !== queue2 && queue2.isProcessing) && warning$3(!1, "An update (setState, replaceState, or forceUpdate) was scheduled " + "from inside an update function. Update functions should be pure, " + "with zero side-effects. Consider using componentDidUpdate or a " + "callback."); var insertAfter1 = findInsertionPosition(queue1, update), insertBefore1 = null !== insertAfter1 ? insertAfter1.next : queue1.first; - if (null === queue2) return insertUpdateIntoQueue(queue1, update, insertAfter1, insertBefore1), + if (null === queue2) return insertUpdateIntoQueue(queue1, update, insertAfter1, insertBefore1), null; var insertAfter2 = findInsertionPosition(queue2, update), insertBefore2 = null !== insertAfter2 ? insertAfter2.next : queue2.first; if (insertUpdateIntoQueue(queue1, update, insertAfter1, insertBefore1), insertBefore1 !== insertBefore2) { var update2 = cloneUpdate(update); return insertUpdateIntoQueue(queue2, update2, insertAfter2, insertBefore2), update2; } - return null === insertAfter2 && (queue2.first = update), null === insertBefore2 && (queue2.last = null), + return null === insertAfter2 && (queue2.first = update), null === insertBefore2 && (queue2.last = null), null; } @@ -1244,8 +1243,8 @@ function addTopLevelUpdate$1(fiber, partialState, callback, priorityLevel) { }, update2 = insertUpdate(fiber, update); if (isTopLevelUnmount) { var queue1 = fiber.updateQueue, queue2 = null !== fiber.alternate ? fiber.alternate.updateQueue : null; - null !== queue1 && null !== update.next && (update.next = null, queue1.last = update), - null !== queue2 && null !== update2 && null !== update2.next && (update2.next = null, + null !== queue1 && null !== update.next && (update.next = null, queue1.last = update), + null !== queue2 && null !== update2 && null !== update2.next && (update2.next = null, queue2.last = update); } } @@ -1265,13 +1264,13 @@ function beginUpdateQueue(workInProgress, queue, instance, prevState, props, pri for (var state = prevState, dontMutatePrevState = !0, callbackList = queue.callbackList, update = queue.first; null !== update && comparePriority(update.priorityLevel, priorityLevel) <= 0; ) { queue.first = update.next, null === queue.first && (queue.last = null); var _partialState = void 0; - update.isReplace ? (state = getStateFromUpdate(update, instance, state, props), - dontMutatePrevState = !0) : (_partialState = getStateFromUpdate(update, instance, state, props)) && (state = dontMutatePrevState ? Object.assign({}, state, _partialState) : Object.assign(state, _partialState), - dontMutatePrevState = !1), update.isForced && (queue.hasForceUpdate = !0), null === update.callback || update.isTopLevelUnmount && null !== update.next || (callbackList = callbackList || [], - callbackList.push(update.callback), workInProgress.effectTag |= CallbackEffect), + update.isReplace ? (state = getStateFromUpdate(update, instance, state, props), + dontMutatePrevState = !0) : (_partialState = getStateFromUpdate(update, instance, state, props)) && (state = dontMutatePrevState ? Object.assign({}, state, _partialState) : Object.assign(state, _partialState), + dontMutatePrevState = !1), update.isForced && (queue.hasForceUpdate = !0), null === update.callback || update.isTopLevelUnmount && null !== update.next || (callbackList = callbackList || [], + callbackList.push(update.callback), workInProgress.effectTag |= CallbackEffect), update = update.next; } - return queue.callbackList = callbackList, null !== queue.first || null !== callbackList || queue.hasForceUpdate || (workInProgress.updateQueue = null), + return queue.callbackList = callbackList, null !== queue.first || null !== callbackList || queue.hasForceUpdate || (workInProgress.updateQueue = null), queue.isProcessing = !1, state; } @@ -1281,7 +1280,7 @@ function commitCallbacks(finishedWork, queue, context) { var callbackList = queue.callbackList; if (null !== callbackList) for (var i = 0; i < callbackList.length; i++) { var _callback = callbackList[i]; - invariant("function" == typeof _callback, "Invalid argument passed as callback. Expected a function. Instead " + "received: %s", _callback), + invariant("function" == typeof _callback, "Invalid argument passed as callback. Expected a function. Instead " + "received: %s", _callback), _callback.call(context); } } @@ -1331,7 +1330,7 @@ Object.assign(ReactGlobalSharedState, { ReactDebugCurrentFrame: ReactInternals.ReactDebugCurrentFrame }); -var ReactGlobalSharedState_1 = ReactGlobalSharedState, ReactCurrentOwner = ReactGlobalSharedState_1.ReactCurrentOwner, warning$4 = warning, HostRoot$1 = ReactTypeOfWork.HostRoot, HostComponent$1 = ReactTypeOfWork.HostComponent, HostText = ReactTypeOfWork.HostText, ClassComponent$1 = ReactTypeOfWork.ClassComponent, NoEffect = ReactTypeOfSideEffect.NoEffect, Placement = ReactTypeOfSideEffect.Placement, MOUNTING = 1, MOUNTED = 2, UNMOUNTED = 3; +var ReactGlobalSharedState_1 = ReactGlobalSharedState, ReactCurrentOwner = ReactGlobalSharedState_1.ReactCurrentOwner, warning$4 = warning, HostRoot$1 = ReactTypeOfWork.HostRoot, HostComponent$2 = ReactTypeOfWork.HostComponent, HostText = ReactTypeOfWork.HostText, ClassComponent$1 = ReactTypeOfWork.ClassComponent, NoEffect = ReactTypeOfSideEffect.NoEffect, Placement = ReactTypeOfSideEffect.Placement, MOUNTING = 1, MOUNTED = 2, UNMOUNTED = 3; function isFiberMountedImpl(fiber) { var node = fiber; @@ -1348,7 +1347,7 @@ var isFiberMounted$1 = function(fiber) { var owner = ReactCurrentOwner.current; if (null !== owner && owner.tag === ClassComponent$1) { var ownerFiber = owner, instance = ownerFiber.stateNode; - warning$4(instance._warnedAboutRefsInRender, "%s is accessing isMounted inside its render() function. " + "render() should be a pure function of props and state. It should " + "never access something that requires stale data from the previous " + "render, such as refs. Move this logic to componentDidMount and " + "componentDidUpdate instead.", getComponentName_1(ownerFiber) || "A component"), + warning$4(instance._warnedAboutRefsInRender, "%s is accessing isMounted inside its render() function. " + "render() should be a pure function of props and state. It should " + "never access something that requires stale data from the previous " + "render, such as refs. Move this logic to componentDidMount and " + "componentDidUpdate instead.", getComponentName_1(ownerFiber) || "A component"), instance._warnedAboutRefsInRender = !0; } var fiber = ReactInstanceMap_1.get(component); @@ -1363,7 +1362,7 @@ function findCurrentFiberUsingSlowPath(fiber) { var alternate = fiber.alternate; if (!alternate) { var state = isFiberMountedImpl(fiber); - return invariant(state !== UNMOUNTED, "Unable to find node on an unmounted component."), + return invariant(state !== UNMOUNTED, "Unable to find node on an unmounted component."), state === MOUNTING ? null : fiber; } for (var a = fiber, b = alternate; !0; ) { @@ -1406,7 +1405,7 @@ function findCurrentFiberUsingSlowPath(fiber) { } invariant(a.alternate === b, "Return fibers should always be each others' alternates."); } - return invariant(a.tag === HostRoot$1, "Unable to find node on an unmounted component."), + return invariant(a.tag === HostRoot$1, "Unable to find node on an unmounted component."), a.stateNode.current === a ? fiber : alternate; } @@ -1414,7 +1413,7 @@ var findCurrentFiberUsingSlowPath_1 = findCurrentFiberUsingSlowPath, findCurrent var currentParent = findCurrentFiberUsingSlowPath(parent); if (!currentParent) return null; for (var node = currentParent; !0; ) { - if (node.tag === HostComponent$1 || node.tag === HostText) return node; + if (node.tag === HostComponent$2 || node.tag === HostText) return node; if (node.child) node.child.return = node, node = node.child; else { if (node === currentParent) return null; for (;!node.sibling; ) { @@ -1438,7 +1437,7 @@ var findCurrentFiberUsingSlowPath_1 = findCurrentFiberUsingSlowPath, findCurrent return -1 === index; }, pop$1 = function(cursor, fiber) { if (index < 0) return void warning(!1, "Unexpected pop."); - fiber !== fiberStack[index] && warning(!1, "Unexpected Fiber popped."), cursor.current = valueStack[index], + fiber !== fiberStack[index] && warning(!1, "Unexpected Fiber popped."), cursor.current = valueStack[index], valueStack[index] = null, fiberStack[index] = null, index--; }, push$1 = function(cursor, value, fiber) { index++, valueStack[index] = cursor.current, fiberStack[index] = fiber, cursor.current = value; @@ -1450,7 +1449,7 @@ var findCurrentFiberUsingSlowPath_1 = findCurrentFiberUsingSlowPath, findCurrent pop: pop$1, push: push$1, reset: reset -}, IndeterminateComponent = ReactTypeOfWork.IndeterminateComponent, FunctionalComponent = ReactTypeOfWork.FunctionalComponent, ClassComponent$2 = ReactTypeOfWork.ClassComponent, HostComponent$2 = ReactTypeOfWork.HostComponent; +}, IndeterminateComponent = ReactTypeOfWork.IndeterminateComponent, FunctionalComponent = ReactTypeOfWork.FunctionalComponent, ClassComponent$2 = ReactTypeOfWork.ClassComponent, HostComponent$3 = ReactTypeOfWork.HostComponent; function describeComponentFrame(name, source, ownerName) { return "\n in " + (name || "Unknown") + (source ? " (at " + source.fileName.replace(/^.*[\\\/]/, "") + ":" + source.lineNumber + ")" : ownerName ? " (created by " + ownerName + ")" : ""); @@ -1461,7 +1460,7 @@ function describeFiber(fiber) { case IndeterminateComponent: case FunctionalComponent: case ClassComponent$2: - case HostComponent$2: + case HostComponent$3: var owner = fiber._debugOwner, source = fiber._debugSource, name = getComponentName_1(fiber), ownerName = null; return owner && (ownerName = getComponentName_1(owner)), describeComponentFrame(name, source, ownerName); @@ -1498,7 +1497,7 @@ var ReactDebugCurrentFiber$2 = { phase: null, getCurrentFiberOwnerName: getCurrentFiberOwnerName, getCurrentFiberStackAddendum: getCurrentFiberStackAddendum -}, ReactDebugCurrentFiber_1 = ReactDebugCurrentFiber$2, ReactDebugFiberPerf = null, _require$2 = ReactTypeOfWork, HostRoot$2 = _require$2.HostRoot, HostComponent$3 = _require$2.HostComponent, HostText$1 = _require$2.HostText, HostPortal = _require$2.HostPortal, YieldComponent = _require$2.YieldComponent, Fragment = _require$2.Fragment, getComponentName$4 = getComponentName_1, reactEmoji = "⚛", warningEmoji = "⛔", supportsUserTiming = "undefined" != typeof performance && "function" == typeof performance.mark && "function" == typeof performance.clearMarks && "function" == typeof performance.measure && "function" == typeof performance.clearMeasures, currentFiber = null, currentPhase = null, currentPhaseFiber = null, isCommitting = !1, hasScheduledUpdateInCurrentCommit = !1, hasScheduledUpdateInCurrentPhase = !1, commitCountInCurrentWorkLoop = 0, effectCountInCurrentCommit = 0, labelsInCurrentCommit = new Set(), formatMarkName = function(markName) { +}, ReactDebugCurrentFiber_1 = ReactDebugCurrentFiber$2, ReactDebugFiberPerf = null, _require$2 = ReactTypeOfWork, HostRoot$2 = _require$2.HostRoot, HostComponent$4 = _require$2.HostComponent, HostText$1 = _require$2.HostText, HostPortal = _require$2.HostPortal, YieldComponent = _require$2.YieldComponent, Fragment = _require$2.Fragment, getComponentName$4 = getComponentName_1, reactEmoji = "⚛", warningEmoji = "⛔", supportsUserTiming = "undefined" != typeof performance && "function" == typeof performance.mark && "function" == typeof performance.clearMarks && "function" == typeof performance.measure && "function" == typeof performance.clearMeasures, currentFiber = null, currentPhase = null, currentPhaseFiber = null, isCommitting = !1, hasScheduledUpdateInCurrentCommit = !1, hasScheduledUpdateInCurrentPhase = !1, commitCountInCurrentWorkLoop = 0, effectCountInCurrentCommit = 0, labelsInCurrentCommit = new Set(), formatMarkName = function(markName) { return reactEmoji + " " + markName; }, formatLabel = function(label, warning$$1) { return (warning$$1 ? warningEmoji + " " : reactEmoji + " ") + label + (warning$$1 ? " Warning: " + warning$$1 : ""); @@ -1531,7 +1530,7 @@ var ReactDebugCurrentFiber$2 = { }, shouldIgnoreFiber = function(fiber) { switch (fiber.tag) { case HostRoot$2: - case HostComponent$3: + case HostComponent$4: case HostText$1: case HostPortal: case YieldComponent: @@ -1542,10 +1541,10 @@ var ReactDebugCurrentFiber$2 = { return !1; } }, clearPendingPhaseMeasurement = function() { - null !== currentPhase && null !== currentPhaseFiber && clearFiberMark(currentPhaseFiber, currentPhase), + null !== currentPhase && null !== currentPhaseFiber && clearFiberMark(currentPhaseFiber, currentPhase), currentPhaseFiber = null, currentPhase = null, hasScheduledUpdateInCurrentPhase = !1; }, pauseTimers = function() { - for (var fiber = currentFiber; fiber; ) fiber._debugIsCurrentlyTiming && endFiberMark(fiber, null, null), + for (var fiber = currentFiber; fiber; ) fiber._debugIsCurrentlyTiming && endFiberMark(fiber, null, null), fiber = fiber.return; }, resumeTimersRecursively = function(fiber) { null !== fiber.return && resumeTimersRecursively(fiber.return), fiber._debugIsCurrentlyTiming && beginFiberMark(fiber, null); @@ -1564,15 +1563,15 @@ ReactDebugFiberPerf = { supportsUserTiming && !shouldIgnoreFiber(fiber) && (currentFiber = fiber, beginFiberMark(fiber, null) && (fiber._debugIsCurrentlyTiming = !0)); }, cancelWorkTimer: function(fiber) { - supportsUserTiming && !shouldIgnoreFiber(fiber) && (fiber._debugIsCurrentlyTiming = !1, + supportsUserTiming && !shouldIgnoreFiber(fiber) && (fiber._debugIsCurrentlyTiming = !1, clearFiberMark(fiber, null)); }, stopWorkTimer: function(fiber) { - supportsUserTiming && !shouldIgnoreFiber(fiber) && (currentFiber = fiber.return, + supportsUserTiming && !shouldIgnoreFiber(fiber) && (currentFiber = fiber.return, fiber._debugIsCurrentlyTiming && (fiber._debugIsCurrentlyTiming = !1, endFiberMark(fiber, null, null))); }, startPhaseTimer: function(fiber, phase) { - supportsUserTiming && (clearPendingPhaseMeasurement(), beginFiberMark(fiber, phase) && (currentPhaseFiber = fiber, + supportsUserTiming && (clearPendingPhaseMeasurement(), beginFiberMark(fiber, phase) && (currentPhaseFiber = fiber, currentPhase = phase)); }, stopPhaseTimer: function() { @@ -1584,7 +1583,7 @@ ReactDebugFiberPerf = { } }, startWorkLoopTimer: function() { - supportsUserTiming && (commitCountInCurrentWorkLoop = 0, beginMark("(React Tree Reconciliation)"), + supportsUserTiming && (commitCountInCurrentWorkLoop = 0, beginMark("(React Tree Reconciliation)"), resumeTimers()); }, stopWorkLoopTimer: function() { @@ -1594,14 +1593,14 @@ ReactDebugFiberPerf = { } }, startCommitTimer: function() { - supportsUserTiming && (isCommitting = !0, hasScheduledUpdateInCurrentCommit = !1, + supportsUserTiming && (isCommitting = !0, hasScheduledUpdateInCurrentCommit = !1, labelsInCurrentCommit.clear(), beginMark("(Committing Changes)")); }, stopCommitTimer: function() { if (supportsUserTiming) { var warning$$1 = null; - hasScheduledUpdateInCurrentCommit ? warning$$1 = "Lifecycle hook scheduled a cascading update" : commitCountInCurrentWorkLoop > 0 && (warning$$1 = "Caused by a cascading update in earlier commit"), - hasScheduledUpdateInCurrentCommit = !1, commitCountInCurrentWorkLoop++, isCommitting = !1, + hasScheduledUpdateInCurrentCommit ? warning$$1 = "Lifecycle hook scheduled a cascading update" : commitCountInCurrentWorkLoop > 0 && (warning$$1 = "Caused by a cascading update in earlier commit"), + hasScheduledUpdateInCurrentCommit = !1, commitCountInCurrentWorkLoop++, isCommitting = !1, labelsInCurrentCommit.clear(), endMark("(Committing Changes)", "(Committing Changes)", warning$$1); } }, @@ -1652,8 +1651,8 @@ var cacheContext_1 = cacheContext, getMaskedContext = function(workInProgress, u var context = {}; for (var key in contextTypes) context[key] = unmaskedContext[key]; var name = getComponentName_1(workInProgress) || "Unknown"; - return ReactDebugCurrentFrame.current = workInProgress, checkPropTypes(contextTypes, context, "context", name, ReactDebugCurrentFrame.getStackAddendum), - ReactDebugCurrentFrame.current = null, instance && cacheContext(workInProgress, unmaskedContext, context), + return ReactDebugCurrentFrame.current = workInProgress, checkPropTypes(contextTypes, context, "context", name, ReactDebugCurrentFrame.getStackAddendum), + ReactDebugCurrentFrame.current = null, instance && cacheContext(workInProgress, unmaskedContext, context), context; }, hasContextChanged = function() { return didPerformWorkStackCursor.current; @@ -1676,7 +1675,7 @@ function popContextProvider(fiber) { } var popContextProvider_1 = popContextProvider, pushTopLevelContextObject = function(fiber, context, didChange) { - invariant(null == contextStackCursor.cursor, "Unexpected context found on stack"), + invariant(null == contextStackCursor.cursor, "Unexpected context found on stack"), push(contextStackCursor, context, fiber), push(didPerformWorkStackCursor, didChange, fiber); }; @@ -1684,30 +1683,30 @@ function processChildContext$1(fiber, parentContext, isReconciling) { var instance = fiber.stateNode, childContextTypes = fiber.type.childContextTypes; if ("function" != typeof instance.getChildContext) { var componentName = getComponentName_1(fiber) || "Unknown"; - return warnedAboutMissingGetChildContext[componentName] || (warnedAboutMissingGetChildContext[componentName] = !0, - warning(!1, "%s.childContextTypes is specified but there is no getChildContext() method " + "on the instance. You can either define getChildContext() on %s or remove " + "childContextTypes from it.", componentName, componentName)), + return warnedAboutMissingGetChildContext[componentName] || (warnedAboutMissingGetChildContext[componentName] = !0, + warning(!1, "%s.childContextTypes is specified but there is no getChildContext() method " + "on the instance. You can either define getChildContext() on %s or remove " + "childContextTypes from it.", componentName, componentName)), parentContext; } var childContext = void 0; - ReactDebugCurrentFiber$1.phase = "getChildContext", startPhaseTimer(fiber, "getChildContext"), + ReactDebugCurrentFiber$1.phase = "getChildContext", startPhaseTimer(fiber, "getChildContext"), childContext = instance.getChildContext(), stopPhaseTimer(), ReactDebugCurrentFiber$1.phase = null; for (var contextKey in childContext) invariant(contextKey in childContextTypes, '%s.getChildContext(): key "%s" is not defined in childContextTypes.', getComponentName_1(fiber) || "Unknown", contextKey); var name = getComponentName_1(fiber) || "Unknown", workInProgress = isReconciling ? fiber : null; - return ReactDebugCurrentFrame.current = workInProgress, checkPropTypes(childContextTypes, childContext, "child context", name, ReactDebugCurrentFrame.getStackAddendum), + return ReactDebugCurrentFrame.current = workInProgress, checkPropTypes(childContextTypes, childContext, "child context", name, ReactDebugCurrentFrame.getStackAddendum), ReactDebugCurrentFrame.current = null, _extends$2({}, parentContext, childContext); } var processChildContext_1 = processChildContext$1, pushContextProvider = function(workInProgress) { if (!isContextProvider$1(workInProgress)) return !1; var instance = workInProgress.stateNode, memoizedMergedChildContext = instance && instance.__reactInternalMemoizedMergedChildContext || emptyObject; - return previousContext = contextStackCursor.current, push(contextStackCursor, memoizedMergedChildContext, workInProgress), + return previousContext = contextStackCursor.current, push(contextStackCursor, memoizedMergedChildContext, workInProgress), push(didPerformWorkStackCursor, !1, workInProgress), !0; }, invalidateContextProvider = function(workInProgress) { var instance = workInProgress.stateNode; invariant(instance, "Expected to have an instance by this point."); var mergedContext = processChildContext$1(workInProgress, previousContext, !0); - instance.__reactInternalMemoizedMergedChildContext = mergedContext, pop(didPerformWorkStackCursor, workInProgress), - pop(contextStackCursor, workInProgress), push(contextStackCursor, mergedContext, workInProgress), + instance.__reactInternalMemoizedMergedChildContext = mergedContext, pop(didPerformWorkStackCursor, workInProgress), + pop(contextStackCursor, workInProgress), push(contextStackCursor, mergedContext, workInProgress), push(didPerformWorkStackCursor, !0, workInProgress); }, resetContext = function() { previousContext = emptyObject, contextStackCursor.current = emptyObject, didPerformWorkStackCursor.current = !1; @@ -1736,7 +1735,7 @@ var processChildContext_1 = processChildContext$1, pushContextProvider = functio }, ReactTypeOfInternalContext = { NoContext: 0, AsyncUpdates: 1 -}, IndeterminateComponent$1 = ReactTypeOfWork.IndeterminateComponent, ClassComponent$3 = ReactTypeOfWork.ClassComponent, HostRoot$3 = ReactTypeOfWork.HostRoot, HostComponent$4 = ReactTypeOfWork.HostComponent, HostText$2 = ReactTypeOfWork.HostText, HostPortal$1 = ReactTypeOfWork.HostPortal, CoroutineComponent = ReactTypeOfWork.CoroutineComponent, YieldComponent$1 = ReactTypeOfWork.YieldComponent, Fragment$1 = ReactTypeOfWork.Fragment, NoWork$1 = ReactPriorityLevel.NoWork, NoContext = ReactTypeOfInternalContext.NoContext, NoEffect$1 = ReactTypeOfSideEffect.NoEffect, cloneUpdateQueue$1 = ReactFiberUpdateQueue.cloneUpdateQueue, getComponentName$5 = getComponentName_1, hasBadMapPolyfill = !1; +}, IndeterminateComponent$1 = ReactTypeOfWork.IndeterminateComponent, ClassComponent$3 = ReactTypeOfWork.ClassComponent, HostRoot$3 = ReactTypeOfWork.HostRoot, HostComponent$5 = ReactTypeOfWork.HostComponent, HostText$2 = ReactTypeOfWork.HostText, HostPortal$1 = ReactTypeOfWork.HostPortal, CoroutineComponent = ReactTypeOfWork.CoroutineComponent, YieldComponent$1 = ReactTypeOfWork.YieldComponent, Fragment$1 = ReactTypeOfWork.Fragment, NoWork$1 = ReactPriorityLevel.NoWork, NoContext = ReactTypeOfInternalContext.NoContext, NoEffect$1 = ReactTypeOfSideEffect.NoEffect, cloneUpdateQueue$1 = ReactFiberUpdateQueue.cloneUpdateQueue, getComponentName$5 = getComponentName_1, hasBadMapPolyfill = !1; try { var nonExtensibleObject = Object.preventExtensions({}); @@ -1772,8 +1771,8 @@ var debugCounter = 1, createFiber = function(tag, key, internalContextTag) { progressedLastDeletion: null, alternate: null }; - return fiber._debugID = debugCounter++, fiber._debugSource = null, fiber._debugOwner = null, - fiber._debugIsCurrentlyTiming = !1, hasBadMapPolyfill || "function" != typeof Object.preventExtensions || Object.preventExtensions(fiber), + return fiber._debugID = debugCounter++, fiber._debugSource = null, fiber._debugOwner = null, + fiber._debugIsCurrentlyTiming = !1, hasBadMapPolyfill || "function" != typeof Object.preventExtensions || Object.preventExtensions(fiber), fiber; }; @@ -1783,14 +1782,14 @@ function shouldConstruct(Component) { var cloneFiber = function(fiber, priorityLevel) { var alt = fiber.alternate; - return null !== alt ? (alt.effectTag = NoEffect$1, alt.nextEffect = null, alt.firstEffect = null, - alt.lastEffect = null) : (alt = createFiber(fiber.tag, fiber.key, fiber.internalContextTag), - alt.type = fiber.type, alt.progressedChild = fiber.progressedChild, alt.progressedPriority = fiber.progressedPriority, - alt.alternate = fiber, fiber.alternate = alt), alt.stateNode = fiber.stateNode, - alt.child = fiber.child, alt.sibling = fiber.sibling, alt.index = fiber.index, alt.ref = fiber.ref, - alt.pendingProps = fiber.pendingProps, cloneUpdateQueue$1(fiber, alt), alt.pendingWorkPriority = priorityLevel, - alt.memoizedProps = fiber.memoizedProps, alt.memoizedState = fiber.memoizedState, - alt._debugID = fiber._debugID, alt._debugSource = fiber._debugSource, alt._debugOwner = fiber._debugOwner, + return null !== alt ? (alt.effectTag = NoEffect$1, alt.nextEffect = null, alt.firstEffect = null, + alt.lastEffect = null) : (alt = createFiber(fiber.tag, fiber.key, fiber.internalContextTag), + alt.type = fiber.type, alt.progressedChild = fiber.progressedChild, alt.progressedPriority = fiber.progressedPriority, + alt.alternate = fiber, fiber.alternate = alt), alt.stateNode = fiber.stateNode, + alt.child = fiber.child, alt.sibling = fiber.sibling, alt.index = fiber.index, alt.ref = fiber.ref, + alt.pendingProps = fiber.pendingProps, cloneUpdateQueue$1(fiber, alt), alt.pendingWorkPriority = priorityLevel, + alt.memoizedProps = fiber.memoizedProps, alt.memoizedState = fiber.memoizedState, + alt._debugID = fiber._debugID, alt._debugSource = fiber._debugSource, alt._debugOwner = fiber._debugOwner, alt; }, createHostRootFiber$1 = function() { return createFiber(HostRoot$3, null, NoContext); @@ -1798,22 +1797,22 @@ var cloneFiber = function(fiber, priorityLevel) { var owner = null; owner = element._owner; var fiber = createFiberFromElementType(element.type, element.key, internalContextTag, owner); - return fiber.pendingProps = element.props, fiber.pendingWorkPriority = priorityLevel, + return fiber.pendingProps = element.props, fiber.pendingWorkPriority = priorityLevel, fiber._debugSource = element._source, fiber._debugOwner = element._owner, fiber; }, createFiberFromFragment = function(elements, internalContextTag, priorityLevel) { var fiber = createFiber(Fragment$1, null, internalContextTag); - return fiber.pendingProps = elements, fiber.pendingWorkPriority = priorityLevel, + return fiber.pendingProps = elements, fiber.pendingWorkPriority = priorityLevel, fiber; }, createFiberFromText = function(content, internalContextTag, priorityLevel) { var fiber = createFiber(HostText$2, null, internalContextTag); - return fiber.pendingProps = content, fiber.pendingWorkPriority = priorityLevel, + return fiber.pendingProps = content, fiber.pendingWorkPriority = priorityLevel, fiber; }; function createFiberFromElementType(type, key, internalContextTag, debugOwner) { var fiber = void 0; - if ("function" == typeof type) fiber = shouldConstruct(type) ? createFiber(ClassComponent$3, key, internalContextTag) : createFiber(IndeterminateComponent$1, key, internalContextTag), - fiber.type = type; else if ("string" == typeof type) fiber = createFiber(HostComponent$4, key, internalContextTag), + if ("function" == typeof type) fiber = shouldConstruct(type) ? createFiber(ClassComponent$3, key, internalContextTag) : createFiber(IndeterminateComponent$1, key, internalContextTag), + fiber.type = type; else if ("string" == typeof type) fiber = createFiber(HostComponent$5, key, internalContextTag), fiber.type = type; else if ("object" == typeof type && null !== type && "number" == typeof type.tag) fiber = type; else { var info = ""; (void 0 === type || "object" == typeof type && null !== type && 0 === Object.keys(type).length) && (info += " You likely forgot to export your component from the file " + "it's defined in."); @@ -1824,17 +1823,17 @@ function createFiberFromElementType(type, key, internalContextTag, debugOwner) { } var createFiberFromElementType_1 = createFiberFromElementType, createFiberFromHostInstanceForDeletion = function() { - var fiber = createFiber(HostComponent$4, null, NoContext); + var fiber = createFiber(HostComponent$5, null, NoContext); return fiber.type = "DELETED", fiber; }, createFiberFromCoroutine = function(coroutine, internalContextTag, priorityLevel) { var fiber = createFiber(CoroutineComponent, coroutine.key, internalContextTag); - return fiber.type = coroutine.handler, fiber.pendingProps = coroutine, fiber.pendingWorkPriority = priorityLevel, + return fiber.type = coroutine.handler, fiber.pendingProps = coroutine, fiber.pendingWorkPriority = priorityLevel, fiber; }, createFiberFromYield = function(yieldNode, internalContextTag, priorityLevel) { return createFiber(YieldComponent$1, null, internalContextTag); }, createFiberFromPortal = function(portal, internalContextTag, priorityLevel) { var fiber = createFiber(HostPortal$1, portal.key, internalContextTag); - return fiber.pendingProps = portal.children || [], fiber.pendingWorkPriority = priorityLevel, + return fiber.pendingProps = portal.children || [], fiber.pendingWorkPriority = priorityLevel, fiber.stateNode = { containerInfo: portal.containerInfo, implementation: portal.implementation @@ -1864,8 +1863,8 @@ var createFiberFromElementType_1 = createFiberFromElementType, createFiberFromHo createFiberRoot: createFiberRoot$1 }, REACT_ELEMENT_TYPE = "function" == typeof Symbol && Symbol.for && Symbol.for("react.element") || 60103, ReactElementSymbol = REACT_ELEMENT_TYPE, REACT_COROUTINE_TYPE$1, REACT_YIELD_TYPE$1; -"function" == typeof Symbol && Symbol.for ? (REACT_COROUTINE_TYPE$1 = Symbol.for("react.coroutine"), -REACT_YIELD_TYPE$1 = Symbol.for("react.yield")) : (REACT_COROUTINE_TYPE$1 = 60104, +"function" == typeof Symbol && Symbol.for ? (REACT_COROUTINE_TYPE$1 = Symbol.for("react.coroutine"), +REACT_YIELD_TYPE$1 = Symbol.for("react.yield")) : (REACT_COROUTINE_TYPE$1 = 60104, REACT_YIELD_TYPE$1 = 60105); var createCoroutine = function(children, handler, props) { @@ -1876,7 +1875,7 @@ var createCoroutine = function(children, handler, props) { handler: handler, props: props }; - return Object.freeze && (Object.freeze(coroutine.props), Object.freeze(coroutine)), + return Object.freeze && (Object.freeze(coroutine.props), Object.freeze(coroutine)), coroutine; }, createYield = function(value) { var yieldNode = { @@ -1904,13 +1903,13 @@ function getIteratorFn(maybeIterable) { var getIteratorFn_1 = getIteratorFn, REACT_COROUTINE_TYPE = ReactCoroutine.REACT_COROUTINE_TYPE, REACT_YIELD_TYPE = ReactCoroutine.REACT_YIELD_TYPE, REACT_PORTAL_TYPE$1 = ReactPortal.REACT_PORTAL_TYPE, _require3$3 = ReactDebugCurrentFiber_1, getCurrentFiberStackAddendum$1 = _require3$3.getCurrentFiberStackAddendum, warning$7 = warning, didWarnAboutMaps = !1, ownerHasKeyUseWarning = {}, warnForMissingKey = function(child) { if (null !== child && "object" == typeof child && child._store && !child._store.validated && null == child.key) { - invariant("object" == typeof child._store, "React Component in warnForMissingKey should have a _store"), + invariant("object" == typeof child._store, "React Component in warnForMissingKey should have a _store"), child._store.validated = !0; - var currentComponentErrorInfo = "Each child in an array or iterator should have a unique " + '"key" prop. See https://fb.me/react-warning-keys for ' + "more information." + (getCurrentFiberStackAddendum$1(child) || ""); - ownerHasKeyUseWarning[currentComponentErrorInfo] || (ownerHasKeyUseWarning[currentComponentErrorInfo] = !0, - warning$7(!1, "Each child in an array or iterator should have a unique " + '"key" prop. See https://fb.me/react-warning-keys for ' + "more information.%s", getCurrentFiberStackAddendum$1(child))); + var currentComponentErrorInfo = "Each child in an array or iterator should have a unique " + '"key" prop. See https://fb.me/react-warning-keys for ' + "more information." + (getCurrentFiberStackAddendum$1() || ""); + ownerHasKeyUseWarning[currentComponentErrorInfo] || (ownerHasKeyUseWarning[currentComponentErrorInfo] = !0, + warning$7(!1, "Each child in an array or iterator should have a unique " + '"key" prop. See https://fb.me/react-warning-keys for ' + "more information.%s", getCurrentFiberStackAddendum$1())); } -}, cloneFiber$2 = ReactFiber.cloneFiber, createFiberFromElement$1 = ReactFiber.createFiberFromElement, createFiberFromFragment$1 = ReactFiber.createFiberFromFragment, createFiberFromText$1 = ReactFiber.createFiberFromText, createFiberFromCoroutine$1 = ReactFiber.createFiberFromCoroutine, createFiberFromYield$1 = ReactFiber.createFiberFromYield, createFiberFromPortal$1 = ReactFiber.createFiberFromPortal, isArray = Array.isArray, FunctionalComponent$2 = ReactTypeOfWork.FunctionalComponent, ClassComponent$6 = ReactTypeOfWork.ClassComponent, HostText$4 = ReactTypeOfWork.HostText, HostPortal$4 = ReactTypeOfWork.HostPortal, CoroutineComponent$2 = ReactTypeOfWork.CoroutineComponent, YieldComponent$3 = ReactTypeOfWork.YieldComponent, Fragment$3 = ReactTypeOfWork.Fragment, NoEffect$3 = ReactTypeOfSideEffect.NoEffect, Placement$3 = ReactTypeOfSideEffect.Placement, Deletion$1 = ReactTypeOfSideEffect.Deletion; +}, cloneFiber$2 = ReactFiber.cloneFiber, createFiberFromElement$1 = ReactFiber.createFiberFromElement, createFiberFromFragment$1 = ReactFiber.createFiberFromFragment, createFiberFromText$1 = ReactFiber.createFiberFromText, createFiberFromCoroutine$1 = ReactFiber.createFiberFromCoroutine, createFiberFromYield$1 = ReactFiber.createFiberFromYield, createFiberFromPortal$1 = ReactFiber.createFiberFromPortal, isArray = Array.isArray, FunctionalComponent$2 = ReactTypeOfWork.FunctionalComponent, ClassComponent$6 = ReactTypeOfWork.ClassComponent, HostText$4 = ReactTypeOfWork.HostText, HostPortal$4 = ReactTypeOfWork.HostPortal, CoroutineComponent$2 = ReactTypeOfWork.CoroutineComponent, YieldComponent$3 = ReactTypeOfWork.YieldComponent, Fragment$3 = ReactTypeOfWork.Fragment, NoEffect$2 = ReactTypeOfSideEffect.NoEffect, Placement$3 = ReactTypeOfSideEffect.Placement, Deletion$1 = ReactTypeOfSideEffect.Deletion; function coerceRef(current, element) { var mixedRef = element.ref; @@ -1918,7 +1917,7 @@ function coerceRef(current, element) { var owner = element._owner, inst = void 0; if (owner) if ("number" == typeof owner.tag) { var ownerFiber = owner; - invariant(ownerFiber.tag === ClassComponent$6, "Stateless function components cannot have refs."), + invariant(ownerFiber.tag === ClassComponent$6, "Stateless function components cannot have refs."), inst = ownerFiber.stateNode; } else inst = owner.getPublicInstance(); invariant(inst, "Missing owner for string ref %s. This error is likely caused by a " + "bug in React. Please file an issue.", mixedRef); @@ -1936,7 +1935,7 @@ function coerceRef(current, element) { function throwOnInvalidObjectType(returnFiber, newChild) { if ("textarea" !== returnFiber.type) { var addendum = ""; - addendum = " If you meant to render a collection of children, use an array " + "instead." + (getCurrentFiberStackAddendum$1() || ""), + addendum = " If you meant to render a collection of children, use an array " + "instead." + (getCurrentFiberStackAddendum$1() || ""), invariant(!1, "Objects are not valid as a React child (found: %s).%s", "[object Object]" === Object.prototype.toString.call(newChild) ? "object with keys {" + Object.keys(newChild).join(", ") + "}" : newChild, addendum); } } @@ -1949,18 +1948,18 @@ function ChildReconciler(shouldClone, shouldTrackSideEffects) { childToDelete = childToDelete.alternate; } var last = returnFiber.progressedLastDeletion; - null !== last ? (last.nextEffect = childToDelete, returnFiber.progressedLastDeletion = childToDelete) : returnFiber.progressedFirstDeletion = returnFiber.progressedLastDeletion = childToDelete, + null !== last ? (last.nextEffect = childToDelete, returnFiber.progressedLastDeletion = childToDelete) : returnFiber.progressedFirstDeletion = returnFiber.progressedLastDeletion = childToDelete, childToDelete.nextEffect = null, childToDelete.effectTag = Deletion$1; } } function deleteRemainingChildren(returnFiber, currentFirstChild) { if (!shouldTrackSideEffects) return null; - for (var childToDelete = currentFirstChild; null !== childToDelete; ) deleteChild(returnFiber, childToDelete), + for (var childToDelete = currentFirstChild; null !== childToDelete; ) deleteChild(returnFiber, childToDelete), childToDelete = childToDelete.sibling; return null; } function mapRemainingChildren(returnFiber, currentFirstChild) { - for (var existingChildren = new Map(), existingChild = currentFirstChild; null !== existingChild; ) null !== existingChild.key ? existingChildren.set(existingChild.key, existingChild) : existingChildren.set(existingChild.index, existingChild), + for (var existingChildren = new Map(), existingChild = currentFirstChild; null !== existingChild; ) null !== existingChild.key ? existingChildren.set(existingChild.key, existingChild) : existingChildren.set(existingChild.index, existingChild), existingChild = existingChild.sibling; return existingChildren; } @@ -1969,7 +1968,7 @@ function ChildReconciler(shouldClone, shouldTrackSideEffects) { var clone = cloneFiber$2(fiber, priority); return clone.index = 0, clone.sibling = null, clone; } - return fiber.pendingWorkPriority = priority, fiber.effectTag = NoEffect$3, fiber.index = 0, + return fiber.pendingWorkPriority = priority, fiber.effectTag = NoEffect$2, fiber.index = 0, fiber.sibling = null, fiber; } function placeChild(newFiber, lastPlacedIndex, newIndex) { @@ -1982,7 +1981,7 @@ function ChildReconciler(shouldClone, shouldTrackSideEffects) { return newFiber.effectTag = Placement$3, lastPlacedIndex; } function placeSingleChild(newFiber) { - return shouldTrackSideEffects && null === newFiber.alternate && (newFiber.effectTag = Placement$3), + return shouldTrackSideEffects && null === newFiber.alternate && (newFiber.effectTag = Placement$3), newFiber; } function updateTextNode(returnFiber, current, textContent, priority) { @@ -1996,12 +1995,12 @@ function ChildReconciler(shouldClone, shouldTrackSideEffects) { function updateElement(returnFiber, current, element, priority) { if (null === current || current.type !== element.type) { var created = createFiberFromElement$1(element, returnFiber.internalContextTag, priority); - return created.ref = coerceRef(current, element), created.return = returnFiber, + return created.ref = coerceRef(current, element), created.return = returnFiber, created; } var existing = useFiber(current, priority); - return existing.ref = coerceRef(current, element), existing.pendingProps = element.props, - existing.return = returnFiber, existing._debugSource = element._source, existing._debugOwner = element._owner, + return existing.ref = coerceRef(current, element), existing.pendingProps = element.props, + existing.return = returnFiber, existing._debugSource = element._source, existing._debugOwner = element._owner, existing; } function updateCoroutine(returnFiber, current, coroutine, priority) { @@ -2026,7 +2025,7 @@ function ChildReconciler(shouldClone, shouldTrackSideEffects) { return created.return = returnFiber, created; } var existing = useFiber(current, priority); - return existing.pendingProps = portal.children || [], existing.return = returnFiber, + return existing.pendingProps = portal.children || [], existing.return = returnFiber, existing; } function updateFragment(returnFiber, current, fragment, priority) { @@ -2046,7 +2045,7 @@ function ChildReconciler(shouldClone, shouldTrackSideEffects) { switch (newChild.$$typeof) { case ReactElementSymbol: var _created = createFiberFromElement$1(newChild, returnFiber.internalContextTag, priority); - return _created.ref = coerceRef(null, newChild), _created.return = returnFiber, + return _created.ref = coerceRef(null, newChild), _created.return = returnFiber, _created; case REACT_COROUTINE_TYPE: @@ -2148,25 +2147,25 @@ function ChildReconciler(shouldClone, shouldTrackSideEffects) { null === oldFiber && (oldFiber = nextOldFiber); break; } - shouldTrackSideEffects && oldFiber && null === newFiber.alternate && deleteChild(returnFiber, oldFiber), - lastPlacedIndex = placeChild(newFiber, lastPlacedIndex, newIdx), null === previousNewFiber ? resultingFirstChild = newFiber : previousNewFiber.sibling = newFiber, + shouldTrackSideEffects && oldFiber && null === newFiber.alternate && deleteChild(returnFiber, oldFiber), + lastPlacedIndex = placeChild(newFiber, lastPlacedIndex, newIdx), null === previousNewFiber ? resultingFirstChild = newFiber : previousNewFiber.sibling = newFiber, previousNewFiber = newFiber, oldFiber = nextOldFiber; } - if (newIdx === newChildren.length) return deleteRemainingChildren(returnFiber, oldFiber), + if (newIdx === newChildren.length) return deleteRemainingChildren(returnFiber, oldFiber), resultingFirstChild; if (null === oldFiber) { for (;newIdx < newChildren.length; newIdx++) { var _newFiber = createChild(returnFiber, newChildren[newIdx], priority); - _newFiber && (lastPlacedIndex = placeChild(_newFiber, lastPlacedIndex, newIdx), - null === previousNewFiber ? resultingFirstChild = _newFiber : previousNewFiber.sibling = _newFiber, + _newFiber && (lastPlacedIndex = placeChild(_newFiber, lastPlacedIndex, newIdx), + null === previousNewFiber ? resultingFirstChild = _newFiber : previousNewFiber.sibling = _newFiber, previousNewFiber = _newFiber); } return resultingFirstChild; } for (var existingChildren = mapRemainingChildren(returnFiber, oldFiber); newIdx < newChildren.length; newIdx++) { var _newFiber2 = updateFromMap(existingChildren, returnFiber, newIdx, newChildren[newIdx], priority); - _newFiber2 && (shouldTrackSideEffects && null !== _newFiber2.alternate && existingChildren.delete(null === _newFiber2.key ? newIdx : _newFiber2.key), - lastPlacedIndex = placeChild(_newFiber2, lastPlacedIndex, newIdx), null === previousNewFiber ? resultingFirstChild = _newFiber2 : previousNewFiber.sibling = _newFiber2, + _newFiber2 && (shouldTrackSideEffects && null !== _newFiber2.alternate && existingChildren.delete(null === _newFiber2.key ? newIdx : _newFiber2.key), + lastPlacedIndex = placeChild(_newFiber2, lastPlacedIndex, newIdx), null === previousNewFiber ? resultingFirstChild = _newFiber2 : previousNewFiber.sibling = _newFiber2, previousNewFiber = _newFiber2); } return shouldTrackSideEffects && existingChildren.forEach(function(child) { @@ -2175,9 +2174,9 @@ function ChildReconciler(shouldClone, shouldTrackSideEffects) { } function reconcileChildrenIterator(returnFiber, currentFirstChild, newChildrenIterable, priority) { var iteratorFn = getIteratorFn_1(newChildrenIterable); - if (invariant("function" == typeof iteratorFn, "An object is not an iterable. This error is likely caused by a bug in " + "React. Please file an issue."), + if (invariant("function" == typeof iteratorFn, "An object is not an iterable. This error is likely caused by a bug in " + "React. Please file an issue."), "function" == typeof newChildrenIterable.entries) { - newChildrenIterable.entries === iteratorFn && (warning$7(didWarnAboutMaps, "Using Maps as children is unsupported and will likely yield " + "unexpected results. Convert it to a sequence/iterable of keyed " + "ReactElements instead.%s", getCurrentFiberStackAddendum$1()), + newChildrenIterable.entries === iteratorFn && (warning$7(didWarnAboutMaps, "Using Maps as children is unsupported and will likely yield " + "unexpected results. Convert it to a sequence/iterable of keyed " + "ReactElements instead.%s", getCurrentFiberStackAddendum$1()), didWarnAboutMaps = !0); } var _newChildren = iteratorFn.call(newChildrenIterable); @@ -2187,7 +2186,7 @@ function ChildReconciler(shouldClone, shouldTrackSideEffects) { } var newChildren = iteratorFn.call(newChildrenIterable); invariant(null != newChildren, "An iterable object provided no iterator."); - for (var resultingFirstChild = null, previousNewFiber = null, oldFiber = currentFirstChild, lastPlacedIndex = 0, newIdx = 0, nextOldFiber = null, step = newChildren.next(); null !== oldFiber && !step.done; newIdx++, + for (var resultingFirstChild = null, previousNewFiber = null, oldFiber = currentFirstChild, lastPlacedIndex = 0, newIdx = 0, nextOldFiber = null, step = newChildren.next(); null !== oldFiber && !step.done; newIdx++, step = newChildren.next()) { oldFiber.index > newIdx ? (nextOldFiber = oldFiber, oldFiber = null) : nextOldFiber = oldFiber.sibling; var newFiber = updateSlot(returnFiber, oldFiber, step.value, priority); @@ -2195,25 +2194,25 @@ function ChildReconciler(shouldClone, shouldTrackSideEffects) { oldFiber || (oldFiber = nextOldFiber); break; } - shouldTrackSideEffects && oldFiber && null === newFiber.alternate && deleteChild(returnFiber, oldFiber), - lastPlacedIndex = placeChild(newFiber, lastPlacedIndex, newIdx), null === previousNewFiber ? resultingFirstChild = newFiber : previousNewFiber.sibling = newFiber, + shouldTrackSideEffects && oldFiber && null === newFiber.alternate && deleteChild(returnFiber, oldFiber), + lastPlacedIndex = placeChild(newFiber, lastPlacedIndex, newIdx), null === previousNewFiber ? resultingFirstChild = newFiber : previousNewFiber.sibling = newFiber, previousNewFiber = newFiber, oldFiber = nextOldFiber; } if (step.done) return deleteRemainingChildren(returnFiber, oldFiber), resultingFirstChild; if (null === oldFiber) { for (;!step.done; newIdx++, step = newChildren.next()) { var _newFiber3 = createChild(returnFiber, step.value, priority); - null !== _newFiber3 && (lastPlacedIndex = placeChild(_newFiber3, lastPlacedIndex, newIdx), - null === previousNewFiber ? resultingFirstChild = _newFiber3 : previousNewFiber.sibling = _newFiber3, + null !== _newFiber3 && (lastPlacedIndex = placeChild(_newFiber3, lastPlacedIndex, newIdx), + null === previousNewFiber ? resultingFirstChild = _newFiber3 : previousNewFiber.sibling = _newFiber3, previousNewFiber = _newFiber3); } return resultingFirstChild; } - for (var existingChildren = mapRemainingChildren(returnFiber, oldFiber); !step.done; newIdx++, + for (var existingChildren = mapRemainingChildren(returnFiber, oldFiber); !step.done; newIdx++, step = newChildren.next()) { var _newFiber4 = updateFromMap(existingChildren, returnFiber, newIdx, step.value, priority); - null !== _newFiber4 && (shouldTrackSideEffects && null !== _newFiber4.alternate && existingChildren.delete(null === _newFiber4.key ? newIdx : _newFiber4.key), - lastPlacedIndex = placeChild(_newFiber4, lastPlacedIndex, newIdx), null === previousNewFiber ? resultingFirstChild = _newFiber4 : previousNewFiber.sibling = _newFiber4, + null !== _newFiber4 && (shouldTrackSideEffects && null !== _newFiber4.alternate && existingChildren.delete(null === _newFiber4.key ? newIdx : _newFiber4.key), + lastPlacedIndex = placeChild(_newFiber4, lastPlacedIndex, newIdx), null === previousNewFiber ? resultingFirstChild = _newFiber4 : previousNewFiber.sibling = _newFiber4, previousNewFiber = _newFiber4); } return shouldTrackSideEffects && existingChildren.forEach(function(child) { @@ -2236,8 +2235,8 @@ function ChildReconciler(shouldClone, shouldTrackSideEffects) { if (child.type === element.type) { deleteRemainingChildren(returnFiber, child.sibling); var existing = useFiber(child, priority); - return existing.ref = coerceRef(child, element), existing.pendingProps = element.props, - existing.return = returnFiber, existing._debugSource = element._source, existing._debugOwner = element._owner, + return existing.ref = coerceRef(child, element), existing.pendingProps = element.props, + existing.return = returnFiber, existing._debugSource = element._source, existing._debugOwner = element._owner, existing; } deleteRemainingChildren(returnFiber, child); @@ -2246,7 +2245,7 @@ function ChildReconciler(shouldClone, shouldTrackSideEffects) { deleteChild(returnFiber, child), child = child.sibling; } var created = createFiberFromElement$1(element, returnFiber.internalContextTag, priority); - return created.ref = coerceRef(currentFirstChild, element), created.return = returnFiber, + return created.ref = coerceRef(currentFirstChild, element), created.return = returnFiber, created; } function reconcileSingleCoroutine(returnFiber, currentFirstChild, coroutine, priority) { @@ -2284,7 +2283,7 @@ function ChildReconciler(shouldClone, shouldTrackSideEffects) { if (child.tag === HostPortal$4 && child.stateNode.containerInfo === portal.containerInfo && child.stateNode.implementation === portal.implementation) { deleteRemainingChildren(returnFiber, child.sibling); var existing = useFiber(child, priority); - return existing.pendingProps = portal.children || [], existing.return = returnFiber, + return existing.pendingProps = portal.children || [], existing.return = returnFiber, existing; } deleteRemainingChildren(returnFiber, child); @@ -2346,11 +2345,11 @@ function ChildReconciler(shouldClone, shouldTrackSideEffects) { var reconcileChildFibers$1 = ChildReconciler(!0, !0), reconcileChildFibersInPlace$1 = ChildReconciler(!1, !0), mountChildFibersInPlace$1 = ChildReconciler(!1, !1), cloneChildFibers$1 = function(current, workInProgress) { if (workInProgress.child) if (null !== current && workInProgress.child === current.child) { var currentChild = workInProgress.child, newChild = cloneFiber$2(currentChild, currentChild.pendingWorkPriority); - for (workInProgress.child = newChild, newChild.return = workInProgress; null !== currentChild.sibling; ) currentChild = currentChild.sibling, - newChild = newChild.sibling = cloneFiber$2(currentChild, currentChild.pendingWorkPriority), + for (workInProgress.child = newChild, newChild.return = workInProgress; null !== currentChild.sibling; ) currentChild = currentChild.sibling, + newChild = newChild.sibling = cloneFiber$2(currentChild, currentChild.pendingWorkPriority), newChild.return = workInProgress; newChild.sibling = null; - } else for (var child = workInProgress.child; null !== child; ) child.return = workInProgress, + } else for (var child = workInProgress.child; null !== child; ) child.return = workInProgress, child = child.sibling; }, ReactChildFiber = { reconcileChildFibers: reconcileChildFibers$1, @@ -2364,17 +2363,17 @@ var reconcileChildFibers$1 = ChildReconciler(!0, !0), reconcileChildFibersInPlac isMounted: isMounted$1, enqueueSetState: function(instance, partialState, callback) { var fiber = ReactInstanceMap_1.get(instance), priorityLevel = getPriorityContext(fiber, !1); - callback = void 0 === callback ? null : callback, warnOnInvalidCallback(callback, "setState"), + callback = void 0 === callback ? null : callback, warnOnInvalidCallback(callback, "setState"), addUpdate$1(fiber, partialState, callback, priorityLevel), scheduleUpdate(fiber, priorityLevel); }, enqueueReplaceState: function(instance, state, callback) { var fiber = ReactInstanceMap_1.get(instance), priorityLevel = getPriorityContext(fiber, !1); - callback = void 0 === callback ? null : callback, warnOnInvalidCallback(callback, "replaceState"), + callback = void 0 === callback ? null : callback, warnOnInvalidCallback(callback, "replaceState"), addReplaceUpdate$1(fiber, state, callback, priorityLevel), scheduleUpdate(fiber, priorityLevel); }, enqueueForceUpdate: function(instance, callback) { var fiber = ReactInstanceMap_1.get(instance), priorityLevel = getPriorityContext(fiber, !1); - callback = void 0 === callback ? null : callback, warnOnInvalidCallback(callback, "forceUpdate"), + callback = void 0 === callback ? null : callback, warnOnInvalidCallback(callback, "forceUpdate"), addForceUpdate$1(fiber, callback, priorityLevel), scheduleUpdate(fiber, priorityLevel); } }; @@ -2384,7 +2383,7 @@ var reconcileChildFibers$1 = ChildReconciler(!0, !0), reconcileChildFibersInPlac if ("function" == typeof instance.shouldComponentUpdate) { startPhaseTimer$1(workInProgress, "shouldComponentUpdate"); var shouldUpdate = instance.shouldComponentUpdate(newProps, newState, newContext); - return stopPhaseTimer$1(), warning$8(void 0 !== shouldUpdate, "%s.shouldComponentUpdate(): Returned undefined instead of a " + "boolean value. Make sure to return true or false.", getComponentName_1(workInProgress) || "Unknown"), + return stopPhaseTimer$1(), warning$8(void 0 !== shouldUpdate, "%s.shouldComponentUpdate(): Returned undefined instead of a " + "boolean value. Make sure to return true or false.", getComponentName_1(workInProgress) || "Unknown"), shouldUpdate; } return !type.prototype || !type.prototype.isPureReactComponent || (!shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState)); @@ -2401,7 +2400,7 @@ var reconcileChildFibers$1 = ChildReconciler(!0, !0), reconcileChildFibersInPlac var noInstanceContextTypes = !instance.contextTypes; warning$8(noInstanceContextTypes, "contextTypes was defined as an instance property on %s. Use a static " + "property to define contextTypes instead.", name); var noComponentShouldUpdate = "function" != typeof instance.componentShouldUpdate; - warning$8(noComponentShouldUpdate, "%s has a method called " + "componentShouldUpdate(). Did you mean shouldComponentUpdate()? " + "The name is phrased as a question because the function is " + "expected to return a value.", name), + warning$8(noComponentShouldUpdate, "%s has a method called " + "componentShouldUpdate(). Did you mean shouldComponentUpdate()? " + "The name is phrased as a question because the function is " + "expected to return a value.", name), type.prototype && type.prototype.isPureReactComponent && void 0 !== instance.shouldComponentUpdate && warning$8(!1, "%s has a method called shouldComponentUpdate(). " + "shouldComponentUpdate should not be used when extending React.PureComponent. " + "Please extend React.Component if shouldComponentUpdate is used.", getComponentName_1(workInProgress) || "A pure component"); var noComponentDidUnmount = "function" != typeof instance.componentDidUnmount; warning$8(noComponentDidUnmount, "%s has a method called " + "componentDidUnmount(). But there is no such lifecycle method. " + "Did you mean componentWillUnmount()?", name); @@ -2412,7 +2411,7 @@ var reconcileChildFibers$1 = ChildReconciler(!0, !0), reconcileChildFibersInPlac var noInstanceDefaultProps = !instance.defaultProps; warning$8(noInstanceDefaultProps, "Setting defaultProps as an instance property on %s is not supported and will be ignored." + " Instead, define defaultProps as a static property on %s.", name, name); var state = instance.state; - state && ("object" != typeof state || isArray$1(state)) && invariant(!1, "%s.state: must be set to an object or null", getComponentName_1(workInProgress)), + state && ("object" != typeof state || isArray$1(state)) && invariant(!1, "%s.state: must be set to an object or null", getComponentName_1(workInProgress)), "function" == typeof instance.getChildContext && invariant("object" == typeof workInProgress.type.childContextTypes, "%s.getChildContext(): childContextTypes must be defined in order to " + "use getChildContext().", getComponentName_1(workInProgress)); } function resetInputPointers(workInProgress, instance) { @@ -2423,19 +2422,19 @@ var reconcileChildFibers$1 = ChildReconciler(!0, !0), reconcileChildFibersInPlac } function constructClassInstance(workInProgress, props) { var ctor = workInProgress.type, unmaskedContext = getUnmaskedContext$2(workInProgress), needsContext = isContextConsumer$1(workInProgress), context = needsContext ? getMaskedContext$2(workInProgress, unmaskedContext) : emptyObject, instance = new ctor(props, context); - return adoptClassInstance(workInProgress, instance), needsContext && cacheContext$1(workInProgress, unmaskedContext, context), + return adoptClassInstance(workInProgress, instance), needsContext && cacheContext$1(workInProgress, unmaskedContext, context), instance; } function callComponentWillMount(workInProgress, instance) { startPhaseTimer$1(workInProgress, "componentWillMount"); var oldState = instance.state; - instance.componentWillMount(), stopPhaseTimer$1(), oldState !== instance.state && (warning$8(!1, "%s.componentWillMount(): Assigning directly to this.state is " + "deprecated (except inside a component's " + "constructor). Use setState instead.", getComponentName_1(workInProgress)), + instance.componentWillMount(), stopPhaseTimer$1(), oldState !== instance.state && (warning$8(!1, "%s.componentWillMount(): Assigning directly to this.state is " + "deprecated (except inside a component's " + "constructor). Use setState instead.", getComponentName_1(workInProgress)), updater.enqueueReplaceState(instance, instance.state, null)); } function callComponentWillReceiveProps(workInProgress, instance, newProps, newContext) { startPhaseTimer$1(workInProgress, "componentWillReceiveProps"); var oldState = instance.state; - instance.componentWillReceiveProps(newProps, newContext), stopPhaseTimer$1(), instance.state !== oldState && (warning$8(!1, "%s.componentWillReceiveProps(): Assigning directly to " + "this.state is deprecated (except inside a component's " + "constructor). Use setState instead.", getComponentName_1(workInProgress)), + instance.componentWillReceiveProps(newProps, newContext), stopPhaseTimer$1(), instance.state !== oldState && (warning$8(!1, "%s.componentWillReceiveProps(): Assigning directly to " + "this.state is deprecated (except inside a component's " + "constructor). Use setState instead.", getComponentName_1(workInProgress)), updater.enqueueReplaceState(instance, instance.state, null)); } function mountClassInstance(workInProgress, priorityLevel) { @@ -2443,8 +2442,8 @@ var reconcileChildFibers$1 = ChildReconciler(!0, !0), reconcileChildFibersInPlac var instance = workInProgress.stateNode, state = instance.state || null, props = workInProgress.pendingProps; invariant(props, "There must be pending props for an initial mount. This error is " + "likely caused by a bug in React. Please file an issue."); var unmaskedContext = getUnmaskedContext$2(workInProgress); - if (instance.props = props, instance.state = state, instance.refs = emptyObject, - instance.context = getMaskedContext$2(workInProgress, unmaskedContext), ReactFeatureFlags_1.enableAsyncSubtreeAPI && null != workInProgress.type && !0 === workInProgress.type.unstable_asyncUpdates && (workInProgress.internalContextTag |= AsyncUpdates$1), + if (instance.props = props, instance.state = state, instance.refs = emptyObject, + instance.context = getMaskedContext$2(workInProgress, unmaskedContext), ReactFeatureFlags_1.enableAsyncSubtreeAPI && null != workInProgress.type && !0 === workInProgress.type.unstable_asyncUpdates && (workInProgress.internalContextTag |= AsyncUpdates$1), "function" == typeof instance.componentWillMount) { callComponentWillMount(workInProgress, instance); var updateQueue = workInProgress.updateQueue; @@ -2460,16 +2459,16 @@ var reconcileChildFibers$1 = ChildReconciler(!0, !0), reconcileChildFibersInPlac var newUnmaskedContext = getUnmaskedContext$2(workInProgress), newContext = getMaskedContext$2(workInProgress, newUnmaskedContext), oldContext = instance.context, oldProps = workInProgress.memoizedProps; "function" != typeof instance.componentWillReceiveProps || oldProps === newProps && oldContext === newContext || callComponentWillReceiveProps(workInProgress, instance, newProps, newContext); var updateQueue = workInProgress.updateQueue; - if (null !== updateQueue && (newState = beginUpdateQueue$2(workInProgress, updateQueue, instance, newState, newProps, priorityLevel)), - !checkShouldComponentUpdate(workInProgress, workInProgress.memoizedProps, newProps, workInProgress.memoizedState, newState, newContext)) return instance.props = newProps, + if (null !== updateQueue && (newState = beginUpdateQueue$2(workInProgress, updateQueue, instance, newState, newProps, priorityLevel)), + !checkShouldComponentUpdate(workInProgress, workInProgress.memoizedProps, newProps, workInProgress.memoizedState, newState, newContext)) return instance.props = newProps, instance.state = newState, instance.context = newContext, !1; - if (instance.props = newProps, instance.state = newState, instance.context = newContext, + if (instance.props = newProps, instance.state = newState, instance.context = newContext, "function" == typeof instance.componentWillMount) { callComponentWillMount(workInProgress, instance); var newUpdateQueue = workInProgress.updateQueue; null !== newUpdateQueue && (newState = beginUpdateQueue$2(workInProgress, newUpdateQueue, instance, newState, newProps, priorityLevel)); } - return "function" == typeof instance.componentDidMount && (workInProgress.effectTag |= Update$1), + return "function" == typeof instance.componentDidMount && (workInProgress.effectTag |= Update$1), instance.state = newState, !0; } function updateClassInstance(current, workInProgress, priorityLevel) { @@ -2480,15 +2479,15 @@ var reconcileChildFibers$1 = ChildReconciler(!0, !0), reconcileChildFibersInPlac var oldContext = instance.context, newUnmaskedContext = getUnmaskedContext$2(workInProgress), newContext = getMaskedContext$2(workInProgress, newUnmaskedContext); "function" != typeof instance.componentWillReceiveProps || oldProps === newProps && oldContext === newContext || callComponentWillReceiveProps(workInProgress, instance, newProps, newContext); var updateQueue = workInProgress.updateQueue, oldState = workInProgress.memoizedState, newState = void 0; - if (newState = null !== updateQueue ? beginUpdateQueue$2(workInProgress, updateQueue, instance, oldState, newProps, priorityLevel) : oldState, - !(oldProps !== newProps || oldState !== newState || hasContextChanged$2() || null !== updateQueue && updateQueue.hasForceUpdate)) return "function" == typeof instance.componentDidUpdate && (oldProps === current.memoizedProps && oldState === current.memoizedState || (workInProgress.effectTag |= Update$1)), + if (newState = null !== updateQueue ? beginUpdateQueue$2(workInProgress, updateQueue, instance, oldState, newProps, priorityLevel) : oldState, + !(oldProps !== newProps || oldState !== newState || hasContextChanged$2() || null !== updateQueue && updateQueue.hasForceUpdate)) return "function" == typeof instance.componentDidUpdate && (oldProps === current.memoizedProps && oldState === current.memoizedState || (workInProgress.effectTag |= Update$1)), !1; var shouldUpdate = checkShouldComponentUpdate(workInProgress, oldProps, newProps, oldState, newState, newContext); - return shouldUpdate ? ("function" == typeof instance.componentWillUpdate && (startPhaseTimer$1(workInProgress, "componentWillUpdate"), - instance.componentWillUpdate(newProps, newState, newContext), stopPhaseTimer$1()), - "function" == typeof instance.componentDidUpdate && (workInProgress.effectTag |= Update$1)) : ("function" == typeof instance.componentDidUpdate && (oldProps === current.memoizedProps && oldState === current.memoizedState || (workInProgress.effectTag |= Update$1)), - memoizeProps(workInProgress, newProps), memoizeState(workInProgress, newState)), - instance.props = newProps, instance.state = newState, instance.context = newContext, + return shouldUpdate ? ("function" == typeof instance.componentWillUpdate && (startPhaseTimer$1(workInProgress, "componentWillUpdate"), + instance.componentWillUpdate(newProps, newState, newContext), stopPhaseTimer$1()), + "function" == typeof instance.componentDidUpdate && (workInProgress.effectTag |= Update$1)) : ("function" == typeof instance.componentDidUpdate && (oldProps === current.memoizedProps && oldState === current.memoizedState || (workInProgress.effectTag |= Update$1)), + memoizeProps(workInProgress, newProps), memoizeState(workInProgress, newState)), + instance.props = newProps, instance.state = newState, instance.context = newContext, shouldUpdate; } return { @@ -2498,10 +2497,10 @@ var reconcileChildFibers$1 = ChildReconciler(!0, !0), reconcileChildFibersInPlac resumeMountClassInstance: resumeMountClassInstance, updateClassInstance: updateClassInstance }; -}, mountChildFibersInPlace = ReactChildFiber.mountChildFibersInPlace, reconcileChildFibers = ReactChildFiber.reconcileChildFibers, reconcileChildFibersInPlace = ReactChildFiber.reconcileChildFibersInPlace, cloneChildFibers = ReactChildFiber.cloneChildFibers, beginUpdateQueue$1 = ReactFiberUpdateQueue.beginUpdateQueue, getMaskedContext$1 = ReactFiberContext.getMaskedContext, getUnmaskedContext$1 = ReactFiberContext.getUnmaskedContext, hasContextChanged$1 = ReactFiberContext.hasContextChanged, pushContextProvider$1 = ReactFiberContext.pushContextProvider, pushTopLevelContextObject$1 = ReactFiberContext.pushTopLevelContextObject, invalidateContextProvider$1 = ReactFiberContext.invalidateContextProvider, IndeterminateComponent$2 = ReactTypeOfWork.IndeterminateComponent, FunctionalComponent$1 = ReactTypeOfWork.FunctionalComponent, ClassComponent$5 = ReactTypeOfWork.ClassComponent, HostRoot$5 = ReactTypeOfWork.HostRoot, HostComponent$6 = ReactTypeOfWork.HostComponent, HostText$3 = ReactTypeOfWork.HostText, HostPortal$3 = ReactTypeOfWork.HostPortal, CoroutineComponent$1 = ReactTypeOfWork.CoroutineComponent, CoroutineHandlerPhase = ReactTypeOfWork.CoroutineHandlerPhase, YieldComponent$2 = ReactTypeOfWork.YieldComponent, Fragment$2 = ReactTypeOfWork.Fragment, NoWork$3 = ReactPriorityLevel.NoWork, OffscreenPriority$1 = ReactPriorityLevel.OffscreenPriority, Placement$2 = ReactTypeOfSideEffect.Placement, ContentReset$1 = ReactTypeOfSideEffect.ContentReset, Err$1 = ReactTypeOfSideEffect.Err, Ref$1 = ReactTypeOfSideEffect.Ref, ReactCurrentOwner$2 = ReactGlobalSharedState_1.ReactCurrentOwner, ReactDebugCurrentFiber$4 = ReactDebugCurrentFiber_1, _require7 = ReactDebugFiberPerf_1, cancelWorkTimer = _require7.cancelWorkTimer, warning$6 = warning, warnedAboutStatelessRefs = {}, ReactFiberBeginWork = function(config, hostContext, hydrationContext, scheduleUpdate, getPriorityContext) { +}, mountChildFibersInPlace = ReactChildFiber.mountChildFibersInPlace, reconcileChildFibers = ReactChildFiber.reconcileChildFibers, reconcileChildFibersInPlace = ReactChildFiber.reconcileChildFibersInPlace, cloneChildFibers = ReactChildFiber.cloneChildFibers, beginUpdateQueue$1 = ReactFiberUpdateQueue.beginUpdateQueue, getMaskedContext$1 = ReactFiberContext.getMaskedContext, getUnmaskedContext$1 = ReactFiberContext.getUnmaskedContext, hasContextChanged$1 = ReactFiberContext.hasContextChanged, pushContextProvider$1 = ReactFiberContext.pushContextProvider, pushTopLevelContextObject$1 = ReactFiberContext.pushTopLevelContextObject, invalidateContextProvider$1 = ReactFiberContext.invalidateContextProvider, IndeterminateComponent$2 = ReactTypeOfWork.IndeterminateComponent, FunctionalComponent$1 = ReactTypeOfWork.FunctionalComponent, ClassComponent$5 = ReactTypeOfWork.ClassComponent, HostRoot$5 = ReactTypeOfWork.HostRoot, HostComponent$7 = ReactTypeOfWork.HostComponent, HostText$3 = ReactTypeOfWork.HostText, HostPortal$3 = ReactTypeOfWork.HostPortal, CoroutineComponent$1 = ReactTypeOfWork.CoroutineComponent, CoroutineHandlerPhase = ReactTypeOfWork.CoroutineHandlerPhase, YieldComponent$2 = ReactTypeOfWork.YieldComponent, Fragment$2 = ReactTypeOfWork.Fragment, NoWork$3 = ReactPriorityLevel.NoWork, OffscreenPriority$1 = ReactPriorityLevel.OffscreenPriority, PerformedWork$1 = ReactTypeOfSideEffect.PerformedWork, Placement$2 = ReactTypeOfSideEffect.Placement, ContentReset$1 = ReactTypeOfSideEffect.ContentReset, Err$1 = ReactTypeOfSideEffect.Err, Ref$1 = ReactTypeOfSideEffect.Ref, ReactCurrentOwner$2 = ReactGlobalSharedState_1.ReactCurrentOwner, ReactDebugCurrentFiber$4 = ReactDebugCurrentFiber_1, _require7 = ReactDebugFiberPerf_1, cancelWorkTimer = _require7.cancelWorkTimer, warning$6 = warning, warnedAboutStatelessRefs = {}, ReactFiberBeginWork = function(config, hostContext, hydrationContext, scheduleUpdate, getPriorityContext) { var shouldSetTextContent = config.shouldSetTextContent, useSyncScheduling = config.useSyncScheduling, shouldDeprioritizeSubtree = config.shouldDeprioritizeSubtree, pushHostContext = hostContext.pushHostContext, pushHostContainer = hostContext.pushHostContainer, enterHydrationState = hydrationContext.enterHydrationState, resetHydrationState = hydrationContext.resetHydrationState, tryToClaimNextHydratableInstance = hydrationContext.tryToClaimNextHydratableInstance, _ReactFiberClassCompo = ReactFiberClassComponent(scheduleUpdate, getPriorityContext, memoizeProps, memoizeState), adoptClassInstance = _ReactFiberClassCompo.adoptClassInstance, constructClassInstance = _ReactFiberClassCompo.constructClassInstance, mountClassInstance = _ReactFiberClassCompo.mountClassInstance, resumeMountClassInstance = _ReactFiberClassCompo.resumeMountClassInstance, updateClassInstance = _ReactFiberClassCompo.updateClassInstance; function markChildAsProgressed(current, workInProgress, priorityLevel) { - workInProgress.progressedChild = workInProgress.child, workInProgress.progressedPriority = priorityLevel, + workInProgress.progressedChild = workInProgress.child, workInProgress.progressedPriority = priorityLevel, null !== current && (current.progressedChild = workInProgress.progressedChild, current.progressedPriority = workInProgress.progressedPriority); } function clearDeletions(workInProgress) { @@ -2514,15 +2513,15 @@ var reconcileChildFibers$1 = ChildReconciler(!0, !0), reconcileChildFibersInPlac reconcileChildrenAtPriority(current, workInProgress, nextChildren, workInProgress.pendingWorkPriority); } function reconcileChildrenAtPriority(current, workInProgress, nextChildren, priorityLevel) { - workInProgress.memoizedProps = null, null === current ? workInProgress.child = mountChildFibersInPlace(workInProgress, workInProgress.child, nextChildren, priorityLevel) : current.child === workInProgress.child ? (clearDeletions(workInProgress), - workInProgress.child = reconcileChildFibers(workInProgress, workInProgress.child, nextChildren, priorityLevel), - transferDeletions(workInProgress)) : (workInProgress.child = reconcileChildFibersInPlace(workInProgress, workInProgress.child, nextChildren, priorityLevel), + workInProgress.memoizedProps = null, null === current ? workInProgress.child = mountChildFibersInPlace(workInProgress, workInProgress.child, nextChildren, priorityLevel) : current.child === workInProgress.child ? (clearDeletions(workInProgress), + workInProgress.child = reconcileChildFibers(workInProgress, workInProgress.child, nextChildren, priorityLevel), + transferDeletions(workInProgress)) : (workInProgress.child = reconcileChildFibersInPlace(workInProgress, workInProgress.child, nextChildren, priorityLevel), transferDeletions(workInProgress)), markChildAsProgressed(current, workInProgress, priorityLevel); } function updateFragment(current, workInProgress) { var nextChildren = workInProgress.pendingProps; if (hasContextChanged$1()) null === nextChildren && (nextChildren = workInProgress.memoizedProps); else if (null === nextChildren || workInProgress.memoizedProps === nextChildren) return bailoutOnAlreadyFinishedWork(current, workInProgress); - return reconcileChildren(current, workInProgress, nextChildren), memoizeProps(workInProgress, nextChildren), + return reconcileChildren(current, workInProgress, nextChildren), memoizeProps(workInProgress, nextChildren), workInProgress.child; } function markRef(current, workInProgress) { @@ -2533,18 +2532,19 @@ var reconcileChildFibers$1 = ChildReconciler(!0, !0), reconcileChildFibersInPlac var fn = workInProgress.type, nextProps = workInProgress.pendingProps, memoizedProps = workInProgress.memoizedProps; if (hasContextChanged$1()) null === nextProps && (nextProps = memoizedProps); else { if (null === nextProps || memoizedProps === nextProps) return bailoutOnAlreadyFinishedWork(current, workInProgress); - if ("function" == typeof fn.shouldComponentUpdate && !fn.shouldComponentUpdate(memoizedProps, nextProps)) return memoizeProps(workInProgress, nextProps), + if ("function" == typeof fn.shouldComponentUpdate && !fn.shouldComponentUpdate(memoizedProps, nextProps)) return memoizeProps(workInProgress, nextProps), bailoutOnAlreadyFinishedWork(current, workInProgress); } var nextChildren, unmaskedContext = getUnmaskedContext$1(workInProgress), context = getMaskedContext$1(workInProgress, unmaskedContext); - return ReactCurrentOwner$2.current = workInProgress, ReactDebugCurrentFiber$4.phase = "render", - nextChildren = fn(nextProps, context), ReactDebugCurrentFiber$4.phase = null, reconcileChildren(current, workInProgress, nextChildren), - memoizeProps(workInProgress, nextProps), workInProgress.child; + return ReactCurrentOwner$2.current = workInProgress, ReactDebugCurrentFiber$4.phase = "render", + nextChildren = fn(nextProps, context), ReactDebugCurrentFiber$4.phase = null, workInProgress.effectTag |= PerformedWork$1, + reconcileChildren(current, workInProgress, nextChildren), memoizeProps(workInProgress, nextProps), + workInProgress.child; } function updateClassComponent(current, workInProgress, priorityLevel) { var hasContext = pushContextProvider$1(workInProgress), shouldUpdate = void 0; - return null === current ? workInProgress.stateNode ? shouldUpdate = resumeMountClassInstance(workInProgress, priorityLevel) : (constructClassInstance(workInProgress, workInProgress.pendingProps), - mountClassInstance(workInProgress, priorityLevel), shouldUpdate = !0) : shouldUpdate = updateClassInstance(current, workInProgress, priorityLevel), + return null === current ? workInProgress.stateNode ? shouldUpdate = resumeMountClassInstance(workInProgress, priorityLevel) : (constructClassInstance(workInProgress, workInProgress.pendingProps), + mountClassInstance(workInProgress, priorityLevel), shouldUpdate = !0) : shouldUpdate = updateClassInstance(current, workInProgress, priorityLevel), finishClassComponent(current, workInProgress, shouldUpdate, hasContext); } function finishClassComponent(current, workInProgress, shouldUpdate, hasContext) { @@ -2552,105 +2552,108 @@ var reconcileChildFibers$1 = ChildReconciler(!0, !0), reconcileChildFibersInPlac var instance = workInProgress.stateNode; ReactCurrentOwner$2.current = workInProgress; var nextChildren = void 0; - return ReactDebugCurrentFiber$4.phase = "render", nextChildren = instance.render(), - ReactDebugCurrentFiber$4.phase = null, reconcileChildren(current, workInProgress, nextChildren), - memoizeState(workInProgress, instance.state), memoizeProps(workInProgress, instance.props), - hasContext && invalidateContextProvider$1(workInProgress), workInProgress.child; + return ReactDebugCurrentFiber$4.phase = "render", nextChildren = instance.render(), + ReactDebugCurrentFiber$4.phase = null, workInProgress.effectTag |= PerformedWork$1, + reconcileChildren(current, workInProgress, nextChildren), memoizeState(workInProgress, instance.state), + memoizeProps(workInProgress, instance.props), hasContext && invalidateContextProvider$1(workInProgress), + workInProgress.child; } function updateHostRoot(current, workInProgress, priorityLevel) { var root = workInProgress.stateNode; - root.pendingContext ? pushTopLevelContextObject$1(workInProgress, root.pendingContext, root.pendingContext !== root.context) : root.context && pushTopLevelContextObject$1(workInProgress, root.context, !1), + root.pendingContext ? pushTopLevelContextObject$1(workInProgress, root.pendingContext, root.pendingContext !== root.context) : root.context && pushTopLevelContextObject$1(workInProgress, root.context, !1), pushHostContainer(workInProgress, root.containerInfo); var updateQueue = workInProgress.updateQueue; if (null !== updateQueue) { var prevState = workInProgress.memoizedState, state = beginUpdateQueue$1(workInProgress, updateQueue, null, prevState, null, priorityLevel); if (prevState === state) return resetHydrationState(), bailoutOnAlreadyFinishedWork(current, workInProgress); var element = state.element; - return null !== current && null !== current.child || !enterHydrationState(workInProgress) ? (resetHydrationState(), - reconcileChildren(current, workInProgress, element), memoizeState(workInProgress, state), - workInProgress.child) : (workInProgress.effectTag |= Placement$2, workInProgress.child = mountChildFibersInPlace(workInProgress, workInProgress.child, element, priorityLevel), - markChildAsProgressed(current, workInProgress, priorityLevel), workInProgress.child); + return null !== current && null !== current.child || !enterHydrationState(workInProgress) ? (resetHydrationState(), + reconcileChildren(current, workInProgress, element)) : (workInProgress.effectTag |= Placement$2, + workInProgress.child = mountChildFibersInPlace(workInProgress, workInProgress.child, element, priorityLevel), + markChildAsProgressed(current, workInProgress, priorityLevel)), memoizeState(workInProgress, state), + workInProgress.child; } return resetHydrationState(), bailoutOnAlreadyFinishedWork(current, workInProgress); } function updateHostComponent(current, workInProgress) { pushHostContext(workInProgress), null === current && tryToClaimNextHydratableInstance(workInProgress); - var nextProps = workInProgress.pendingProps, prevProps = null !== current ? current.memoizedProps : null, memoizedProps = workInProgress.memoizedProps; + var nextProps = workInProgress.pendingProps, type = workInProgress.type, prevProps = null !== current ? current.memoizedProps : null, memoizedProps = workInProgress.memoizedProps; if (hasContextChanged$1()) null === nextProps && (nextProps = memoizedProps, invariant(null !== nextProps, "We should always have pending or current props. This error is " + "likely caused by a bug in React. Please file an issue.")); else if (null === nextProps || memoizedProps === nextProps) { - if (!useSyncScheduling && shouldDeprioritizeSubtree(workInProgress.type, memoizedProps) && workInProgress.pendingWorkPriority !== OffscreenPriority$1) { - for (var child = workInProgress.progressedChild; null !== child; ) child.pendingWorkPriority = OffscreenPriority$1, + if (!useSyncScheduling && shouldDeprioritizeSubtree(type, memoizedProps) && workInProgress.pendingWorkPriority !== OffscreenPriority$1) { + for (var child = workInProgress.progressedChild; null !== child; ) child.pendingWorkPriority = OffscreenPriority$1, child = child.sibling; return null; } return bailoutOnAlreadyFinishedWork(current, workInProgress); } var nextChildren = nextProps.children; - if (shouldSetTextContent(nextProps) ? nextChildren = null : prevProps && shouldSetTextContent(prevProps) && (workInProgress.effectTag |= ContentReset$1), + if (shouldSetTextContent(type, nextProps) ? nextChildren = null : prevProps && shouldSetTextContent(type, prevProps) && (workInProgress.effectTag |= ContentReset$1), markRef(current, workInProgress), !useSyncScheduling && shouldDeprioritizeSubtree(workInProgress.type, nextProps) && workInProgress.pendingWorkPriority !== OffscreenPriority$1) { - if (workInProgress.progressedPriority === OffscreenPriority$1 && (workInProgress.child = workInProgress.progressedChild), - reconcileChildrenAtPriority(current, workInProgress, nextChildren, OffscreenPriority$1), - memoizeProps(workInProgress, nextProps), workInProgress.child = null !== current ? current.child : null, - null === current) for (var _child = workInProgress.progressedChild; null !== _child; ) _child.effectTag = Placement$2, + if (workInProgress.progressedPriority === OffscreenPriority$1 && (workInProgress.child = workInProgress.progressedChild), + reconcileChildrenAtPriority(current, workInProgress, nextChildren, OffscreenPriority$1), + memoizeProps(workInProgress, nextProps), workInProgress.child = null !== current ? current.child : null, + null === current) for (var _child = workInProgress.progressedChild; null !== _child; ) _child.effectTag = Placement$2, _child = _child.sibling; return null; } - return reconcileChildren(current, workInProgress, nextChildren), memoizeProps(workInProgress, nextProps), + return reconcileChildren(current, workInProgress, nextChildren), memoizeProps(workInProgress, nextProps), workInProgress.child; } function updateHostText(current, workInProgress) { null === current && tryToClaimNextHydratableInstance(workInProgress); var nextProps = workInProgress.pendingProps; - return null === nextProps && (nextProps = workInProgress.memoizedProps), memoizeProps(workInProgress, nextProps), + return null === nextProps && (nextProps = workInProgress.memoizedProps), memoizeProps(workInProgress, nextProps), null; } function mountIndeterminateComponent(current, workInProgress, priorityLevel) { invariant(null === current, "An indeterminate component should never have mounted. This error is " + "likely caused by a bug in React. Please file an issue."); var value, fn = workInProgress.type, props = workInProgress.pendingProps, unmaskedContext = getUnmaskedContext$1(workInProgress), context = getMaskedContext$1(workInProgress, unmaskedContext); - if (ReactCurrentOwner$2.current = workInProgress, "object" == typeof (value = fn(props, context)) && null !== value && "function" == typeof value.render) { + if (ReactCurrentOwner$2.current = workInProgress, value = fn(props, context), workInProgress.effectTag |= PerformedWork$1, + "object" == typeof value && null !== value && "function" == typeof value.render) { workInProgress.tag = ClassComponent$5; var hasContext = pushContextProvider$1(workInProgress); - return adoptClassInstance(workInProgress, value), mountClassInstance(workInProgress, priorityLevel), + return adoptClassInstance(workInProgress, value), mountClassInstance(workInProgress, priorityLevel), finishClassComponent(current, workInProgress, !0, hasContext); } workInProgress.tag = FunctionalComponent$1; var Component = workInProgress.type; - if (Component && warning$6(!Component.childContextTypes, "%s(...): childContextTypes cannot be defined on a functional component.", Component.displayName || Component.name || "Component"), + if (Component && warning$6(!Component.childContextTypes, "%s(...): childContextTypes cannot be defined on a functional component.", Component.displayName || Component.name || "Component"), null !== workInProgress.ref) { var info = "", ownerName = ReactDebugCurrentFiber$4.getCurrentFiberOwnerName(); ownerName && (info += "\n\nCheck the render method of `" + ownerName + "`."); var warningKey = ownerName || workInProgress._debugID || "", debugSource = workInProgress._debugSource; - debugSource && (warningKey = debugSource.fileName + ":" + debugSource.lineNumber), - warnedAboutStatelessRefs[warningKey] || (warnedAboutStatelessRefs[warningKey] = !0, + debugSource && (warningKey = debugSource.fileName + ":" + debugSource.lineNumber), + warnedAboutStatelessRefs[warningKey] || (warnedAboutStatelessRefs[warningKey] = !0, warning$6(!1, "Stateless function components cannot be given refs. " + "Attempts to access this ref will fail.%s%s", info, ReactDebugCurrentFiber$4.getCurrentFiberStackAddendum())); } - return reconcileChildren(current, workInProgress, value), memoizeProps(workInProgress, props), + return reconcileChildren(current, workInProgress, value), memoizeProps(workInProgress, props), workInProgress.child; } function updateCoroutineComponent(current, workInProgress) { var nextCoroutine = workInProgress.pendingProps; - hasContextChanged$1() ? null === nextCoroutine && (nextCoroutine = current && current.memoizedProps, + hasContextChanged$1() ? null === nextCoroutine && (nextCoroutine = current && current.memoizedProps, invariant(null !== nextCoroutine, "We should always have pending or current props. This error is " + "likely caused by a bug in React. Please file an issue.")) : null !== nextCoroutine && workInProgress.memoizedProps !== nextCoroutine || (nextCoroutine = workInProgress.memoizedProps); var nextChildren = nextCoroutine.children, priorityLevel = workInProgress.pendingWorkPriority; - return workInProgress.memoizedProps = null, null === current ? workInProgress.stateNode = mountChildFibersInPlace(workInProgress, workInProgress.stateNode, nextChildren, priorityLevel) : current.child === workInProgress.child ? (clearDeletions(workInProgress), - workInProgress.stateNode = reconcileChildFibers(workInProgress, workInProgress.stateNode, nextChildren, priorityLevel), - transferDeletions(workInProgress)) : (workInProgress.stateNode = reconcileChildFibersInPlace(workInProgress, workInProgress.stateNode, nextChildren, priorityLevel), - transferDeletions(workInProgress)), memoizeProps(workInProgress, nextCoroutine), + return workInProgress.memoizedProps = null, null === current ? workInProgress.stateNode = mountChildFibersInPlace(workInProgress, workInProgress.stateNode, nextChildren, priorityLevel) : current.child === workInProgress.child ? (clearDeletions(workInProgress), + workInProgress.stateNode = reconcileChildFibers(workInProgress, workInProgress.stateNode, nextChildren, priorityLevel), + transferDeletions(workInProgress)) : (workInProgress.stateNode = reconcileChildFibersInPlace(workInProgress, workInProgress.stateNode, nextChildren, priorityLevel), + transferDeletions(workInProgress)), memoizeProps(workInProgress, nextCoroutine), workInProgress.stateNode; } function updatePortalComponent(current, workInProgress) { pushHostContainer(workInProgress, workInProgress.stateNode.containerInfo); var priorityLevel = workInProgress.pendingWorkPriority, nextChildren = workInProgress.pendingProps; - if (hasContextChanged$1()) null === nextChildren && (nextChildren = current && current.memoizedProps, + if (hasContextChanged$1()) null === nextChildren && (nextChildren = current && current.memoizedProps, invariant(null != nextChildren, "We should always have pending or current props. This error is " + "likely caused by a bug in React. Please file an issue.")); else if (null === nextChildren || workInProgress.memoizedProps === nextChildren) return bailoutOnAlreadyFinishedWork(current, workInProgress); - return null === current ? (workInProgress.child = reconcileChildFibersInPlace(workInProgress, workInProgress.child, nextChildren, priorityLevel), - memoizeProps(workInProgress, nextChildren), markChildAsProgressed(current, workInProgress, priorityLevel)) : (reconcileChildren(current, workInProgress, nextChildren), + return null === current ? (workInProgress.child = reconcileChildFibersInPlace(workInProgress, workInProgress.child, nextChildren, priorityLevel), + memoizeProps(workInProgress, nextChildren), markChildAsProgressed(current, workInProgress, priorityLevel)) : (reconcileChildren(current, workInProgress, nextChildren), memoizeProps(workInProgress, nextChildren)), workInProgress.child; } function bailoutOnAlreadyFinishedWork(current, workInProgress) { cancelWorkTimer(workInProgress); var priorityLevel = workInProgress.pendingWorkPriority; - return current && workInProgress.child === current.child && clearDeletions(workInProgress), - cloneChildFibers(current, workInProgress), markChildAsProgressed(current, workInProgress, priorityLevel), + return current && workInProgress.child === current.child && clearDeletions(workInProgress), + cloneChildFibers(current, workInProgress), markChildAsProgressed(current, workInProgress, priorityLevel), workInProgress.child; } function bailoutOnLowPriority(current, workInProgress) { @@ -2672,8 +2675,8 @@ var reconcileChildFibers$1 = ChildReconciler(!0, !0), reconcileChildFibersInPlac } function beginWork(current, workInProgress, priorityLevel) { if (workInProgress.pendingWorkPriority === NoWork$3 || workInProgress.pendingWorkPriority > priorityLevel) return bailoutOnLowPriority(current, workInProgress); - switch (ReactDebugCurrentFiber$4.current = workInProgress, workInProgress.firstEffect = null, - workInProgress.lastEffect = null, workInProgress.progressedPriority === priorityLevel && (workInProgress.child = workInProgress.progressedChild), + switch (ReactDebugCurrentFiber$4.current = workInProgress, workInProgress.firstEffect = null, + workInProgress.lastEffect = null, workInProgress.progressedPriority === priorityLevel && (workInProgress.child = workInProgress.progressedChild), workInProgress.tag) { case IndeterminateComponent$2: return mountIndeterminateComponent(current, workInProgress, priorityLevel); @@ -2687,7 +2690,7 @@ var reconcileChildFibers$1 = ChildReconciler(!0, !0), reconcileChildFibersInPlac case HostRoot$5: return updateHostRoot(current, workInProgress, priorityLevel); - case HostComponent$6: + case HostComponent$7: return updateHostComponent(current, workInProgress); case HostText$3: @@ -2713,12 +2716,12 @@ var reconcileChildFibers$1 = ChildReconciler(!0, !0), reconcileChildFibersInPlac } } function beginFailedWork(current, workInProgress, priorityLevel) { - if (invariant(workInProgress.tag === ClassComponent$5 || workInProgress.tag === HostRoot$5, "Invalid type of work. This error is likely caused by a bug in React. " + "Please file an issue."), + if (invariant(workInProgress.tag === ClassComponent$5 || workInProgress.tag === HostRoot$5, "Invalid type of work. This error is likely caused by a bug in React. " + "Please file an issue."), workInProgress.effectTag |= Err$1, workInProgress.pendingWorkPriority === NoWork$3 || workInProgress.pendingWorkPriority > priorityLevel) return bailoutOnLowPriority(current, workInProgress); - if (workInProgress.firstEffect = null, workInProgress.lastEffect = null, reconcileChildren(current, workInProgress, null), + if (workInProgress.firstEffect = null, workInProgress.lastEffect = null, reconcileChildren(current, workInProgress, null), workInProgress.tag === ClassComponent$5) { var instance = workInProgress.stateNode; - workInProgress.memoizedProps = instance.props, workInProgress.memoizedState = instance.state, + workInProgress.memoizedProps = instance.props, workInProgress.memoizedState = instance.state, workInProgress.pendingProps = null; } return workInProgress.child; @@ -2727,10 +2730,10 @@ var reconcileChildFibers$1 = ChildReconciler(!0, !0), reconcileChildFibersInPlac beginWork: beginWork, beginFailedWork: beginFailedWork }; -}, reconcileChildFibers$2 = ReactChildFiber.reconcileChildFibers, popContextProvider$2 = ReactFiberContext.popContextProvider, IndeterminateComponent$3 = ReactTypeOfWork.IndeterminateComponent, FunctionalComponent$3 = ReactTypeOfWork.FunctionalComponent, ClassComponent$7 = ReactTypeOfWork.ClassComponent, HostRoot$6 = ReactTypeOfWork.HostRoot, HostComponent$7 = ReactTypeOfWork.HostComponent, HostText$5 = ReactTypeOfWork.HostText, HostPortal$5 = ReactTypeOfWork.HostPortal, CoroutineComponent$3 = ReactTypeOfWork.CoroutineComponent, CoroutineHandlerPhase$1 = ReactTypeOfWork.CoroutineHandlerPhase, YieldComponent$4 = ReactTypeOfWork.YieldComponent, Fragment$4 = ReactTypeOfWork.Fragment, Placement$4 = ReactTypeOfSideEffect.Placement, Ref$2 = ReactTypeOfSideEffect.Ref, Update$2 = ReactTypeOfSideEffect.Update, ReactDebugCurrentFiber$5 = ReactDebugCurrentFiber_1, ReactFiberCompleteWork = function(config, hostContext, hydrationContext) { - var createInstance = config.createInstance, createTextInstance = config.createTextInstance, appendInitialChild = config.appendInitialChild, finalizeInitialChildren = config.finalizeInitialChildren, prepareUpdate = config.prepareUpdate, getRootHostContainer = hostContext.getRootHostContainer, popHostContext = hostContext.popHostContext, getHostContext = hostContext.getHostContext, popHostContainer = hostContext.popHostContainer, hydrateHostInstance = hydrationContext.hydrateHostInstance, hydrateHostTextInstance = hydrationContext.hydrateHostTextInstance, popHydrationState = hydrationContext.popHydrationState; +}, reconcileChildFibers$2 = ReactChildFiber.reconcileChildFibers, popContextProvider$2 = ReactFiberContext.popContextProvider, IndeterminateComponent$3 = ReactTypeOfWork.IndeterminateComponent, FunctionalComponent$3 = ReactTypeOfWork.FunctionalComponent, ClassComponent$7 = ReactTypeOfWork.ClassComponent, HostRoot$6 = ReactTypeOfWork.HostRoot, HostComponent$8 = ReactTypeOfWork.HostComponent, HostText$5 = ReactTypeOfWork.HostText, HostPortal$5 = ReactTypeOfWork.HostPortal, CoroutineComponent$3 = ReactTypeOfWork.CoroutineComponent, CoroutineHandlerPhase$1 = ReactTypeOfWork.CoroutineHandlerPhase, YieldComponent$4 = ReactTypeOfWork.YieldComponent, Fragment$4 = ReactTypeOfWork.Fragment, Placement$4 = ReactTypeOfSideEffect.Placement, Ref$2 = ReactTypeOfSideEffect.Ref, Update$2 = ReactTypeOfSideEffect.Update, ReactDebugCurrentFiber$5 = ReactDebugCurrentFiber_1, ReactFiberCompleteWork = function(config, hostContext, hydrationContext) { + var createInstance = config.createInstance, createTextInstance = config.createTextInstance, appendInitialChild = config.appendInitialChild, finalizeInitialChildren = config.finalizeInitialChildren, prepareUpdate = config.prepareUpdate, getRootHostContainer = hostContext.getRootHostContainer, popHostContext = hostContext.popHostContext, getHostContext = hostContext.getHostContext, popHostContainer = hostContext.popHostContainer, prepareToHydrateHostInstance = hydrationContext.prepareToHydrateHostInstance, prepareToHydrateHostTextInstance = hydrationContext.prepareToHydrateHostTextInstance, popHydrationState = hydrationContext.popHydrationState; function markChildAsProgressed(current, workInProgress, priorityLevel) { - workInProgress.progressedChild = workInProgress.child, workInProgress.progressedPriority = priorityLevel, + workInProgress.progressedChild = workInProgress.child, workInProgress.progressedPriority = priorityLevel, null !== current && (current.progressedChild = workInProgress.progressedChild, current.progressedPriority = workInProgress.progressedPriority); } function markUpdate(workInProgress) { @@ -2742,7 +2745,7 @@ var reconcileChildFibers$1 = ChildReconciler(!0, !0), reconcileChildFibersInPlac function appendAllYields(yields, workInProgress) { var node = workInProgress.stateNode; for (node && (node.return = workInProgress); null !== node; ) { - if (node.tag === HostComponent$7 || node.tag === HostText$5 || node.tag === HostPortal$5) invariant(!1, "A coroutine cannot have host component children."); else if (node.tag === YieldComponent$4) yields.push(node.type); else if (null !== node.child) { + if (node.tag === HostComponent$8 || node.tag === HostText$5 || node.tag === HostPortal$5) invariant(!1, "A coroutine cannot have host component children."); else if (node.tag === YieldComponent$4) yields.push(node.type); else if (null !== node.child) { node.child.return = node, node = node.child; continue; } @@ -2755,17 +2758,17 @@ var reconcileChildFibers$1 = ChildReconciler(!0, !0), reconcileChildFibersInPlac } function moveCoroutineToHandlerPhase(current, workInProgress) { var coroutine = workInProgress.memoizedProps; - invariant(coroutine, "Should be resolved by now. This error is likely caused by a bug in " + "React. Please file an issue."), + invariant(coroutine, "Should be resolved by now. This error is likely caused by a bug in " + "React. Please file an issue."), workInProgress.tag = CoroutineHandlerPhase$1; var yields = []; appendAllYields(yields, workInProgress); var fn = coroutine.handler, props = coroutine.props, nextChildren = fn(props, yields), currentFirstChild = null !== current ? current.child : null, priority = workInProgress.pendingWorkPriority; - return workInProgress.child = reconcileChildFibers$2(workInProgress, currentFirstChild, nextChildren, priority), + return workInProgress.child = reconcileChildFibers$2(workInProgress, currentFirstChild, nextChildren, priority), markChildAsProgressed(current, workInProgress, priority), workInProgress.child; } function appendAllChildren(parent, workInProgress) { for (var node = workInProgress.child; null !== node; ) { - if (node.tag === HostComponent$7 || node.tag === HostText$5) appendInitialChild(parent, node.stateNode); else if (node.tag === HostPortal$5) ; else if (null !== node.child) { + if (node.tag === HostComponent$8 || node.tag === HostText$5) appendInitialChild(parent, node.stateNode); else if (node.tag === HostPortal$5) ; else if (null !== node.child) { node = node.child; continue; } @@ -2787,24 +2790,27 @@ var reconcileChildFibers$1 = ChildReconciler(!0, !0), reconcileChildFibersInPlac case HostRoot$6: var fiberRoot = workInProgress.stateNode; - return fiberRoot.pendingContext && (fiberRoot.context = fiberRoot.pendingContext, - fiberRoot.pendingContext = null), null !== current && null !== current.child || (popHydrationState(workInProgress), + return fiberRoot.pendingContext && (fiberRoot.context = fiberRoot.pendingContext, + fiberRoot.pendingContext = null), null !== current && null !== current.child || (popHydrationState(workInProgress), workInProgress.effectTag &= ~Placement$4), null; - case HostComponent$7: + case HostComponent$8: popHostContext(workInProgress); var rootContainerInstance = getRootHostContainer(), type = workInProgress.type, newProps = workInProgress.memoizedProps; if (null !== current && null != workInProgress.stateNode) { var oldProps = current.memoizedProps, instance = workInProgress.stateNode, currentHostContext = getHostContext(), updatePayload = prepareUpdate(instance, type, oldProps, newProps, rootContainerInstance, currentHostContext); - workInProgress.updateQueue = updatePayload, updatePayload && markUpdate(workInProgress), + workInProgress.updateQueue = updatePayload, updatePayload && markUpdate(workInProgress), current.ref !== workInProgress.ref && markRef(workInProgress); } else { - if (!newProps) return invariant(null !== workInProgress.stateNode, "We must have new props for new mounts. This error is likely " + "caused by a bug in React. Please file an issue."), + if (!newProps) return invariant(null !== workInProgress.stateNode, "We must have new props for new mounts. This error is likely " + "caused by a bug in React. Please file an issue."), null; - var _currentHostContext = getHostContext(), _instance = void 0; - popHydrationState(workInProgress) ? _instance = hydrateHostInstance(workInProgress, rootContainerInstance) : (_instance = createInstance(type, newProps, rootContainerInstance, _currentHostContext, workInProgress), - appendAllChildren(_instance, workInProgress), finalizeInitialChildren(_instance, type, newProps, rootContainerInstance) && markUpdate(workInProgress)), - workInProgress.stateNode = _instance, null !== workInProgress.ref && markRef(workInProgress); + var _currentHostContext = getHostContext(); + if (popHydrationState(workInProgress)) prepareToHydrateHostInstance(workInProgress, rootContainerInstance) && markUpdate(workInProgress); else { + var _instance = createInstance(type, newProps, rootContainerInstance, _currentHostContext, workInProgress); + appendAllChildren(_instance, workInProgress), finalizeInitialChildren(_instance, type, newProps, rootContainerInstance) && markUpdate(workInProgress), + workInProgress.stateNode = _instance; + } + null !== workInProgress.ref && markRef(workInProgress); } return null; @@ -2813,11 +2819,10 @@ var reconcileChildFibers$1 = ChildReconciler(!0, !0), reconcileChildFibersInPlac if (current && null != workInProgress.stateNode) { current.memoizedProps !== newText && markUpdate(workInProgress); } else { - if ("string" != typeof newText) return invariant(null !== workInProgress.stateNode, "We must have new props for new mounts. This error is likely " + "caused by a bug in React. Please file an issue."), + if ("string" != typeof newText) return invariant(null !== workInProgress.stateNode, "We must have new props for new mounts. This error is likely " + "caused by a bug in React. Please file an issue."), null; - var _rootContainerInstance = getRootHostContainer(), _currentHostContext2 = getHostContext(), textInstance = void 0; - textInstance = popHydrationState(workInProgress) ? hydrateHostTextInstance(workInProgress, _rootContainerInstance) : createTextInstance(newText, _rootContainerInstance, _currentHostContext2, workInProgress), - workInProgress.stateNode = textInstance; + var _rootContainerInstance = getRootHostContainer(), _currentHostContext2 = getHostContext(); + popHydrationState(workInProgress) ? prepareToHydrateHostTextInstance(workInProgress) && markUpdate(workInProgress) : workInProgress.stateNode = createTextInstance(newText, _rootContainerInstance, _currentHostContext2, workInProgress); } return null; @@ -2869,9 +2874,9 @@ var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCo injectInternals: injectInternals_1, onCommitRoot: onCommitRoot_1, onCommitUnmount: onCommitUnmount_1 -}, ClassComponent$8 = ReactTypeOfWork.ClassComponent, HostRoot$7 = ReactTypeOfWork.HostRoot, HostComponent$8 = ReactTypeOfWork.HostComponent, HostText$6 = ReactTypeOfWork.HostText, HostPortal$6 = ReactTypeOfWork.HostPortal, CoroutineComponent$4 = ReactTypeOfWork.CoroutineComponent, commitCallbacks$1 = ReactFiberUpdateQueue.commitCallbacks, onCommitUnmount = ReactFiberDevToolsHook.onCommitUnmount, invokeGuardedCallback$2 = ReactErrorUtils_1.invokeGuardedCallback, Placement$5 = ReactTypeOfSideEffect.Placement, Update$3 = ReactTypeOfSideEffect.Update, Callback$1 = ReactTypeOfSideEffect.Callback, ContentReset$2 = ReactTypeOfSideEffect.ContentReset, _require5$2 = ReactDebugFiberPerf_1, startPhaseTimer$2 = _require5$2.startPhaseTimer, stopPhaseTimer$2 = _require5$2.stopPhaseTimer, ReactFiberCommitWork = function(config, captureError) { +}, ClassComponent$8 = ReactTypeOfWork.ClassComponent, HostRoot$7 = ReactTypeOfWork.HostRoot, HostComponent$9 = ReactTypeOfWork.HostComponent, HostText$6 = ReactTypeOfWork.HostText, HostPortal$6 = ReactTypeOfWork.HostPortal, CoroutineComponent$4 = ReactTypeOfWork.CoroutineComponent, commitCallbacks$1 = ReactFiberUpdateQueue.commitCallbacks, onCommitUnmount = ReactFiberDevToolsHook.onCommitUnmount, invokeGuardedCallback$2 = ReactErrorUtils_1.invokeGuardedCallback, Placement$5 = ReactTypeOfSideEffect.Placement, Update$3 = ReactTypeOfSideEffect.Update, Callback$1 = ReactTypeOfSideEffect.Callback, ContentReset$2 = ReactTypeOfSideEffect.ContentReset, _require5$2 = ReactDebugFiberPerf_1, startPhaseTimer$2 = _require5$2.startPhaseTimer, stopPhaseTimer$2 = _require5$2.stopPhaseTimer, ReactFiberCommitWork = function(config, captureError) { var commitMount = config.commitMount, commitUpdate = config.commitUpdate, resetTextContent = config.resetTextContent, commitTextUpdate = config.commitTextUpdate, appendChild = config.appendChild, insertBefore = config.insertBefore, removeChild = config.removeChild, getPublicInstance = config.getPublicInstance, callComponentWillUnmountWithTimerInDev = function(current, instance) { - startPhaseTimer$2(current, "componentWillUnmount"), instance.componentWillUnmount(), + startPhaseTimer$2(current, "componentWillUnmount"), instance.componentWillUnmount(), stopPhaseTimer$2(); }; function safelyCallComponentWillUnmount(current, instance) { @@ -2888,7 +2893,7 @@ var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCo function getHostParent(fiber) { for (var parent = fiber.return; null !== parent; ) { switch (parent.tag) { - case HostComponent$8: + case HostComponent$9: return parent.stateNode; case HostRoot$7: @@ -2907,7 +2912,7 @@ var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCo invariant(!1, "Expected to find a host parent. This error is likely caused by a bug " + "in React. Please file an issue."); } function isHostParent(fiber) { - return fiber.tag === HostComponent$8 || fiber.tag === HostRoot$7 || fiber.tag === HostPortal$6; + return fiber.tag === HostComponent$9 || fiber.tag === HostRoot$7 || fiber.tag === HostPortal$6; } function getHostSibling(fiber) { var node = fiber; @@ -2916,7 +2921,7 @@ var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCo if (null === node.return || isHostParent(node.return)) return null; node = node.return; } - for (node.sibling.return = node.return, node = node.sibling; node.tag !== HostComponent$8 && node.tag !== HostText$6; ) { + for (node.sibling.return = node.return, node = node.sibling; node.tag !== HostComponent$9 && node.tag !== HostText$6; ) { if (node.effectTag & Placement$5) continue siblings; if (null === node.child || node.tag === HostPortal$6) continue siblings; node.child.return = node, node = node.child; @@ -2927,7 +2932,7 @@ var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCo function commitPlacement(finishedWork) { var parentFiber = getHostParentFiber(finishedWork), parent = void 0; switch (parentFiber.tag) { - case HostComponent$8: + case HostComponent$9: parent = parentFiber.stateNode; break; @@ -2941,7 +2946,7 @@ var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCo } parentFiber.effectTag & ContentReset$2 && (resetTextContent(parent), parentFiber.effectTag &= ~ContentReset$2); for (var before = getHostSibling(finishedWork), node = finishedWork; !0; ) { - if (node.tag === HostComponent$8 || node.tag === HostText$6) before ? insertBefore(parent, node.stateNode, before) : appendChild(parent, node.stateNode); else if (node.tag === HostPortal$6) ; else if (null !== node.child) { + if (node.tag === HostComponent$9 || node.tag === HostText$6) before ? insertBefore(parent, node.stateNode, before) : appendChild(parent, node.stateNode); else if (node.tag === HostPortal$6) ; else if (null !== node.child) { node.child.return = node, node = node.child; continue; } @@ -2965,7 +2970,7 @@ var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCo } function unmountHostComponents(parent, current) { for (var node = current; !0; ) { - if (node.tag === HostComponent$8 || node.tag === HostText$6) commitNestedUnmounts(node), + if (node.tag === HostComponent$9 || node.tag === HostText$6) commitNestedUnmounts(node), removeChild(parent, node.stateNode); else if (node.tag === HostPortal$6) { if (parent = node.stateNode.containerInfo, null !== node.child) { node.child.return = node, node = node.child; @@ -2984,7 +2989,7 @@ var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCo } } function commitDeletion(current) { - unmountHostComponents(getHostParent(current), current), current.return = null, current.child = null, + unmountHostComponents(getHostParent(current), current), current.return = null, current.child = null, current.alternate && (current.alternate.child = null, current.alternate.return = null); } function commitUnmount(current) { @@ -2994,7 +2999,7 @@ var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCo var instance = current.stateNode; return void ("function" == typeof instance.componentWillUnmount && safelyCallComponentWillUnmount(current, instance)); - case HostComponent$8: + case HostComponent$9: return void safelyDetachRef(current); case CoroutineComponent$4: @@ -3009,17 +3014,17 @@ var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCo case ClassComponent$8: return; - case HostComponent$8: + case HostComponent$9: var instance = finishedWork.stateNode; - if (null != instance && null !== current) { - var newProps = finishedWork.memoizedProps, oldProps = current.memoizedProps, type = finishedWork.type, updatePayload = finishedWork.updateQueue; + if (null != instance) { + var newProps = finishedWork.memoizedProps, oldProps = null !== current ? current.memoizedProps : newProps, type = finishedWork.type, updatePayload = finishedWork.updateQueue; finishedWork.updateQueue = null, null !== updatePayload && commitUpdate(instance, updatePayload, type, oldProps, newProps, finishedWork); } return; case HostText$6: - invariant(null !== finishedWork.stateNode && null !== current, "This should only be done during updates. This error is likely " + "caused by a bug in React. Please file an issue."); - var textInstance = finishedWork.stateNode, newText = finishedWork.memoizedProps, oldText = current.memoizedProps; + invariant(null !== finishedWork.stateNode, "This should have a text node initialized. This error is likely " + "caused by a bug in React. Please file an issue."); + var textInstance = finishedWork.stateNode, newText = finishedWork.memoizedProps, oldText = null !== current ? current.memoizedProps : newText; return void commitTextUpdate(textInstance, oldText, newText); case HostRoot$7: @@ -3034,10 +3039,10 @@ var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCo switch (finishedWork.tag) { case ClassComponent$8: var instance = finishedWork.stateNode; - if (finishedWork.effectTag & Update$3) if (null === current) startPhaseTimer$2(finishedWork, "componentDidMount"), + if (finishedWork.effectTag & Update$3) if (null === current) startPhaseTimer$2(finishedWork, "componentDidMount"), instance.componentDidMount(), stopPhaseTimer$2(); else { var prevProps = current.memoizedProps, prevState = current.memoizedState; - startPhaseTimer$2(finishedWork, "componentDidUpdate"), instance.componentDidUpdate(prevProps, prevState), + startPhaseTimer$2(finishedWork, "componentDidUpdate"), instance.componentDidUpdate(prevProps, prevState), stopPhaseTimer$2(); } return void (finishedWork.effectTag & Callback$1 && null !== finishedWork.updateQueue && commitCallbacks$1(finishedWork, finishedWork.updateQueue, instance)); @@ -3050,7 +3055,7 @@ var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCo } return; - case HostComponent$8: + case HostComponent$9: var _instance2 = finishedWork.stateNode; if (null === current && finishedWork.effectTag & Update$3) { var type = finishedWork.type, props = finishedWork.memoizedProps; @@ -3069,7 +3074,15 @@ var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCo function commitAttachRef(finishedWork) { var ref = finishedWork.ref; if (null !== ref) { - ref(getPublicInstance(finishedWork.stateNode)); + var instance = finishedWork.stateNode; + switch (finishedWork.tag) { + case HostComponent$9: + ref(getPublicInstance(instance)); + break; + + default: + ref(instance); + } } } function commitDetachRef(current) { @@ -3087,7 +3100,7 @@ var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCo }, createCursor$2 = ReactFiberStack.createCursor, pop$2 = ReactFiberStack.pop, push$2 = ReactFiberStack.push, NO_CONTEXT = {}, ReactFiberHostContext = function(config) { var getChildHostContext = config.getChildHostContext, getRootHostContext = config.getRootHostContext, contextStackCursor = createCursor$2(NO_CONTEXT), contextFiberStackCursor = createCursor$2(NO_CONTEXT), rootInstanceStackCursor = createCursor$2(NO_CONTEXT); function requiredContext(c) { - return invariant(c !== NO_CONTEXT, "Expected host context to exist. This error is likely caused by a bug " + "in React. Please file an issue."), + return invariant(c !== NO_CONTEXT, "Expected host context to exist. This error is likely caused by a bug " + "in React. Please file an issue."), c; } function getRootHostContainer() { @@ -3109,7 +3122,7 @@ var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCo context !== nextContext && (push$2(contextFiberStackCursor, fiber, fiber), push$2(contextStackCursor, nextContext, fiber)); } function popHostContext(fiber) { - contextFiberStackCursor.current === fiber && (pop$2(contextStackCursor, fiber), + contextFiberStackCursor.current === fiber && (pop$2(contextStackCursor, fiber), pop$2(contextFiberStackCursor, fiber)); } function resetHostContainer() { @@ -3124,7 +3137,7 @@ var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCo pushHostContext: pushHostContext, resetHostContainer: resetHostContainer }; -}, HostComponent$9 = ReactTypeOfWork.HostComponent, HostRoot$8 = ReactTypeOfWork.HostRoot, Deletion$2 = ReactTypeOfSideEffect.Deletion, Placement$6 = ReactTypeOfSideEffect.Placement, createFiberFromHostInstanceForDeletion$1 = ReactFiber.createFiberFromHostInstanceForDeletion, ReactFiberHydrationContext = function(config) { +}, HostComponent$10 = ReactTypeOfWork.HostComponent, HostText$7 = ReactTypeOfWork.HostText, HostRoot$8 = ReactTypeOfWork.HostRoot, Deletion$2 = ReactTypeOfSideEffect.Deletion, Placement$6 = ReactTypeOfSideEffect.Placement, createFiberFromHostInstanceForDeletion$1 = ReactFiber.createFiberFromHostInstanceForDeletion, ReactFiberHydrationContext = function(config) { var shouldSetTextContent = config.shouldSetTextContent, canHydrateInstance = config.canHydrateInstance, canHydrateTextInstance = config.canHydrateTextInstance, getNextHydratableSibling = config.getNextHydratableSibling, getFirstHydratableChild = config.getFirstHydratableChild, hydrateInstance = config.hydrateInstance, hydrateTextInstance = config.hydrateTextInstance; if (!(canHydrateInstance && canHydrateTextInstance && getNextHydratableSibling && getFirstHydratableChild && hydrateInstance && hydrateTextInstance)) return { enterHydrationState: function() { @@ -3132,10 +3145,10 @@ var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCo }, resetHydrationState: function() {}, tryToClaimNextHydratableInstance: function() {}, - hydrateHostInstance: function() { + prepareToHydrateHostInstance: function() { invariant(!1, "React bug."); }, - hydrateHostTextInstance: function() { + prepareToHydrateHostTextInstance: function() { invariant(!1, "React bug."); }, popHydrationState: function(fiber) { @@ -3145,49 +3158,59 @@ var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCo var hydrationParentFiber = null, nextHydratableInstance = null, isHydrating = !1; function enterHydrationState(fiber) { var parentInstance = fiber.stateNode.containerInfo; - return nextHydratableInstance = getFirstHydratableChild(parentInstance), hydrationParentFiber = fiber, + return nextHydratableInstance = getFirstHydratableChild(parentInstance), hydrationParentFiber = fiber, isHydrating = !0, !0; } function deleteHydratableInstance(returnFiber, instance) { var childToDelete = createFiberFromHostInstanceForDeletion$1(); - childToDelete.stateNode = instance, childToDelete.return = returnFiber; - var last = returnFiber.progressedLastDeletion; - null !== last ? (last.nextEffect = childToDelete, returnFiber.progressedLastDeletion = childToDelete) : returnFiber.progressedFirstDeletion = returnFiber.progressedLastDeletion = childToDelete, - childToDelete.effectTag = Deletion$2, null !== returnFiber.lastEffect ? (returnFiber.lastEffect.nextEffect = childToDelete, + childToDelete.stateNode = instance, childToDelete.return = returnFiber, childToDelete.effectTag = Deletion$2, + null !== returnFiber.lastEffect ? (returnFiber.lastEffect.nextEffect = childToDelete, returnFiber.lastEffect = childToDelete) : returnFiber.firstEffect = returnFiber.lastEffect = childToDelete; } + function canHydrate(fiber, nextInstance) { + switch (fiber.tag) { + case HostComponent$10: + var type = fiber.type, props = fiber.memoizedProps; + return canHydrateInstance(nextInstance, type, props); + + case HostText$7: + return canHydrateTextInstance(nextInstance); + + default: + return !1; + } + } function tryToClaimNextHydratableInstance(fiber) { if (isHydrating) { var nextInstance = nextHydratableInstance; if (!nextInstance) return fiber.effectTag |= Placement$6, isHydrating = !1, void (hydrationParentFiber = fiber); - var type = fiber.type, props = fiber.memoizedProps; - if (!canHydrateInstance(nextInstance, type, props)) { - if (!(nextInstance = getNextHydratableSibling(nextInstance)) || !canHydrateInstance(nextInstance, type, props)) return fiber.effectTag |= Placement$6, + if (!canHydrate(fiber, nextInstance)) { + if (!(nextInstance = getNextHydratableSibling(nextInstance)) || !canHydrate(fiber, nextInstance)) return fiber.effectTag |= Placement$6, isHydrating = !1, void (hydrationParentFiber = fiber); deleteHydratableInstance(hydrationParentFiber, nextHydratableInstance); } fiber.stateNode = nextInstance, hydrationParentFiber = fiber, nextHydratableInstance = getFirstHydratableChild(nextInstance); } } - function hydrateHostInstance(fiber, rootContainerInstance) { - var instance = fiber.stateNode; - return hydrateInstance(instance, fiber.type, fiber.memoizedProps, rootContainerInstance, fiber), - instance; + function prepareToHydrateHostInstance(fiber, rootContainerInstance) { + var instance = fiber.stateNode, updatePayload = hydrateInstance(instance, fiber.type, fiber.memoizedProps, rootContainerInstance, fiber); + return fiber.updateQueue = updatePayload, null !== updatePayload; } - function hydrateHostTextInstance(fiber) { + function prepareToHydrateHostTextInstance(fiber) { var textInstance = fiber.stateNode; - return hydrateTextInstance(textInstance, fiber), textInstance; + return hydrateTextInstance(textInstance, fiber.memoizedProps, fiber); } function popToNextHostParent(fiber) { - for (var parent = fiber.return; null !== parent && parent.tag !== HostComponent$9 && parent.tag !== HostRoot$8; ) parent = parent.return; + for (var parent = fiber.return; null !== parent && parent.tag !== HostComponent$10 && parent.tag !== HostRoot$8; ) parent = parent.return; hydrationParentFiber = parent; } function popHydrationState(fiber) { if (fiber !== hydrationParentFiber) return !1; if (!isHydrating) return popToNextHostParent(fiber), isHydrating = !0, !1; - if (fiber.tag !== HostComponent$9 || "head" !== fiber.type && "body" !== fiber.type && !shouldSetTextContent(fiber.memoizedProps)) for (var nextInstance = nextHydratableInstance; nextInstance; ) deleteHydratableInstance(fiber, nextInstance), + var type = fiber.type; + if (fiber.tag !== HostComponent$10 || "head" !== type && "body" !== type && !shouldSetTextContent(type, fiber.memoizedProps)) for (var nextInstance = nextHydratableInstance; nextInstance; ) deleteHydratableInstance(fiber, nextInstance), nextInstance = getNextHydratableSibling(nextInstance); - return popToNextHostParent(fiber), nextHydratableInstance = hydrationParentFiber ? getNextHydratableSibling(fiber.stateNode) : null, + return popToNextHostParent(fiber), nextHydratableInstance = hydrationParentFiber ? getNextHydratableSibling(fiber.stateNode) : null, !0; } function resetHydrationState() { @@ -3197,13 +3220,13 @@ var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCo enterHydrationState: enterHydrationState, resetHydrationState: resetHydrationState, tryToClaimNextHydratableInstance: tryToClaimNextHydratableInstance, - hydrateHostInstance: hydrateHostInstance, - hydrateHostTextInstance: hydrateHostTextInstance, + prepareToHydrateHostInstance: prepareToHydrateHostInstance, + prepareToHydrateHostTextInstance: prepareToHydrateHostTextInstance, popHydrationState: popHydrationState }; }, ReactFiberInstrumentation$2 = { debugTool: null -}, ReactFiberInstrumentation_1 = ReactFiberInstrumentation$2, popContextProvider$1 = ReactFiberContext.popContextProvider, reset$1 = ReactFiberStack.reset, getStackAddendumByWorkInProgressFiber$2 = ReactFiberComponentTreeHook.getStackAddendumByWorkInProgressFiber, logCapturedError$1 = ReactFiberErrorLogger.logCapturedError, invokeGuardedCallback$1 = ReactErrorUtils_1.invokeGuardedCallback, ReactCurrentOwner$1 = ReactGlobalSharedState_1.ReactCurrentOwner, cloneFiber$1 = ReactFiber.cloneFiber, onCommitRoot = ReactFiberDevToolsHook.onCommitRoot, NoWork$2 = ReactPriorityLevel.NoWork, SynchronousPriority$1 = ReactPriorityLevel.SynchronousPriority, TaskPriority$1 = ReactPriorityLevel.TaskPriority, AnimationPriority = ReactPriorityLevel.AnimationPriority, HighPriority = ReactPriorityLevel.HighPriority, LowPriority = ReactPriorityLevel.LowPriority, OffscreenPriority = ReactPriorityLevel.OffscreenPriority, AsyncUpdates = ReactTypeOfInternalContext.AsyncUpdates, NoEffect$2 = ReactTypeOfSideEffect.NoEffect, Placement$1 = ReactTypeOfSideEffect.Placement, Update = ReactTypeOfSideEffect.Update, PlacementAndUpdate = ReactTypeOfSideEffect.PlacementAndUpdate, Deletion = ReactTypeOfSideEffect.Deletion, ContentReset = ReactTypeOfSideEffect.ContentReset, Callback = ReactTypeOfSideEffect.Callback, Err = ReactTypeOfSideEffect.Err, Ref = ReactTypeOfSideEffect.Ref, HostRoot$4 = ReactTypeOfWork.HostRoot, HostComponent$5 = ReactTypeOfWork.HostComponent, HostPortal$2 = ReactTypeOfWork.HostPortal, ClassComponent$4 = ReactTypeOfWork.ClassComponent, getPendingPriority$1 = ReactFiberUpdateQueue.getPendingPriority, _require14 = ReactFiberContext, resetContext$1 = _require14.resetContext, warning$5 = warning, ReactFiberInstrumentation$1 = ReactFiberInstrumentation_1, ReactDebugCurrentFiber$3 = ReactDebugCurrentFiber_1, _require15 = ReactDebugFiberPerf_1, recordEffect = _require15.recordEffect, recordScheduleUpdate = _require15.recordScheduleUpdate, startWorkTimer = _require15.startWorkTimer, stopWorkTimer = _require15.stopWorkTimer, startWorkLoopTimer = _require15.startWorkLoopTimer, stopWorkLoopTimer = _require15.stopWorkLoopTimer, startCommitTimer = _require15.startCommitTimer, stopCommitTimer = _require15.stopCommitTimer, startCommitHostEffectsTimer = _require15.startCommitHostEffectsTimer, stopCommitHostEffectsTimer = _require15.stopCommitHostEffectsTimer, startCommitLifeCyclesTimer = _require15.startCommitLifeCyclesTimer, stopCommitLifeCyclesTimer = _require15.stopCommitLifeCyclesTimer, warnAboutUpdateOnUnmounted = function(instance) { +}, ReactFiberInstrumentation_1 = ReactFiberInstrumentation$2, popContextProvider$1 = ReactFiberContext.popContextProvider, reset$1 = ReactFiberStack.reset, getStackAddendumByWorkInProgressFiber$2 = ReactFiberComponentTreeHook.getStackAddendumByWorkInProgressFiber, logCapturedError$1 = ReactFiberErrorLogger.logCapturedError, invokeGuardedCallback$1 = ReactErrorUtils_1.invokeGuardedCallback, ReactCurrentOwner$1 = ReactGlobalSharedState_1.ReactCurrentOwner, cloneFiber$1 = ReactFiber.cloneFiber, onCommitRoot = ReactFiberDevToolsHook.onCommitRoot, NoWork$2 = ReactPriorityLevel.NoWork, SynchronousPriority$1 = ReactPriorityLevel.SynchronousPriority, TaskPriority$1 = ReactPriorityLevel.TaskPriority, AnimationPriority = ReactPriorityLevel.AnimationPriority, HighPriority = ReactPriorityLevel.HighPriority, LowPriority = ReactPriorityLevel.LowPriority, OffscreenPriority = ReactPriorityLevel.OffscreenPriority, AsyncUpdates = ReactTypeOfInternalContext.AsyncUpdates, PerformedWork = ReactTypeOfSideEffect.PerformedWork, Placement$1 = ReactTypeOfSideEffect.Placement, Update = ReactTypeOfSideEffect.Update, PlacementAndUpdate = ReactTypeOfSideEffect.PlacementAndUpdate, Deletion = ReactTypeOfSideEffect.Deletion, ContentReset = ReactTypeOfSideEffect.ContentReset, Callback = ReactTypeOfSideEffect.Callback, Err = ReactTypeOfSideEffect.Err, Ref = ReactTypeOfSideEffect.Ref, HostRoot$4 = ReactTypeOfWork.HostRoot, HostComponent$6 = ReactTypeOfWork.HostComponent, HostPortal$2 = ReactTypeOfWork.HostPortal, ClassComponent$4 = ReactTypeOfWork.ClassComponent, getPendingPriority$1 = ReactFiberUpdateQueue.getPendingPriority, _require14 = ReactFiberContext, resetContext$1 = _require14.resetContext, warning$5 = warning, ReactFiberInstrumentation$1 = ReactFiberInstrumentation_1, ReactDebugCurrentFiber$3 = ReactDebugCurrentFiber_1, _require15 = ReactDebugFiberPerf_1, recordEffect = _require15.recordEffect, recordScheduleUpdate = _require15.recordScheduleUpdate, startWorkTimer = _require15.startWorkTimer, stopWorkTimer = _require15.stopWorkTimer, startWorkLoopTimer = _require15.startWorkLoopTimer, stopWorkLoopTimer = _require15.stopWorkLoopTimer, startCommitTimer = _require15.startCommitTimer, stopCommitTimer = _require15.stopCommitTimer, startCommitHostEffectsTimer = _require15.startCommitHostEffectsTimer, stopCommitHostEffectsTimer = _require15.stopCommitHostEffectsTimer, startCommitLifeCyclesTimer = _require15.startCommitLifeCyclesTimer, stopCommitLifeCyclesTimer = _require15.stopCommitLifeCyclesTimer, warnAboutUpdateOnUnmounted = function(instance) { var ctor = instance.constructor; warning$5(!1, "Can only update a mounted or mounting component. This usually means " + "you called setState, replaceState, or forceUpdate on an unmounted " + "component. This is a no-op.\n\nPlease check the code for the " + "%s component.", ctor && (ctor.displayName || ctor.name) || "ReactClass"); }, warnAboutInvalidUpdates = function(instance) { @@ -3230,14 +3253,14 @@ var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCo for (;null !== nextScheduledRoot && nextScheduledRoot.current.pendingWorkPriority === NoWork$2; ) { nextScheduledRoot.isScheduled = !1; var next = nextScheduledRoot.nextScheduledRoot; - if (nextScheduledRoot.nextScheduledRoot = null, nextScheduledRoot === lastScheduledRoot) return nextScheduledRoot = null, + if (nextScheduledRoot.nextScheduledRoot = null, nextScheduledRoot === lastScheduledRoot) return nextScheduledRoot = null, lastScheduledRoot = null, nextPriorityLevel = NoWork$2, null; nextScheduledRoot = next; } - for (var root = nextScheduledRoot, highestPriorityRoot = null, highestPriorityLevel = NoWork$2; null !== root; ) root.current.pendingWorkPriority !== NoWork$2 && (highestPriorityLevel === NoWork$2 || highestPriorityLevel > root.current.pendingWorkPriority) && (highestPriorityLevel = root.current.pendingWorkPriority, + for (var root = nextScheduledRoot, highestPriorityRoot = null, highestPriorityLevel = NoWork$2; null !== root; ) root.current.pendingWorkPriority !== NoWork$2 && (highestPriorityLevel === NoWork$2 || highestPriorityLevel > root.current.pendingWorkPriority) && (highestPriorityLevel = root.current.pendingWorkPriority, highestPriorityRoot = root), root = root.nextScheduledRoot; - return null !== highestPriorityRoot ? (nextPriorityLevel = highestPriorityLevel, - priorityContext = nextPriorityLevel, resetContextStack(), cloneFiber$1(highestPriorityRoot.current, highestPriorityLevel)) : (nextPriorityLevel = NoWork$2, + return null !== highestPriorityRoot ? (nextPriorityLevel = highestPriorityLevel, + priorityContext = nextPriorityLevel, resetContextStack(), cloneFiber$1(highestPriorityRoot.current, highestPriorityLevel)) : (nextPriorityLevel = NoWork$2, null); } function commitAllHostEffects() { @@ -3248,7 +3271,7 @@ var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCo var current = nextEffect.alternate; null !== current && commitDetachRef(current); } - switch (effectTag & ~(Callback | Err | ContentReset | Ref)) { + switch (effectTag & ~(Callback | Err | ContentReset | Ref | PerformedWork)) { case Placement$1: commitPlacement(nextEffect), nextEffect.effectTag &= ~Placement$1; break; @@ -3279,7 +3302,7 @@ var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCo var current = nextEffect.alternate; commitLifeCycles(current, nextEffect); } - effectTag & Ref && (recordEffect(), commitAttachRef(nextEffect)), effectTag & Err && (recordEffect(), + effectTag & Ref && (recordEffect(), commitAttachRef(nextEffect)), effectTag & Err && (recordEffect(), commitErrorHandling(nextEffect)); var next = nextEffect.nextEffect; nextEffect.nextEffect = null, nextEffect = next; @@ -3288,51 +3311,52 @@ var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCo function commitAllWork(finishedWork) { isCommitting = !0, startCommitTimer(), pendingCommit = null; var root = finishedWork.stateNode; - invariant(root.current !== finishedWork, "Cannot commit the same tree as before. This is probably a bug " + "related to the return field. This error is likely caused by a bug " + "in React. Please file an issue."), + invariant(root.current !== finishedWork, "Cannot commit the same tree as before. This is probably a bug " + "related to the return field. This error is likely caused by a bug " + "in React. Please file an issue."), ReactCurrentOwner$1.current = null; var previousPriorityContext = priorityContext; priorityContext = TaskPriority$1; var firstEffect = void 0; - finishedWork.effectTag !== NoEffect$2 ? null !== finishedWork.lastEffect ? (finishedWork.lastEffect.nextEffect = finishedWork, - firstEffect = finishedWork.firstEffect) : firstEffect = finishedWork : firstEffect = finishedWork.firstEffect; - var commitInfo = prepareForCommit(); - for (nextEffect = firstEffect, startCommitHostEffectsTimer(); null !== nextEffect; ) { + for (finishedWork.effectTag > PerformedWork ? null !== finishedWork.lastEffect ? (finishedWork.lastEffect.nextEffect = finishedWork, + firstEffect = finishedWork.firstEffect) : firstEffect = finishedWork : firstEffect = finishedWork.firstEffect, + prepareForCommit(), nextEffect = firstEffect, startCommitHostEffectsTimer(); null !== nextEffect; ) { var _error = null; - _error = invokeGuardedCallback$1(null, commitAllHostEffects, null, finishedWork), - null !== _error && (invariant(null !== nextEffect, "Should have next effect. This error is likely caused by a bug " + "in React. Please file an issue."), + _error = invokeGuardedCallback$1(null, commitAllHostEffects, null), null !== _error && (invariant(null !== nextEffect, "Should have next effect. This error is likely caused by a bug " + "in React. Please file an issue."), captureError(nextEffect, _error), null !== nextEffect && (nextEffect = nextEffect.nextEffect)); } - for (stopCommitHostEffectsTimer(), resetAfterCommit(commitInfo), root.current = finishedWork, + for (stopCommitHostEffectsTimer(), resetAfterCommit(), root.current = finishedWork, nextEffect = firstEffect, startCommitLifeCyclesTimer(); null !== nextEffect; ) { var _error2 = null; - _error2 = invokeGuardedCallback$1(null, commitAllLifeCycles, null, finishedWork), - null !== _error2 && (invariant(null !== nextEffect, "Should have next effect. This error is likely caused by a bug " + "in React. Please file an issue."), + _error2 = invokeGuardedCallback$1(null, commitAllLifeCycles, null), null !== _error2 && (invariant(null !== nextEffect, "Should have next effect. This error is likely caused by a bug " + "in React. Please file an issue."), captureError(nextEffect, _error2), null !== nextEffect && (nextEffect = nextEffect.nextEffect)); } - isCommitting = !1, stopCommitLifeCyclesTimer(), stopCommitTimer(), "function" == typeof onCommitRoot && onCommitRoot(finishedWork.stateNode), - !0 && ReactFiberInstrumentation$1.debugTool && ReactFiberInstrumentation$1.debugTool.onCommitWork(finishedWork), - commitPhaseBoundaries && (commitPhaseBoundaries.forEach(scheduleErrorRecovery), + isCommitting = !1, stopCommitLifeCyclesTimer(), stopCommitTimer(), "function" == typeof onCommitRoot && onCommitRoot(finishedWork.stateNode), + !0 && ReactFiberInstrumentation$1.debugTool && ReactFiberInstrumentation$1.debugTool.onCommitWork(finishedWork), + commitPhaseBoundaries && (commitPhaseBoundaries.forEach(scheduleErrorRecovery), commitPhaseBoundaries = null), priorityContext = previousPriorityContext; } function resetWorkPriority(workInProgress) { var newPriority = NoWork$2, queue = workInProgress.updateQueue, tag = workInProgress.tag; null === queue || tag !== ClassComponent$4 && tag !== HostRoot$4 || (newPriority = getPendingPriority$1(queue)); - for (var child = workInProgress.progressedChild; null !== child; ) child.pendingWorkPriority !== NoWork$2 && (newPriority === NoWork$2 || newPriority > child.pendingWorkPriority) && (newPriority = child.pendingWorkPriority), + for (var child = workInProgress.progressedChild; null !== child; ) child.pendingWorkPriority !== NoWork$2 && (newPriority === NoWork$2 || newPriority > child.pendingWorkPriority) && (newPriority = child.pendingWorkPriority), child = child.sibling; workInProgress.pendingWorkPriority = newPriority; } function completeUnitOfWork(workInProgress) { for (;!0; ) { var current = workInProgress.alternate, next = completeWork(current, workInProgress), returnFiber = workInProgress.return, siblingFiber = workInProgress.sibling; - if (resetWorkPriority(workInProgress), null !== next) return stopWorkTimer(workInProgress), - !0 && ReactFiberInstrumentation$1.debugTool && ReactFiberInstrumentation$1.debugTool.onCompleteWork(workInProgress), + if (resetWorkPriority(workInProgress), null !== next) return stopWorkTimer(workInProgress), + !0 && ReactFiberInstrumentation$1.debugTool && ReactFiberInstrumentation$1.debugTool.onCompleteWork(workInProgress), next; - if (null !== returnFiber && (null === returnFiber.firstEffect && (returnFiber.firstEffect = workInProgress.firstEffect), - null !== workInProgress.lastEffect && (null !== returnFiber.lastEffect && (returnFiber.lastEffect.nextEffect = workInProgress.firstEffect), - returnFiber.lastEffect = workInProgress.lastEffect), workInProgress.effectTag !== NoEffect$2 && (null !== returnFiber.lastEffect ? returnFiber.lastEffect.nextEffect = workInProgress : returnFiber.firstEffect = workInProgress, - returnFiber.lastEffect = workInProgress)), stopWorkTimer(workInProgress), !0 && ReactFiberInstrumentation$1.debugTool && ReactFiberInstrumentation$1.debugTool.onCompleteWork(workInProgress), + if (null !== returnFiber) { + null === returnFiber.firstEffect && (returnFiber.firstEffect = workInProgress.firstEffect), + null !== workInProgress.lastEffect && (null !== returnFiber.lastEffect && (returnFiber.lastEffect.nextEffect = workInProgress.firstEffect), + returnFiber.lastEffect = workInProgress.lastEffect); + workInProgress.effectTag > PerformedWork && (null !== returnFiber.lastEffect ? returnFiber.lastEffect.nextEffect = workInProgress : returnFiber.firstEffect = workInProgress, + returnFiber.lastEffect = workInProgress); + } + if (stopWorkTimer(workInProgress), !0 && ReactFiberInstrumentation$1.debugTool && ReactFiberInstrumentation$1.debugTool.onCompleteWork(workInProgress), null !== siblingFiber) return siblingFiber; - if (null === returnFiber) return nextPriorityLevel < HighPriority ? commitAllWork(workInProgress) : pendingCommit = workInProgress, + if (null === returnFiber) return nextPriorityLevel < HighPriority ? commitAllWork(workInProgress) : pendingCommit = workInProgress, null; workInProgress = returnFiber; } @@ -3342,16 +3366,16 @@ var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCo var current = workInProgress.alternate; startWorkTimer(workInProgress); var next = beginWork(current, workInProgress, nextPriorityLevel); - return !0 && ReactFiberInstrumentation$1.debugTool && ReactFiberInstrumentation$1.debugTool.onBeginWork(workInProgress), - null === next && (next = completeUnitOfWork(workInProgress)), ReactCurrentOwner$1.current = null, + return !0 && ReactFiberInstrumentation$1.debugTool && ReactFiberInstrumentation$1.debugTool.onBeginWork(workInProgress), + null === next && (next = completeUnitOfWork(workInProgress)), ReactCurrentOwner$1.current = null, ReactDebugCurrentFiber$3.current = null, next; } function performFailedUnitOfWork(workInProgress) { var current = workInProgress.alternate; startWorkTimer(workInProgress); var next = beginFailedWork(current, workInProgress, nextPriorityLevel); - return !0 && ReactFiberInstrumentation$1.debugTool && ReactFiberInstrumentation$1.debugTool.onBeginWork(workInProgress), - null === next && (next = completeUnitOfWork(workInProgress)), ReactCurrentOwner$1.current = null, + return !0 && ReactFiberInstrumentation$1.debugTool && ReactFiberInstrumentation$1.debugTool.onBeginWork(workInProgress), + null === next && (next = completeUnitOfWork(workInProgress)), ReactCurrentOwner$1.current = null, ReactDebugCurrentFiber$3.current = null, next; } function performDeferredWork(deadline) { @@ -3364,32 +3388,26 @@ var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCo for (null === nextUnitOfWork && (nextUnitOfWork = findNextUnitOfWork()); null !== capturedErrors && capturedErrors.size && null !== nextUnitOfWork && nextPriorityLevel !== NoWork$2 && nextPriorityLevel <= TaskPriority$1; ) null === (nextUnitOfWork = hasCapturedError(nextUnitOfWork) ? performFailedUnitOfWork(nextUnitOfWork) : performUnitOfWork(nextUnitOfWork)) && (nextUnitOfWork = findNextUnitOfWork()); } function workLoop(priorityLevel, deadline) { - clearErrors(), null === nextUnitOfWork && (nextUnitOfWork = findNextUnitOfWork()); - var hostRootTimeMarker = void 0; - if (ReactFeatureFlags_1.logTopLevelRenders && null !== nextUnitOfWork && nextUnitOfWork.tag === HostRoot$4 && null !== nextUnitOfWork.child) { - hostRootTimeMarker = "React update: " + (getComponentName_1(nextUnitOfWork.child) || ""), - console.time(hostRootTimeMarker); - } - if (null !== deadline && priorityLevel > TaskPriority$1) for (;null !== nextUnitOfWork && !deadlineHasExpired; ) deadline.timeRemaining() > timeHeuristicForUnitOfWork ? null === (nextUnitOfWork = performUnitOfWork(nextUnitOfWork)) && null !== pendingCommit && (deadline.timeRemaining() > timeHeuristicForUnitOfWork ? (commitAllWork(pendingCommit), - nextUnitOfWork = findNextUnitOfWork(), clearErrors()) : deadlineHasExpired = !0) : deadlineHasExpired = !0; else for (;null !== nextUnitOfWork && nextPriorityLevel !== NoWork$2 && nextPriorityLevel <= priorityLevel; ) null === (nextUnitOfWork = performUnitOfWork(nextUnitOfWork)) && (nextUnitOfWork = findNextUnitOfWork(), + if (clearErrors(), null === nextUnitOfWork && (nextUnitOfWork = findNextUnitOfWork()), + null !== deadline && priorityLevel > TaskPriority$1) for (;null !== nextUnitOfWork && !deadlineHasExpired; ) deadline.timeRemaining() > timeHeuristicForUnitOfWork ? null === (nextUnitOfWork = performUnitOfWork(nextUnitOfWork)) && null !== pendingCommit && (deadline.timeRemaining() > timeHeuristicForUnitOfWork ? (commitAllWork(pendingCommit), + nextUnitOfWork = findNextUnitOfWork(), clearErrors()) : deadlineHasExpired = !0) : deadlineHasExpired = !0; else for (;null !== nextUnitOfWork && nextPriorityLevel !== NoWork$2 && nextPriorityLevel <= priorityLevel; ) null === (nextUnitOfWork = performUnitOfWork(nextUnitOfWork)) && (nextUnitOfWork = findNextUnitOfWork(), clearErrors()); - hostRootTimeMarker && console.timeEnd(hostRootTimeMarker); } function performWork(priorityLevel, deadline) { - startWorkLoopTimer(), invariant(!isPerformingWork, "performWork was called recursively. This error is likely caused " + "by a bug in React. Please file an issue."), + startWorkLoopTimer(), invariant(!isPerformingWork, "performWork was called recursively. This error is likely caused " + "by a bug in React. Please file an issue."), isPerformingWork = !0; for (var isPerformingDeferredWork = !!deadline; priorityLevel !== NoWork$2 && !fatalError; ) { - invariant(null !== deadline || priorityLevel < HighPriority, "Cannot perform deferred work without a deadline. This error is " + "likely caused by a bug in React. Please file an issue."), + invariant(null !== deadline || priorityLevel < HighPriority, "Cannot perform deferred work without a deadline. This error is " + "likely caused by a bug in React. Please file an issue."), null === pendingCommit || deadlineHasExpired || commitAllWork(pendingCommit), priorityContextBeforeReconciliation = priorityContext; var _error3 = null; - if (_error3 = invokeGuardedCallback$1(null, workLoop, null, priorityLevel, deadline), + if (_error3 = invokeGuardedCallback$1(null, workLoop, null, priorityLevel, deadline), priorityContext = priorityContextBeforeReconciliation, null !== _error3) { var failedWork = nextUnitOfWork; if (null !== failedWork) { var maybeBoundary = captureError(failedWork, _error3); if (null !== maybeBoundary) { var boundary = maybeBoundary; - beginFailedWork(boundary.alternate, boundary, priorityLevel), unwindContexts(failedWork, boundary), + beginFailedWork(boundary.alternate, boundary, priorityLevel), unwindContexts(failedWork, boundary), nextUnitOfWork = completeUnitOfWork(boundary); } continue; @@ -3413,17 +3431,17 @@ var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCo } else priorityLevel = nextPriorityLevel; } var errorToThrow = fatalError || firstUncaughtError; - if (isPerformingWork = !1, deadlineHasExpired = !1, fatalError = null, firstUncaughtError = null, + if (isPerformingWork = !1, deadlineHasExpired = !1, fatalError = null, firstUncaughtError = null, capturedErrors = null, failedBoundaries = null, stopWorkLoopTimer(), null !== errorToThrow) throw errorToThrow; } function captureError(failedWork, error) { - ReactCurrentOwner$1.current = null, ReactDebugCurrentFiber$3.current = null, ReactDebugCurrentFiber$3.phase = null, + ReactCurrentOwner$1.current = null, ReactDebugCurrentFiber$3.current = null, ReactDebugCurrentFiber$3.phase = null, nextUnitOfWork = null; var boundary = null, errorBoundaryFound = !1, willRetry = !1, errorBoundaryName = null; if (failedWork.tag === HostRoot$4) boundary = failedWork, isFailedBoundary(failedWork) && (fatalError = error); else for (var node = failedWork.return; null !== node && null === boundary; ) { if (node.tag === ClassComponent$4) { var instance = node.stateNode; - "function" == typeof instance.unstable_handleError && (errorBoundaryFound = !0, + "function" == typeof instance.unstable_handleError && (errorBoundaryFound = !0, errorBoundaryName = getComponentName_1(node), boundary = node, willRetry = !0); } else node.tag === HostRoot$4 && (boundary = node); if (isFailedBoundary(node)) { @@ -3435,16 +3453,16 @@ var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCo } if (null !== boundary) { null === failedBoundaries && (failedBoundaries = new Set()), failedBoundaries.add(boundary); - var _componentStack = getStackAddendumByWorkInProgressFiber$2(failedWork), _componentName2 = getComponentName_1(failedWork); + var _componentStack = getStackAddendumByWorkInProgressFiber$2(failedWork), _componentName = getComponentName_1(failedWork); return null === capturedErrors && (capturedErrors = new Map()), capturedErrors.set(boundary, { - componentName: _componentName2, + componentName: _componentName, componentStack: _componentStack, error: error, errorBoundary: errorBoundaryFound ? boundary.stateNode : null, errorBoundaryFound: errorBoundaryFound, errorBoundaryName: errorBoundaryName, willRetry: willRetry - }), isCommitting ? (null === commitPhaseBoundaries && (commitPhaseBoundaries = new Set()), + }), isCommitting ? (null === commitPhaseBoundaries && (commitPhaseBoundaries = new Set()), commitPhaseBoundaries.add(boundary)) : scheduleErrorRecovery(boundary), boundary; } return null === firstUncaughtError && (firstUncaughtError = error), null; @@ -3457,9 +3475,9 @@ var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCo } function commitErrorHandling(effectfulFiber) { var capturedError = void 0; - null !== capturedErrors && (capturedError = capturedErrors.get(effectfulFiber), - capturedErrors.delete(effectfulFiber), null == capturedError && null !== effectfulFiber.alternate && (effectfulFiber = effectfulFiber.alternate, - capturedError = capturedErrors.get(effectfulFiber), capturedErrors.delete(effectfulFiber))), + null !== capturedErrors && (capturedError = capturedErrors.get(effectfulFiber), + capturedErrors.delete(effectfulFiber), null == capturedError && null !== effectfulFiber.alternate && (effectfulFiber = effectfulFiber.alternate, + capturedError = capturedErrors.get(effectfulFiber), capturedErrors.delete(effectfulFiber))), invariant(null != capturedError, "No error for given unit of work. This error is likely caused by a " + "bug in React. Please file an issue."); var error = capturedError.error; try { @@ -3488,7 +3506,7 @@ var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCo popContextProvider$1(node); break; - case HostComponent$5: + case HostComponent$6: popHostContext(node); break; @@ -3500,18 +3518,18 @@ var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCo } } function scheduleRoot(root, priorityLevel) { - priorityLevel !== NoWork$2 && (root.isScheduled || (root.isScheduled = !0, lastScheduledRoot ? (lastScheduledRoot.nextScheduledRoot = root, + priorityLevel !== NoWork$2 && (root.isScheduled || (root.isScheduled = !0, lastScheduledRoot ? (lastScheduledRoot.nextScheduledRoot = root, lastScheduledRoot = root) : (nextScheduledRoot = root, lastScheduledRoot = root))); } function scheduleUpdate(fiber, priorityLevel) { - if (recordScheduleUpdate(), priorityLevel <= nextPriorityLevel && (nextUnitOfWork = null), + if (recordScheduleUpdate(), priorityLevel <= nextPriorityLevel && (nextUnitOfWork = null), fiber.tag === ClassComponent$4) { var instance = fiber.stateNode; warnAboutInvalidUpdates(instance); } for (var node = fiber, shouldContinue = !0; null !== node && shouldContinue; ) { - if (shouldContinue = !1, (node.pendingWorkPriority === NoWork$2 || node.pendingWorkPriority > priorityLevel) && (shouldContinue = !0, - node.pendingWorkPriority = priorityLevel), null !== node.alternate && (node.alternate.pendingWorkPriority === NoWork$2 || node.alternate.pendingWorkPriority > priorityLevel) && (shouldContinue = !0, + if (shouldContinue = !1, (node.pendingWorkPriority === NoWork$2 || node.pendingWorkPriority > priorityLevel) && (shouldContinue = !0, + node.pendingWorkPriority = priorityLevel), null !== node.alternate && (node.alternate.pendingWorkPriority === NoWork$2 || node.alternate.pendingWorkPriority > priorityLevel) && (shouldContinue = !0, node.alternate.pendingWorkPriority = priorityLevel), null === node.return) { if (node.tag !== HostRoot$4) return void (fiber.tag === ClassComponent$4 && warnAboutUpdateOnUnmounted(fiber.stateNode)); switch (scheduleRoot(node.stateNode, priorityLevel), priorityLevel) { @@ -3535,7 +3553,7 @@ var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCo } function getPriorityContext(fiber, forceAsync) { var priorityLevel = priorityContext; - return priorityLevel === NoWork$2 && (priorityLevel = !useSyncScheduling || fiber.internalContextTag & AsyncUpdates || forceAsync ? LowPriority : SynchronousPriority$1), + return priorityLevel === NoWork$2 && (priorityLevel = !useSyncScheduling || fiber.internalContextTag & AsyncUpdates || forceAsync ? LowPriority : SynchronousPriority$1), priorityLevel === SynchronousPriority$1 && (isPerformingWork || isBatchingUpdates) ? TaskPriority$1 : priorityLevel; } function scheduleErrorRecovery(fiber) { @@ -3609,7 +3627,7 @@ getContextForSubtree._injectFiber = function(fn) { getContextFiber = fn; }; -var getContextForSubtree_1 = getContextForSubtree, addTopLevelUpdate = ReactFiberUpdateQueue.addTopLevelUpdate, findCurrentUnmaskedContext = ReactFiberContext.findCurrentUnmaskedContext, isContextProvider = ReactFiberContext.isContextProvider, processChildContext = ReactFiberContext.processChildContext, createFiberRoot = ReactFiberRoot.createFiberRoot, warning$2 = warning, ReactFiberInstrumentation = ReactFiberInstrumentation_1, ReactDebugCurrentFiber = ReactDebugCurrentFiber_1, getComponentName = getComponentName_1, findCurrentHostFiber = ReactFiberTreeReflection.findCurrentHostFiber; +var getContextForSubtree_1 = getContextForSubtree, addTopLevelUpdate = ReactFiberUpdateQueue.addTopLevelUpdate, findCurrentUnmaskedContext = ReactFiberContext.findCurrentUnmaskedContext, isContextProvider = ReactFiberContext.isContextProvider, processChildContext = ReactFiberContext.processChildContext, createFiberRoot = ReactFiberRoot.createFiberRoot, HostComponent$1 = ReactTypeOfWork.HostComponent, warning$2 = warning, ReactFiberInstrumentation = ReactFiberInstrumentation_1, ReactDebugCurrentFiber = ReactDebugCurrentFiber_1, getComponentName = getComponentName_1, findCurrentHostFiber = ReactFiberTreeReflection.findCurrentHostFiber; getContextForSubtree_1._injectFiber(function(fiber) { var parentContext = findCurrentUnmaskedContext(fiber); @@ -3617,13 +3635,13 @@ getContextForSubtree_1._injectFiber(function(fiber) { }); var ReactFiberReconciler = function(config) { - var _ReactFiberScheduler = ReactFiberScheduler(config), scheduleUpdate = _ReactFiberScheduler.scheduleUpdate, getPriorityContext = _ReactFiberScheduler.getPriorityContext, performWithPriority = _ReactFiberScheduler.performWithPriority, batchedUpdates = _ReactFiberScheduler.batchedUpdates, unbatchedUpdates = _ReactFiberScheduler.unbatchedUpdates, syncUpdates = _ReactFiberScheduler.syncUpdates, deferredUpdates = _ReactFiberScheduler.deferredUpdates; + var getPublicInstance = config.getPublicInstance, _ReactFiberScheduler = ReactFiberScheduler(config), scheduleUpdate = _ReactFiberScheduler.scheduleUpdate, getPriorityContext = _ReactFiberScheduler.getPriorityContext, performWithPriority = _ReactFiberScheduler.performWithPriority, batchedUpdates = _ReactFiberScheduler.batchedUpdates, unbatchedUpdates = _ReactFiberScheduler.unbatchedUpdates, syncUpdates = _ReactFiberScheduler.syncUpdates, deferredUpdates = _ReactFiberScheduler.deferredUpdates; function scheduleTopLevelUpdate(current, element, callback) { "render" === ReactDebugCurrentFiber.phase && null !== ReactDebugCurrentFiber.current && warning$2(!1, "Render methods should be a pure function of props and state; " + "triggering nested component updates from render is not allowed. " + "If necessary, trigger nested updates in componentDidUpdate.\n\n" + "Check the render method of %s.", getComponentName(ReactDebugCurrentFiber.current) || "Unknown"); var forceAsync = ReactFeatureFlags_1.enableAsyncSubtreeAPI && null != element && null != element.type && !0 === element.type.unstable_asyncUpdates, priorityLevel = getPriorityContext(current, forceAsync), nextState = { element: element }; - callback = void 0 === callback ? null : callback, warning$2(null === callback || "function" == typeof callback, "render(...): Expected the last optional `callback` argument to be a " + "function. Instead received: %s.", callback), + callback = void 0 === callback ? null : callback, warning$2(null === callback || "function" == typeof callback, "render(...): Expected the last optional `callback` argument to be a " + "function. Instead received: %s.", callback), addTopLevelUpdate(current, nextState, callback, priorityLevel), scheduleUpdate(current, priorityLevel); } return { @@ -3634,7 +3652,7 @@ var ReactFiberReconciler = function(config) { var current = container.current; ReactFiberInstrumentation.debugTool && (null === current.alternate ? ReactFiberInstrumentation.debugTool.onMountContainer(container) : null === element ? ReactFiberInstrumentation.debugTool.onUnmountContainer(container) : ReactFiberInstrumentation.debugTool.onUpdateContainer(container)); var context = getContextForSubtree_1(parentComponent); - null === container.context ? container.context = context : container.pendingContext = context, + null === container.context ? container.context = context : container.pendingContext = context, scheduleTopLevelUpdate(current, element, callback); }, performWithPriority: performWithPriority, @@ -3644,7 +3662,14 @@ var ReactFiberReconciler = function(config) { deferredUpdates: deferredUpdates, getPublicRootInstance: function(container) { var containerFiber = container.current; - return containerFiber.child ? containerFiber.child.stateNode : null; + if (!containerFiber.child) return null; + switch (containerFiber.child.tag) { + case HostComponent$1: + return getPublicInstance(containerFiber.child.stateNode); + + default: + return containerFiber.child.stateNode; + } }, findHostInstance: function(fiber) { var hostFiber = findCurrentHostFiber(fiber); @@ -3667,7 +3692,7 @@ var objects = {}, uniqueID = 1, emptyObject$3 = {}, ReactNativePropRegistry = fu }, ReactNativePropRegistry.getByID = function(id) { if (!id) return emptyObject$3; var object = objects[id]; - return object || (console.warn("Invalid style with id `" + id + "`. Skipping ..."), + return object || (console.warn("Invalid style with id `" + id + "`. Skipping ..."), emptyObject$3); }, ReactNativePropRegistry; }(), ReactNativePropRegistry_1 = ReactNativePropRegistry, emptyObject$2 = {}, removedKeys = null, removedKeyCount = 0; @@ -3688,7 +3713,7 @@ function restoreDeletedValuesInNestedArray(updatePayload, node, validAttributes) if (void 0 !== nextProp) { var attributeConfig = validAttributes[propKey]; if (attributeConfig) { - if ("function" == typeof nextProp && (nextProp = !0), void 0 === nextProp && (nextProp = null), + if ("function" == typeof nextProp && (nextProp = !0), void 0 === nextProp && (nextProp = null), "object" != typeof attributeConfig) updatePayload[propKey] = nextProp; else if ("function" == typeof attributeConfig.diff || "function" == typeof attributeConfig.process) { var nextValue = "function" == typeof attributeConfig.process ? attributeConfig.process(nextProp) : nextProp; updatePayload[propKey] = nextValue; @@ -3728,10 +3753,10 @@ function clearNestedProperty(updatePayload, prevProp, validAttributes) { function diffProperties(updatePayload, prevProps, nextProps, validAttributes) { var attributeConfig, nextProp, prevProp; - for (var propKey in nextProps) if (attributeConfig = validAttributes[propKey]) if (prevProp = prevProps[propKey], - nextProp = nextProps[propKey], "function" == typeof nextProp && (nextProp = !0, - "function" == typeof prevProp && (prevProp = !0)), void 0 === nextProp && (nextProp = null, - void 0 === prevProp && (prevProp = null)), removedKeys && (removedKeys[propKey] = !1), + for (var propKey in nextProps) if (attributeConfig = validAttributes[propKey]) if (prevProp = prevProps[propKey], + nextProp = nextProps[propKey], "function" == typeof nextProp && (nextProp = !0, + "function" == typeof prevProp && (prevProp = !0)), void 0 === nextProp && (nextProp = null, + void 0 === prevProp && (prevProp = null)), removedKeys && (removedKeys[propKey] = !1), updatePayload && void 0 !== updatePayload[propKey]) { if ("object" != typeof attributeConfig) updatePayload[propKey] = nextProp; else if ("function" == typeof attributeConfig.diff || "function" == typeof attributeConfig.process) { var nextValue = "function" == typeof attributeConfig.process ? attributeConfig.process(nextProp) : nextProp; @@ -3739,13 +3764,13 @@ function diffProperties(updatePayload, prevProps, nextProps, validAttributes) { } } else if (prevProp !== nextProp) if ("object" != typeof attributeConfig) defaultDiffer(prevProp, nextProp) && ((updatePayload || (updatePayload = {}))[propKey] = nextProp); else if ("function" == typeof attributeConfig.diff || "function" == typeof attributeConfig.process) { var shouldUpdate = void 0 === prevProp || ("function" == typeof attributeConfig.diff ? attributeConfig.diff(prevProp, nextProp) : defaultDiffer(prevProp, nextProp)); - shouldUpdate && (nextValue = "function" == typeof attributeConfig.process ? attributeConfig.process(nextProp) : nextProp, + shouldUpdate && (nextValue = "function" == typeof attributeConfig.process ? attributeConfig.process(nextProp) : nextProp, (updatePayload || (updatePayload = {}))[propKey] = nextValue); - } else removedKeys = null, removedKeyCount = 0, updatePayload = diffNestedProperty(updatePayload, prevProp, nextProp, attributeConfig), - removedKeyCount > 0 && updatePayload && (restoreDeletedValuesInNestedArray(updatePayload, nextProp, attributeConfig), + } else removedKeys = null, removedKeyCount = 0, updatePayload = diffNestedProperty(updatePayload, prevProp, nextProp, attributeConfig), + removedKeyCount > 0 && updatePayload && (restoreDeletedValuesInNestedArray(updatePayload, nextProp, attributeConfig), removedKeys = null); - for (propKey in prevProps) void 0 === nextProps[propKey] && (attributeConfig = validAttributes[propKey]) && (updatePayload && void 0 !== updatePayload[propKey] || void 0 !== (prevProp = prevProps[propKey]) && ("object" != typeof attributeConfig || "function" == typeof attributeConfig.diff || "function" == typeof attributeConfig.process ? ((updatePayload || (updatePayload = {}))[propKey] = null, - removedKeys || (removedKeys = {}), removedKeys[propKey] || (removedKeys[propKey] = !0, + for (propKey in prevProps) void 0 === nextProps[propKey] && (attributeConfig = validAttributes[propKey]) && (updatePayload && void 0 !== updatePayload[propKey] || void 0 !== (prevProp = prevProps[propKey]) && ("object" != typeof attributeConfig || "function" == typeof attributeConfig.diff || "function" == typeof attributeConfig.process ? ((updatePayload || (updatePayload = {}))[propKey] = null, + removedKeys || (removedKeys = {}), removedKeys[propKey] || (removedKeys[propKey] = !0, removedKeyCount++)) : updatePayload = clearNestedProperty(updatePayload, prevProp, attributeConfig))); return updatePayload; } @@ -3781,7 +3806,7 @@ function mountSafeCallback$1(context, callback) { function throwOnStylesProp(component, props) { if (void 0 !== props.styles) { var owner = component._owner || null, name = component.constructor.displayName, msg = "`styles` is not a supported property of `" + name + "`, did " + "you mean `style` (singular)?"; - throw owner && owner.constructor && owner.constructor.displayName && (msg += "\n\nCheck the `" + owner.constructor.displayName + "` parent " + " component."), + throw owner && owner.constructor && owner.constructor.displayName && (msg += "\n\nCheck the `" + owner.constructor.displayName + "` parent " + " component."), new Error(msg); } } @@ -3802,7 +3827,7 @@ function _classCallCheck$1(instance, Constructor) { var mountSafeCallback = NativeMethodsMixinUtils.mountSafeCallback, warnForStyleProps = NativeMethodsMixinUtils.warnForStyleProps, ReactNativeFiberHostComponent = function() { function ReactNativeFiberHostComponent(tag, viewConfig) { - _classCallCheck$1(this, ReactNativeFiberHostComponent), this._nativeTag = tag, this._children = [], + _classCallCheck$1(this, ReactNativeFiberHostComponent), this._nativeTag = tag, this._children = [], this.viewConfig = viewConfig; } return ReactNativeFiberHostComponent.prototype.blur = function() { @@ -3820,21 +3845,20 @@ var mountSafeCallback = NativeMethodsMixinUtils.mountSafeCallback, warnForStyleP var updatePayload = ReactNativeAttributePayload_1.create(nativeProps, this.viewConfig.validAttributes); UIManager.updateView(this._nativeTag, this.viewConfig.uiViewClassName, updatePayload); }, ReactNativeFiberHostComponent; -}(), ReactNativeFiberHostComponent_1 = ReactNativeFiberHostComponent, viewConfigs = new Map(), prefix = "topsecret-", ReactNativeViewConfigRegistry = { +}(), ReactNativeFiberHostComponent_1 = ReactNativeFiberHostComponent, viewConfigs = new Map(), ReactNativeViewConfigRegistry = { register: function(viewConfig) { var name = viewConfig.uiViewClassName; - invariant(!viewConfigs.has(name), "Tried to register two views with the same name %s", name); - var secretName = prefix + name; - return viewConfigs.set(secretName, viewConfig), secretName; + return invariant(!viewConfigs.has(name), "Tried to register two views with the same name %s", name), + viewConfigs.set(name, viewConfig), name; }, - get: function(secretName) { - var config = viewConfigs.get(secretName); - return invariant(config, "View config not found for name %s", secretName), config; + get: function(name) { + var config = viewConfigs.get(name); + return invariant(config, "View config not found for name %s", name), config; } }, ReactNativeViewConfigRegistry_1 = ReactNativeViewConfigRegistry, precacheFiberNode$1 = ReactNativeComponentTree_1.precacheFiberNode, uncacheFiberNode$1 = ReactNativeComponentTree_1.uncacheFiberNode, updateFiberProps$1 = ReactNativeComponentTree_1.updateFiberProps; function recursivelyUncacheFiberNode(node) { - "number" == typeof node ? uncacheFiberNode$1(node) : (uncacheFiberNode$1(node._nativeTag), + "number" == typeof node ? uncacheFiberNode$1(node) : (uncacheFiberNode$1(node._nativeTag), node._children.forEach(recursivelyUncacheFiberNode)); } @@ -3843,7 +3867,7 @@ var NativeRenderer = ReactFiberReconciler({ var childTag = "number" == typeof child ? child : child._nativeTag; if ("number" == typeof parentInstance) UIManager.setChildren(parentInstance, [ childTag ]); else { var children = parentInstance._children, index = children.indexOf(child); - index >= 0 ? (children.splice(index, 1), children.push(child), UIManager.manageChildren(parentInstance._nativeTag, [ index ], [ children.length - 1 ], [], [], [])) : (children.push(child), + index >= 0 ? (children.splice(index, 1), children.push(child), UIManager.manageChildren(parentInstance._nativeTag, [ index ], [ children.length - 1 ], [], [], [])) : (children.push(child), UIManager.manageChildren(parentInstance._nativeTag, [], [], [ childTag ], [ children.length - 1 ], [])); } }, @@ -3868,7 +3892,7 @@ var NativeRenderer = ReactFiberReconciler({ var updatePayload = ReactNativeAttributePayload_1.create(props, viewConfig.validAttributes); UIManager.createView(tag, viewConfig.uiViewClassName, rootContainerInstance, updatePayload); var component = new ReactNativeFiberHostComponent_1(tag, viewConfig); - return precacheFiberNode$1(internalInstanceHandle, tag), updateFiberProps$1(tag, props), + return precacheFiberNode$1(internalInstanceHandle, tag), updateFiberProps$1(tag, props), component; }, createTextInstance: function(text, rootContainerInstance, hostContext, internalInstanceHandle) { @@ -3924,11 +3948,11 @@ var NativeRenderer = ReactFiberReconciler({ }, scheduleAnimationCallback: commonjsGlobal.requestAnimationFrame, scheduleDeferredCallback: commonjsGlobal.requestIdleCallback, - shouldSetTextContent: function(props) { + shouldSetTextContent: function(type, props) { return !1; }, useSyncScheduling: !0 -}), ReactNativeFiberRenderer = NativeRenderer, getClosestInstanceFromNode = ReactNativeComponentTree_1.getClosestInstanceFromNode, findCurrentFiberUsingSlowPath$1 = ReactFiberTreeReflection.findCurrentFiberUsingSlowPath, HostComponent$10 = ReactTypeOfWork.HostComponent, getInspectorDataForViewTag = void 0, traverseOwnerTreeUp = function(hierarchy, instance) { +}), ReactNativeFiberRenderer = NativeRenderer, getClosestInstanceFromNode = ReactNativeComponentTree_1.getClosestInstanceFromNode, findCurrentFiberUsingSlowPath$1 = ReactFiberTreeReflection.findCurrentFiberUsingSlowPath, HostComponent$11 = ReactTypeOfWork.HostComponent, getInspectorDataForViewTag = void 0, traverseOwnerTreeUp = function(hierarchy, instance) { instance && (hierarchy.unshift(instance), traverseOwnerTreeUp(hierarchy, instance._debugOwner)); }, getOwnerHierarchy = function(instance) { var hierarchy = []; @@ -3936,7 +3960,7 @@ var NativeRenderer = ReactFiberReconciler({ }, lastNonHostInstance = function(hierarchy) { for (var i = hierarchy.length - 1; i > 1; i--) { var instance = hierarchy[i]; - if (instance.tag !== HostComponent$10) return instance; + if (instance.tag !== HostComponent$11) return instance; } return hierarchy[0]; }, getHostProps = function(fiber) { @@ -3944,17 +3968,15 @@ var NativeRenderer = ReactFiberReconciler({ return host ? host.memoizedProps || emptyObject : emptyObject; }, getHostNode = function(fiber, findNodeHandle) { for (var hostNode = void 0; fiber; ) { - if (null !== fiber.stateNode && fiber.tag === HostComponent$10 && (hostNode = findNodeHandle(fiber.stateNode)), + if (null !== fiber.stateNode && fiber.tag === HostComponent$11 && (hostNode = findNodeHandle(fiber.stateNode)), hostNode) return hostNode; fiber = fiber.child; } return null; -}, stripTopSecret = function(str) { - return "string" == typeof str && str.replace("topsecret-", ""); }, createHierarchy = function(fiberHierarchy) { return fiberHierarchy.map(function(fiber) { return { - name: stripTopSecret(getComponentName_1(fiber)), + name: getComponentName_1(fiber), getInspectorData: function(findNodeHandle) { return { measure: function(callback) { @@ -3972,7 +3994,6 @@ getInspectorDataForViewTag = function(viewTag) { var fiber = findCurrentFiberUsingSlowPath$1(getClosestInstanceFromNode(viewTag)), fiberHierarchy = getOwnerHierarchy(fiber), instance = lastNonHostInstance(fiberHierarchy), hierarchy = createHierarchy(fiberHierarchy), props = getHostProps(instance), source = instance._debugSource; return { hierarchy: hierarchy, - instance: instance, props: props, selection: fiberHierarchy.indexOf(instance), source: source @@ -3994,39 +4015,110 @@ var ReactNativeFiberInspector = { function findNodeHandle(componentOrHandle) { var owner = ReactCurrentOwner$3.current; - if (null !== owner && (warning(owner._warnedAboutRefsInRender, "%s is accessing findNodeHandle inside its render(). " + "render() should be a pure function of props and state. It should " + "never access something that requires stale data from the previous " + "render, such as refs. Move this logic to componentDidMount and " + "componentDidUpdate instead.", owner.getName() || "A component"), + if (null !== owner && (warning(owner._warnedAboutRefsInRender, "%s is accessing findNodeHandle inside its render(). " + "render() should be a pure function of props and state. It should " + "never access something that requires stale data from the previous " + "render, such as refs. Move this logic to componentDidMount and " + "componentDidUpdate instead.", owner.getName() || "A component"), owner._warnedAboutRefsInRender = !0), null == componentOrHandle) return null; if ("number" == typeof componentOrHandle) return componentOrHandle; var component = componentOrHandle, internalInstance = ReactInstanceMap_1.get(component); - return internalInstance ? injectedFindNode(internalInstance) : component || (invariant("object" == typeof component && ("_rootNodeID" in component || "_nativeTag" in component) || null != component.render && "function" == typeof component.render, "findNodeHandle(...): Argument is not a component " + "(type: %s, keys: %s)", typeof component, Object.keys(component)), + return internalInstance ? injectedFindNode(internalInstance) : component || (invariant("object" == typeof component && ("_rootNodeID" in component || "_nativeTag" in component) || null != component.render && "function" == typeof component.render, "findNodeHandle(...): Argument is not a component " + "(type: %s, keys: %s)", typeof component, Object.keys(component)), void invariant(!1, "findNodeHandle(...): Unable to find node handle for unmounted " + "component.")); } var findNodeHandle_1 = findNodeHandle, findNumericNodeHandleFiber = function(componentOrHandle) { var instance = findNodeHandle_1(componentOrHandle); return null == instance || "number" == typeof instance ? instance : instance._nativeTag; -}, DevOnlyStubShim = null, mountSafeCallback$2 = NativeMethodsMixinUtils.mountSafeCallback, throwOnStylesProp$1 = NativeMethodsMixinUtils.throwOnStylesProp, warnForStyleProps$2 = NativeMethodsMixinUtils.warnForStyleProps, findNumericNodeHandle = ReactNativeFeatureFlags$1.useFiber ? findNumericNodeHandleFiber : DevOnlyStubShim, NativeMethodsMixin = { - measure: function(callback) { +}, DevOnlyStubShim = null; + +function _classCallCheck$2(instance, Constructor) { + if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); +} + +function _possibleConstructorReturn(self, call) { + if (!self) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); + return !call || "object" != typeof call && "function" != typeof call ? self : call; +} + +function _inherits(subClass, superClass) { + if ("function" != typeof superClass && null !== superClass) throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); + subClass.prototype = Object.create(superClass && superClass.prototype, { + constructor: { + value: subClass, + enumerable: !1, + writable: !0, + configurable: !0 + } + }), superClass && (Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass); +} + +var mountSafeCallback$2 = NativeMethodsMixinUtils.mountSafeCallback, findNumericNodeHandle = ReactNativeFeatureFlags$1.useFiber ? findNumericNodeHandleFiber : DevOnlyStubShim, ReactNativeComponent = function(_React$Component) { + _inherits(ReactNativeComponent, _React$Component); + function ReactNativeComponent() { + return _classCallCheck$2(this, ReactNativeComponent), _possibleConstructorReturn(this, _React$Component.apply(this, arguments)); + } + return ReactNativeComponent.prototype.blur = function() { + TextInputState.blurTextInput(findNumericNodeHandle(this)); + }, ReactNativeComponent.prototype.focus = function() { + TextInputState.focusTextInput(findNumericNodeHandle(this)); + }, ReactNativeComponent.prototype.measure = function(callback) { UIManager.measure(findNumericNodeHandle(this), mountSafeCallback$2(this, callback)); + }, ReactNativeComponent.prototype.measureInWindow = function(callback) { + UIManager.measureInWindow(findNumericNodeHandle(this), mountSafeCallback$2(this, callback)); + }, ReactNativeComponent.prototype.measureLayout = function(relativeToNativeNode, onSuccess, onFail) { + UIManager.measureLayout(findNumericNodeHandle(this), relativeToNativeNode, mountSafeCallback$2(this, onFail), mountSafeCallback$2(this, onSuccess)); + }, ReactNativeComponent.prototype.setNativeProps = function(nativeProps) { + injectedSetNativeProps(this, nativeProps); + }, ReactNativeComponent; +}(react.Component); + +function setNativePropsFiber(componentOrHandle, nativeProps) { + var maybeInstance = void 0; + try { + maybeInstance = findNodeHandle_1(componentOrHandle); + } catch (error) {} + if (null != maybeInstance) { + var viewConfig = maybeInstance.viewConfig, updatePayload = ReactNativeAttributePayload_1.create(nativeProps, viewConfig.validAttributes); + UIManager.updateView(maybeInstance._nativeTag, viewConfig.uiViewClassName, updatePayload); + } +} + +function setNativePropsStack(componentOrHandle, nativeProps) { + var maybeInstance = findNodeHandle_1(componentOrHandle); + if (null != maybeInstance) { + var viewConfig = void 0; + if (void 0 !== maybeInstance.viewConfig) viewConfig = maybeInstance.viewConfig; else if (void 0 !== maybeInstance._instance && void 0 !== maybeInstance._instance.viewConfig) viewConfig = maybeInstance._instance.viewConfig; else { + for (;void 0 !== maybeInstance._renderedComponent; ) maybeInstance = maybeInstance._renderedComponent; + viewConfig = maybeInstance.viewConfig; + } + var tag = "function" == typeof maybeInstance.getHostNode ? maybeInstance.getHostNode() : maybeInstance._rootNodeID, updatePayload = ReactNativeAttributePayload_1.create(nativeProps, viewConfig.validAttributes); + UIManager.updateView(tag, viewConfig.uiViewClassName, updatePayload); + } +} + +var injectedSetNativeProps = void 0; + +injectedSetNativeProps = ReactNativeFeatureFlags$1.useFiber ? setNativePropsFiber : setNativePropsStack; + +var ReactNativeComponent_1 = ReactNativeComponent, mountSafeCallback$3 = NativeMethodsMixinUtils.mountSafeCallback, throwOnStylesProp$1 = NativeMethodsMixinUtils.throwOnStylesProp, warnForStyleProps$2 = NativeMethodsMixinUtils.warnForStyleProps, findNumericNodeHandle$1 = ReactNativeFeatureFlags$1.useFiber ? findNumericNodeHandleFiber : DevOnlyStubShim, NativeMethodsMixin = { + measure: function(callback) { + UIManager.measure(findNumericNodeHandle$1(this), mountSafeCallback$3(this, callback)); }, measureInWindow: function(callback) { - UIManager.measureInWindow(findNumericNodeHandle(this), mountSafeCallback$2(this, callback)); + UIManager.measureInWindow(findNumericNodeHandle$1(this), mountSafeCallback$3(this, callback)); }, measureLayout: function(relativeToNativeNode, onSuccess, onFail) { - UIManager.measureLayout(findNumericNodeHandle(this), relativeToNativeNode, mountSafeCallback$2(this, onFail), mountSafeCallback$2(this, onSuccess)); + UIManager.measureLayout(findNumericNodeHandle$1(this), relativeToNativeNode, mountSafeCallback$3(this, onFail), mountSafeCallback$3(this, onSuccess)); }, setNativeProps: function(nativeProps) { - injectedSetNativeProps(this, nativeProps); + injectedSetNativeProps$1(this, nativeProps); }, focus: function() { - TextInputState.focusTextInput(findNumericNodeHandle(this)); + TextInputState.focusTextInput(findNumericNodeHandle$1(this)); }, blur: function() { - TextInputState.blurTextInput(findNumericNodeHandle(this)); + TextInputState.blurTextInput(findNumericNodeHandle$1(this)); } }; -function setNativePropsFiber(componentOrHandle, nativeProps) { +function setNativePropsFiber$1(componentOrHandle, nativeProps) { var maybeInstance = void 0; try { maybeInstance = findNodeHandle_1(componentOrHandle); @@ -4039,7 +4131,7 @@ function setNativePropsFiber(componentOrHandle, nativeProps) { } } -function setNativePropsStack(componentOrHandle, nativeProps) { +function setNativePropsStack$1(componentOrHandle, nativeProps) { var maybeInstance = findNodeHandle_1(componentOrHandle); if (null != maybeInstance) { var viewConfig = void 0; @@ -4054,13 +4146,13 @@ function setNativePropsStack(componentOrHandle, nativeProps) { } } -var injectedSetNativeProps = void 0; +var injectedSetNativeProps$1 = void 0; -injectedSetNativeProps = ReactNativeFeatureFlags$1.useFiber ? setNativePropsFiber : setNativePropsStack; +injectedSetNativeProps$1 = ReactNativeFeatureFlags$1.useFiber ? setNativePropsFiber$1 : setNativePropsStack$1; var NativeMethodsMixin_DEV = NativeMethodsMixin; -invariant(!NativeMethodsMixin_DEV.componentWillMount && !NativeMethodsMixin_DEV.componentWillReceiveProps, "Do not override existing functions."), +invariant(!NativeMethodsMixin_DEV.componentWillMount && !NativeMethodsMixin_DEV.componentWillReceiveProps, "Do not override existing functions."), NativeMethodsMixin_DEV.componentWillMount = function() { throwOnStylesProp$1(this, this.props); }, NativeMethodsMixin_DEV.componentWillReceiveProps = function(newProps) { @@ -4070,12 +4162,12 @@ NativeMethodsMixin_DEV.componentWillMount = function() { var NativeMethodsMixin_1 = NativeMethodsMixin, TouchHistoryMath = { centroidDimension: function(touchHistory, touchesChangedAfter, isXAxis, ofCurrent) { var touchBank = touchHistory.touchBank, total = 0, count = 0, oneTouchData = 1 === touchHistory.numberActiveTouches ? touchHistory.touchBank[touchHistory.indexOfSingleActiveTouch] : null; - if (null !== oneTouchData) oneTouchData.touchActive && oneTouchData.currentTimeStamp > touchesChangedAfter && (total += ofCurrent && isXAxis ? oneTouchData.currentPageX : ofCurrent && !isXAxis ? oneTouchData.currentPageY : !ofCurrent && isXAxis ? oneTouchData.previousPageX : oneTouchData.previousPageY, + if (null !== oneTouchData) oneTouchData.touchActive && oneTouchData.currentTimeStamp > touchesChangedAfter && (total += ofCurrent && isXAxis ? oneTouchData.currentPageX : ofCurrent && !isXAxis ? oneTouchData.currentPageY : !ofCurrent && isXAxis ? oneTouchData.previousPageX : oneTouchData.previousPageY, count = 1); else for (var i = 0; i < touchBank.length; i++) { var touchTrack = touchBank[i]; if (null !== touchTrack && void 0 !== touchTrack && touchTrack.touchActive && touchTrack.currentTimeStamp >= touchesChangedAfter) { var toAdd; - toAdd = ofCurrent && isXAxis ? touchTrack.currentPageX : ofCurrent && !isXAxis ? touchTrack.currentPageY : !ofCurrent && isXAxis ? touchTrack.previousPageX : touchTrack.previousPageY, + toAdd = ofCurrent && isXAxis ? touchTrack.currentPageX : ofCurrent && !isXAxis ? touchTrack.currentPageY : !ofCurrent && isXAxis ? touchTrack.previousPageX : touchTrack.previousPageY, total += toAdd, count++; } } @@ -4102,10 +4194,10 @@ var NativeMethodsMixin_1 = NativeMethodsMixin, TouchHistoryMath = { noCentroid: -1 }, TouchHistoryMath_1 = TouchHistoryMath, createReactNativeComponentClassFiber = function(viewConfig) { return ReactNativeViewConfigRegistry_1.register(viewConfig); -}, createReactNativeComponentClassFiber_1 = createReactNativeComponentClassFiber, createReactNativeComponentClass = ReactNativeFeatureFlags$1.useFiber ? createReactNativeComponentClassFiber_1 : DevOnlyStubShim, findNumericNodeHandle$1 = ReactNativeFeatureFlags$1.useFiber ? findNumericNodeHandleFiber : DevOnlyStubShim; +}, createReactNativeComponentClassFiber_1 = createReactNativeComponentClassFiber, createReactNativeComponentClass = ReactNativeFeatureFlags$1.useFiber ? createReactNativeComponentClassFiber_1 : DevOnlyStubShim, findNumericNodeHandle$2 = ReactNativeFeatureFlags$1.useFiber ? findNumericNodeHandleFiber : DevOnlyStubShim; function takeSnapshot(view, options) { - return "number" != typeof view && "window" !== view && (view = findNumericNodeHandle$1(view) || "window"), + return "number" != typeof view && "window" !== view && (view = findNumericNodeHandle$2(view) || "window"), UIManager.__takeSnapshot(view, options); } @@ -4143,7 +4235,7 @@ var ReactHostOperationHistoryHook_1 = ReactHostOperationHistoryHook, ReactCompon try { fn.call(context, arg1, arg2, arg3, arg4, arg5); } catch (e) { - warning(didHookThrowForEvent[event], "Exception thrown by hook while handling %s: %s", event, e + "\n" + e.stack), + warning(didHookThrowForEvent[event], "Exception thrown by hook while handling %s: %s", event, e + "\n" + e.stack), didHookThrowForEvent[event] = !0; } }, emitEvent = function(event, arg1, arg2, arg3, arg4, arg5) { @@ -4167,7 +4259,7 @@ var ReactHostOperationHistoryHook_1 = ReactHostOperationHistoryHook, ReactCompon }, {}); }, resetMeasurements = function() { var previousStartTime = currentFlushStartTime, previousMeasurements = currentFlushMeasurements, previousOperations = ReactHostOperationHistoryHook_1.getHistory(); - if (0 === currentFlushNesting) return currentFlushStartTime = 0, currentFlushMeasurements = [], + if (0 === currentFlushNesting) return currentFlushStartTime = 0, currentFlushMeasurements = [], void clearHistory(); if (previousMeasurements.length || previousOperations.length) { var registeredIDs = ReactComponentTreeHook.getRegisteredIDs(); @@ -4182,16 +4274,16 @@ var ReactHostOperationHistoryHook_1 = ReactHostOperationHistoryHook, ReactCompon }, checkDebugID = function(debugID) { arguments.length > 1 && void 0 !== arguments[1] && arguments[1] && 0 === debugID || debugID || warning(!1, "ReactDebugTool: debugID may not be empty."); }, beginLifeCycleTimer = function(debugID, timerType) { - 0 !== currentFlushNesting && (currentTimerType && !lifeCycleTimerHasWarned && (warning(!1, "There is an internal error in the React performance measurement code." + "\n\nDid not expect %s timer to start while %s timer is still in " + "progress for %s instance.", timerType, currentTimerType || "no", debugID === currentTimerDebugID ? "the same" : "another"), - lifeCycleTimerHasWarned = !0), currentTimerStartTime = performanceNow(), currentTimerNestedFlushDuration = 0, + 0 !== currentFlushNesting && (currentTimerType && !lifeCycleTimerHasWarned && (warning(!1, "There is an internal error in the React performance measurement code." + "\n\nDid not expect %s timer to start while %s timer is still in " + "progress for %s instance.", timerType, currentTimerType || "no", debugID === currentTimerDebugID ? "the same" : "another"), + lifeCycleTimerHasWarned = !0), currentTimerStartTime = performanceNow(), currentTimerNestedFlushDuration = 0, currentTimerDebugID = debugID, currentTimerType = timerType); }, endLifeCycleTimer = function(debugID, timerType) { - 0 !== currentFlushNesting && (currentTimerType === timerType || lifeCycleTimerHasWarned || (warning(!1, "There is an internal error in the React performance measurement code. " + "We did not expect %s timer to stop while %s timer is still in " + "progress for %s instance. Please report this as a bug in React.", timerType, currentTimerType || "no", debugID === currentTimerDebugID ? "the same" : "another"), + 0 !== currentFlushNesting && (currentTimerType === timerType || lifeCycleTimerHasWarned || (warning(!1, "There is an internal error in the React performance measurement code. " + "We did not expect %s timer to stop while %s timer is still in " + "progress for %s instance. Please report this as a bug in React.", timerType, currentTimerType || "no", debugID === currentTimerDebugID ? "the same" : "another"), lifeCycleTimerHasWarned = !0), isProfiling && currentFlushMeasurements.push({ timerType: timerType, instanceID: debugID, duration: performanceNow() - currentTimerStartTime - currentTimerNestedFlushDuration - }), currentTimerStartTime = 0, currentTimerNestedFlushDuration = 0, currentTimerDebugID = null, + }), currentTimerStartTime = 0, currentTimerNestedFlushDuration = 0, currentTimerDebugID = null, currentTimerType = null); }, pauseCurrentLifeCycleTimer = function() { var currentTimer = { @@ -4200,11 +4292,11 @@ var ReactHostOperationHistoryHook_1 = ReactHostOperationHistoryHook, ReactCompon debugID: currentTimerDebugID, timerType: currentTimerType }; - lifeCycleTimerStack.push(currentTimer), currentTimerStartTime = 0, currentTimerNestedFlushDuration = 0, + lifeCycleTimerStack.push(currentTimer), currentTimerStartTime = 0, currentTimerNestedFlushDuration = 0, currentTimerDebugID = null, currentTimerType = null; }, resumeCurrentLifeCycleTimer = function() { var _lifeCycleTimerStack$ = lifeCycleTimerStack.pop(), startTime = _lifeCycleTimerStack$.startTime, nestedFlushStartTime = _lifeCycleTimerStack$.nestedFlushStartTime, debugID = _lifeCycleTimerStack$.debugID, timerType = _lifeCycleTimerStack$.timerType, nestedFlushDuration = performanceNow() - nestedFlushStartTime; - currentTimerStartTime = startTime, currentTimerNestedFlushDuration += nestedFlushDuration, + currentTimerStartTime = startTime, currentTimerNestedFlushDuration += nestedFlushDuration, currentTimerDebugID = debugID, currentTimerType = timerType; }, lastMarkTimeStamp = 0, canUsePerformanceMeasure = "undefined" != typeof performance && "function" == typeof performance.mark && "function" == typeof performance.clearMarks && "function" == typeof performance.measure && "function" == typeof performance.clearMeasures, shouldMark = function(debugID) { if (!isProfiling || !canUsePerformanceMeasure) return !1; @@ -4231,14 +4323,14 @@ ReactDebugTool = { hooks.push(hook); }, removeHook: function(hook) { - for (var i = 0; i < hooks.length; i++) hooks[i] === hook && (hooks.splice(i, 1), + for (var i = 0; i < hooks.length; i++) hooks[i] === hook && (hooks.splice(i, 1), i--); }, isProfiling: function() { return isProfiling; }, beginProfiling: function() { - isProfiling || (isProfiling = !0, flushHistory.length = 0, resetMeasurements(), + isProfiling || (isProfiling = !0, flushHistory.length = 0, resetMeasurements(), ReactDebugTool.addHook(ReactHostOperationHistoryHook_1)); }, endProfiling: function() { @@ -4254,11 +4346,11 @@ ReactDebugTool = { resetMeasurements(), currentFlushNesting--, resumeCurrentLifeCycleTimer(), emitEvent("onEndFlush"); }, onBeginLifeCycleTimer: function(debugID, timerType) { - checkDebugID(debugID), emitEvent("onBeginLifeCycleTimer", debugID, timerType), markBegin(debugID, timerType), + checkDebugID(debugID), emitEvent("onBeginLifeCycleTimer", debugID, timerType), markBegin(debugID, timerType), beginLifeCycleTimer(debugID, timerType); }, onEndLifeCycleTimer: function(debugID, timerType) { - checkDebugID(debugID), endLifeCycleTimer(debugID, timerType), markEnd(debugID, timerType), + checkDebugID(debugID), endLifeCycleTimer(debugID, timerType), markEnd(debugID, timerType), emitEvent("onEndLifeCycleTimer", debugID, timerType); }, onBeginProcessingChildContext: function() { @@ -4277,7 +4369,7 @@ ReactDebugTool = { checkDebugID(debugID), childDebugIDs.forEach(checkDebugID), emitEvent("onSetChildren", debugID, childDebugIDs); }, onBeforeMountComponent: function(debugID, element, parentDebugID) { - checkDebugID(debugID), checkDebugID(parentDebugID, !0), emitEvent("onBeforeMountComponent", debugID, element, parentDebugID), + checkDebugID(debugID), checkDebugID(parentDebugID, !0), emitEvent("onBeforeMountComponent", debugID, element, parentDebugID), markBegin(debugID, "mount"); }, onMountComponent: function(debugID) { @@ -4354,7 +4446,7 @@ function getExclusive() { counts: {}, durations: {}, totalDuration: 0 - }), stats.durations[timerType] || (stats.durations[timerType] = 0), stats.counts[timerType] || (stats.counts[timerType] = 0), + }), stats.durations[timerType] || (stats.durations[timerType] = 0), stats.counts[timerType] || (stats.counts[timerType] = 0), affectedIDs[key][instanceID] = !0, applyUpdate(stats); } return flushHistory.forEach(function(flush) { @@ -4427,7 +4519,7 @@ function getWasted() { return flushHistory.forEach(function(flush) { var measurements = flush.measurements, treeSnapshot = flush.treeSnapshot, operations = flush.operations, isDefinitelyNotWastedByID = {}; operations.forEach(function(operation) { - for (var instanceID = operation.instanceID, nextParentID = instanceID; nextParentID; ) isDefinitelyNotWastedByID[nextParentID] = !0, + for (var instanceID = operation.instanceID, nextParentID = instanceID; nextParentID; ) isDefinitelyNotWastedByID[nextParentID] = !0, nextParentID = treeSnapshot[nextParentID].parentID; }); var renderedCompositeIDs = {}; @@ -4530,14 +4622,14 @@ function printOperations(flushHistory) { var warnedAboutPrintDOM = !1; function printDOM(measurements) { - return lowPriorityWarning_1(warnedAboutPrintDOM, "`ReactPerf.printDOM(...)` is deprecated. Use " + "`ReactPerf.printOperations(...)` instead."), + return lowPriorityWarning_1(warnedAboutPrintDOM, "`ReactPerf.printDOM(...)` is deprecated. Use " + "`ReactPerf.printOperations(...)` instead."), warnedAboutPrintDOM = !0, printOperations(measurements); } var warnedAboutGetMeasurementsSummaryMap = !1; function getMeasurementsSummaryMap(measurements) { - return lowPriorityWarning_1(warnedAboutGetMeasurementsSummaryMap, "`ReactPerf.getMeasurementsSummaryMap(...)` is deprecated. Use " + "`ReactPerf.getWasted(...)` instead."), + return lowPriorityWarning_1(warnedAboutGetMeasurementsSummaryMap, "`ReactPerf.getMeasurementsSummaryMap(...)` is deprecated. Use " + "`ReactPerf.getWasted(...)` instead."), warnedAboutGetMeasurementsSummaryMap = !0, getWasted(measurements); } @@ -4577,10 +4669,11 @@ var roots = new Map(); ReactFiberErrorLogger.injection.injectDialog(ReactNativeFiberErrorDialog_1.showDialog); var ReactNative = { + NativeComponent: ReactNativeComponent_1, findNodeHandle: findNumericNodeHandleFiber, render: function(element, containerTag, callback) { var root = roots.get(containerTag); - return root || (root = ReactNativeFiberRenderer.createContainer(containerTag), roots.set(containerTag, root)), + return root || (root = ReactNativeFiberRenderer.createContainer(containerTag), roots.set(containerTag, root)), ReactNativeFiberRenderer.updateContainer(element, root, null, callback), ReactNativeFiberRenderer.getPublicRootInstance(root); }, unmountComponentAtNode: function(containerTag) { diff --git a/Libraries/Renderer/ReactNativeFiber-prod.js b/Libraries/Renderer/ReactNativeFiber-prod.js index 1c12ed8e5..4af3c6d93 100644 --- a/Libraries/Renderer/ReactNativeFiber-prod.js +++ b/Libraries/Renderer/ReactNativeFiber-prod.js @@ -23,7 +23,7 @@ var emptyObject = require("fbjs/lib/emptyObject"), react = require("react"), sha require("deepFreezeAndThrowOnMutationInDev"), require("ReactNativeFeatureFlags"); -var defaultShowDialog = function() { +var defaultShowDialog = function(capturedError) { return !0; }, showDialog = defaultShowDialog; @@ -36,8 +36,8 @@ function logCapturedError(capturedError) { var injection = { injectDialog: function(fn) { - invariant(showDialog === defaultShowDialog, "The custom dialog was already injected."), - invariant("function" == typeof fn, "Injected showDialog() must be a function."), + invariant(showDialog === defaultShowDialog, "The custom dialog was already injected."), + invariant("function" == typeof fn, "Injected showDialog() must be a function."), showDialog = fn; } }, logCapturedError_1 = logCapturedError, ReactFiberErrorLogger = { @@ -59,7 +59,7 @@ var injection = { }, ReactErrorUtils = { injection: { injectErrorUtils: function(injectedErrorUtils) { - invariant("function" == typeof injectedErrorUtils.invokeGuardedCallback, "Injected invokeGuardedCallback() must be a function."), + invariant("function" == typeof injectedErrorUtils.invokeGuardedCallback, "Injected invokeGuardedCallback() must be a function."), invokeGuardedCallback = injectedErrorUtils.invokeGuardedCallback; } }, @@ -93,7 +93,7 @@ function isStartish(topLevelType) { function executeDispatch(event, simulated, listener, inst) { var type = event.type || "unknown-event"; - event.currentTarget = EventPluginUtils.getNodeFromInstance(inst), ReactErrorUtils_1.invokeGuardedCallbackAndCatchFirstError(type, listener, void 0, event), + event.currentTarget = EventPluginUtils.getNodeFromInstance(inst), ReactErrorUtils_1.invokeGuardedCallbackAndCatchFirstError(type, listener, void 0, event), event.currentTarget = null; } @@ -118,10 +118,10 @@ function executeDispatchesInOrderStopAtTrue(event) { function executeDirectDispatch(event) { var dispatchListener = event._dispatchListeners, dispatchInstance = event._dispatchInstances; - invariant(!Array.isArray(dispatchListener), "executeDirectDispatch(...): Invalid `event`."), + invariant(!Array.isArray(dispatchListener), "executeDirectDispatch(...): Invalid `event`."), event.currentTarget = dispatchListener ? EventPluginUtils.getNodeFromInstance(dispatchInstance) : null; var res = dispatchListener ? dispatchListener(event) : null; - return event.currentTarget = null, event._dispatchListeners = null, event._dispatchInstances = null, + return event.currentTarget = null, event._dispatchListeners = null, event._dispatchInstances = null, res; } @@ -161,7 +161,7 @@ function restoreStateOfTarget(target) { var props = EventPluginUtils_1.getFiberCurrentPropsFromNode(internalInstance.stateNode); return void fiberHostComponent.restoreControlledState(internalInstance.stateNode, internalInstance.type, props); } - invariant("function" == typeof internalInstance.restoreControlledState, "The internal instance must be a React host component."), + invariant("function" == typeof internalInstance.restoreControlledState, "The internal instance must be a React host component."), internalInstance.restoreControlledState(); } } @@ -219,12 +219,12 @@ function ReactNativeFiberErrorDialog(capturedError) { var componentStack = capturedError.componentStack, error = capturedError.error, errorMessage = void 0, errorStack = void 0, errorType = void 0; if (error && "object" == typeof error) { var message = error.message, name = error.name; - errorMessage = (message ? name + ": " + message : name) + "\n\nThis error is located at:" + componentStack, + errorMessage = (message ? name + ": " + message : name) + "\n\nThis error is located at:" + componentStack, errorStack = error.stack, errorType = error.constructor; - } else errorMessage = "Unspecified error at:" + componentStack, errorStack = "", + } else errorMessage = "Unspecified error at:" + componentStack, errorStack = "", errorType = Error; var newError = new errorType(errorMessage); - return newError.stack = errorStack, ExceptionsManager.handleException(newError, !1), + return newError.stack = errorStack, ExceptionsManager.handleException(newError, !1), !1; } @@ -235,9 +235,9 @@ var showDialog$1 = ReactNativeFiberErrorDialog, ReactNativeFiberErrorDialog_1 = function recomputePluginOrdering() { if (eventPluginOrder) for (var pluginName in namesToPlugins) { var pluginModule = namesToPlugins[pluginName], pluginIndex = eventPluginOrder.indexOf(pluginName); - if (invariant(pluginIndex > -1, "EventPluginRegistry: Cannot inject event plugins that do not exist in " + "the plugin ordering, `%s`.", pluginName), + if (invariant(pluginIndex > -1, "EventPluginRegistry: Cannot inject event plugins that do not exist in " + "the plugin ordering, `%s`.", pluginName), !EventPluginRegistry.plugins[pluginIndex]) { - invariant(pluginModule.extractEvents, "EventPluginRegistry: Event plugins must implement an `extractEvents` " + "method, but `%s` does not.", pluginName), + invariant(pluginModule.extractEvents, "EventPluginRegistry: Event plugins must implement an `extractEvents` " + "method, but `%s` does not.", pluginName), EventPluginRegistry.plugins[pluginIndex] = pluginModule; var publishedEvents = pluginModule.eventTypes; for (var eventName in publishedEvents) invariant(publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName), "EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.", eventName, pluginName); @@ -246,7 +246,7 @@ function recomputePluginOrdering() { } function publishEventForPlugin(dispatchConfig, pluginModule, eventName) { - invariant(!EventPluginRegistry.eventNameDispatchConfigs.hasOwnProperty(eventName), "EventPluginHub: More than one plugin attempted to publish the same " + "event name, `%s`.", eventName), + invariant(!EventPluginRegistry.eventNameDispatchConfigs.hasOwnProperty(eventName), "EventPluginHub: More than one plugin attempted to publish the same " + "event name, `%s`.", eventName), EventPluginRegistry.eventNameDispatchConfigs[eventName] = dispatchConfig; var phasedRegistrationNames = dispatchConfig.phasedRegistrationNames; if (phasedRegistrationNames) { @@ -256,12 +256,12 @@ function publishEventForPlugin(dispatchConfig, pluginModule, eventName) { } return !0; } - return !!dispatchConfig.registrationName && (publishRegistrationName(dispatchConfig.registrationName, pluginModule, eventName), + return !!dispatchConfig.registrationName && (publishRegistrationName(dispatchConfig.registrationName, pluginModule, eventName), !0); } function publishRegistrationName(registrationName, pluginModule, eventName) { - invariant(!EventPluginRegistry.registrationNameModules[registrationName], "EventPluginHub: More than one plugin attempted to publish the same " + "registration name, `%s`.", registrationName), + invariant(!EventPluginRegistry.registrationNameModules[registrationName], "EventPluginHub: More than one plugin attempted to publish the same " + "registration name, `%s`.", registrationName), EventPluginRegistry.registrationNameModules[registrationName] = pluginModule, EventPluginRegistry.registrationNameDependencies[registrationName] = pluginModule.eventTypes[eventName].dependencies; } @@ -272,14 +272,14 @@ var EventPluginRegistry = { registrationNameDependencies: {}, possibleRegistrationNames: null, injectEventPluginOrder: function(injectedEventPluginOrder) { - invariant(!eventPluginOrder, "EventPluginRegistry: Cannot inject event plugin ordering more than " + "once. You are likely trying to load more than one copy of React."), + invariant(!eventPluginOrder, "EventPluginRegistry: Cannot inject event plugin ordering more than " + "once. You are likely trying to load more than one copy of React."), eventPluginOrder = Array.prototype.slice.call(injectedEventPluginOrder), recomputePluginOrdering(); }, injectEventPluginsByName: function(injectedNamesToPlugins) { var isOrderingDirty = !1; for (var pluginName in injectedNamesToPlugins) if (injectedNamesToPlugins.hasOwnProperty(pluginName)) { var pluginModule = injectedNamesToPlugins[pluginName]; - namesToPlugins.hasOwnProperty(pluginName) && namesToPlugins[pluginName] === pluginModule || (invariant(!namesToPlugins[pluginName], "EventPluginRegistry: Cannot inject two different event plugins " + "using the same name, `%s`.", pluginName), + namesToPlugins.hasOwnProperty(pluginName) && namesToPlugins[pluginName] === pluginModule || (invariant(!namesToPlugins[pluginName], "EventPluginRegistry: Cannot inject two different event plugins " + "using the same name, `%s`.", pluginName), namesToPlugins[pluginName] = pluginModule, isOrderingDirty = !0); } isOrderingDirty && recomputePluginOrdering(); @@ -287,8 +287,8 @@ var EventPluginRegistry = { }, EventPluginRegistry_1 = EventPluginRegistry; function accumulateInto(current, next) { - return invariant(null != next, "accumulateInto(...): Accumulated items must not be null or undefined."), - null == current ? next : Array.isArray(current) ? Array.isArray(next) ? (current.push.apply(current, next), + return invariant(null != next, "accumulateInto(...): Accumulated items must not be null or undefined."), + null == current ? next : Array.isArray(current) ? Array.isArray(next) ? (current.push.apply(current, next), current) : (current.push(next), current) : Array.isArray(next) ? [ current ].concat(next) : [ current, next ]; } @@ -349,7 +349,7 @@ var EventPluginHub = { var _props = currentElement.props; if (listener = _props[registrationName], shouldPreventMouseEvent(registrationName, currentElement.type, _props)) return null; } - return invariant(!listener || "function" == typeof listener, "Expected %s listener to be a function, instead got type %s", registrationName, typeof listener), + return invariant(!listener || "function" == typeof listener, "Expected %s listener to be a function, instead got type %s", registrationName, typeof listener), listener; }, extractEvents: function(topLevelType, targetInst, nativeEvent, nativeEventTarget) { @@ -367,8 +367,8 @@ var EventPluginHub = { }, processEventQueue: function(simulated) { var processingEventQueue = eventQueue; - eventQueue = null, simulated ? forEachAccumulated_1(processingEventQueue, executeDispatchesAndReleaseSimulated) : forEachAccumulated_1(processingEventQueue, executeDispatchesAndReleaseTopLevel), - invariant(!eventQueue, "processEventQueue(): Additional events were enqueued while processing " + "an event queue. Support for this has not yet been implemented."), + eventQueue = null, simulated ? forEachAccumulated_1(processingEventQueue, executeDispatchesAndReleaseSimulated) : forEachAccumulated_1(processingEventQueue, executeDispatchesAndReleaseTopLevel), + invariant(!eventQueue, "processEventQueue(): Additional events were enqueued while processing " + "an event queue. Support for this has not yet been implemented."), ReactErrorUtils_1.rethrowCaughtError(); } }, EventPluginHub_1 = EventPluginHub, ReactTypeOfWork = { @@ -428,7 +428,7 @@ function traverseTwoPhase(inst, fn, arg) { } function traverseEnterLeave(from, to, fn, argFrom, argTo) { - for (var common = from && to ? getLowestCommonAncestor(from, to) : null, pathFrom = []; from && from !== common; ) pathFrom.push(from), + for (var common = from && to ? getLowestCommonAncestor(from, to) : null, pathFrom = []; from && from !== common; ) pathFrom.push(from), from = getParent(from); for (var pathTo = []; to && to !== common; ) pathTo.push(to), to = getParent(to); var i; @@ -451,7 +451,7 @@ function listenerAtPhase(inst, event, propagationPhase) { function accumulateDirectionalDispatches(inst, phase, event) { var listener = listenerAtPhase(inst, event, phase); - listener && (event._dispatchListeners = accumulateInto_1(event._dispatchListeners, listener), + listener && (event._dispatchListeners = accumulateInto_1(event._dispatchListeners, listener), event._dispatchInstances = accumulateInto_1(event._dispatchInstances, inst)); } @@ -469,7 +469,7 @@ function accumulateTwoPhaseDispatchesSingleSkipTarget(event) { function accumulateDispatches(inst, ignoredDirection, event) { if (inst && event && event.dispatchConfig.registrationName) { var registrationName = event.dispatchConfig.registrationName, listener = getListener(inst, registrationName); - listener && (event._dispatchListeners = accumulateInto_1(event._dispatchListeners, listener), + listener && (event._dispatchListeners = accumulateInto_1(event._dispatchListeners, listener), event._dispatchInstances = accumulateInto_1(event._dispatchInstances, inst)); } } @@ -529,12 +529,12 @@ var EventPropagators = { return new Klass(a1, a2, a3, a4); }, standardReleaser = function(instance) { var Klass = this; - invariant(instance instanceof Klass, "Trying to release an instance into a pool of a different type."), + invariant(instance instanceof Klass, "Trying to release an instance into a pool of a different type."), instance.destructor(), Klass.instancePool.length < Klass.poolSize && Klass.instancePool.push(instance); }, DEFAULT_POOL_SIZE = 10, DEFAULT_POOLER = oneArgumentPooler, addPoolingTo = function(CopyConstructor, pooler) { var NewKlass = CopyConstructor; - return NewKlass.instancePool = [], NewKlass.getPooled = pooler || DEFAULT_POOLER, - NewKlass.poolSize || (NewKlass.poolSize = DEFAULT_POOL_SIZE), NewKlass.release = standardReleaser, + return NewKlass.instancePool = [], NewKlass.getPooled = pooler || DEFAULT_POOLER, + NewKlass.poolSize || (NewKlass.poolSize = DEFAULT_POOL_SIZE), NewKlass.release = standardReleaser, NewKlass; }, PooledClass = { addPoolingTo: addPoolingTo, @@ -564,7 +564,7 @@ function SyntheticEvent(dispatchConfig, targetInst, nativeEvent, nativeEventTarg normalize ? this[propName] = normalize(nativeEvent) : "target" === propName ? this.target = nativeEventTarget : this[propName] = nativeEvent[propName]; } var defaultPrevented = null != nativeEvent.defaultPrevented ? nativeEvent.defaultPrevented : !1 === nativeEvent.returnValue; - return this.isDefaultPrevented = defaultPrevented ? emptyFunction.thatReturnsTrue : emptyFunction.thatReturnsFalse, + return this.isDefaultPrevented = defaultPrevented ? emptyFunction.thatReturnsTrue : emptyFunction.thatReturnsFalse, this.isPropagationStopped = emptyFunction.thatReturnsFalse, this; } @@ -572,12 +572,12 @@ Object.assign(SyntheticEvent.prototype, { preventDefault: function() { this.defaultPrevented = !0; var event = this.nativeEvent; - event && (event.preventDefault ? event.preventDefault() : "unknown" != typeof event.returnValue && (event.returnValue = !1), + event && (event.preventDefault ? event.preventDefault() : "unknown" != typeof event.returnValue && (event.returnValue = !1), this.isDefaultPrevented = emptyFunction.thatReturnsTrue); }, stopPropagation: function() { var event = this.nativeEvent; - event && (event.stopPropagation ? event.stopPropagation() : "unknown" != typeof event.cancelBubble && (event.cancelBubble = !0), + event && (event.stopPropagation ? event.stopPropagation() : "unknown" != typeof event.cancelBubble && (event.cancelBubble = !0), this.isPropagationStopped = emptyFunction.thatReturnsTrue); }, persist: function() { @@ -593,8 +593,8 @@ Object.assign(SyntheticEvent.prototype, { var Super = this, E = function() {}; E.prototype = Super.prototype; var prototype = new E(); - Object.assign(prototype, Class.prototype), Class.prototype = prototype, Class.prototype.constructor = Class, - Class.Interface = Object.assign({}, Super.Interface, Interface), Class.augmentClass = Super.augmentClass, + Object.assign(prototype, Class.prototype), Class.prototype = prototype, Class.prototype.constructor = Class, + Class.Interface = Object.assign({}, Super.Interface, Interface), Class.augmentClass = Super.augmentClass, PooledClass_1.addPoolingTo(Class, PooledClass_1.fourArgumentPooler); }, PooledClass_1.addPoolingTo(SyntheticEvent, PooledClass_1.fourArgumentPooler); @@ -608,7 +608,7 @@ var SyntheticEvent_1 = SyntheticEvent, _extends = Object.assign || function(targ for (var bubblingTypeName in customBubblingEventTypes) allTypesByEventName[bubblingTypeName] = customBubblingEventTypes[bubblingTypeName]; -for (var directTypeName in customDirectEventTypes) warning(!customBubblingEventTypes[directTypeName], "Event cannot be both direct and bubbling: %s", directTypeName), +for (var directTypeName in customDirectEventTypes) warning(!customBubblingEventTypes[directTypeName], "Event cannot be both direct and bubbling: %s", directTypeName), allTypesByEventName[directTypeName] = customDirectEventTypes[directTypeName]; var ReactNativeBridgeEventPlugin = { @@ -734,7 +734,7 @@ var ReactEventEmitterMixin = { var touch = changedTouches[jj]; touch.changedTouches = changedTouches, touch.touches = touches; var nativeEvent = touch, rootNodeID = null, target = nativeEvent.target; - null !== target && void 0 !== target && (target < ReactNativeTagHandles_1.tagsStartAt || (rootNodeID = target)), + null !== target && void 0 !== target && (target < ReactNativeTagHandles_1.tagsStartAt || (rootNodeID = target)), ReactNativeEventEmitter._receiveRootNodeIDEvent(rootNodeID, eventTopLevelType, nativeEvent); } } @@ -784,38 +784,38 @@ function createTouchRecord(touch) { } function resetTouchRecord(touchRecord, touch) { - touchRecord.touchActive = !0, touchRecord.startPageX = touch.pageX, touchRecord.startPageY = touch.pageY, - touchRecord.startTimeStamp = timestampForTouch(touch), touchRecord.currentPageX = touch.pageX, - touchRecord.currentPageY = touch.pageY, touchRecord.currentTimeStamp = timestampForTouch(touch), - touchRecord.previousPageX = touch.pageX, touchRecord.previousPageY = touch.pageY, + touchRecord.touchActive = !0, touchRecord.startPageX = touch.pageX, touchRecord.startPageY = touch.pageY, + touchRecord.startTimeStamp = timestampForTouch(touch), touchRecord.currentPageX = touch.pageX, + touchRecord.currentPageY = touch.pageY, touchRecord.currentTimeStamp = timestampForTouch(touch), + touchRecord.previousPageX = touch.pageX, touchRecord.previousPageY = touch.pageY, touchRecord.previousTimeStamp = timestampForTouch(touch); } function getTouchIdentifier(_ref) { var identifier = _ref.identifier; - return invariant(null != identifier, "Touch object is missing identifier."), warning(identifier <= MAX_TOUCH_BANK, "Touch identifier %s is greater than maximum supported %s which causes " + "performance issues backfilling array locations for all of the indices.", identifier, MAX_TOUCH_BANK), + return invariant(null != identifier, "Touch object is missing identifier."), warning(identifier <= MAX_TOUCH_BANK, "Touch identifier %s is greater than maximum supported %s which causes " + "performance issues backfilling array locations for all of the indices.", identifier, MAX_TOUCH_BANK), identifier; } function recordTouchStart(touch) { var identifier = getTouchIdentifier(touch), touchRecord = touchBank[identifier]; - touchRecord ? resetTouchRecord(touchRecord, touch) : touchBank[identifier] = createTouchRecord(touch), + touchRecord ? resetTouchRecord(touchRecord, touch) : touchBank[identifier] = createTouchRecord(touch), touchHistory.mostRecentTimeStamp = timestampForTouch(touch); } function recordTouchMove(touch) { var touchRecord = touchBank[getTouchIdentifier(touch)]; - touchRecord ? (touchRecord.touchActive = !0, touchRecord.previousPageX = touchRecord.currentPageX, - touchRecord.previousPageY = touchRecord.currentPageY, touchRecord.previousTimeStamp = touchRecord.currentTimeStamp, - touchRecord.currentPageX = touch.pageX, touchRecord.currentPageY = touch.pageY, + touchRecord ? (touchRecord.touchActive = !0, touchRecord.previousPageX = touchRecord.currentPageX, + touchRecord.previousPageY = touchRecord.currentPageY, touchRecord.previousTimeStamp = touchRecord.currentTimeStamp, + touchRecord.currentPageX = touch.pageX, touchRecord.currentPageY = touch.pageY, touchRecord.currentTimeStamp = timestampForTouch(touch), touchHistory.mostRecentTimeStamp = timestampForTouch(touch)) : console.error("Cannot record touch move without a touch start.\n" + "Touch Move: %s\n", "Touch Bank: %s", printTouch(touch), printTouchBank()); } function recordTouchEnd(touch) { var touchRecord = touchBank[getTouchIdentifier(touch)]; - touchRecord ? (touchRecord.touchActive = !1, touchRecord.previousPageX = touchRecord.currentPageX, - touchRecord.previousPageY = touchRecord.currentPageY, touchRecord.previousTimeStamp = touchRecord.currentTimeStamp, - touchRecord.currentPageX = touch.pageX, touchRecord.currentPageY = touch.pageY, + touchRecord ? (touchRecord.touchActive = !1, touchRecord.previousPageX = touchRecord.currentPageX, + touchRecord.previousPageY = touchRecord.currentPageY, touchRecord.previousTimeStamp = touchRecord.currentTimeStamp, + touchRecord.currentPageX = touch.pageX, touchRecord.currentPageY = touch.pageY, touchRecord.currentTimeStamp = timestampForTouch(touch), touchHistory.mostRecentTimeStamp = timestampForTouch(touch)) : console.error("Cannot record touch end without a touch start.\n" + "Touch End: %s\n", "Touch Bank: %s", printTouch(touch), printTouchBank()); } @@ -830,14 +830,14 @@ function printTouch(touch) { function printTouchBank() { var printed = JSON.stringify(touchBank.slice(0, MAX_TOUCH_BANK)); - return touchBank.length > MAX_TOUCH_BANK && (printed += " (original size: " + touchBank.length + ")"), + return touchBank.length > MAX_TOUCH_BANK && (printed += " (original size: " + touchBank.length + ")"), printed; } var ResponderTouchHistoryStore = { recordTouchTrack: function(topLevelType, nativeEvent) { - if (isMoveish$2(topLevelType)) nativeEvent.changedTouches.forEach(recordTouchMove); else if (isStartish$2(topLevelType)) nativeEvent.changedTouches.forEach(recordTouchStart), - touchHistory.numberActiveTouches = nativeEvent.touches.length, 1 === touchHistory.numberActiveTouches && (touchHistory.indexOfSingleActiveTouch = nativeEvent.touches[0].identifier); else if (isEndish$2(topLevelType) && (nativeEvent.changedTouches.forEach(recordTouchEnd), + if (isMoveish$2(topLevelType)) nativeEvent.changedTouches.forEach(recordTouchMove); else if (isStartish$2(topLevelType)) nativeEvent.changedTouches.forEach(recordTouchStart), + touchHistory.numberActiveTouches = nativeEvent.touches.length, 1 === touchHistory.numberActiveTouches && (touchHistory.indexOfSingleActiveTouch = nativeEvent.touches[0].identifier); else if (isEndish$2(topLevelType) && (nativeEvent.changedTouches.forEach(recordTouchEnd), touchHistory.numberActiveTouches = nativeEvent.touches.length, 1 === touchHistory.numberActiveTouches)) for (var i = 0; i < touchBank.length; i++) { var touchTrackToCheck = touchBank[i]; if (null != touchTrackToCheck && touchTrackToCheck.touchActive) { @@ -850,7 +850,7 @@ var ResponderTouchHistoryStore = { }, ResponderTouchHistoryStore_1 = ResponderTouchHistoryStore; function accumulate(current, next) { - return invariant(null != next, "accumulate(...): Accumulated items must be not be null or undefined."), + return invariant(null != next, "accumulate(...): Accumulated items must be not be null or undefined."), null == current ? next : Array.isArray(current) ? current.concat(next) : Array.isArray(next) ? [ current ].concat(next) : [ current, next ]; } @@ -912,24 +912,24 @@ function setResponderAndExtractTransfer(topLevelType, targetInst, nativeEvent, n var shouldSetEventType = isStartish$1(topLevelType) ? eventTypes.startShouldSetResponder : isMoveish$1(topLevelType) ? eventTypes.moveShouldSetResponder : "topSelectionChange" === topLevelType ? eventTypes.selectionChangeShouldSetResponder : eventTypes.scrollShouldSetResponder, bubbleShouldSetFrom = responderInst ? ReactTreeTraversal.getLowestCommonAncestor(responderInst, targetInst) : targetInst, skipOverBubbleShouldSetFrom = bubbleShouldSetFrom === responderInst, shouldSetEvent = ResponderSyntheticEvent_1.getPooled(shouldSetEventType, bubbleShouldSetFrom, nativeEvent, nativeEventTarget); shouldSetEvent.touchHistory = ResponderTouchHistoryStore_1.touchHistory, skipOverBubbleShouldSetFrom ? EventPropagators_1.accumulateTwoPhaseDispatchesSkipTarget(shouldSetEvent) : EventPropagators_1.accumulateTwoPhaseDispatches(shouldSetEvent); var wantsResponderInst = executeDispatchesInOrderStopAtTrue$1(shouldSetEvent); - if (shouldSetEvent.isPersistent() || shouldSetEvent.constructor.release(shouldSetEvent), + if (shouldSetEvent.isPersistent() || shouldSetEvent.constructor.release(shouldSetEvent), !wantsResponderInst || wantsResponderInst === responderInst) return null; var extracted, grantEvent = ResponderSyntheticEvent_1.getPooled(eventTypes.responderGrant, wantsResponderInst, nativeEvent, nativeEventTarget); grantEvent.touchHistory = ResponderTouchHistoryStore_1.touchHistory, EventPropagators_1.accumulateDirectDispatches(grantEvent); var blockHostResponder = !0 === executeDirectDispatch$1(grantEvent); if (responderInst) { var terminationRequestEvent = ResponderSyntheticEvent_1.getPooled(eventTypes.responderTerminationRequest, responderInst, nativeEvent, nativeEventTarget); - terminationRequestEvent.touchHistory = ResponderTouchHistoryStore_1.touchHistory, + terminationRequestEvent.touchHistory = ResponderTouchHistoryStore_1.touchHistory, EventPropagators_1.accumulateDirectDispatches(terminationRequestEvent); var shouldSwitch = !hasDispatches$1(terminationRequestEvent) || executeDirectDispatch$1(terminationRequestEvent); - if (terminationRequestEvent.isPersistent() || terminationRequestEvent.constructor.release(terminationRequestEvent), + if (terminationRequestEvent.isPersistent() || terminationRequestEvent.constructor.release(terminationRequestEvent), shouldSwitch) { var terminateEvent = ResponderSyntheticEvent_1.getPooled(eventTypes.responderTerminate, responderInst, nativeEvent, nativeEventTarget); - terminateEvent.touchHistory = ResponderTouchHistoryStore_1.touchHistory, EventPropagators_1.accumulateDirectDispatches(terminateEvent), + terminateEvent.touchHistory = ResponderTouchHistoryStore_1.touchHistory, EventPropagators_1.accumulateDirectDispatches(terminateEvent), extracted = accumulate_1(extracted, [ grantEvent, terminateEvent ]), changeResponder(wantsResponderInst, blockHostResponder); } else { var rejectEvent = ResponderSyntheticEvent_1.getPooled(eventTypes.responderReject, wantsResponderInst, nativeEvent, nativeEventTarget); - rejectEvent.touchHistory = ResponderTouchHistoryStore_1.touchHistory, EventPropagators_1.accumulateDirectDispatches(rejectEvent), + rejectEvent.touchHistory = ResponderTouchHistoryStore_1.touchHistory, EventPropagators_1.accumulateDirectDispatches(rejectEvent), extracted = accumulate_1(extracted, rejectEvent); } } else extracted = accumulate_1(extracted, grantEvent), changeResponder(wantsResponderInst, blockHostResponder); @@ -960,7 +960,7 @@ var ResponderEventPlugin = { eventTypes: eventTypes, extractEvents: function(topLevelType, targetInst, nativeEvent, nativeEventTarget) { if (isStartish$1(topLevelType)) trackedTouchCount += 1; else if (isEndish$1(topLevelType)) { - if (!(trackedTouchCount >= 0)) return console.error("Ended a touch event which was not counted in `trackedTouchCount`."), + if (!(trackedTouchCount >= 0)) return console.error("Ended a touch event which was not counted in `trackedTouchCount`."), null; trackedTouchCount -= 1; } @@ -968,17 +968,17 @@ var ResponderEventPlugin = { var extracted = canTriggerTransfer(topLevelType, targetInst, nativeEvent) ? setResponderAndExtractTransfer(topLevelType, targetInst, nativeEvent, nativeEventTarget) : null, isResponderTouchStart = responderInst && isStartish$1(topLevelType), isResponderTouchMove = responderInst && isMoveish$1(topLevelType), isResponderTouchEnd = responderInst && isEndish$1(topLevelType), incrementalTouch = isResponderTouchStart ? eventTypes.responderStart : isResponderTouchMove ? eventTypes.responderMove : isResponderTouchEnd ? eventTypes.responderEnd : null; if (incrementalTouch) { var gesture = ResponderSyntheticEvent_1.getPooled(incrementalTouch, responderInst, nativeEvent, nativeEventTarget); - gesture.touchHistory = ResponderTouchHistoryStore_1.touchHistory, EventPropagators_1.accumulateDirectDispatches(gesture), + gesture.touchHistory = ResponderTouchHistoryStore_1.touchHistory, EventPropagators_1.accumulateDirectDispatches(gesture), extracted = accumulate_1(extracted, gesture); } var isResponderTerminate = responderInst && "topTouchCancel" === topLevelType, isResponderRelease = responderInst && !isResponderTerminate && isEndish$1(topLevelType) && noResponderTouches(nativeEvent), finalTouch = isResponderTerminate ? eventTypes.responderTerminate : isResponderRelease ? eventTypes.responderRelease : null; if (finalTouch) { var finalEvent = ResponderSyntheticEvent_1.getPooled(finalTouch, responderInst, nativeEvent, nativeEventTarget); - finalEvent.touchHistory = ResponderTouchHistoryStore_1.touchHistory, EventPropagators_1.accumulateDirectDispatches(finalEvent), + finalEvent.touchHistory = ResponderTouchHistoryStore_1.touchHistory, EventPropagators_1.accumulateDirectDispatches(finalEvent), extracted = accumulate_1(extracted, finalEvent), changeResponder(null); } var numberActiveTouches = ResponderTouchHistoryStore_1.touchHistory.numberActiveTouches; - return ResponderEventPlugin.GlobalInteractionHandler && numberActiveTouches !== previousActiveTouches && ResponderEventPlugin.GlobalInteractionHandler.onChange(numberActiveTouches), + return ResponderEventPlugin.GlobalInteractionHandler && numberActiveTouches !== previousActiveTouches && ResponderEventPlugin.GlobalInteractionHandler.onChange(numberActiveTouches), previousActiveTouches = numberActiveTouches, extracted; }, GlobalResponderHandler: null, @@ -994,8 +994,8 @@ var ResponderEventPlugin = { }, ResponderEventPlugin_1 = ResponderEventPlugin; function inject() { - RCTEventEmitter.register(ReactNativeEventEmitter_1), EventPluginHub_1.injection.injectEventPluginOrder(ReactNativeEventPluginOrder_1), - EventPluginUtils_1.injection.injectComponentTree(ReactNativeComponentTree_1), ResponderEventPlugin_1.injection.injectGlobalResponderHandler(ReactNativeGlobalResponderHandler_1), + RCTEventEmitter.register(ReactNativeEventEmitter_1), EventPluginHub_1.injection.injectEventPluginOrder(ReactNativeEventPluginOrder_1), + EventPluginUtils_1.injection.injectComponentTree(ReactNativeComponentTree_1), ResponderEventPlugin_1.injection.injectGlobalResponderHandler(ReactNativeGlobalResponderHandler_1), EventPluginHub_1.injection.injectEventPluginsByName({ ResponderEventPlugin: ResponderEventPlugin_1, ReactNativeBridgeEventPlugin: ReactNativeBridgeEventPlugin_1 @@ -1020,20 +1020,19 @@ var ReactNativeInjection = { isPortal: isPortal, REACT_PORTAL_TYPE: REACT_PORTAL_TYPE_1 }, commonjsGlobal = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof self ? self : {}, ReactFeatureFlags = { - logTopLevelRenders: !1, - prepareNewChildrenBeforeUnmountInStack: !0, disableNewFiberFeatures: !1, enableAsyncSubtreeAPI: !1 }, ReactFeatureFlags_1 = ReactFeatureFlags, ReactTypeOfSideEffect = { NoEffect: 0, - Placement: 1, - Update: 2, - PlacementAndUpdate: 3, - Deletion: 4, - ContentReset: 8, - Callback: 16, - Err: 32, - Ref: 64 + PerformedWork: 1, + Placement: 2, + Update: 4, + PlacementAndUpdate: 6, + Deletion: 8, + ContentReset: 16, + Callback: 32, + Err: 64, + Ref: 128 }, ReactPriorityLevel = { NoWork: 0, SynchronousPriority: 1, @@ -1063,8 +1062,8 @@ function cloneUpdateQueue(current, workInProgress) { var currentQueue = current.updateQueue; if (null === currentQueue) return workInProgress.updateQueue = null, null; var altQueue = null !== workInProgress.updateQueue ? workInProgress.updateQueue : {}; - return altQueue.first = currentQueue.first, altQueue.last = currentQueue.last, altQueue.hasForceUpdate = !1, - altQueue.callbackList = null, altQueue.isProcessing = !1, workInProgress.updateQueue = altQueue, + return altQueue.first = currentQueue.first, altQueue.last = currentQueue.last, altQueue.hasForceUpdate = !1, + altQueue.callbackList = null, altQueue.isProcessing = !1, workInProgress.updateQueue = altQueue, altQueue; } @@ -1083,27 +1082,27 @@ function cloneUpdate(update) { } function insertUpdateIntoQueue(queue, update, insertAfter, insertBefore) { - null !== insertAfter ? insertAfter.next = update : (update.next = queue.first, queue.first = update), + null !== insertAfter ? insertAfter.next = update : (update.next = queue.first, queue.first = update), null !== insertBefore ? update.next = insertBefore : queue.last = update; } function findInsertionPosition(queue, update) { var priorityLevel = update.priorityLevel, insertAfter = null, insertBefore = null; - if (null !== queue.last && comparePriority(queue.last.priorityLevel, priorityLevel) <= 0) insertAfter = queue.last; else for (insertBefore = queue.first; null !== insertBefore && comparePriority(insertBefore.priorityLevel, priorityLevel) <= 0; ) insertAfter = insertBefore, + if (null !== queue.last && comparePriority(queue.last.priorityLevel, priorityLevel) <= 0) insertAfter = queue.last; else for (insertBefore = queue.first; null !== insertBefore && comparePriority(insertBefore.priorityLevel, priorityLevel) <= 0; ) insertAfter = insertBefore, insertBefore = insertBefore.next; return insertAfter; } function insertUpdate(fiber, update) { var queue1 = ensureUpdateQueue(fiber), queue2 = null !== fiber.alternate ? ensureUpdateQueue(fiber.alternate) : null, insertAfter1 = findInsertionPosition(queue1, update), insertBefore1 = null !== insertAfter1 ? insertAfter1.next : queue1.first; - if (null === queue2) return insertUpdateIntoQueue(queue1, update, insertAfter1, insertBefore1), + if (null === queue2) return insertUpdateIntoQueue(queue1, update, insertAfter1, insertBefore1), null; var insertAfter2 = findInsertionPosition(queue2, update), insertBefore2 = null !== insertAfter2 ? insertAfter2.next : queue2.first; if (insertUpdateIntoQueue(queue1, update, insertAfter1, insertBefore1), insertBefore1 !== insertBefore2) { var update2 = cloneUpdate(update); return insertUpdateIntoQueue(queue2, update2, insertAfter2, insertBefore2), update2; } - return null === insertAfter2 && (queue2.first = update), null === insertBefore2 && (queue2.last = null), + return null === insertAfter2 && (queue2.first = update), null === insertBefore2 && (queue2.last = null), null; } @@ -1167,8 +1166,8 @@ function addTopLevelUpdate$1(fiber, partialState, callback, priorityLevel) { }, update2 = insertUpdate(fiber, update); if (isTopLevelUnmount) { var queue1 = fiber.updateQueue, queue2 = null !== fiber.alternate ? fiber.alternate.updateQueue : null; - null !== queue1 && null !== update.next && (update.next = null, queue1.last = update), - null !== queue2 && null !== update2 && null !== update2.next && (update2.next = null, + null !== queue1 && null !== update.next && (update.next = null, queue1.last = update), + null !== queue2 && null !== update2 && null !== update2.next && (update2.next = null, queue2.last = update); } } @@ -1188,13 +1187,13 @@ function beginUpdateQueue(workInProgress, queue, instance, prevState, props, pri for (var state = prevState, dontMutatePrevState = !0, callbackList = queue.callbackList, update = queue.first; null !== update && comparePriority(update.priorityLevel, priorityLevel) <= 0; ) { queue.first = update.next, null === queue.first && (queue.last = null); var _partialState = void 0; - update.isReplace ? (state = getStateFromUpdate(update, instance, state, props), - dontMutatePrevState = !0) : (_partialState = getStateFromUpdate(update, instance, state, props)) && (state = dontMutatePrevState ? Object.assign({}, state, _partialState) : Object.assign(state, _partialState), - dontMutatePrevState = !1), update.isForced && (queue.hasForceUpdate = !0), null === update.callback || update.isTopLevelUnmount && null !== update.next || (callbackList = callbackList || [], - callbackList.push(update.callback), workInProgress.effectTag |= CallbackEffect), + update.isReplace ? (state = getStateFromUpdate(update, instance, state, props), + dontMutatePrevState = !0) : (_partialState = getStateFromUpdate(update, instance, state, props)) && (state = dontMutatePrevState ? Object.assign({}, state, _partialState) : Object.assign(state, _partialState), + dontMutatePrevState = !1), update.isForced && (queue.hasForceUpdate = !0), null === update.callback || update.isTopLevelUnmount && null !== update.next || (callbackList = callbackList || [], + callbackList.push(update.callback), workInProgress.effectTag |= CallbackEffect), update = update.next; } - return queue.callbackList = callbackList, null !== queue.first || null !== callbackList || queue.hasForceUpdate || (workInProgress.updateQueue = null), + return queue.callbackList = callbackList, null !== queue.first || null !== callbackList || queue.hasForceUpdate || (workInProgress.updateQueue = null), state; } @@ -1204,7 +1203,7 @@ function commitCallbacks(finishedWork, queue, context) { var callbackList = queue.callbackList; if (null !== callbackList) for (var i = 0; i < callbackList.length; i++) { var _callback = callbackList[i]; - invariant("function" == typeof _callback, "Invalid argument passed as callback. Expected a function. Instead " + "received: %s", _callback), + invariant("function" == typeof _callback, "Invalid argument passed as callback. Expected a function. Instead " + "received: %s", _callback), _callback.call(context); } } @@ -1247,7 +1246,7 @@ var getComponentName_1 = getComponentName$1, ReactInstanceMap = { } }, ReactInstanceMap_1 = ReactInstanceMap, ReactInternals = react.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, ReactGlobalSharedState = { ReactCurrentOwner: ReactInternals.ReactCurrentOwner -}, ReactGlobalSharedState_1 = ReactGlobalSharedState, HostRoot$1 = ReactTypeOfWork.HostRoot, HostComponent$1 = ReactTypeOfWork.HostComponent, HostText = ReactTypeOfWork.HostText, NoEffect = ReactTypeOfSideEffect.NoEffect, Placement = ReactTypeOfSideEffect.Placement, MOUNTING = 1, MOUNTED = 2, UNMOUNTED = 3; +}, ReactGlobalSharedState_1 = ReactGlobalSharedState, HostRoot$1 = ReactTypeOfWork.HostRoot, HostComponent$2 = ReactTypeOfWork.HostComponent, HostText = ReactTypeOfWork.HostText, NoEffect = ReactTypeOfSideEffect.NoEffect, Placement = ReactTypeOfSideEffect.Placement, MOUNTING = 1, MOUNTED = 2, UNMOUNTED = 3; function isFiberMountedImpl(fiber) { var node = fiber; @@ -1273,7 +1272,7 @@ function findCurrentFiberUsingSlowPath(fiber) { var alternate = fiber.alternate; if (!alternate) { var state = isFiberMountedImpl(fiber); - return invariant(state !== UNMOUNTED, "Unable to find node on an unmounted component."), + return invariant(state !== UNMOUNTED, "Unable to find node on an unmounted component."), state === MOUNTING ? null : fiber; } for (var a = fiber, b = alternate; !0; ) { @@ -1316,7 +1315,7 @@ function findCurrentFiberUsingSlowPath(fiber) { } invariant(a.alternate === b, "Return fibers should always be each others' alternates."); } - return invariant(a.tag === HostRoot$1, "Unable to find node on an unmounted component."), + return invariant(a.tag === HostRoot$1, "Unable to find node on an unmounted component."), a.stateNode.current === a ? fiber : alternate; } @@ -1324,7 +1323,7 @@ var findCurrentFiberUsingSlowPath_1 = findCurrentFiberUsingSlowPath, findCurrent var currentParent = findCurrentFiberUsingSlowPath(parent); if (!currentParent) return null; for (var node = currentParent; !0; ) { - if (node.tag === HostComponent$1 || node.tag === HostText) return node; + if (node.tag === HostComponent$2 || node.tag === HostText) return node; if (node.child) node.child.return = node, node = node.child; else { if (node === currentParent) return null; for (;!node.sibling; ) { @@ -1406,7 +1405,7 @@ function popContextProvider(fiber) { } var popContextProvider_1 = popContextProvider, pushTopLevelContextObject = function(fiber, context, didChange) { - invariant(null == contextStackCursor.cursor, "Unexpected context found on stack"), + invariant(null == contextStackCursor.cursor, "Unexpected context found on stack"), push(contextStackCursor, context, fiber), push(didPerformWorkStackCursor, didChange, fiber); }; @@ -1422,14 +1421,14 @@ function processChildContext$1(fiber, parentContext, isReconciling) { var processChildContext_1 = processChildContext$1, pushContextProvider = function(workInProgress) { if (!isContextProvider$1(workInProgress)) return !1; var instance = workInProgress.stateNode, memoizedMergedChildContext = instance && instance.__reactInternalMemoizedMergedChildContext || emptyObject; - return previousContext = contextStackCursor.current, push(contextStackCursor, memoizedMergedChildContext, workInProgress), + return previousContext = contextStackCursor.current, push(contextStackCursor, memoizedMergedChildContext, workInProgress), push(didPerformWorkStackCursor, !1, workInProgress), !0; }, invalidateContextProvider = function(workInProgress) { var instance = workInProgress.stateNode; invariant(instance, "Expected to have an instance by this point."); var mergedContext = processChildContext$1(workInProgress, previousContext, !0); - instance.__reactInternalMemoizedMergedChildContext = mergedContext, pop(didPerformWorkStackCursor, workInProgress), - pop(contextStackCursor, workInProgress), push(contextStackCursor, mergedContext, workInProgress), + instance.__reactInternalMemoizedMergedChildContext = mergedContext, pop(didPerformWorkStackCursor, workInProgress), + pop(contextStackCursor, workInProgress), push(contextStackCursor, mergedContext, workInProgress), push(didPerformWorkStackCursor, !0, workInProgress); }, resetContext = function() { previousContext = emptyObject, contextStackCursor.current = emptyObject, didPerformWorkStackCursor.current = !1; @@ -1458,7 +1457,7 @@ var processChildContext_1 = processChildContext$1, pushContextProvider = functio }, ReactTypeOfInternalContext = { NoContext: 0, AsyncUpdates: 1 -}, IndeterminateComponent = ReactTypeOfWork.IndeterminateComponent, ClassComponent$2 = ReactTypeOfWork.ClassComponent, HostRoot$2 = ReactTypeOfWork.HostRoot, HostComponent$2 = ReactTypeOfWork.HostComponent, HostText$1 = ReactTypeOfWork.HostText, HostPortal = ReactTypeOfWork.HostPortal, CoroutineComponent = ReactTypeOfWork.CoroutineComponent, YieldComponent = ReactTypeOfWork.YieldComponent, Fragment = ReactTypeOfWork.Fragment, NoWork$1 = ReactPriorityLevel.NoWork, NoContext = ReactTypeOfInternalContext.NoContext, NoEffect$1 = ReactTypeOfSideEffect.NoEffect, cloneUpdateQueue$1 = ReactFiberUpdateQueue.cloneUpdateQueue, createFiber = function(tag, key, internalContextTag) { +}, IndeterminateComponent = ReactTypeOfWork.IndeterminateComponent, ClassComponent$2 = ReactTypeOfWork.ClassComponent, HostRoot$2 = ReactTypeOfWork.HostRoot, HostComponent$3 = ReactTypeOfWork.HostComponent, HostText$1 = ReactTypeOfWork.HostText, HostPortal = ReactTypeOfWork.HostPortal, CoroutineComponent = ReactTypeOfWork.CoroutineComponent, YieldComponent = ReactTypeOfWork.YieldComponent, Fragment = ReactTypeOfWork.Fragment, NoWork$1 = ReactPriorityLevel.NoWork, NoContext = ReactTypeOfInternalContext.NoContext, NoEffect$1 = ReactTypeOfSideEffect.NoEffect, cloneUpdateQueue$1 = ReactFiberUpdateQueue.cloneUpdateQueue, createFiber = function(tag, key, internalContextTag) { return { tag: tag, key: key, @@ -1493,34 +1492,34 @@ function shouldConstruct(Component) { var cloneFiber = function(fiber, priorityLevel) { var alt = fiber.alternate; - return null !== alt ? (alt.effectTag = NoEffect$1, alt.nextEffect = null, alt.firstEffect = null, - alt.lastEffect = null) : (alt = createFiber(fiber.tag, fiber.key, fiber.internalContextTag), - alt.type = fiber.type, alt.progressedChild = fiber.progressedChild, alt.progressedPriority = fiber.progressedPriority, - alt.alternate = fiber, fiber.alternate = alt), alt.stateNode = fiber.stateNode, - alt.child = fiber.child, alt.sibling = fiber.sibling, alt.index = fiber.index, alt.ref = fiber.ref, - alt.pendingProps = fiber.pendingProps, cloneUpdateQueue$1(fiber, alt), alt.pendingWorkPriority = priorityLevel, - alt.memoizedProps = fiber.memoizedProps, alt.memoizedState = fiber.memoizedState, + return null !== alt ? (alt.effectTag = NoEffect$1, alt.nextEffect = null, alt.firstEffect = null, + alt.lastEffect = null) : (alt = createFiber(fiber.tag, fiber.key, fiber.internalContextTag), + alt.type = fiber.type, alt.progressedChild = fiber.progressedChild, alt.progressedPriority = fiber.progressedPriority, + alt.alternate = fiber, fiber.alternate = alt), alt.stateNode = fiber.stateNode, + alt.child = fiber.child, alt.sibling = fiber.sibling, alt.index = fiber.index, alt.ref = fiber.ref, + alt.pendingProps = fiber.pendingProps, cloneUpdateQueue$1(fiber, alt), alt.pendingWorkPriority = priorityLevel, + alt.memoizedProps = fiber.memoizedProps, alt.memoizedState = fiber.memoizedState, alt; }, createHostRootFiber$1 = function() { return createFiber(HostRoot$2, null, NoContext); }, createFiberFromElement = function(element, internalContextTag, priorityLevel) { var owner = null, fiber = createFiberFromElementType(element.type, element.key, internalContextTag, owner); - return fiber.pendingProps = element.props, fiber.pendingWorkPriority = priorityLevel, + return fiber.pendingProps = element.props, fiber.pendingWorkPriority = priorityLevel, fiber; }, createFiberFromFragment = function(elements, internalContextTag, priorityLevel) { var fiber = createFiber(Fragment, null, internalContextTag); - return fiber.pendingProps = elements, fiber.pendingWorkPriority = priorityLevel, + return fiber.pendingProps = elements, fiber.pendingWorkPriority = priorityLevel, fiber; }, createFiberFromText = function(content, internalContextTag, priorityLevel) { var fiber = createFiber(HostText$1, null, internalContextTag); - return fiber.pendingProps = content, fiber.pendingWorkPriority = priorityLevel, + return fiber.pendingProps = content, fiber.pendingWorkPriority = priorityLevel, fiber; }; function createFiberFromElementType(type, key, internalContextTag, debugOwner) { var fiber = void 0; - if ("function" == typeof type) fiber = shouldConstruct(type) ? createFiber(ClassComponent$2, key, internalContextTag) : createFiber(IndeterminateComponent, key, internalContextTag), - fiber.type = type; else if ("string" == typeof type) fiber = createFiber(HostComponent$2, key, internalContextTag), + if ("function" == typeof type) fiber = shouldConstruct(type) ? createFiber(ClassComponent$2, key, internalContextTag) : createFiber(IndeterminateComponent, key, internalContextTag), + fiber.type = type; else if ("string" == typeof type) fiber = createFiber(HostComponent$3, key, internalContextTag), fiber.type = type; else if ("object" == typeof type && null !== type && "number" == typeof type.tag) fiber = type; else { var info = ""; invariant(!1, "Element type is invalid: expected a string (for built-in components) " + "or a class/function (for composite components) but got: %s.%s", null == type ? type : typeof type, info); @@ -1529,17 +1528,17 @@ function createFiberFromElementType(type, key, internalContextTag, debugOwner) { } var createFiberFromElementType_1 = createFiberFromElementType, createFiberFromHostInstanceForDeletion = function() { - var fiber = createFiber(HostComponent$2, null, NoContext); + var fiber = createFiber(HostComponent$3, null, NoContext); return fiber.type = "DELETED", fiber; }, createFiberFromCoroutine = function(coroutine, internalContextTag, priorityLevel) { var fiber = createFiber(CoroutineComponent, coroutine.key, internalContextTag); - return fiber.type = coroutine.handler, fiber.pendingProps = coroutine, fiber.pendingWorkPriority = priorityLevel, + return fiber.type = coroutine.handler, fiber.pendingProps = coroutine, fiber.pendingWorkPriority = priorityLevel, fiber; }, createFiberFromYield = function(yieldNode, internalContextTag, priorityLevel) { return createFiber(YieldComponent, null, internalContextTag); }, createFiberFromPortal = function(portal, internalContextTag, priorityLevel) { var fiber = createFiber(HostPortal, portal.key, internalContextTag); - return fiber.pendingProps = portal.children || [], fiber.pendingWorkPriority = priorityLevel, + return fiber.pendingProps = portal.children || [], fiber.pendingWorkPriority = priorityLevel, fiber.stateNode = { containerInfo: portal.containerInfo, implementation: portal.implementation @@ -1567,7 +1566,7 @@ var createFiberFromElementType_1 = createFiberFromElementType, createFiberFromHo return uninitializedFiber.stateNode = root, root; }, ReactFiberRoot = { createFiberRoot: createFiberRoot$1 -}, IndeterminateComponent$1 = ReactTypeOfWork.IndeterminateComponent, FunctionalComponent = ReactTypeOfWork.FunctionalComponent, ClassComponent$4 = ReactTypeOfWork.ClassComponent, HostComponent$4 = ReactTypeOfWork.HostComponent; +}, IndeterminateComponent$1 = ReactTypeOfWork.IndeterminateComponent, FunctionalComponent = ReactTypeOfWork.FunctionalComponent, ClassComponent$4 = ReactTypeOfWork.ClassComponent, HostComponent$5 = ReactTypeOfWork.HostComponent; function describeComponentFrame(name, source, ownerName) { return "\n in " + (name || "Unknown") + (source ? " (at " + source.fileName.replace(/^.*[\\\/]/, "") + ":" + source.lineNumber + ")" : ownerName ? " (created by " + ownerName + ")" : ""); @@ -1578,7 +1577,7 @@ function describeFiber(fiber) { case IndeterminateComponent$1: case FunctionalComponent: case ClassComponent$4: - case HostComponent$4: + case HostComponent$5: var owner = fiber._debugOwner, source = fiber._debugSource, name = getComponentName_1(fiber), ownerName = null; return owner && (ownerName = getComponentName_1(owner)), describeComponentFrame(name, source, ownerName); @@ -1600,8 +1599,8 @@ var ReactFiberComponentTreeHook = { describeComponentFrame: describeComponentFrame }, REACT_ELEMENT_TYPE = "function" == typeof Symbol && Symbol.for && Symbol.for("react.element") || 60103, ReactElementSymbol = REACT_ELEMENT_TYPE, REACT_COROUTINE_TYPE$1, REACT_YIELD_TYPE$1; -"function" == typeof Symbol && Symbol.for ? (REACT_COROUTINE_TYPE$1 = Symbol.for("react.coroutine"), -REACT_YIELD_TYPE$1 = Symbol.for("react.yield")) : (REACT_COROUTINE_TYPE$1 = 60104, +"function" == typeof Symbol && Symbol.for ? (REACT_COROUTINE_TYPE$1 = Symbol.for("react.coroutine"), +REACT_YIELD_TYPE$1 = Symbol.for("react.yield")) : (REACT_COROUTINE_TYPE$1 = 60104, REACT_YIELD_TYPE$1 = 60105); var createCoroutine = function(children, handler, props) { @@ -1636,7 +1635,7 @@ function getIteratorFn(maybeIterable) { if ("function" == typeof iteratorFn) return iteratorFn; } -var getIteratorFn_1 = getIteratorFn, REACT_COROUTINE_TYPE = ReactCoroutine.REACT_COROUTINE_TYPE, REACT_YIELD_TYPE = ReactCoroutine.REACT_YIELD_TYPE, REACT_PORTAL_TYPE$1 = ReactPortal.REACT_PORTAL_TYPE, cloneFiber$2 = ReactFiber.cloneFiber, createFiberFromElement$1 = ReactFiber.createFiberFromElement, createFiberFromFragment$1 = ReactFiber.createFiberFromFragment, createFiberFromText$1 = ReactFiber.createFiberFromText, createFiberFromCoroutine$1 = ReactFiber.createFiberFromCoroutine, createFiberFromYield$1 = ReactFiber.createFiberFromYield, createFiberFromPortal$1 = ReactFiber.createFiberFromPortal, isArray = Array.isArray, FunctionalComponent$2 = ReactTypeOfWork.FunctionalComponent, ClassComponent$6 = ReactTypeOfWork.ClassComponent, HostText$3 = ReactTypeOfWork.HostText, HostPortal$3 = ReactTypeOfWork.HostPortal, CoroutineComponent$2 = ReactTypeOfWork.CoroutineComponent, YieldComponent$2 = ReactTypeOfWork.YieldComponent, Fragment$2 = ReactTypeOfWork.Fragment, NoEffect$3 = ReactTypeOfSideEffect.NoEffect, Placement$3 = ReactTypeOfSideEffect.Placement, Deletion$1 = ReactTypeOfSideEffect.Deletion; +var getIteratorFn_1 = getIteratorFn, REACT_COROUTINE_TYPE = ReactCoroutine.REACT_COROUTINE_TYPE, REACT_YIELD_TYPE = ReactCoroutine.REACT_YIELD_TYPE, REACT_PORTAL_TYPE$1 = ReactPortal.REACT_PORTAL_TYPE, cloneFiber$2 = ReactFiber.cloneFiber, createFiberFromElement$1 = ReactFiber.createFiberFromElement, createFiberFromFragment$1 = ReactFiber.createFiberFromFragment, createFiberFromText$1 = ReactFiber.createFiberFromText, createFiberFromCoroutine$1 = ReactFiber.createFiberFromCoroutine, createFiberFromYield$1 = ReactFiber.createFiberFromYield, createFiberFromPortal$1 = ReactFiber.createFiberFromPortal, isArray = Array.isArray, FunctionalComponent$2 = ReactTypeOfWork.FunctionalComponent, ClassComponent$6 = ReactTypeOfWork.ClassComponent, HostText$3 = ReactTypeOfWork.HostText, HostPortal$3 = ReactTypeOfWork.HostPortal, CoroutineComponent$2 = ReactTypeOfWork.CoroutineComponent, YieldComponent$2 = ReactTypeOfWork.YieldComponent, Fragment$2 = ReactTypeOfWork.Fragment, NoEffect$2 = ReactTypeOfSideEffect.NoEffect, Placement$3 = ReactTypeOfSideEffect.Placement, Deletion$1 = ReactTypeOfSideEffect.Deletion; function coerceRef(current, element) { var mixedRef = element.ref; @@ -1644,7 +1643,7 @@ function coerceRef(current, element) { var owner = element._owner, inst = void 0; if (owner) if ("number" == typeof owner.tag) { var ownerFiber = owner; - invariant(ownerFiber.tag === ClassComponent$6, "Stateless function components cannot have refs."), + invariant(ownerFiber.tag === ClassComponent$6, "Stateless function components cannot have refs."), inst = ownerFiber.stateNode; } else inst = owner.getPublicInstance(); invariant(inst, "Missing owner for string ref %s. This error is likely caused by a " + "bug in React. Please file an issue.", mixedRef); @@ -1673,18 +1672,18 @@ function ChildReconciler(shouldClone, shouldTrackSideEffects) { childToDelete = childToDelete.alternate; } var last = returnFiber.progressedLastDeletion; - null !== last ? (last.nextEffect = childToDelete, returnFiber.progressedLastDeletion = childToDelete) : returnFiber.progressedFirstDeletion = returnFiber.progressedLastDeletion = childToDelete, + null !== last ? (last.nextEffect = childToDelete, returnFiber.progressedLastDeletion = childToDelete) : returnFiber.progressedFirstDeletion = returnFiber.progressedLastDeletion = childToDelete, childToDelete.nextEffect = null, childToDelete.effectTag = Deletion$1; } } function deleteRemainingChildren(returnFiber, currentFirstChild) { if (!shouldTrackSideEffects) return null; - for (var childToDelete = currentFirstChild; null !== childToDelete; ) deleteChild(returnFiber, childToDelete), + for (var childToDelete = currentFirstChild; null !== childToDelete; ) deleteChild(returnFiber, childToDelete), childToDelete = childToDelete.sibling; return null; } function mapRemainingChildren(returnFiber, currentFirstChild) { - for (var existingChildren = new Map(), existingChild = currentFirstChild; null !== existingChild; ) null !== existingChild.key ? existingChildren.set(existingChild.key, existingChild) : existingChildren.set(existingChild.index, existingChild), + for (var existingChildren = new Map(), existingChild = currentFirstChild; null !== existingChild; ) null !== existingChild.key ? existingChildren.set(existingChild.key, existingChild) : existingChildren.set(existingChild.index, existingChild), existingChild = existingChild.sibling; return existingChildren; } @@ -1693,7 +1692,7 @@ function ChildReconciler(shouldClone, shouldTrackSideEffects) { var clone = cloneFiber$2(fiber, priority); return clone.index = 0, clone.sibling = null, clone; } - return fiber.pendingWorkPriority = priority, fiber.effectTag = NoEffect$3, fiber.index = 0, + return fiber.pendingWorkPriority = priority, fiber.effectTag = NoEffect$2, fiber.index = 0, fiber.sibling = null, fiber; } function placeChild(newFiber, lastPlacedIndex, newIndex) { @@ -1706,7 +1705,7 @@ function ChildReconciler(shouldClone, shouldTrackSideEffects) { return newFiber.effectTag = Placement$3, lastPlacedIndex; } function placeSingleChild(newFiber) { - return shouldTrackSideEffects && null === newFiber.alternate && (newFiber.effectTag = Placement$3), + return shouldTrackSideEffects && null === newFiber.alternate && (newFiber.effectTag = Placement$3), newFiber; } function updateTextNode(returnFiber, current, textContent, priority) { @@ -1720,11 +1719,11 @@ function ChildReconciler(shouldClone, shouldTrackSideEffects) { function updateElement(returnFiber, current, element, priority) { if (null === current || current.type !== element.type) { var created = createFiberFromElement$1(element, returnFiber.internalContextTag, priority); - return created.ref = coerceRef(current, element), created.return = returnFiber, + return created.ref = coerceRef(current, element), created.return = returnFiber, created; } var existing = useFiber(current, priority); - return existing.ref = coerceRef(current, element), existing.pendingProps = element.props, + return existing.ref = coerceRef(current, element), existing.pendingProps = element.props, existing.return = returnFiber, existing; } function updateCoroutine(returnFiber, current, coroutine, priority) { @@ -1749,7 +1748,7 @@ function ChildReconciler(shouldClone, shouldTrackSideEffects) { return created.return = returnFiber, created; } var existing = useFiber(current, priority); - return existing.pendingProps = portal.children || [], existing.return = returnFiber, + return existing.pendingProps = portal.children || [], existing.return = returnFiber, existing; } function updateFragment(returnFiber, current, fragment, priority) { @@ -1769,7 +1768,7 @@ function ChildReconciler(shouldClone, shouldTrackSideEffects) { switch (newChild.$$typeof) { case ReactElementSymbol: var _created = createFiberFromElement$1(newChild, returnFiber.internalContextTag, priority); - return _created.ref = coerceRef(null, newChild), _created.return = returnFiber, + return _created.ref = coerceRef(null, newChild), _created.return = returnFiber, _created; case REACT_COROUTINE_TYPE: @@ -1847,25 +1846,25 @@ function ChildReconciler(shouldClone, shouldTrackSideEffects) { null === oldFiber && (oldFiber = nextOldFiber); break; } - shouldTrackSideEffects && oldFiber && null === newFiber.alternate && deleteChild(returnFiber, oldFiber), - lastPlacedIndex = placeChild(newFiber, lastPlacedIndex, newIdx), null === previousNewFiber ? resultingFirstChild = newFiber : previousNewFiber.sibling = newFiber, + shouldTrackSideEffects && oldFiber && null === newFiber.alternate && deleteChild(returnFiber, oldFiber), + lastPlacedIndex = placeChild(newFiber, lastPlacedIndex, newIdx), null === previousNewFiber ? resultingFirstChild = newFiber : previousNewFiber.sibling = newFiber, previousNewFiber = newFiber, oldFiber = nextOldFiber; } - if (newIdx === newChildren.length) return deleteRemainingChildren(returnFiber, oldFiber), + if (newIdx === newChildren.length) return deleteRemainingChildren(returnFiber, oldFiber), resultingFirstChild; if (null === oldFiber) { for (;newIdx < newChildren.length; newIdx++) { var _newFiber = createChild(returnFiber, newChildren[newIdx], priority); - _newFiber && (lastPlacedIndex = placeChild(_newFiber, lastPlacedIndex, newIdx), - null === previousNewFiber ? resultingFirstChild = _newFiber : previousNewFiber.sibling = _newFiber, + _newFiber && (lastPlacedIndex = placeChild(_newFiber, lastPlacedIndex, newIdx), + null === previousNewFiber ? resultingFirstChild = _newFiber : previousNewFiber.sibling = _newFiber, previousNewFiber = _newFiber); } return resultingFirstChild; } for (var existingChildren = mapRemainingChildren(returnFiber, oldFiber); newIdx < newChildren.length; newIdx++) { var _newFiber2 = updateFromMap(existingChildren, returnFiber, newIdx, newChildren[newIdx], priority); - _newFiber2 && (shouldTrackSideEffects && null !== _newFiber2.alternate && existingChildren.delete(null === _newFiber2.key ? newIdx : _newFiber2.key), - lastPlacedIndex = placeChild(_newFiber2, lastPlacedIndex, newIdx), null === previousNewFiber ? resultingFirstChild = _newFiber2 : previousNewFiber.sibling = _newFiber2, + _newFiber2 && (shouldTrackSideEffects && null !== _newFiber2.alternate && existingChildren.delete(null === _newFiber2.key ? newIdx : _newFiber2.key), + lastPlacedIndex = placeChild(_newFiber2, lastPlacedIndex, newIdx), null === previousNewFiber ? resultingFirstChild = _newFiber2 : previousNewFiber.sibling = _newFiber2, previousNewFiber = _newFiber2); } return shouldTrackSideEffects && existingChildren.forEach(function(child) { @@ -1877,7 +1876,7 @@ function ChildReconciler(shouldClone, shouldTrackSideEffects) { invariant("function" == typeof iteratorFn, "An object is not an iterable. This error is likely caused by a bug in " + "React. Please file an issue."); var newChildren = iteratorFn.call(newChildrenIterable); invariant(null != newChildren, "An iterable object provided no iterator."); - for (var resultingFirstChild = null, previousNewFiber = null, oldFiber = currentFirstChild, lastPlacedIndex = 0, newIdx = 0, nextOldFiber = null, step = newChildren.next(); null !== oldFiber && !step.done; newIdx++, + for (var resultingFirstChild = null, previousNewFiber = null, oldFiber = currentFirstChild, lastPlacedIndex = 0, newIdx = 0, nextOldFiber = null, step = newChildren.next(); null !== oldFiber && !step.done; newIdx++, step = newChildren.next()) { oldFiber.index > newIdx ? (nextOldFiber = oldFiber, oldFiber = null) : nextOldFiber = oldFiber.sibling; var newFiber = updateSlot(returnFiber, oldFiber, step.value, priority); @@ -1885,25 +1884,25 @@ function ChildReconciler(shouldClone, shouldTrackSideEffects) { oldFiber || (oldFiber = nextOldFiber); break; } - shouldTrackSideEffects && oldFiber && null === newFiber.alternate && deleteChild(returnFiber, oldFiber), - lastPlacedIndex = placeChild(newFiber, lastPlacedIndex, newIdx), null === previousNewFiber ? resultingFirstChild = newFiber : previousNewFiber.sibling = newFiber, + shouldTrackSideEffects && oldFiber && null === newFiber.alternate && deleteChild(returnFiber, oldFiber), + lastPlacedIndex = placeChild(newFiber, lastPlacedIndex, newIdx), null === previousNewFiber ? resultingFirstChild = newFiber : previousNewFiber.sibling = newFiber, previousNewFiber = newFiber, oldFiber = nextOldFiber; } if (step.done) return deleteRemainingChildren(returnFiber, oldFiber), resultingFirstChild; if (null === oldFiber) { for (;!step.done; newIdx++, step = newChildren.next()) { var _newFiber3 = createChild(returnFiber, step.value, priority); - null !== _newFiber3 && (lastPlacedIndex = placeChild(_newFiber3, lastPlacedIndex, newIdx), - null === previousNewFiber ? resultingFirstChild = _newFiber3 : previousNewFiber.sibling = _newFiber3, + null !== _newFiber3 && (lastPlacedIndex = placeChild(_newFiber3, lastPlacedIndex, newIdx), + null === previousNewFiber ? resultingFirstChild = _newFiber3 : previousNewFiber.sibling = _newFiber3, previousNewFiber = _newFiber3); } return resultingFirstChild; } - for (var existingChildren = mapRemainingChildren(returnFiber, oldFiber); !step.done; newIdx++, + for (var existingChildren = mapRemainingChildren(returnFiber, oldFiber); !step.done; newIdx++, step = newChildren.next()) { var _newFiber4 = updateFromMap(existingChildren, returnFiber, newIdx, step.value, priority); - null !== _newFiber4 && (shouldTrackSideEffects && null !== _newFiber4.alternate && existingChildren.delete(null === _newFiber4.key ? newIdx : _newFiber4.key), - lastPlacedIndex = placeChild(_newFiber4, lastPlacedIndex, newIdx), null === previousNewFiber ? resultingFirstChild = _newFiber4 : previousNewFiber.sibling = _newFiber4, + null !== _newFiber4 && (shouldTrackSideEffects && null !== _newFiber4.alternate && existingChildren.delete(null === _newFiber4.key ? newIdx : _newFiber4.key), + lastPlacedIndex = placeChild(_newFiber4, lastPlacedIndex, newIdx), null === previousNewFiber ? resultingFirstChild = _newFiber4 : previousNewFiber.sibling = _newFiber4, previousNewFiber = _newFiber4); } return shouldTrackSideEffects && existingChildren.forEach(function(child) { @@ -1926,7 +1925,7 @@ function ChildReconciler(shouldClone, shouldTrackSideEffects) { if (child.type === element.type) { deleteRemainingChildren(returnFiber, child.sibling); var existing = useFiber(child, priority); - return existing.ref = coerceRef(child, element), existing.pendingProps = element.props, + return existing.ref = coerceRef(child, element), existing.pendingProps = element.props, existing.return = returnFiber, existing; } deleteRemainingChildren(returnFiber, child); @@ -1935,7 +1934,7 @@ function ChildReconciler(shouldClone, shouldTrackSideEffects) { deleteChild(returnFiber, child), child = child.sibling; } var created = createFiberFromElement$1(element, returnFiber.internalContextTag, priority); - return created.ref = coerceRef(currentFirstChild, element), created.return = returnFiber, + return created.ref = coerceRef(currentFirstChild, element), created.return = returnFiber, created; } function reconcileSingleCoroutine(returnFiber, currentFirstChild, coroutine, priority) { @@ -1973,7 +1972,7 @@ function ChildReconciler(shouldClone, shouldTrackSideEffects) { if (child.tag === HostPortal$3 && child.stateNode.containerInfo === portal.containerInfo && child.stateNode.implementation === portal.implementation) { deleteRemainingChildren(returnFiber, child.sibling); var existing = useFiber(child, priority); - return existing.pendingProps = portal.children || [], existing.return = returnFiber, + return existing.pendingProps = portal.children || [], existing.return = returnFiber, existing; } deleteRemainingChildren(returnFiber, child); @@ -2032,11 +2031,11 @@ function ChildReconciler(shouldClone, shouldTrackSideEffects) { var reconcileChildFibers$1 = ChildReconciler(!0, !0), reconcileChildFibersInPlace$1 = ChildReconciler(!1, !0), mountChildFibersInPlace$1 = ChildReconciler(!1, !1), cloneChildFibers$1 = function(current, workInProgress) { if (workInProgress.child) if (null !== current && workInProgress.child === current.child) { var currentChild = workInProgress.child, newChild = cloneFiber$2(currentChild, currentChild.pendingWorkPriority); - for (workInProgress.child = newChild, newChild.return = workInProgress; null !== currentChild.sibling; ) currentChild = currentChild.sibling, - newChild = newChild.sibling = cloneFiber$2(currentChild, currentChild.pendingWorkPriority), + for (workInProgress.child = newChild, newChild.return = workInProgress; null !== currentChild.sibling; ) currentChild = currentChild.sibling, + newChild = newChild.sibling = cloneFiber$2(currentChild, currentChild.pendingWorkPriority), newChild.return = workInProgress; newChild.sibling = null; - } else for (var child = workInProgress.child; null !== child; ) child.return = workInProgress, + } else for (var child = workInProgress.child; null !== child; ) child.return = workInProgress, child = child.sibling; }, ReactChildFiber = { reconcileChildFibers: reconcileChildFibers$1, @@ -2048,17 +2047,17 @@ var reconcileChildFibers$1 = ChildReconciler(!0, !0), reconcileChildFibersInPlac isMounted: isMounted$1, enqueueSetState: function(instance, partialState, callback) { var fiber = ReactInstanceMap_1.get(instance), priorityLevel = getPriorityContext(fiber, !1); - callback = void 0 === callback ? null : callback, addUpdate$1(fiber, partialState, callback, priorityLevel), + callback = void 0 === callback ? null : callback, addUpdate$1(fiber, partialState, callback, priorityLevel), scheduleUpdate(fiber, priorityLevel); }, enqueueReplaceState: function(instance, state, callback) { var fiber = ReactInstanceMap_1.get(instance), priorityLevel = getPriorityContext(fiber, !1); - callback = void 0 === callback ? null : callback, addReplaceUpdate$1(fiber, state, callback, priorityLevel), + callback = void 0 === callback ? null : callback, addReplaceUpdate$1(fiber, state, callback, priorityLevel), scheduleUpdate(fiber, priorityLevel); }, enqueueForceUpdate: function(instance, callback) { var fiber = ReactInstanceMap_1.get(instance), priorityLevel = getPriorityContext(fiber, !1); - callback = void 0 === callback ? null : callback, addForceUpdate$1(fiber, callback, priorityLevel), + callback = void 0 === callback ? null : callback, addForceUpdate$1(fiber, callback, priorityLevel), scheduleUpdate(fiber, priorityLevel); } }; @@ -2078,7 +2077,7 @@ var reconcileChildFibers$1 = ChildReconciler(!0, !0), reconcileChildFibersInPlac } function constructClassInstance(workInProgress, props) { var ctor = workInProgress.type, unmaskedContext = getUnmaskedContext$2(workInProgress), needsContext = isContextConsumer$1(workInProgress), context = needsContext ? getMaskedContext$2(workInProgress, unmaskedContext) : emptyObject, instance = new ctor(props, context); - return adoptClassInstance(workInProgress, instance), needsContext && cacheContext$1(workInProgress, unmaskedContext, context), + return adoptClassInstance(workInProgress, instance), needsContext && cacheContext$1(workInProgress, unmaskedContext, context), instance; } function callComponentWillMount(workInProgress, instance) { @@ -2093,8 +2092,8 @@ var reconcileChildFibers$1 = ChildReconciler(!0, !0), reconcileChildFibersInPlac var instance = workInProgress.stateNode, state = instance.state || null, props = workInProgress.pendingProps; invariant(props, "There must be pending props for an initial mount. This error is " + "likely caused by a bug in React. Please file an issue."); var unmaskedContext = getUnmaskedContext$2(workInProgress); - if (instance.props = props, instance.state = state, instance.refs = emptyObject, - instance.context = getMaskedContext$2(workInProgress, unmaskedContext), ReactFeatureFlags_1.enableAsyncSubtreeAPI && null != workInProgress.type && !0 === workInProgress.type.unstable_asyncUpdates && (workInProgress.internalContextTag |= AsyncUpdates$1), + if (instance.props = props, instance.state = state, instance.refs = emptyObject, + instance.context = getMaskedContext$2(workInProgress, unmaskedContext), ReactFeatureFlags_1.enableAsyncSubtreeAPI && null != workInProgress.type && !0 === workInProgress.type.unstable_asyncUpdates && (workInProgress.internalContextTag |= AsyncUpdates$1), "function" == typeof instance.componentWillMount) { callComponentWillMount(workInProgress, instance); var updateQueue = workInProgress.updateQueue; @@ -2110,16 +2109,16 @@ var reconcileChildFibers$1 = ChildReconciler(!0, !0), reconcileChildFibersInPlac var newUnmaskedContext = getUnmaskedContext$2(workInProgress), newContext = getMaskedContext$2(workInProgress, newUnmaskedContext), oldContext = instance.context, oldProps = workInProgress.memoizedProps; "function" != typeof instance.componentWillReceiveProps || oldProps === newProps && oldContext === newContext || callComponentWillReceiveProps(workInProgress, instance, newProps, newContext); var updateQueue = workInProgress.updateQueue; - if (null !== updateQueue && (newState = beginUpdateQueue$2(workInProgress, updateQueue, instance, newState, newProps, priorityLevel)), - !checkShouldComponentUpdate(workInProgress, workInProgress.memoizedProps, newProps, workInProgress.memoizedState, newState, newContext)) return instance.props = newProps, + if (null !== updateQueue && (newState = beginUpdateQueue$2(workInProgress, updateQueue, instance, newState, newProps, priorityLevel)), + !checkShouldComponentUpdate(workInProgress, workInProgress.memoizedProps, newProps, workInProgress.memoizedState, newState, newContext)) return instance.props = newProps, instance.state = newState, instance.context = newContext, !1; - if (instance.props = newProps, instance.state = newState, instance.context = newContext, + if (instance.props = newProps, instance.state = newState, instance.context = newContext, "function" == typeof instance.componentWillMount) { callComponentWillMount(workInProgress, instance); var newUpdateQueue = workInProgress.updateQueue; null !== newUpdateQueue && (newState = beginUpdateQueue$2(workInProgress, newUpdateQueue, instance, newState, newProps, priorityLevel)); } - return "function" == typeof instance.componentDidMount && (workInProgress.effectTag |= Update$1), + return "function" == typeof instance.componentDidMount && (workInProgress.effectTag |= Update$1), instance.state = newState, !0; } function updateClassInstance(current, workInProgress, priorityLevel) { @@ -2130,14 +2129,14 @@ var reconcileChildFibers$1 = ChildReconciler(!0, !0), reconcileChildFibersInPlac var oldContext = instance.context, newUnmaskedContext = getUnmaskedContext$2(workInProgress), newContext = getMaskedContext$2(workInProgress, newUnmaskedContext); "function" != typeof instance.componentWillReceiveProps || oldProps === newProps && oldContext === newContext || callComponentWillReceiveProps(workInProgress, instance, newProps, newContext); var updateQueue = workInProgress.updateQueue, oldState = workInProgress.memoizedState, newState = void 0; - if (newState = null !== updateQueue ? beginUpdateQueue$2(workInProgress, updateQueue, instance, oldState, newProps, priorityLevel) : oldState, - !(oldProps !== newProps || oldState !== newState || hasContextChanged$2() || null !== updateQueue && updateQueue.hasForceUpdate)) return "function" == typeof instance.componentDidUpdate && (oldProps === current.memoizedProps && oldState === current.memoizedState || (workInProgress.effectTag |= Update$1)), + if (newState = null !== updateQueue ? beginUpdateQueue$2(workInProgress, updateQueue, instance, oldState, newProps, priorityLevel) : oldState, + !(oldProps !== newProps || oldState !== newState || hasContextChanged$2() || null !== updateQueue && updateQueue.hasForceUpdate)) return "function" == typeof instance.componentDidUpdate && (oldProps === current.memoizedProps && oldState === current.memoizedState || (workInProgress.effectTag |= Update$1)), !1; var shouldUpdate = checkShouldComponentUpdate(workInProgress, oldProps, newProps, oldState, newState, newContext); - return shouldUpdate ? ("function" == typeof instance.componentWillUpdate && instance.componentWillUpdate(newProps, newState, newContext), - "function" == typeof instance.componentDidUpdate && (workInProgress.effectTag |= Update$1)) : ("function" == typeof instance.componentDidUpdate && (oldProps === current.memoizedProps && oldState === current.memoizedState || (workInProgress.effectTag |= Update$1)), - memoizeProps(workInProgress, newProps), memoizeState(workInProgress, newState)), - instance.props = newProps, instance.state = newState, instance.context = newContext, + return shouldUpdate ? ("function" == typeof instance.componentWillUpdate && instance.componentWillUpdate(newProps, newState, newContext), + "function" == typeof instance.componentDidUpdate && (workInProgress.effectTag |= Update$1)) : ("function" == typeof instance.componentDidUpdate && (oldProps === current.memoizedProps && oldState === current.memoizedState || (workInProgress.effectTag |= Update$1)), + memoizeProps(workInProgress, newProps), memoizeState(workInProgress, newState)), + instance.props = newProps, instance.state = newState, instance.context = newContext, shouldUpdate; } return { @@ -2147,10 +2146,10 @@ var reconcileChildFibers$1 = ChildReconciler(!0, !0), reconcileChildFibersInPlac resumeMountClassInstance: resumeMountClassInstance, updateClassInstance: updateClassInstance }; -}, mountChildFibersInPlace = ReactChildFiber.mountChildFibersInPlace, reconcileChildFibers = ReactChildFiber.reconcileChildFibers, reconcileChildFibersInPlace = ReactChildFiber.reconcileChildFibersInPlace, cloneChildFibers = ReactChildFiber.cloneChildFibers, beginUpdateQueue$1 = ReactFiberUpdateQueue.beginUpdateQueue, getMaskedContext$1 = ReactFiberContext.getMaskedContext, getUnmaskedContext$1 = ReactFiberContext.getUnmaskedContext, hasContextChanged$1 = ReactFiberContext.hasContextChanged, pushContextProvider$1 = ReactFiberContext.pushContextProvider, pushTopLevelContextObject$1 = ReactFiberContext.pushTopLevelContextObject, invalidateContextProvider$1 = ReactFiberContext.invalidateContextProvider, IndeterminateComponent$2 = ReactTypeOfWork.IndeterminateComponent, FunctionalComponent$1 = ReactTypeOfWork.FunctionalComponent, ClassComponent$5 = ReactTypeOfWork.ClassComponent, HostRoot$4 = ReactTypeOfWork.HostRoot, HostComponent$5 = ReactTypeOfWork.HostComponent, HostText$2 = ReactTypeOfWork.HostText, HostPortal$2 = ReactTypeOfWork.HostPortal, CoroutineComponent$1 = ReactTypeOfWork.CoroutineComponent, CoroutineHandlerPhase = ReactTypeOfWork.CoroutineHandlerPhase, YieldComponent$1 = ReactTypeOfWork.YieldComponent, Fragment$1 = ReactTypeOfWork.Fragment, NoWork$3 = ReactPriorityLevel.NoWork, OffscreenPriority$1 = ReactPriorityLevel.OffscreenPriority, Placement$2 = ReactTypeOfSideEffect.Placement, ContentReset$1 = ReactTypeOfSideEffect.ContentReset, Err$1 = ReactTypeOfSideEffect.Err, Ref$1 = ReactTypeOfSideEffect.Ref, ReactCurrentOwner$2 = ReactGlobalSharedState_1.ReactCurrentOwner, ReactFiberBeginWork = function(config, hostContext, hydrationContext, scheduleUpdate, getPriorityContext) { +}, mountChildFibersInPlace = ReactChildFiber.mountChildFibersInPlace, reconcileChildFibers = ReactChildFiber.reconcileChildFibers, reconcileChildFibersInPlace = ReactChildFiber.reconcileChildFibersInPlace, cloneChildFibers = ReactChildFiber.cloneChildFibers, beginUpdateQueue$1 = ReactFiberUpdateQueue.beginUpdateQueue, getMaskedContext$1 = ReactFiberContext.getMaskedContext, getUnmaskedContext$1 = ReactFiberContext.getUnmaskedContext, hasContextChanged$1 = ReactFiberContext.hasContextChanged, pushContextProvider$1 = ReactFiberContext.pushContextProvider, pushTopLevelContextObject$1 = ReactFiberContext.pushTopLevelContextObject, invalidateContextProvider$1 = ReactFiberContext.invalidateContextProvider, IndeterminateComponent$2 = ReactTypeOfWork.IndeterminateComponent, FunctionalComponent$1 = ReactTypeOfWork.FunctionalComponent, ClassComponent$5 = ReactTypeOfWork.ClassComponent, HostRoot$4 = ReactTypeOfWork.HostRoot, HostComponent$6 = ReactTypeOfWork.HostComponent, HostText$2 = ReactTypeOfWork.HostText, HostPortal$2 = ReactTypeOfWork.HostPortal, CoroutineComponent$1 = ReactTypeOfWork.CoroutineComponent, CoroutineHandlerPhase = ReactTypeOfWork.CoroutineHandlerPhase, YieldComponent$1 = ReactTypeOfWork.YieldComponent, Fragment$1 = ReactTypeOfWork.Fragment, NoWork$3 = ReactPriorityLevel.NoWork, OffscreenPriority$1 = ReactPriorityLevel.OffscreenPriority, PerformedWork$1 = ReactTypeOfSideEffect.PerformedWork, Placement$2 = ReactTypeOfSideEffect.Placement, ContentReset$1 = ReactTypeOfSideEffect.ContentReset, Err$1 = ReactTypeOfSideEffect.Err, Ref$1 = ReactTypeOfSideEffect.Ref, ReactCurrentOwner$2 = ReactGlobalSharedState_1.ReactCurrentOwner, ReactFiberBeginWork = function(config, hostContext, hydrationContext, scheduleUpdate, getPriorityContext) { var shouldSetTextContent = config.shouldSetTextContent, useSyncScheduling = config.useSyncScheduling, shouldDeprioritizeSubtree = config.shouldDeprioritizeSubtree, pushHostContext = hostContext.pushHostContext, pushHostContainer = hostContext.pushHostContainer, enterHydrationState = hydrationContext.enterHydrationState, resetHydrationState = hydrationContext.resetHydrationState, tryToClaimNextHydratableInstance = hydrationContext.tryToClaimNextHydratableInstance, _ReactFiberClassCompo = ReactFiberClassComponent(scheduleUpdate, getPriorityContext, memoizeProps, memoizeState), adoptClassInstance = _ReactFiberClassCompo.adoptClassInstance, constructClassInstance = _ReactFiberClassCompo.constructClassInstance, mountClassInstance = _ReactFiberClassCompo.mountClassInstance, resumeMountClassInstance = _ReactFiberClassCompo.resumeMountClassInstance, updateClassInstance = _ReactFiberClassCompo.updateClassInstance; function markChildAsProgressed(current, workInProgress, priorityLevel) { - workInProgress.progressedChild = workInProgress.child, workInProgress.progressedPriority = priorityLevel, + workInProgress.progressedChild = workInProgress.child, workInProgress.progressedPriority = priorityLevel, null !== current && (current.progressedChild = workInProgress.progressedChild, current.progressedPriority = workInProgress.progressedPriority); } function clearDeletions(workInProgress) { @@ -2163,15 +2162,15 @@ var reconcileChildFibers$1 = ChildReconciler(!0, !0), reconcileChildFibersInPlac reconcileChildrenAtPriority(current, workInProgress, nextChildren, workInProgress.pendingWorkPriority); } function reconcileChildrenAtPriority(current, workInProgress, nextChildren, priorityLevel) { - workInProgress.memoizedProps = null, null === current ? workInProgress.child = mountChildFibersInPlace(workInProgress, workInProgress.child, nextChildren, priorityLevel) : current.child === workInProgress.child ? (clearDeletions(workInProgress), - workInProgress.child = reconcileChildFibers(workInProgress, workInProgress.child, nextChildren, priorityLevel), - transferDeletions(workInProgress)) : (workInProgress.child = reconcileChildFibersInPlace(workInProgress, workInProgress.child, nextChildren, priorityLevel), + workInProgress.memoizedProps = null, null === current ? workInProgress.child = mountChildFibersInPlace(workInProgress, workInProgress.child, nextChildren, priorityLevel) : current.child === workInProgress.child ? (clearDeletions(workInProgress), + workInProgress.child = reconcileChildFibers(workInProgress, workInProgress.child, nextChildren, priorityLevel), + transferDeletions(workInProgress)) : (workInProgress.child = reconcileChildFibersInPlace(workInProgress, workInProgress.child, nextChildren, priorityLevel), transferDeletions(workInProgress)), markChildAsProgressed(current, workInProgress, priorityLevel); } function updateFragment(current, workInProgress) { var nextChildren = workInProgress.pendingProps; if (hasContextChanged$1()) null === nextChildren && (nextChildren = workInProgress.memoizedProps); else if (null === nextChildren || workInProgress.memoizedProps === nextChildren) return bailoutOnAlreadyFinishedWork(current, workInProgress); - return reconcileChildren(current, workInProgress, nextChildren), memoizeProps(workInProgress, nextChildren), + return reconcileChildren(current, workInProgress, nextChildren), memoizeProps(workInProgress, nextChildren), workInProgress.child; } function markRef(current, workInProgress) { @@ -2182,17 +2181,18 @@ var reconcileChildFibers$1 = ChildReconciler(!0, !0), reconcileChildFibersInPlac var fn = workInProgress.type, nextProps = workInProgress.pendingProps, memoizedProps = workInProgress.memoizedProps; if (hasContextChanged$1()) null === nextProps && (nextProps = memoizedProps); else { if (null === nextProps || memoizedProps === nextProps) return bailoutOnAlreadyFinishedWork(current, workInProgress); - if ("function" == typeof fn.shouldComponentUpdate && !fn.shouldComponentUpdate(memoizedProps, nextProps)) return memoizeProps(workInProgress, nextProps), + if ("function" == typeof fn.shouldComponentUpdate && !fn.shouldComponentUpdate(memoizedProps, nextProps)) return memoizeProps(workInProgress, nextProps), bailoutOnAlreadyFinishedWork(current, workInProgress); } var nextChildren, unmaskedContext = getUnmaskedContext$1(workInProgress), context = getMaskedContext$1(workInProgress, unmaskedContext); - return nextChildren = fn(nextProps, context), reconcileChildren(current, workInProgress, nextChildren), - memoizeProps(workInProgress, nextProps), workInProgress.child; + return nextChildren = fn(nextProps, context), workInProgress.effectTag |= PerformedWork$1, + reconcileChildren(current, workInProgress, nextChildren), memoizeProps(workInProgress, nextProps), + workInProgress.child; } function updateClassComponent(current, workInProgress, priorityLevel) { var hasContext = pushContextProvider$1(workInProgress), shouldUpdate = void 0; - return null === current ? workInProgress.stateNode ? shouldUpdate = resumeMountClassInstance(workInProgress, priorityLevel) : (constructClassInstance(workInProgress, workInProgress.pendingProps), - mountClassInstance(workInProgress, priorityLevel), shouldUpdate = !0) : shouldUpdate = updateClassInstance(current, workInProgress, priorityLevel), + return null === current ? workInProgress.stateNode ? shouldUpdate = resumeMountClassInstance(workInProgress, priorityLevel) : (constructClassInstance(workInProgress, workInProgress.pendingProps), + mountClassInstance(workInProgress, priorityLevel), shouldUpdate = !0) : shouldUpdate = updateClassInstance(current, workInProgress, priorityLevel), finishClassComponent(current, workInProgress, shouldUpdate, hasContext); } function finishClassComponent(current, workInProgress, shouldUpdate, hasContext) { @@ -2200,92 +2200,94 @@ var reconcileChildFibers$1 = ChildReconciler(!0, !0), reconcileChildFibersInPlac var instance = workInProgress.stateNode; ReactCurrentOwner$2.current = workInProgress; var nextChildren = void 0; - return nextChildren = instance.render(), reconcileChildren(current, workInProgress, nextChildren), - memoizeState(workInProgress, instance.state), memoizeProps(workInProgress, instance.props), - hasContext && invalidateContextProvider$1(workInProgress), workInProgress.child; + return nextChildren = instance.render(), workInProgress.effectTag |= PerformedWork$1, + reconcileChildren(current, workInProgress, nextChildren), memoizeState(workInProgress, instance.state), + memoizeProps(workInProgress, instance.props), hasContext && invalidateContextProvider$1(workInProgress), + workInProgress.child; } function updateHostRoot(current, workInProgress, priorityLevel) { var root = workInProgress.stateNode; - root.pendingContext ? pushTopLevelContextObject$1(workInProgress, root.pendingContext, root.pendingContext !== root.context) : root.context && pushTopLevelContextObject$1(workInProgress, root.context, !1), + root.pendingContext ? pushTopLevelContextObject$1(workInProgress, root.pendingContext, root.pendingContext !== root.context) : root.context && pushTopLevelContextObject$1(workInProgress, root.context, !1), pushHostContainer(workInProgress, root.containerInfo); var updateQueue = workInProgress.updateQueue; if (null !== updateQueue) { var prevState = workInProgress.memoizedState, state = beginUpdateQueue$1(workInProgress, updateQueue, null, prevState, null, priorityLevel); if (prevState === state) return resetHydrationState(), bailoutOnAlreadyFinishedWork(current, workInProgress); var element = state.element; - return null !== current && null !== current.child || !enterHydrationState(workInProgress) ? (resetHydrationState(), - reconcileChildren(current, workInProgress, element), memoizeState(workInProgress, state), - workInProgress.child) : (workInProgress.effectTag |= Placement$2, workInProgress.child = mountChildFibersInPlace(workInProgress, workInProgress.child, element, priorityLevel), - markChildAsProgressed(current, workInProgress, priorityLevel), workInProgress.child); + return null !== current && null !== current.child || !enterHydrationState(workInProgress) ? (resetHydrationState(), + reconcileChildren(current, workInProgress, element)) : (workInProgress.effectTag |= Placement$2, + workInProgress.child = mountChildFibersInPlace(workInProgress, workInProgress.child, element, priorityLevel), + markChildAsProgressed(current, workInProgress, priorityLevel)), memoizeState(workInProgress, state), + workInProgress.child; } return resetHydrationState(), bailoutOnAlreadyFinishedWork(current, workInProgress); } function updateHostComponent(current, workInProgress) { pushHostContext(workInProgress), null === current && tryToClaimNextHydratableInstance(workInProgress); - var nextProps = workInProgress.pendingProps, prevProps = null !== current ? current.memoizedProps : null, memoizedProps = workInProgress.memoizedProps; + var nextProps = workInProgress.pendingProps, type = workInProgress.type, prevProps = null !== current ? current.memoizedProps : null, memoizedProps = workInProgress.memoizedProps; if (hasContextChanged$1()) null === nextProps && (nextProps = memoizedProps, invariant(null !== nextProps, "We should always have pending or current props. This error is " + "likely caused by a bug in React. Please file an issue.")); else if (null === nextProps || memoizedProps === nextProps) { - if (!useSyncScheduling && shouldDeprioritizeSubtree(workInProgress.type, memoizedProps) && workInProgress.pendingWorkPriority !== OffscreenPriority$1) { - for (var child = workInProgress.progressedChild; null !== child; ) child.pendingWorkPriority = OffscreenPriority$1, + if (!useSyncScheduling && shouldDeprioritizeSubtree(type, memoizedProps) && workInProgress.pendingWorkPriority !== OffscreenPriority$1) { + for (var child = workInProgress.progressedChild; null !== child; ) child.pendingWorkPriority = OffscreenPriority$1, child = child.sibling; return null; } return bailoutOnAlreadyFinishedWork(current, workInProgress); } var nextChildren = nextProps.children; - if (shouldSetTextContent(nextProps) ? nextChildren = null : prevProps && shouldSetTextContent(prevProps) && (workInProgress.effectTag |= ContentReset$1), + if (shouldSetTextContent(type, nextProps) ? nextChildren = null : prevProps && shouldSetTextContent(type, prevProps) && (workInProgress.effectTag |= ContentReset$1), markRef(current, workInProgress), !useSyncScheduling && shouldDeprioritizeSubtree(workInProgress.type, nextProps) && workInProgress.pendingWorkPriority !== OffscreenPriority$1) { - if (workInProgress.progressedPriority === OffscreenPriority$1 && (workInProgress.child = workInProgress.progressedChild), - reconcileChildrenAtPriority(current, workInProgress, nextChildren, OffscreenPriority$1), - memoizeProps(workInProgress, nextProps), workInProgress.child = null !== current ? current.child : null, - null === current) for (var _child = workInProgress.progressedChild; null !== _child; ) _child.effectTag = Placement$2, + if (workInProgress.progressedPriority === OffscreenPriority$1 && (workInProgress.child = workInProgress.progressedChild), + reconcileChildrenAtPriority(current, workInProgress, nextChildren, OffscreenPriority$1), + memoizeProps(workInProgress, nextProps), workInProgress.child = null !== current ? current.child : null, + null === current) for (var _child = workInProgress.progressedChild; null !== _child; ) _child.effectTag = Placement$2, _child = _child.sibling; return null; } - return reconcileChildren(current, workInProgress, nextChildren), memoizeProps(workInProgress, nextProps), + return reconcileChildren(current, workInProgress, nextChildren), memoizeProps(workInProgress, nextProps), workInProgress.child; } function updateHostText(current, workInProgress) { null === current && tryToClaimNextHydratableInstance(workInProgress); var nextProps = workInProgress.pendingProps; - return null === nextProps && (nextProps = workInProgress.memoizedProps), memoizeProps(workInProgress, nextProps), + return null === nextProps && (nextProps = workInProgress.memoizedProps), memoizeProps(workInProgress, nextProps), null; } function mountIndeterminateComponent(current, workInProgress, priorityLevel) { invariant(null === current, "An indeterminate component should never have mounted. This error is " + "likely caused by a bug in React. Please file an issue."); var value, fn = workInProgress.type, props = workInProgress.pendingProps, unmaskedContext = getUnmaskedContext$1(workInProgress), context = getMaskedContext$1(workInProgress, unmaskedContext); - if ("object" == typeof (value = fn(props, context)) && null !== value && "function" == typeof value.render) { + if (value = fn(props, context), workInProgress.effectTag |= PerformedWork$1, "object" == typeof value && null !== value && "function" == typeof value.render) { workInProgress.tag = ClassComponent$5; var hasContext = pushContextProvider$1(workInProgress); - return adoptClassInstance(workInProgress, value), mountClassInstance(workInProgress, priorityLevel), + return adoptClassInstance(workInProgress, value), mountClassInstance(workInProgress, priorityLevel), finishClassComponent(current, workInProgress, !0, hasContext); } - return workInProgress.tag = FunctionalComponent$1, reconcileChildren(current, workInProgress, value), + return workInProgress.tag = FunctionalComponent$1, reconcileChildren(current, workInProgress, value), memoizeProps(workInProgress, props), workInProgress.child; } function updateCoroutineComponent(current, workInProgress) { var nextCoroutine = workInProgress.pendingProps; - hasContextChanged$1() ? null === nextCoroutine && (nextCoroutine = current && current.memoizedProps, + hasContextChanged$1() ? null === nextCoroutine && (nextCoroutine = current && current.memoizedProps, invariant(null !== nextCoroutine, "We should always have pending or current props. This error is " + "likely caused by a bug in React. Please file an issue.")) : null !== nextCoroutine && workInProgress.memoizedProps !== nextCoroutine || (nextCoroutine = workInProgress.memoizedProps); var nextChildren = nextCoroutine.children, priorityLevel = workInProgress.pendingWorkPriority; - return workInProgress.memoizedProps = null, null === current ? workInProgress.stateNode = mountChildFibersInPlace(workInProgress, workInProgress.stateNode, nextChildren, priorityLevel) : current.child === workInProgress.child ? (clearDeletions(workInProgress), - workInProgress.stateNode = reconcileChildFibers(workInProgress, workInProgress.stateNode, nextChildren, priorityLevel), - transferDeletions(workInProgress)) : (workInProgress.stateNode = reconcileChildFibersInPlace(workInProgress, workInProgress.stateNode, nextChildren, priorityLevel), - transferDeletions(workInProgress)), memoizeProps(workInProgress, nextCoroutine), + return workInProgress.memoizedProps = null, null === current ? workInProgress.stateNode = mountChildFibersInPlace(workInProgress, workInProgress.stateNode, nextChildren, priorityLevel) : current.child === workInProgress.child ? (clearDeletions(workInProgress), + workInProgress.stateNode = reconcileChildFibers(workInProgress, workInProgress.stateNode, nextChildren, priorityLevel), + transferDeletions(workInProgress)) : (workInProgress.stateNode = reconcileChildFibersInPlace(workInProgress, workInProgress.stateNode, nextChildren, priorityLevel), + transferDeletions(workInProgress)), memoizeProps(workInProgress, nextCoroutine), workInProgress.stateNode; } function updatePortalComponent(current, workInProgress) { pushHostContainer(workInProgress, workInProgress.stateNode.containerInfo); var priorityLevel = workInProgress.pendingWorkPriority, nextChildren = workInProgress.pendingProps; - if (hasContextChanged$1()) null === nextChildren && (nextChildren = current && current.memoizedProps, + if (hasContextChanged$1()) null === nextChildren && (nextChildren = current && current.memoizedProps, invariant(null != nextChildren, "We should always have pending or current props. This error is " + "likely caused by a bug in React. Please file an issue.")); else if (null === nextChildren || workInProgress.memoizedProps === nextChildren) return bailoutOnAlreadyFinishedWork(current, workInProgress); - return null === current ? (workInProgress.child = reconcileChildFibersInPlace(workInProgress, workInProgress.child, nextChildren, priorityLevel), - memoizeProps(workInProgress, nextChildren), markChildAsProgressed(current, workInProgress, priorityLevel)) : (reconcileChildren(current, workInProgress, nextChildren), + return null === current ? (workInProgress.child = reconcileChildFibersInPlace(workInProgress, workInProgress.child, nextChildren, priorityLevel), + memoizeProps(workInProgress, nextChildren), markChildAsProgressed(current, workInProgress, priorityLevel)) : (reconcileChildren(current, workInProgress, nextChildren), memoizeProps(workInProgress, nextChildren)), workInProgress.child; } function bailoutOnAlreadyFinishedWork(current, workInProgress) { var priorityLevel = workInProgress.pendingWorkPriority; - return current && workInProgress.child === current.child && clearDeletions(workInProgress), - cloneChildFibers(current, workInProgress), markChildAsProgressed(current, workInProgress, priorityLevel), + return current && workInProgress.child === current.child && clearDeletions(workInProgress), + cloneChildFibers(current, workInProgress), markChildAsProgressed(current, workInProgress, priorityLevel), workInProgress.child; } function bailoutOnLowPriority(current, workInProgress) { @@ -2307,7 +2309,7 @@ var reconcileChildFibers$1 = ChildReconciler(!0, !0), reconcileChildFibersInPlac } function beginWork(current, workInProgress, priorityLevel) { if (workInProgress.pendingWorkPriority === NoWork$3 || workInProgress.pendingWorkPriority > priorityLevel) return bailoutOnLowPriority(current, workInProgress); - switch (workInProgress.firstEffect = null, workInProgress.lastEffect = null, workInProgress.progressedPriority === priorityLevel && (workInProgress.child = workInProgress.progressedChild), + switch (workInProgress.firstEffect = null, workInProgress.lastEffect = null, workInProgress.progressedPriority === priorityLevel && (workInProgress.child = workInProgress.progressedChild), workInProgress.tag) { case IndeterminateComponent$2: return mountIndeterminateComponent(current, workInProgress, priorityLevel); @@ -2321,7 +2323,7 @@ var reconcileChildFibers$1 = ChildReconciler(!0, !0), reconcileChildFibersInPlac case HostRoot$4: return updateHostRoot(current, workInProgress, priorityLevel); - case HostComponent$5: + case HostComponent$6: return updateHostComponent(current, workInProgress); case HostText$2: @@ -2347,12 +2349,12 @@ var reconcileChildFibers$1 = ChildReconciler(!0, !0), reconcileChildFibersInPlac } } function beginFailedWork(current, workInProgress, priorityLevel) { - if (invariant(workInProgress.tag === ClassComponent$5 || workInProgress.tag === HostRoot$4, "Invalid type of work. This error is likely caused by a bug in React. " + "Please file an issue."), + if (invariant(workInProgress.tag === ClassComponent$5 || workInProgress.tag === HostRoot$4, "Invalid type of work. This error is likely caused by a bug in React. " + "Please file an issue."), workInProgress.effectTag |= Err$1, workInProgress.pendingWorkPriority === NoWork$3 || workInProgress.pendingWorkPriority > priorityLevel) return bailoutOnLowPriority(current, workInProgress); - if (workInProgress.firstEffect = null, workInProgress.lastEffect = null, reconcileChildren(current, workInProgress, null), + if (workInProgress.firstEffect = null, workInProgress.lastEffect = null, reconcileChildren(current, workInProgress, null), workInProgress.tag === ClassComponent$5) { var instance = workInProgress.stateNode; - workInProgress.memoizedProps = instance.props, workInProgress.memoizedState = instance.state, + workInProgress.memoizedProps = instance.props, workInProgress.memoizedState = instance.state, workInProgress.pendingProps = null; } return workInProgress.child; @@ -2361,10 +2363,10 @@ var reconcileChildFibers$1 = ChildReconciler(!0, !0), reconcileChildFibersInPlac beginWork: beginWork, beginFailedWork: beginFailedWork }; -}, reconcileChildFibers$2 = ReactChildFiber.reconcileChildFibers, popContextProvider$2 = ReactFiberContext.popContextProvider, IndeterminateComponent$3 = ReactTypeOfWork.IndeterminateComponent, FunctionalComponent$3 = ReactTypeOfWork.FunctionalComponent, ClassComponent$7 = ReactTypeOfWork.ClassComponent, HostRoot$5 = ReactTypeOfWork.HostRoot, HostComponent$6 = ReactTypeOfWork.HostComponent, HostText$4 = ReactTypeOfWork.HostText, HostPortal$4 = ReactTypeOfWork.HostPortal, CoroutineComponent$3 = ReactTypeOfWork.CoroutineComponent, CoroutineHandlerPhase$1 = ReactTypeOfWork.CoroutineHandlerPhase, YieldComponent$3 = ReactTypeOfWork.YieldComponent, Fragment$3 = ReactTypeOfWork.Fragment, Placement$4 = ReactTypeOfSideEffect.Placement, Ref$2 = ReactTypeOfSideEffect.Ref, Update$2 = ReactTypeOfSideEffect.Update, ReactFiberCompleteWork = function(config, hostContext, hydrationContext) { - var createInstance = config.createInstance, createTextInstance = config.createTextInstance, appendInitialChild = config.appendInitialChild, finalizeInitialChildren = config.finalizeInitialChildren, prepareUpdate = config.prepareUpdate, getRootHostContainer = hostContext.getRootHostContainer, popHostContext = hostContext.popHostContext, getHostContext = hostContext.getHostContext, popHostContainer = hostContext.popHostContainer, hydrateHostInstance = hydrationContext.hydrateHostInstance, hydrateHostTextInstance = hydrationContext.hydrateHostTextInstance, popHydrationState = hydrationContext.popHydrationState; +}, reconcileChildFibers$2 = ReactChildFiber.reconcileChildFibers, popContextProvider$2 = ReactFiberContext.popContextProvider, IndeterminateComponent$3 = ReactTypeOfWork.IndeterminateComponent, FunctionalComponent$3 = ReactTypeOfWork.FunctionalComponent, ClassComponent$7 = ReactTypeOfWork.ClassComponent, HostRoot$5 = ReactTypeOfWork.HostRoot, HostComponent$7 = ReactTypeOfWork.HostComponent, HostText$4 = ReactTypeOfWork.HostText, HostPortal$4 = ReactTypeOfWork.HostPortal, CoroutineComponent$3 = ReactTypeOfWork.CoroutineComponent, CoroutineHandlerPhase$1 = ReactTypeOfWork.CoroutineHandlerPhase, YieldComponent$3 = ReactTypeOfWork.YieldComponent, Fragment$3 = ReactTypeOfWork.Fragment, Placement$4 = ReactTypeOfSideEffect.Placement, Ref$2 = ReactTypeOfSideEffect.Ref, Update$2 = ReactTypeOfSideEffect.Update, ReactFiberCompleteWork = function(config, hostContext, hydrationContext) { + var createInstance = config.createInstance, createTextInstance = config.createTextInstance, appendInitialChild = config.appendInitialChild, finalizeInitialChildren = config.finalizeInitialChildren, prepareUpdate = config.prepareUpdate, getRootHostContainer = hostContext.getRootHostContainer, popHostContext = hostContext.popHostContext, getHostContext = hostContext.getHostContext, popHostContainer = hostContext.popHostContainer, prepareToHydrateHostInstance = hydrationContext.prepareToHydrateHostInstance, prepareToHydrateHostTextInstance = hydrationContext.prepareToHydrateHostTextInstance, popHydrationState = hydrationContext.popHydrationState; function markChildAsProgressed(current, workInProgress, priorityLevel) { - workInProgress.progressedChild = workInProgress.child, workInProgress.progressedPriority = priorityLevel, + workInProgress.progressedChild = workInProgress.child, workInProgress.progressedPriority = priorityLevel, null !== current && (current.progressedChild = workInProgress.progressedChild, current.progressedPriority = workInProgress.progressedPriority); } function markUpdate(workInProgress) { @@ -2376,7 +2378,7 @@ var reconcileChildFibers$1 = ChildReconciler(!0, !0), reconcileChildFibersInPlac function appendAllYields(yields, workInProgress) { var node = workInProgress.stateNode; for (node && (node.return = workInProgress); null !== node; ) { - if (node.tag === HostComponent$6 || node.tag === HostText$4 || node.tag === HostPortal$4) invariant(!1, "A coroutine cannot have host component children."); else if (node.tag === YieldComponent$3) yields.push(node.type); else if (null !== node.child) { + if (node.tag === HostComponent$7 || node.tag === HostText$4 || node.tag === HostPortal$4) invariant(!1, "A coroutine cannot have host component children."); else if (node.tag === YieldComponent$3) yields.push(node.type); else if (null !== node.child) { node.child.return = node, node = node.child; continue; } @@ -2389,17 +2391,17 @@ var reconcileChildFibers$1 = ChildReconciler(!0, !0), reconcileChildFibersInPlac } function moveCoroutineToHandlerPhase(current, workInProgress) { var coroutine = workInProgress.memoizedProps; - invariant(coroutine, "Should be resolved by now. This error is likely caused by a bug in " + "React. Please file an issue."), + invariant(coroutine, "Should be resolved by now. This error is likely caused by a bug in " + "React. Please file an issue."), workInProgress.tag = CoroutineHandlerPhase$1; var yields = []; appendAllYields(yields, workInProgress); var fn = coroutine.handler, props = coroutine.props, nextChildren = fn(props, yields), currentFirstChild = null !== current ? current.child : null, priority = workInProgress.pendingWorkPriority; - return workInProgress.child = reconcileChildFibers$2(workInProgress, currentFirstChild, nextChildren, priority), + return workInProgress.child = reconcileChildFibers$2(workInProgress, currentFirstChild, nextChildren, priority), markChildAsProgressed(current, workInProgress, priority), workInProgress.child; } function appendAllChildren(parent, workInProgress) { for (var node = workInProgress.child; null !== node; ) { - if (node.tag === HostComponent$6 || node.tag === HostText$4) appendInitialChild(parent, node.stateNode); else if (node.tag === HostPortal$4) ; else if (null !== node.child) { + if (node.tag === HostComponent$7 || node.tag === HostText$4) appendInitialChild(parent, node.stateNode); else if (node.tag === HostPortal$4) ; else if (null !== node.child) { node = node.child; continue; } @@ -2421,24 +2423,27 @@ var reconcileChildFibers$1 = ChildReconciler(!0, !0), reconcileChildFibersInPlac case HostRoot$5: var fiberRoot = workInProgress.stateNode; - return fiberRoot.pendingContext && (fiberRoot.context = fiberRoot.pendingContext, - fiberRoot.pendingContext = null), null !== current && null !== current.child || (popHydrationState(workInProgress), + return fiberRoot.pendingContext && (fiberRoot.context = fiberRoot.pendingContext, + fiberRoot.pendingContext = null), null !== current && null !== current.child || (popHydrationState(workInProgress), workInProgress.effectTag &= ~Placement$4), null; - case HostComponent$6: + case HostComponent$7: popHostContext(workInProgress); var rootContainerInstance = getRootHostContainer(), type = workInProgress.type, newProps = workInProgress.memoizedProps; if (null !== current && null != workInProgress.stateNode) { var oldProps = current.memoizedProps, instance = workInProgress.stateNode, currentHostContext = getHostContext(), updatePayload = prepareUpdate(instance, type, oldProps, newProps, rootContainerInstance, currentHostContext); - workInProgress.updateQueue = updatePayload, updatePayload && markUpdate(workInProgress), + workInProgress.updateQueue = updatePayload, updatePayload && markUpdate(workInProgress), current.ref !== workInProgress.ref && markRef(workInProgress); } else { - if (!newProps) return invariant(null !== workInProgress.stateNode, "We must have new props for new mounts. This error is likely " + "caused by a bug in React. Please file an issue."), + if (!newProps) return invariant(null !== workInProgress.stateNode, "We must have new props for new mounts. This error is likely " + "caused by a bug in React. Please file an issue."), null; - var _currentHostContext = getHostContext(), _instance = void 0; - popHydrationState(workInProgress) ? _instance = hydrateHostInstance(workInProgress, rootContainerInstance) : (_instance = createInstance(type, newProps, rootContainerInstance, _currentHostContext, workInProgress), - appendAllChildren(_instance, workInProgress), finalizeInitialChildren(_instance, type, newProps, rootContainerInstance) && markUpdate(workInProgress)), - workInProgress.stateNode = _instance, null !== workInProgress.ref && markRef(workInProgress); + var _currentHostContext = getHostContext(); + if (popHydrationState(workInProgress)) prepareToHydrateHostInstance(workInProgress, rootContainerInstance) && markUpdate(workInProgress); else { + var _instance = createInstance(type, newProps, rootContainerInstance, _currentHostContext, workInProgress); + appendAllChildren(_instance, workInProgress), finalizeInitialChildren(_instance, type, newProps, rootContainerInstance) && markUpdate(workInProgress), + workInProgress.stateNode = _instance; + } + null !== workInProgress.ref && markRef(workInProgress); } return null; @@ -2447,11 +2452,10 @@ var reconcileChildFibers$1 = ChildReconciler(!0, !0), reconcileChildFibersInPlac if (current && null != workInProgress.stateNode) { current.memoizedProps !== newText && markUpdate(workInProgress); } else { - if ("string" != typeof newText) return invariant(null !== workInProgress.stateNode, "We must have new props for new mounts. This error is likely " + "caused by a bug in React. Please file an issue."), + if ("string" != typeof newText) return invariant(null !== workInProgress.stateNode, "We must have new props for new mounts. This error is likely " + "caused by a bug in React. Please file an issue."), null; - var _rootContainerInstance = getRootHostContainer(), _currentHostContext2 = getHostContext(), textInstance = void 0; - textInstance = popHydrationState(workInProgress) ? hydrateHostTextInstance(workInProgress, _rootContainerInstance) : createTextInstance(newText, _rootContainerInstance, _currentHostContext2, workInProgress), - workInProgress.stateNode = textInstance; + var _rootContainerInstance = getRootHostContainer(), _currentHostContext2 = getHostContext(); + popHydrationState(workInProgress) ? prepareToHydrateHostTextInstance(workInProgress) && markUpdate(workInProgress) : workInProgress.stateNode = createTextInstance(newText, _rootContainerInstance, _currentHostContext2, workInProgress); } return null; @@ -2499,7 +2503,7 @@ var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCo injectInternals: injectInternals_1, onCommitRoot: onCommitRoot_1, onCommitUnmount: onCommitUnmount_1 -}, ClassComponent$8 = ReactTypeOfWork.ClassComponent, HostRoot$6 = ReactTypeOfWork.HostRoot, HostComponent$7 = ReactTypeOfWork.HostComponent, HostText$5 = ReactTypeOfWork.HostText, HostPortal$5 = ReactTypeOfWork.HostPortal, CoroutineComponent$4 = ReactTypeOfWork.CoroutineComponent, commitCallbacks$1 = ReactFiberUpdateQueue.commitCallbacks, onCommitUnmount = ReactFiberDevToolsHook.onCommitUnmount, Placement$5 = ReactTypeOfSideEffect.Placement, Update$3 = ReactTypeOfSideEffect.Update, Callback$1 = ReactTypeOfSideEffect.Callback, ContentReset$2 = ReactTypeOfSideEffect.ContentReset, ReactFiberCommitWork = function(config, captureError) { +}, ClassComponent$8 = ReactTypeOfWork.ClassComponent, HostRoot$6 = ReactTypeOfWork.HostRoot, HostComponent$8 = ReactTypeOfWork.HostComponent, HostText$5 = ReactTypeOfWork.HostText, HostPortal$5 = ReactTypeOfWork.HostPortal, CoroutineComponent$4 = ReactTypeOfWork.CoroutineComponent, commitCallbacks$1 = ReactFiberUpdateQueue.commitCallbacks, onCommitUnmount = ReactFiberDevToolsHook.onCommitUnmount, Placement$5 = ReactTypeOfSideEffect.Placement, Update$3 = ReactTypeOfSideEffect.Update, Callback$1 = ReactTypeOfSideEffect.Callback, ContentReset$2 = ReactTypeOfSideEffect.ContentReset, ReactFiberCommitWork = function(config, captureError) { var commitMount = config.commitMount, commitUpdate = config.commitUpdate, resetTextContent = config.resetTextContent, commitTextUpdate = config.commitTextUpdate, appendChild = config.appendChild, insertBefore = config.insertBefore, removeChild = config.removeChild, getPublicInstance = config.getPublicInstance; function safelyCallComponentWillUnmount(current, instance) { try { @@ -2521,7 +2525,7 @@ var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCo function getHostParent(fiber) { for (var parent = fiber.return; null !== parent; ) { switch (parent.tag) { - case HostComponent$7: + case HostComponent$8: return parent.stateNode; case HostRoot$6: @@ -2540,7 +2544,7 @@ var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCo invariant(!1, "Expected to find a host parent. This error is likely caused by a bug " + "in React. Please file an issue."); } function isHostParent(fiber) { - return fiber.tag === HostComponent$7 || fiber.tag === HostRoot$6 || fiber.tag === HostPortal$5; + return fiber.tag === HostComponent$8 || fiber.tag === HostRoot$6 || fiber.tag === HostPortal$5; } function getHostSibling(fiber) { var node = fiber; @@ -2549,7 +2553,7 @@ var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCo if (null === node.return || isHostParent(node.return)) return null; node = node.return; } - for (node.sibling.return = node.return, node = node.sibling; node.tag !== HostComponent$7 && node.tag !== HostText$5; ) { + for (node.sibling.return = node.return, node = node.sibling; node.tag !== HostComponent$8 && node.tag !== HostText$5; ) { if (node.effectTag & Placement$5) continue siblings; if (null === node.child || node.tag === HostPortal$5) continue siblings; node.child.return = node, node = node.child; @@ -2560,7 +2564,7 @@ var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCo function commitPlacement(finishedWork) { var parentFiber = getHostParentFiber(finishedWork), parent = void 0; switch (parentFiber.tag) { - case HostComponent$7: + case HostComponent$8: parent = parentFiber.stateNode; break; @@ -2574,7 +2578,7 @@ var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCo } parentFiber.effectTag & ContentReset$2 && (resetTextContent(parent), parentFiber.effectTag &= ~ContentReset$2); for (var before = getHostSibling(finishedWork), node = finishedWork; !0; ) { - if (node.tag === HostComponent$7 || node.tag === HostText$5) before ? insertBefore(parent, node.stateNode, before) : appendChild(parent, node.stateNode); else if (node.tag === HostPortal$5) ; else if (null !== node.child) { + if (node.tag === HostComponent$8 || node.tag === HostText$5) before ? insertBefore(parent, node.stateNode, before) : appendChild(parent, node.stateNode); else if (node.tag === HostPortal$5) ; else if (null !== node.child) { node.child.return = node, node = node.child; continue; } @@ -2598,7 +2602,7 @@ var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCo } function unmountHostComponents(parent, current) { for (var node = current; !0; ) { - if (node.tag === HostComponent$7 || node.tag === HostText$5) commitNestedUnmounts(node), + if (node.tag === HostComponent$8 || node.tag === HostText$5) commitNestedUnmounts(node), removeChild(parent, node.stateNode); else if (node.tag === HostPortal$5) { if (parent = node.stateNode.containerInfo, null !== node.child) { node.child.return = node, node = node.child; @@ -2617,7 +2621,7 @@ var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCo } } function commitDeletion(current) { - unmountHostComponents(getHostParent(current), current), current.return = null, current.child = null, + unmountHostComponents(getHostParent(current), current), current.return = null, current.child = null, current.alternate && (current.alternate.child = null, current.alternate.return = null); } function commitUnmount(current) { @@ -2627,7 +2631,7 @@ var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCo var instance = current.stateNode; return void ("function" == typeof instance.componentWillUnmount && safelyCallComponentWillUnmount(current, instance)); - case HostComponent$7: + case HostComponent$8: return void safelyDetachRef(current); case CoroutineComponent$4: @@ -2642,17 +2646,17 @@ var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCo case ClassComponent$8: return; - case HostComponent$7: + case HostComponent$8: var instance = finishedWork.stateNode; - if (null != instance && null !== current) { - var newProps = finishedWork.memoizedProps, oldProps = current.memoizedProps, type = finishedWork.type, updatePayload = finishedWork.updateQueue; + if (null != instance) { + var newProps = finishedWork.memoizedProps, oldProps = null !== current ? current.memoizedProps : newProps, type = finishedWork.type, updatePayload = finishedWork.updateQueue; finishedWork.updateQueue = null, null !== updatePayload && commitUpdate(instance, updatePayload, type, oldProps, newProps, finishedWork); } return; case HostText$5: - invariant(null !== finishedWork.stateNode && null !== current, "This should only be done during updates. This error is likely " + "caused by a bug in React. Please file an issue."); - var textInstance = finishedWork.stateNode, newText = finishedWork.memoizedProps, oldText = current.memoizedProps; + invariant(null !== finishedWork.stateNode, "This should have a text node initialized. This error is likely " + "caused by a bug in React. Please file an issue."); + var textInstance = finishedWork.stateNode, newText = finishedWork.memoizedProps, oldText = null !== current ? current.memoizedProps : newText; return void commitTextUpdate(textInstance, oldText, newText); case HostRoot$6: @@ -2681,7 +2685,7 @@ var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCo } return; - case HostComponent$7: + case HostComponent$8: var _instance2 = finishedWork.stateNode; if (null === current && finishedWork.effectTag & Update$3) { var type = finishedWork.type, props = finishedWork.memoizedProps; @@ -2700,7 +2704,15 @@ var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCo function commitAttachRef(finishedWork) { var ref = finishedWork.ref; if (null !== ref) { - ref(getPublicInstance(finishedWork.stateNode)); + var instance = finishedWork.stateNode; + switch (finishedWork.tag) { + case HostComponent$8: + ref(getPublicInstance(instance)); + break; + + default: + ref(instance); + } } } function commitDetachRef(current) { @@ -2718,7 +2730,7 @@ var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCo }, createCursor$2 = ReactFiberStack.createCursor, pop$2 = ReactFiberStack.pop, push$2 = ReactFiberStack.push, NO_CONTEXT = {}, ReactFiberHostContext = function(config) { var getChildHostContext = config.getChildHostContext, getRootHostContext = config.getRootHostContext, contextStackCursor = createCursor$2(NO_CONTEXT), contextFiberStackCursor = createCursor$2(NO_CONTEXT), rootInstanceStackCursor = createCursor$2(NO_CONTEXT); function requiredContext(c) { - return invariant(c !== NO_CONTEXT, "Expected host context to exist. This error is likely caused by a bug " + "in React. Please file an issue."), + return invariant(c !== NO_CONTEXT, "Expected host context to exist. This error is likely caused by a bug " + "in React. Please file an issue."), c; } function getRootHostContainer() { @@ -2740,7 +2752,7 @@ var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCo context !== nextContext && (push$2(contextFiberStackCursor, fiber, fiber), push$2(contextStackCursor, nextContext, fiber)); } function popHostContext(fiber) { - contextFiberStackCursor.current === fiber && (pop$2(contextStackCursor, fiber), + contextFiberStackCursor.current === fiber && (pop$2(contextStackCursor, fiber), pop$2(contextFiberStackCursor, fiber)); } function resetHostContainer() { @@ -2755,7 +2767,7 @@ var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCo pushHostContext: pushHostContext, resetHostContainer: resetHostContainer }; -}, HostComponent$8 = ReactTypeOfWork.HostComponent, HostRoot$7 = ReactTypeOfWork.HostRoot, Deletion$2 = ReactTypeOfSideEffect.Deletion, Placement$6 = ReactTypeOfSideEffect.Placement, createFiberFromHostInstanceForDeletion$1 = ReactFiber.createFiberFromHostInstanceForDeletion, ReactFiberHydrationContext = function(config) { +}, HostComponent$9 = ReactTypeOfWork.HostComponent, HostText$6 = ReactTypeOfWork.HostText, HostRoot$7 = ReactTypeOfWork.HostRoot, Deletion$2 = ReactTypeOfSideEffect.Deletion, Placement$6 = ReactTypeOfSideEffect.Placement, createFiberFromHostInstanceForDeletion$1 = ReactFiber.createFiberFromHostInstanceForDeletion, ReactFiberHydrationContext = function(config) { var shouldSetTextContent = config.shouldSetTextContent, canHydrateInstance = config.canHydrateInstance, canHydrateTextInstance = config.canHydrateTextInstance, getNextHydratableSibling = config.getNextHydratableSibling, getFirstHydratableChild = config.getFirstHydratableChild, hydrateInstance = config.hydrateInstance, hydrateTextInstance = config.hydrateTextInstance; if (!(canHydrateInstance && canHydrateTextInstance && getNextHydratableSibling && getFirstHydratableChild && hydrateInstance && hydrateTextInstance)) return { enterHydrationState: function() { @@ -2763,10 +2775,10 @@ var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCo }, resetHydrationState: function() {}, tryToClaimNextHydratableInstance: function() {}, - hydrateHostInstance: function() { + prepareToHydrateHostInstance: function() { invariant(!1, "React bug."); }, - hydrateHostTextInstance: function() { + prepareToHydrateHostTextInstance: function() { invariant(!1, "React bug."); }, popHydrationState: function(fiber) { @@ -2776,49 +2788,59 @@ var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCo var hydrationParentFiber = null, nextHydratableInstance = null, isHydrating = !1; function enterHydrationState(fiber) { var parentInstance = fiber.stateNode.containerInfo; - return nextHydratableInstance = getFirstHydratableChild(parentInstance), hydrationParentFiber = fiber, + return nextHydratableInstance = getFirstHydratableChild(parentInstance), hydrationParentFiber = fiber, isHydrating = !0, !0; } function deleteHydratableInstance(returnFiber, instance) { var childToDelete = createFiberFromHostInstanceForDeletion$1(); - childToDelete.stateNode = instance, childToDelete.return = returnFiber; - var last = returnFiber.progressedLastDeletion; - null !== last ? (last.nextEffect = childToDelete, returnFiber.progressedLastDeletion = childToDelete) : returnFiber.progressedFirstDeletion = returnFiber.progressedLastDeletion = childToDelete, - childToDelete.effectTag = Deletion$2, null !== returnFiber.lastEffect ? (returnFiber.lastEffect.nextEffect = childToDelete, + childToDelete.stateNode = instance, childToDelete.return = returnFiber, childToDelete.effectTag = Deletion$2, + null !== returnFiber.lastEffect ? (returnFiber.lastEffect.nextEffect = childToDelete, returnFiber.lastEffect = childToDelete) : returnFiber.firstEffect = returnFiber.lastEffect = childToDelete; } + function canHydrate(fiber, nextInstance) { + switch (fiber.tag) { + case HostComponent$9: + var type = fiber.type, props = fiber.memoizedProps; + return canHydrateInstance(nextInstance, type, props); + + case HostText$6: + return canHydrateTextInstance(nextInstance); + + default: + return !1; + } + } function tryToClaimNextHydratableInstance(fiber) { if (isHydrating) { var nextInstance = nextHydratableInstance; if (!nextInstance) return fiber.effectTag |= Placement$6, isHydrating = !1, void (hydrationParentFiber = fiber); - var type = fiber.type, props = fiber.memoizedProps; - if (!canHydrateInstance(nextInstance, type, props)) { - if (!(nextInstance = getNextHydratableSibling(nextInstance)) || !canHydrateInstance(nextInstance, type, props)) return fiber.effectTag |= Placement$6, + if (!canHydrate(fiber, nextInstance)) { + if (!(nextInstance = getNextHydratableSibling(nextInstance)) || !canHydrate(fiber, nextInstance)) return fiber.effectTag |= Placement$6, isHydrating = !1, void (hydrationParentFiber = fiber); deleteHydratableInstance(hydrationParentFiber, nextHydratableInstance); } fiber.stateNode = nextInstance, hydrationParentFiber = fiber, nextHydratableInstance = getFirstHydratableChild(nextInstance); } } - function hydrateHostInstance(fiber, rootContainerInstance) { - var instance = fiber.stateNode; - return hydrateInstance(instance, fiber.type, fiber.memoizedProps, rootContainerInstance, fiber), - instance; + function prepareToHydrateHostInstance(fiber, rootContainerInstance) { + var instance = fiber.stateNode, updatePayload = hydrateInstance(instance, fiber.type, fiber.memoizedProps, rootContainerInstance, fiber); + return fiber.updateQueue = updatePayload, null !== updatePayload; } - function hydrateHostTextInstance(fiber) { + function prepareToHydrateHostTextInstance(fiber) { var textInstance = fiber.stateNode; - return hydrateTextInstance(textInstance, fiber), textInstance; + return hydrateTextInstance(textInstance, fiber.memoizedProps, fiber); } function popToNextHostParent(fiber) { - for (var parent = fiber.return; null !== parent && parent.tag !== HostComponent$8 && parent.tag !== HostRoot$7; ) parent = parent.return; + for (var parent = fiber.return; null !== parent && parent.tag !== HostComponent$9 && parent.tag !== HostRoot$7; ) parent = parent.return; hydrationParentFiber = parent; } function popHydrationState(fiber) { if (fiber !== hydrationParentFiber) return !1; if (!isHydrating) return popToNextHostParent(fiber), isHydrating = !0, !1; - if (fiber.tag !== HostComponent$8 || "head" !== fiber.type && "body" !== fiber.type && !shouldSetTextContent(fiber.memoizedProps)) for (var nextInstance = nextHydratableInstance; nextInstance; ) deleteHydratableInstance(fiber, nextInstance), + var type = fiber.type; + if (fiber.tag !== HostComponent$9 || "head" !== type && "body" !== type && !shouldSetTextContent(type, fiber.memoizedProps)) for (var nextInstance = nextHydratableInstance; nextInstance; ) deleteHydratableInstance(fiber, nextInstance), nextInstance = getNextHydratableSibling(nextInstance); - return popToNextHostParent(fiber), nextHydratableInstance = hydrationParentFiber ? getNextHydratableSibling(fiber.stateNode) : null, + return popToNextHostParent(fiber), nextHydratableInstance = hydrationParentFiber ? getNextHydratableSibling(fiber.stateNode) : null, !0; } function resetHydrationState() { @@ -2828,11 +2850,11 @@ var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCo enterHydrationState: enterHydrationState, resetHydrationState: resetHydrationState, tryToClaimNextHydratableInstance: tryToClaimNextHydratableInstance, - hydrateHostInstance: hydrateHostInstance, - hydrateHostTextInstance: hydrateHostTextInstance, + prepareToHydrateHostInstance: prepareToHydrateHostInstance, + prepareToHydrateHostTextInstance: prepareToHydrateHostTextInstance, popHydrationState: popHydrationState }; -}, popContextProvider$1 = ReactFiberContext.popContextProvider, reset$1 = ReactFiberStack.reset, getStackAddendumByWorkInProgressFiber = ReactFiberComponentTreeHook.getStackAddendumByWorkInProgressFiber, logCapturedError$1 = ReactFiberErrorLogger.logCapturedError, ReactCurrentOwner$1 = ReactGlobalSharedState_1.ReactCurrentOwner, cloneFiber$1 = ReactFiber.cloneFiber, onCommitRoot = ReactFiberDevToolsHook.onCommitRoot, NoWork$2 = ReactPriorityLevel.NoWork, SynchronousPriority$1 = ReactPriorityLevel.SynchronousPriority, TaskPriority$1 = ReactPriorityLevel.TaskPriority, AnimationPriority = ReactPriorityLevel.AnimationPriority, HighPriority = ReactPriorityLevel.HighPriority, LowPriority = ReactPriorityLevel.LowPriority, OffscreenPriority = ReactPriorityLevel.OffscreenPriority, AsyncUpdates = ReactTypeOfInternalContext.AsyncUpdates, NoEffect$2 = ReactTypeOfSideEffect.NoEffect, Placement$1 = ReactTypeOfSideEffect.Placement, Update = ReactTypeOfSideEffect.Update, PlacementAndUpdate = ReactTypeOfSideEffect.PlacementAndUpdate, Deletion = ReactTypeOfSideEffect.Deletion, ContentReset = ReactTypeOfSideEffect.ContentReset, Callback = ReactTypeOfSideEffect.Callback, Err = ReactTypeOfSideEffect.Err, Ref = ReactTypeOfSideEffect.Ref, HostRoot$3 = ReactTypeOfWork.HostRoot, HostComponent$3 = ReactTypeOfWork.HostComponent, HostPortal$1 = ReactTypeOfWork.HostPortal, ClassComponent$3 = ReactTypeOfWork.ClassComponent, getPendingPriority$1 = ReactFiberUpdateQueue.getPendingPriority, _require14 = ReactFiberContext, resetContext$1 = _require14.resetContext, ReactFiberInstrumentation$1, timeHeuristicForUnitOfWork = 1, ReactFiberScheduler = function(config) { +}, popContextProvider$1 = ReactFiberContext.popContextProvider, reset$1 = ReactFiberStack.reset, getStackAddendumByWorkInProgressFiber = ReactFiberComponentTreeHook.getStackAddendumByWorkInProgressFiber, logCapturedError$1 = ReactFiberErrorLogger.logCapturedError, ReactCurrentOwner$1 = ReactGlobalSharedState_1.ReactCurrentOwner, cloneFiber$1 = ReactFiber.cloneFiber, onCommitRoot = ReactFiberDevToolsHook.onCommitRoot, NoWork$2 = ReactPriorityLevel.NoWork, SynchronousPriority$1 = ReactPriorityLevel.SynchronousPriority, TaskPriority$1 = ReactPriorityLevel.TaskPriority, AnimationPriority = ReactPriorityLevel.AnimationPriority, HighPriority = ReactPriorityLevel.HighPriority, LowPriority = ReactPriorityLevel.LowPriority, OffscreenPriority = ReactPriorityLevel.OffscreenPriority, AsyncUpdates = ReactTypeOfInternalContext.AsyncUpdates, PerformedWork = ReactTypeOfSideEffect.PerformedWork, Placement$1 = ReactTypeOfSideEffect.Placement, Update = ReactTypeOfSideEffect.Update, PlacementAndUpdate = ReactTypeOfSideEffect.PlacementAndUpdate, Deletion = ReactTypeOfSideEffect.Deletion, ContentReset = ReactTypeOfSideEffect.ContentReset, Callback = ReactTypeOfSideEffect.Callback, Err = ReactTypeOfSideEffect.Err, Ref = ReactTypeOfSideEffect.Ref, HostRoot$3 = ReactTypeOfWork.HostRoot, HostComponent$4 = ReactTypeOfWork.HostComponent, HostPortal$1 = ReactTypeOfWork.HostPortal, ClassComponent$3 = ReactTypeOfWork.ClassComponent, getPendingPriority$1 = ReactFiberUpdateQueue.getPendingPriority, _require14 = ReactFiberContext, resetContext$1 = _require14.resetContext, ReactFiberInstrumentation$1, timeHeuristicForUnitOfWork = 1, ReactFiberScheduler = function(config) { var hostContext = ReactFiberHostContext(config), hydrationContext = ReactFiberHydrationContext(config), popHostContainer = hostContext.popHostContainer, popHostContext = hostContext.popHostContext, resetHostContainer = hostContext.resetHostContainer, _ReactFiberBeginWork = ReactFiberBeginWork(config, hostContext, hydrationContext, scheduleUpdate, getPriorityContext), beginWork = _ReactFiberBeginWork.beginWork, beginFailedWork = _ReactFiberBeginWork.beginFailedWork, _ReactFiberCompleteWo = ReactFiberCompleteWork(config, hostContext, hydrationContext), completeWork = _ReactFiberCompleteWo.completeWork, _ReactFiberCommitWork = ReactFiberCommitWork(config, captureError), commitPlacement = _ReactFiberCommitWork.commitPlacement, commitDeletion = _ReactFiberCommitWork.commitDeletion, commitWork = _ReactFiberCommitWork.commitWork, commitLifeCycles = _ReactFiberCommitWork.commitLifeCycles, commitAttachRef = _ReactFiberCommitWork.commitAttachRef, commitDetachRef = _ReactFiberCommitWork.commitDetachRef, hostScheduleAnimationCallback = config.scheduleAnimationCallback, hostScheduleDeferredCallback = config.scheduleDeferredCallback, useSyncScheduling = config.useSyncScheduling, prepareForCommit = config.prepareForCommit, resetAfterCommit = config.resetAfterCommit, priorityContext = NoWork$2, priorityContextBeforeReconciliation = NoWork$2, isPerformingWork = !1, deadlineHasExpired = !1, isBatchingUpdates = !1, nextUnitOfWork = null, nextPriorityLevel = NoWork$2, nextEffect = null, pendingCommit = null, nextScheduledRoot = null, lastScheduledRoot = null, isAnimationCallbackScheduled = !1, isDeferredCallbackScheduled = !1, capturedErrors = null, failedBoundaries = null, commitPhaseBoundaries = null, firstUncaughtError = null, fatalError = null, isCommitting = !1, isUnmounting = !1; function scheduleAnimationCallback(callback) { isAnimationCallbackScheduled || (isAnimationCallbackScheduled = !0, hostScheduleAnimationCallback(callback)); @@ -2847,14 +2869,14 @@ var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCo for (;null !== nextScheduledRoot && nextScheduledRoot.current.pendingWorkPriority === NoWork$2; ) { nextScheduledRoot.isScheduled = !1; var next = nextScheduledRoot.nextScheduledRoot; - if (nextScheduledRoot.nextScheduledRoot = null, nextScheduledRoot === lastScheduledRoot) return nextScheduledRoot = null, + if (nextScheduledRoot.nextScheduledRoot = null, nextScheduledRoot === lastScheduledRoot) return nextScheduledRoot = null, lastScheduledRoot = null, nextPriorityLevel = NoWork$2, null; nextScheduledRoot = next; } - for (var root = nextScheduledRoot, highestPriorityRoot = null, highestPriorityLevel = NoWork$2; null !== root; ) root.current.pendingWorkPriority !== NoWork$2 && (highestPriorityLevel === NoWork$2 || highestPriorityLevel > root.current.pendingWorkPriority) && (highestPriorityLevel = root.current.pendingWorkPriority, + for (var root = nextScheduledRoot, highestPriorityRoot = null, highestPriorityLevel = NoWork$2; null !== root; ) root.current.pendingWorkPriority !== NoWork$2 && (highestPriorityLevel === NoWork$2 || highestPriorityLevel > root.current.pendingWorkPriority) && (highestPriorityLevel = root.current.pendingWorkPriority, highestPriorityRoot = root), root = root.nextScheduledRoot; - return null !== highestPriorityRoot ? (nextPriorityLevel = highestPriorityLevel, - priorityContext = nextPriorityLevel, resetContextStack(), cloneFiber$1(highestPriorityRoot.current, highestPriorityLevel)) : (nextPriorityLevel = NoWork$2, + return null !== highestPriorityRoot ? (nextPriorityLevel = highestPriorityLevel, + priorityContext = nextPriorityLevel, resetContextStack(), cloneFiber$1(highestPriorityRoot.current, highestPriorityLevel)) : (nextPriorityLevel = NoWork$2, null); } function commitAllHostEffects() { @@ -2864,7 +2886,7 @@ var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCo var current = nextEffect.alternate; null !== current && commitDetachRef(current); } - switch (effectTag & ~(Callback | Err | ContentReset | Ref)) { + switch (effectTag & ~(Callback | Err | ContentReset | Ref | PerformedWork)) { case Placement$1: commitPlacement(nextEffect), nextEffect.effectTag &= ~Placement$1; break; @@ -2901,57 +2923,60 @@ var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCo function commitAllWork(finishedWork) { isCommitting = !0, pendingCommit = null; var root = finishedWork.stateNode; - invariant(root.current !== finishedWork, "Cannot commit the same tree as before. This is probably a bug " + "related to the return field. This error is likely caused by a bug " + "in React. Please file an issue."), + invariant(root.current !== finishedWork, "Cannot commit the same tree as before. This is probably a bug " + "related to the return field. This error is likely caused by a bug " + "in React. Please file an issue."), ReactCurrentOwner$1.current = null; var previousPriorityContext = priorityContext; priorityContext = TaskPriority$1; var firstEffect = void 0; - finishedWork.effectTag !== NoEffect$2 ? null !== finishedWork.lastEffect ? (finishedWork.lastEffect.nextEffect = finishedWork, - firstEffect = finishedWork.firstEffect) : firstEffect = finishedWork : firstEffect = finishedWork.firstEffect; - var commitInfo = prepareForCommit(); - for (nextEffect = firstEffect; null !== nextEffect; ) { + for (finishedWork.effectTag > PerformedWork ? null !== finishedWork.lastEffect ? (finishedWork.lastEffect.nextEffect = finishedWork, + firstEffect = finishedWork.firstEffect) : firstEffect = finishedWork : firstEffect = finishedWork.firstEffect, + prepareForCommit(), nextEffect = firstEffect; null !== nextEffect; ) { var _error = null; try { - commitAllHostEffects(finishedWork); + commitAllHostEffects(); } catch (e) { _error = e; } - null !== _error && (invariant(null !== nextEffect, "Should have next effect. This error is likely caused by a bug " + "in React. Please file an issue."), + null !== _error && (invariant(null !== nextEffect, "Should have next effect. This error is likely caused by a bug " + "in React. Please file an issue."), captureError(nextEffect, _error), null !== nextEffect && (nextEffect = nextEffect.nextEffect)); } - for (resetAfterCommit(commitInfo), root.current = finishedWork, nextEffect = firstEffect; null !== nextEffect; ) { + for (resetAfterCommit(), root.current = finishedWork, nextEffect = firstEffect; null !== nextEffect; ) { var _error2 = null; try { - commitAllLifeCycles(finishedWork); + commitAllLifeCycles(); } catch (e) { _error2 = e; } - null !== _error2 && (invariant(null !== nextEffect, "Should have next effect. This error is likely caused by a bug " + "in React. Please file an issue."), + null !== _error2 && (invariant(null !== nextEffect, "Should have next effect. This error is likely caused by a bug " + "in React. Please file an issue."), captureError(nextEffect, _error2), null !== nextEffect && (nextEffect = nextEffect.nextEffect)); } - isCommitting = !1, "function" == typeof onCommitRoot && onCommitRoot(finishedWork.stateNode), - !1 && ReactFiberInstrumentation$1.debugTool && ReactFiberInstrumentation$1.debugTool.onCommitWork(finishedWork), - commitPhaseBoundaries && (commitPhaseBoundaries.forEach(scheduleErrorRecovery), + isCommitting = !1, "function" == typeof onCommitRoot && onCommitRoot(finishedWork.stateNode), + !1 && ReactFiberInstrumentation$1.debugTool && ReactFiberInstrumentation$1.debugTool.onCommitWork(finishedWork), + commitPhaseBoundaries && (commitPhaseBoundaries.forEach(scheduleErrorRecovery), commitPhaseBoundaries = null), priorityContext = previousPriorityContext; } function resetWorkPriority(workInProgress) { var newPriority = NoWork$2, queue = workInProgress.updateQueue, tag = workInProgress.tag; null === queue || tag !== ClassComponent$3 && tag !== HostRoot$3 || (newPriority = getPendingPriority$1(queue)); - for (var child = workInProgress.progressedChild; null !== child; ) child.pendingWorkPriority !== NoWork$2 && (newPriority === NoWork$2 || newPriority > child.pendingWorkPriority) && (newPriority = child.pendingWorkPriority), + for (var child = workInProgress.progressedChild; null !== child; ) child.pendingWorkPriority !== NoWork$2 && (newPriority === NoWork$2 || newPriority > child.pendingWorkPriority) && (newPriority = child.pendingWorkPriority), child = child.sibling; workInProgress.pendingWorkPriority = newPriority; } function completeUnitOfWork(workInProgress) { for (;!0; ) { var current = workInProgress.alternate, next = completeWork(current, workInProgress), returnFiber = workInProgress.return, siblingFiber = workInProgress.sibling; - if (resetWorkPriority(workInProgress), null !== next) return !1 && ReactFiberInstrumentation$1.debugTool && ReactFiberInstrumentation$1.debugTool.onCompleteWork(workInProgress), + if (resetWorkPriority(workInProgress), null !== next) return !1 && ReactFiberInstrumentation$1.debugTool && ReactFiberInstrumentation$1.debugTool.onCompleteWork(workInProgress), next; - if (null !== returnFiber && (null === returnFiber.firstEffect && (returnFiber.firstEffect = workInProgress.firstEffect), - null !== workInProgress.lastEffect && (null !== returnFiber.lastEffect && (returnFiber.lastEffect.nextEffect = workInProgress.firstEffect), - returnFiber.lastEffect = workInProgress.lastEffect), workInProgress.effectTag !== NoEffect$2 && (null !== returnFiber.lastEffect ? returnFiber.lastEffect.nextEffect = workInProgress : returnFiber.firstEffect = workInProgress, - returnFiber.lastEffect = workInProgress)), !1 && ReactFiberInstrumentation$1.debugTool && ReactFiberInstrumentation$1.debugTool.onCompleteWork(workInProgress), + if (null !== returnFiber) { + null === returnFiber.firstEffect && (returnFiber.firstEffect = workInProgress.firstEffect), + null !== workInProgress.lastEffect && (null !== returnFiber.lastEffect && (returnFiber.lastEffect.nextEffect = workInProgress.firstEffect), + returnFiber.lastEffect = workInProgress.lastEffect); + workInProgress.effectTag > PerformedWork && (null !== returnFiber.lastEffect ? returnFiber.lastEffect.nextEffect = workInProgress : returnFiber.firstEffect = workInProgress, + returnFiber.lastEffect = workInProgress); + } + if (!1 && ReactFiberInstrumentation$1.debugTool && ReactFiberInstrumentation$1.debugTool.onCompleteWork(workInProgress), null !== siblingFiber) return siblingFiber; - if (null === returnFiber) return nextPriorityLevel < HighPriority ? commitAllWork(workInProgress) : pendingCommit = workInProgress, + if (null === returnFiber) return nextPriorityLevel < HighPriority ? commitAllWork(workInProgress) : pendingCommit = workInProgress, null; workInProgress = returnFiber; } @@ -2959,14 +2984,14 @@ var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCo } function performUnitOfWork(workInProgress) { var current = workInProgress.alternate, next = beginWork(current, workInProgress, nextPriorityLevel); - return !1 && ReactFiberInstrumentation$1.debugTool && ReactFiberInstrumentation$1.debugTool.onBeginWork(workInProgress), - null === next && (next = completeUnitOfWork(workInProgress)), ReactCurrentOwner$1.current = null, + return !1 && ReactFiberInstrumentation$1.debugTool && ReactFiberInstrumentation$1.debugTool.onBeginWork(workInProgress), + null === next && (next = completeUnitOfWork(workInProgress)), ReactCurrentOwner$1.current = null, next; } function performFailedUnitOfWork(workInProgress) { var current = workInProgress.alternate, next = beginFailedWork(current, workInProgress, nextPriorityLevel); - return !1 && ReactFiberInstrumentation$1.debugTool && ReactFiberInstrumentation$1.debugTool.onBeginWork(workInProgress), - null === next && (next = completeUnitOfWork(workInProgress)), ReactCurrentOwner$1.current = null, + return !1 && ReactFiberInstrumentation$1.debugTool && ReactFiberInstrumentation$1.debugTool.onBeginWork(workInProgress), + null === next && (next = completeUnitOfWork(workInProgress)), ReactCurrentOwner$1.current = null, next; } function performDeferredWork(deadline) { @@ -2979,22 +3004,16 @@ var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCo for (null === nextUnitOfWork && (nextUnitOfWork = findNextUnitOfWork()); null !== capturedErrors && capturedErrors.size && null !== nextUnitOfWork && nextPriorityLevel !== NoWork$2 && nextPriorityLevel <= TaskPriority$1; ) null === (nextUnitOfWork = hasCapturedError(nextUnitOfWork) ? performFailedUnitOfWork(nextUnitOfWork) : performUnitOfWork(nextUnitOfWork)) && (nextUnitOfWork = findNextUnitOfWork()); } function workLoop(priorityLevel, deadline) { - clearErrors(), null === nextUnitOfWork && (nextUnitOfWork = findNextUnitOfWork()); - var hostRootTimeMarker = void 0; - if (ReactFeatureFlags_1.logTopLevelRenders && null !== nextUnitOfWork && nextUnitOfWork.tag === HostRoot$3 && null !== nextUnitOfWork.child) { - hostRootTimeMarker = "React update: " + (getComponentName_1(nextUnitOfWork.child) || ""), - console.time(hostRootTimeMarker); - } - if (null !== deadline && priorityLevel > TaskPriority$1) for (;null !== nextUnitOfWork && !deadlineHasExpired; ) deadline.timeRemaining() > timeHeuristicForUnitOfWork ? null === (nextUnitOfWork = performUnitOfWork(nextUnitOfWork)) && null !== pendingCommit && (deadline.timeRemaining() > timeHeuristicForUnitOfWork ? (commitAllWork(pendingCommit), - nextUnitOfWork = findNextUnitOfWork(), clearErrors()) : deadlineHasExpired = !0) : deadlineHasExpired = !0; else for (;null !== nextUnitOfWork && nextPriorityLevel !== NoWork$2 && nextPriorityLevel <= priorityLevel; ) null === (nextUnitOfWork = performUnitOfWork(nextUnitOfWork)) && (nextUnitOfWork = findNextUnitOfWork(), + if (clearErrors(), null === nextUnitOfWork && (nextUnitOfWork = findNextUnitOfWork()), + null !== deadline && priorityLevel > TaskPriority$1) for (;null !== nextUnitOfWork && !deadlineHasExpired; ) deadline.timeRemaining() > timeHeuristicForUnitOfWork ? null === (nextUnitOfWork = performUnitOfWork(nextUnitOfWork)) && null !== pendingCommit && (deadline.timeRemaining() > timeHeuristicForUnitOfWork ? (commitAllWork(pendingCommit), + nextUnitOfWork = findNextUnitOfWork(), clearErrors()) : deadlineHasExpired = !0) : deadlineHasExpired = !0; else for (;null !== nextUnitOfWork && nextPriorityLevel !== NoWork$2 && nextPriorityLevel <= priorityLevel; ) null === (nextUnitOfWork = performUnitOfWork(nextUnitOfWork)) && (nextUnitOfWork = findNextUnitOfWork(), clearErrors()); - hostRootTimeMarker && console.timeEnd(hostRootTimeMarker); } function performWork(priorityLevel, deadline) { - invariant(!isPerformingWork, "performWork was called recursively. This error is likely caused " + "by a bug in React. Please file an issue."), + invariant(!isPerformingWork, "performWork was called recursively. This error is likely caused " + "by a bug in React. Please file an issue."), isPerformingWork = !0; for (var isPerformingDeferredWork = !!deadline; priorityLevel !== NoWork$2 && !fatalError; ) { - invariant(null !== deadline || priorityLevel < HighPriority, "Cannot perform deferred work without a deadline. This error is " + "likely caused by a bug in React. Please file an issue."), + invariant(null !== deadline || priorityLevel < HighPriority, "Cannot perform deferred work without a deadline. This error is " + "likely caused by a bug in React. Please file an issue."), null === pendingCommit || deadlineHasExpired || commitAllWork(pendingCommit), priorityContextBeforeReconciliation = priorityContext; var _error3 = null; try { @@ -3008,7 +3027,7 @@ var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCo var maybeBoundary = captureError(failedWork, _error3); if (null !== maybeBoundary) { var boundary = maybeBoundary; - beginFailedWork(boundary.alternate, boundary, priorityLevel), unwindContexts(failedWork, boundary), + beginFailedWork(boundary.alternate, boundary, priorityLevel), unwindContexts(failedWork, boundary), nextUnitOfWork = completeUnitOfWork(boundary); } continue; @@ -3032,7 +3051,7 @@ var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCo } else priorityLevel = nextPriorityLevel; } var errorToThrow = fatalError || firstUncaughtError; - if (isPerformingWork = !1, deadlineHasExpired = !1, fatalError = null, firstUncaughtError = null, + if (isPerformingWork = !1, deadlineHasExpired = !1, fatalError = null, firstUncaughtError = null, capturedErrors = null, failedBoundaries = null, null !== errorToThrow) throw errorToThrow; } function captureError(failedWork, error) { @@ -3041,7 +3060,7 @@ var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCo if (failedWork.tag === HostRoot$3) boundary = failedWork, isFailedBoundary(failedWork) && (fatalError = error); else for (var node = failedWork.return; null !== node && null === boundary; ) { if (node.tag === ClassComponent$3) { var instance = node.stateNode; - "function" == typeof instance.unstable_handleError && (errorBoundaryFound = !0, + "function" == typeof instance.unstable_handleError && (errorBoundaryFound = !0, errorBoundaryName = getComponentName_1(node), boundary = node, willRetry = !0); } else node.tag === HostRoot$3 && (boundary = node); if (isFailedBoundary(node)) { @@ -3053,16 +3072,16 @@ var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCo } if (null !== boundary) { null === failedBoundaries && (failedBoundaries = new Set()), failedBoundaries.add(boundary); - var _componentStack = getStackAddendumByWorkInProgressFiber(failedWork), _componentName2 = getComponentName_1(failedWork); + var _componentStack = getStackAddendumByWorkInProgressFiber(failedWork), _componentName = getComponentName_1(failedWork); return null === capturedErrors && (capturedErrors = new Map()), capturedErrors.set(boundary, { - componentName: _componentName2, + componentName: _componentName, componentStack: _componentStack, error: error, errorBoundary: errorBoundaryFound ? boundary.stateNode : null, errorBoundaryFound: errorBoundaryFound, errorBoundaryName: errorBoundaryName, willRetry: willRetry - }), isCommitting ? (null === commitPhaseBoundaries && (commitPhaseBoundaries = new Set()), + }), isCommitting ? (null === commitPhaseBoundaries && (commitPhaseBoundaries = new Set()), commitPhaseBoundaries.add(boundary)) : scheduleErrorRecovery(boundary), boundary; } return null === firstUncaughtError && (firstUncaughtError = error), null; @@ -3075,9 +3094,9 @@ var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCo } function commitErrorHandling(effectfulFiber) { var capturedError = void 0; - null !== capturedErrors && (capturedError = capturedErrors.get(effectfulFiber), - capturedErrors.delete(effectfulFiber), null == capturedError && null !== effectfulFiber.alternate && (effectfulFiber = effectfulFiber.alternate, - capturedError = capturedErrors.get(effectfulFiber), capturedErrors.delete(effectfulFiber))), + null !== capturedErrors && (capturedError = capturedErrors.get(effectfulFiber), + capturedErrors.delete(effectfulFiber), null == capturedError && null !== effectfulFiber.alternate && (effectfulFiber = effectfulFiber.alternate, + capturedError = capturedErrors.get(effectfulFiber), capturedErrors.delete(effectfulFiber))), invariant(null != capturedError, "No error for given unit of work. This error is likely caused by a " + "bug in React. Please file an issue."); var error = capturedError.error; try { @@ -3106,7 +3125,7 @@ var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCo popContextProvider$1(node); break; - case HostComponent$3: + case HostComponent$4: popHostContext(node); break; @@ -3118,14 +3137,14 @@ var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCo } } function scheduleRoot(root, priorityLevel) { - priorityLevel !== NoWork$2 && (root.isScheduled || (root.isScheduled = !0, lastScheduledRoot ? (lastScheduledRoot.nextScheduledRoot = root, + priorityLevel !== NoWork$2 && (root.isScheduled || (root.isScheduled = !0, lastScheduledRoot ? (lastScheduledRoot.nextScheduledRoot = root, lastScheduledRoot = root) : (nextScheduledRoot = root, lastScheduledRoot = root))); } function scheduleUpdate(fiber, priorityLevel) { priorityLevel <= nextPriorityLevel && (nextUnitOfWork = null); for (var node = fiber, shouldContinue = !0; null !== node && shouldContinue; ) { - if (shouldContinue = !1, (node.pendingWorkPriority === NoWork$2 || node.pendingWorkPriority > priorityLevel) && (shouldContinue = !0, - node.pendingWorkPriority = priorityLevel), null !== node.alternate && (node.alternate.pendingWorkPriority === NoWork$2 || node.alternate.pendingWorkPriority > priorityLevel) && (shouldContinue = !0, + if (shouldContinue = !1, (node.pendingWorkPriority === NoWork$2 || node.pendingWorkPriority > priorityLevel) && (shouldContinue = !0, + node.pendingWorkPriority = priorityLevel), null !== node.alternate && (node.alternate.pendingWorkPriority === NoWork$2 || node.alternate.pendingWorkPriority > priorityLevel) && (shouldContinue = !0, node.alternate.pendingWorkPriority = priorityLevel), null === node.return) { if (node.tag !== HostRoot$3) return; switch (scheduleRoot(node.stateNode, priorityLevel), priorityLevel) { @@ -3149,7 +3168,7 @@ var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCo } function getPriorityContext(fiber, forceAsync) { var priorityLevel = priorityContext; - return priorityLevel === NoWork$2 && (priorityLevel = !useSyncScheduling || fiber.internalContextTag & AsyncUpdates || forceAsync ? LowPriority : SynchronousPriority$1), + return priorityLevel === NoWork$2 && (priorityLevel = !useSyncScheduling || fiber.internalContextTag & AsyncUpdates || forceAsync ? LowPriority : SynchronousPriority$1), priorityLevel === SynchronousPriority$1 && (isPerformingWork || isBatchingUpdates) ? TaskPriority$1 : priorityLevel; } function scheduleErrorRecovery(fiber) { @@ -3223,7 +3242,7 @@ getContextForSubtree._injectFiber = function(fn) { getContextFiber = fn; }; -var getContextForSubtree_1 = getContextForSubtree, addTopLevelUpdate = ReactFiberUpdateQueue.addTopLevelUpdate, findCurrentUnmaskedContext = ReactFiberContext.findCurrentUnmaskedContext, isContextProvider = ReactFiberContext.isContextProvider, processChildContext = ReactFiberContext.processChildContext, createFiberRoot = ReactFiberRoot.createFiberRoot, findCurrentHostFiber = ReactFiberTreeReflection.findCurrentHostFiber; +var getContextForSubtree_1 = getContextForSubtree, addTopLevelUpdate = ReactFiberUpdateQueue.addTopLevelUpdate, findCurrentUnmaskedContext = ReactFiberContext.findCurrentUnmaskedContext, isContextProvider = ReactFiberContext.isContextProvider, processChildContext = ReactFiberContext.processChildContext, createFiberRoot = ReactFiberRoot.createFiberRoot, HostComponent$1 = ReactTypeOfWork.HostComponent, findCurrentHostFiber = ReactFiberTreeReflection.findCurrentHostFiber; getContextForSubtree_1._injectFiber(function(fiber) { var parentContext = findCurrentUnmaskedContext(fiber); @@ -3231,12 +3250,12 @@ getContextForSubtree_1._injectFiber(function(fiber) { }); var ReactFiberReconciler = function(config) { - var _ReactFiberScheduler = ReactFiberScheduler(config), scheduleUpdate = _ReactFiberScheduler.scheduleUpdate, getPriorityContext = _ReactFiberScheduler.getPriorityContext, performWithPriority = _ReactFiberScheduler.performWithPriority, batchedUpdates = _ReactFiberScheduler.batchedUpdates, unbatchedUpdates = _ReactFiberScheduler.unbatchedUpdates, syncUpdates = _ReactFiberScheduler.syncUpdates, deferredUpdates = _ReactFiberScheduler.deferredUpdates; + var getPublicInstance = config.getPublicInstance, _ReactFiberScheduler = ReactFiberScheduler(config), scheduleUpdate = _ReactFiberScheduler.scheduleUpdate, getPriorityContext = _ReactFiberScheduler.getPriorityContext, performWithPriority = _ReactFiberScheduler.performWithPriority, batchedUpdates = _ReactFiberScheduler.batchedUpdates, unbatchedUpdates = _ReactFiberScheduler.unbatchedUpdates, syncUpdates = _ReactFiberScheduler.syncUpdates, deferredUpdates = _ReactFiberScheduler.deferredUpdates; function scheduleTopLevelUpdate(current, element, callback) { var forceAsync = ReactFeatureFlags_1.enableAsyncSubtreeAPI && null != element && null != element.type && !0 === element.type.unstable_asyncUpdates, priorityLevel = getPriorityContext(current, forceAsync), nextState = { element: element }; - callback = void 0 === callback ? null : callback, addTopLevelUpdate(current, nextState, callback, priorityLevel), + callback = void 0 === callback ? null : callback, addTopLevelUpdate(current, nextState, callback, priorityLevel), scheduleUpdate(current, priorityLevel); } return { @@ -3245,7 +3264,7 @@ var ReactFiberReconciler = function(config) { }, updateContainer: function(element, container, parentComponent, callback) { var current = container.current, context = getContextForSubtree_1(parentComponent); - null === container.context ? container.context = context : container.pendingContext = context, + null === container.context ? container.context = context : container.pendingContext = context, scheduleTopLevelUpdate(current, element, callback); }, performWithPriority: performWithPriority, @@ -3255,7 +3274,14 @@ var ReactFiberReconciler = function(config) { deferredUpdates: deferredUpdates, getPublicRootInstance: function(container) { var containerFiber = container.current; - return containerFiber.child ? containerFiber.child.stateNode : null; + if (!containerFiber.child) return null; + switch (containerFiber.child.tag) { + case HostComponent$1: + return getPublicInstance(containerFiber.child.stateNode); + + default: + return containerFiber.child.stateNode; + } }, findHostInstance: function(fiber) { var hostFiber = findCurrentHostFiber(fiber); @@ -3278,7 +3304,7 @@ var objects = {}, uniqueID = 1, emptyObject$3 = {}, ReactNativePropRegistry = fu }, ReactNativePropRegistry.getByID = function(id) { if (!id) return emptyObject$3; var object = objects[id]; - return object || (console.warn("Invalid style with id `" + id + "`. Skipping ..."), + return object || (console.warn("Invalid style with id `" + id + "`. Skipping ..."), emptyObject$3); }, ReactNativePropRegistry; }(), ReactNativePropRegistry_1 = ReactNativePropRegistry, emptyObject$2 = {}, removedKeys = null, removedKeyCount = 0; @@ -3299,7 +3325,7 @@ function restoreDeletedValuesInNestedArray(updatePayload, node, validAttributes) if (void 0 !== nextProp) { var attributeConfig = validAttributes[propKey]; if (attributeConfig) { - if ("function" == typeof nextProp && (nextProp = !0), void 0 === nextProp && (nextProp = null), + if ("function" == typeof nextProp && (nextProp = !0), void 0 === nextProp && (nextProp = null), "object" != typeof attributeConfig) updatePayload[propKey] = nextProp; else if ("function" == typeof attributeConfig.diff || "function" == typeof attributeConfig.process) { var nextValue = "function" == typeof attributeConfig.process ? attributeConfig.process(nextProp) : nextProp; updatePayload[propKey] = nextValue; @@ -3339,10 +3365,10 @@ function clearNestedProperty(updatePayload, prevProp, validAttributes) { function diffProperties(updatePayload, prevProps, nextProps, validAttributes) { var attributeConfig, nextProp, prevProp; - for (var propKey in nextProps) if (attributeConfig = validAttributes[propKey]) if (prevProp = prevProps[propKey], - nextProp = nextProps[propKey], "function" == typeof nextProp && (nextProp = !0, - "function" == typeof prevProp && (prevProp = !0)), void 0 === nextProp && (nextProp = null, - void 0 === prevProp && (prevProp = null)), removedKeys && (removedKeys[propKey] = !1), + for (var propKey in nextProps) if (attributeConfig = validAttributes[propKey]) if (prevProp = prevProps[propKey], + nextProp = nextProps[propKey], "function" == typeof nextProp && (nextProp = !0, + "function" == typeof prevProp && (prevProp = !0)), void 0 === nextProp && (nextProp = null, + void 0 === prevProp && (prevProp = null)), removedKeys && (removedKeys[propKey] = !1), updatePayload && void 0 !== updatePayload[propKey]) { if ("object" != typeof attributeConfig) updatePayload[propKey] = nextProp; else if ("function" == typeof attributeConfig.diff || "function" == typeof attributeConfig.process) { var nextValue = "function" == typeof attributeConfig.process ? attributeConfig.process(nextProp) : nextProp; @@ -3350,13 +3376,13 @@ function diffProperties(updatePayload, prevProps, nextProps, validAttributes) { } } else if (prevProp !== nextProp) if ("object" != typeof attributeConfig) defaultDiffer(prevProp, nextProp) && ((updatePayload || (updatePayload = {}))[propKey] = nextProp); else if ("function" == typeof attributeConfig.diff || "function" == typeof attributeConfig.process) { var shouldUpdate = void 0 === prevProp || ("function" == typeof attributeConfig.diff ? attributeConfig.diff(prevProp, nextProp) : defaultDiffer(prevProp, nextProp)); - shouldUpdate && (nextValue = "function" == typeof attributeConfig.process ? attributeConfig.process(nextProp) : nextProp, + shouldUpdate && (nextValue = "function" == typeof attributeConfig.process ? attributeConfig.process(nextProp) : nextProp, (updatePayload || (updatePayload = {}))[propKey] = nextValue); - } else removedKeys = null, removedKeyCount = 0, updatePayload = diffNestedProperty(updatePayload, prevProp, nextProp, attributeConfig), - removedKeyCount > 0 && updatePayload && (restoreDeletedValuesInNestedArray(updatePayload, nextProp, attributeConfig), + } else removedKeys = null, removedKeyCount = 0, updatePayload = diffNestedProperty(updatePayload, prevProp, nextProp, attributeConfig), + removedKeyCount > 0 && updatePayload && (restoreDeletedValuesInNestedArray(updatePayload, nextProp, attributeConfig), removedKeys = null); - for (propKey in prevProps) void 0 === nextProps[propKey] && (attributeConfig = validAttributes[propKey]) && (updatePayload && void 0 !== updatePayload[propKey] || void 0 !== (prevProp = prevProps[propKey]) && ("object" != typeof attributeConfig || "function" == typeof attributeConfig.diff || "function" == typeof attributeConfig.process ? ((updatePayload || (updatePayload = {}))[propKey] = null, - removedKeys || (removedKeys = {}), removedKeys[propKey] || (removedKeys[propKey] = !0, + for (propKey in prevProps) void 0 === nextProps[propKey] && (attributeConfig = validAttributes[propKey]) && (updatePayload && void 0 !== updatePayload[propKey] || void 0 !== (prevProp = prevProps[propKey]) && ("object" != typeof attributeConfig || "function" == typeof attributeConfig.diff || "function" == typeof attributeConfig.process ? ((updatePayload || (updatePayload = {}))[propKey] = null, + removedKeys || (removedKeys = {}), removedKeys[propKey] || (removedKeys[propKey] = !0, removedKeyCount++)) : updatePayload = clearNestedProperty(updatePayload, prevProp, attributeConfig))); return updatePayload; } @@ -3392,7 +3418,7 @@ function mountSafeCallback$1(context, callback) { function throwOnStylesProp(component, props) { if (void 0 !== props.styles) { var owner = component._owner || null, name = component.constructor.displayName, msg = "`styles` is not a supported property of `" + name + "`, did " + "you mean `style` (singular)?"; - throw owner && owner.constructor && owner.constructor.displayName && (msg += "\n\nCheck the `" + owner.constructor.displayName + "` parent " + " component."), + throw owner && owner.constructor && owner.constructor.displayName && (msg += "\n\nCheck the `" + owner.constructor.displayName + "` parent " + " component."), new Error(msg); } } @@ -3413,7 +3439,7 @@ function _classCallCheck$1(instance, Constructor) { var mountSafeCallback = NativeMethodsMixinUtils.mountSafeCallback, ReactNativeFiberHostComponent = function() { function ReactNativeFiberHostComponent(tag, viewConfig) { - _classCallCheck$1(this, ReactNativeFiberHostComponent), this._nativeTag = tag, this._children = [], + _classCallCheck$1(this, ReactNativeFiberHostComponent), this._nativeTag = tag, this._children = [], this.viewConfig = viewConfig; } return ReactNativeFiberHostComponent.prototype.blur = function() { @@ -3430,21 +3456,20 @@ var mountSafeCallback = NativeMethodsMixinUtils.mountSafeCallback, ReactNativeFi var updatePayload = ReactNativeAttributePayload_1.create(nativeProps, this.viewConfig.validAttributes); UIManager.updateView(this._nativeTag, this.viewConfig.uiViewClassName, updatePayload); }, ReactNativeFiberHostComponent; -}(), ReactNativeFiberHostComponent_1 = ReactNativeFiberHostComponent, viewConfigs = new Map(), prefix = "topsecret-", ReactNativeViewConfigRegistry = { +}(), ReactNativeFiberHostComponent_1 = ReactNativeFiberHostComponent, viewConfigs = new Map(), ReactNativeViewConfigRegistry = { register: function(viewConfig) { var name = viewConfig.uiViewClassName; - invariant(!viewConfigs.has(name), "Tried to register two views with the same name %s", name); - var secretName = prefix + name; - return viewConfigs.set(secretName, viewConfig), secretName; + return invariant(!viewConfigs.has(name), "Tried to register two views with the same name %s", name), + viewConfigs.set(name, viewConfig), name; }, - get: function(secretName) { - var config = viewConfigs.get(secretName); - return invariant(config, "View config not found for name %s", secretName), config; + get: function(name) { + var config = viewConfigs.get(name); + return invariant(config, "View config not found for name %s", name), config; } }, ReactNativeViewConfigRegistry_1 = ReactNativeViewConfigRegistry, precacheFiberNode$1 = ReactNativeComponentTree_1.precacheFiberNode, uncacheFiberNode$1 = ReactNativeComponentTree_1.uncacheFiberNode, updateFiberProps$1 = ReactNativeComponentTree_1.updateFiberProps; function recursivelyUncacheFiberNode(node) { - "number" == typeof node ? uncacheFiberNode$1(node) : (uncacheFiberNode$1(node._nativeTag), + "number" == typeof node ? uncacheFiberNode$1(node) : (uncacheFiberNode$1(node._nativeTag), node._children.forEach(recursivelyUncacheFiberNode)); } @@ -3453,7 +3478,7 @@ var NativeRenderer = ReactFiberReconciler({ var childTag = "number" == typeof child ? child : child._nativeTag; if ("number" == typeof parentInstance) UIManager.setChildren(parentInstance, [ childTag ]); else { var children = parentInstance._children, index = children.indexOf(child); - index >= 0 ? (children.splice(index, 1), children.push(child), UIManager.manageChildren(parentInstance._nativeTag, [ index ], [ children.length - 1 ], [], [], [])) : (children.push(child), + index >= 0 ? (children.splice(index, 1), children.push(child), UIManager.manageChildren(parentInstance._nativeTag, [ index ], [ children.length - 1 ], [], [], [])) : (children.push(child), UIManager.manageChildren(parentInstance._nativeTag, [], [], [ childTag ], [ children.length - 1 ], [])); } }, @@ -3476,7 +3501,7 @@ var NativeRenderer = ReactFiberReconciler({ var tag = ReactNativeTagHandles_1.allocateTag(), viewConfig = ReactNativeViewConfigRegistry_1.get(type), updatePayload = ReactNativeAttributePayload_1.create(props, viewConfig.validAttributes); UIManager.createView(tag, viewConfig.uiViewClassName, rootContainerInstance, updatePayload); var component = new ReactNativeFiberHostComponent_1(tag, viewConfig); - return precacheFiberNode$1(internalInstanceHandle, tag), updateFiberProps$1(tag, props), + return precacheFiberNode$1(internalInstanceHandle, tag), updateFiberProps$1(tag, props), component; }, createTextInstance: function(text, rootContainerInstance, hostContext, internalInstanceHandle) { @@ -3532,7 +3557,7 @@ var NativeRenderer = ReactFiberReconciler({ }, scheduleAnimationCallback: commonjsGlobal.requestAnimationFrame, scheduleDeferredCallback: commonjsGlobal.requestIdleCallback, - shouldSetTextContent: function(props) { + shouldSetTextContent: function(type, props) { return !1; }, useSyncScheduling: !0 @@ -3559,33 +3584,55 @@ function findNodeHandle(componentOrHandle) { if (null == componentOrHandle) return null; if ("number" == typeof componentOrHandle) return componentOrHandle; var component = componentOrHandle, internalInstance = ReactInstanceMap_1.get(component); - return internalInstance ? injectedFindNode(internalInstance) : component || (invariant("object" == typeof component && ("_rootNodeID" in component || "_nativeTag" in component) || null != component.render && "function" == typeof component.render, "findNodeHandle(...): Argument is not a component " + "(type: %s, keys: %s)", typeof component, Object.keys(component)), + return internalInstance ? injectedFindNode(internalInstance) : component || (invariant("object" == typeof component && ("_rootNodeID" in component || "_nativeTag" in component) || null != component.render && "function" == typeof component.render, "findNodeHandle(...): Argument is not a component " + "(type: %s, keys: %s)", typeof component, Object.keys(component)), void invariant(!1, "findNodeHandle(...): Unable to find node handle for unmounted " + "component.")); } var findNodeHandle_1 = findNodeHandle, findNumericNodeHandleFiber = function(componentOrHandle) { var instance = findNodeHandle_1(componentOrHandle); return null == instance || "number" == typeof instance ? instance : instance._nativeTag; -}, DevOnlyStubShim = null, mountSafeCallback$2 = NativeMethodsMixinUtils.mountSafeCallback, findNumericNodeHandle = ReactNativeFeatureFlags$1.useFiber ? findNumericNodeHandleFiber : DevOnlyStubShim, NativeMethodsMixin = { - measure: function(callback) { - UIManager.measure(findNumericNodeHandle(this), mountSafeCallback$2(this, callback)); - }, - measureInWindow: function(callback) { - UIManager.measureInWindow(findNumericNodeHandle(this), mountSafeCallback$2(this, callback)); - }, - measureLayout: function(relativeToNativeNode, onSuccess, onFail) { - UIManager.measureLayout(findNumericNodeHandle(this), relativeToNativeNode, mountSafeCallback$2(this, onFail), mountSafeCallback$2(this, onSuccess)); - }, - setNativeProps: function(nativeProps) { - injectedSetNativeProps(this, nativeProps); - }, - focus: function() { - TextInputState.focusTextInput(findNumericNodeHandle(this)); - }, - blur: function() { - TextInputState.blurTextInput(findNumericNodeHandle(this)); +}, DevOnlyStubShim = null; + +function _classCallCheck$2(instance, Constructor) { + if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); +} + +function _possibleConstructorReturn(self, call) { + if (!self) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); + return !call || "object" != typeof call && "function" != typeof call ? self : call; +} + +function _inherits(subClass, superClass) { + if ("function" != typeof superClass && null !== superClass) throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); + subClass.prototype = Object.create(superClass && superClass.prototype, { + constructor: { + value: subClass, + enumerable: !1, + writable: !0, + configurable: !0 + } + }), superClass && (Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass); +} + +var mountSafeCallback$2 = NativeMethodsMixinUtils.mountSafeCallback, findNumericNodeHandle = ReactNativeFeatureFlags$1.useFiber ? findNumericNodeHandleFiber : DevOnlyStubShim, ReactNativeComponent = function(_React$Component) { + _inherits(ReactNativeComponent, _React$Component); + function ReactNativeComponent() { + return _classCallCheck$2(this, ReactNativeComponent), _possibleConstructorReturn(this, _React$Component.apply(this, arguments)); } -}; + return ReactNativeComponent.prototype.blur = function() { + TextInputState.blurTextInput(findNumericNodeHandle(this)); + }, ReactNativeComponent.prototype.focus = function() { + TextInputState.focusTextInput(findNumericNodeHandle(this)); + }, ReactNativeComponent.prototype.measure = function(callback) { + UIManager.measure(findNumericNodeHandle(this), mountSafeCallback$2(this, callback)); + }, ReactNativeComponent.prototype.measureInWindow = function(callback) { + UIManager.measureInWindow(findNumericNodeHandle(this), mountSafeCallback$2(this, callback)); + }, ReactNativeComponent.prototype.measureLayout = function(relativeToNativeNode, onSuccess, onFail) { + UIManager.measureLayout(findNumericNodeHandle(this), relativeToNativeNode, mountSafeCallback$2(this, onFail), mountSafeCallback$2(this, onSuccess)); + }, ReactNativeComponent.prototype.setNativeProps = function(nativeProps) { + injectedSetNativeProps(this, nativeProps); + }, ReactNativeComponent; +}(react.Component); function setNativePropsFiber(componentOrHandle, nativeProps) { var maybeInstance = void 0; @@ -3615,15 +3662,64 @@ var injectedSetNativeProps = void 0; injectedSetNativeProps = ReactNativeFeatureFlags$1.useFiber ? setNativePropsFiber : setNativePropsStack; +var ReactNativeComponent_1 = ReactNativeComponent, mountSafeCallback$3 = NativeMethodsMixinUtils.mountSafeCallback, findNumericNodeHandle$1 = ReactNativeFeatureFlags$1.useFiber ? findNumericNodeHandleFiber : DevOnlyStubShim, NativeMethodsMixin = { + measure: function(callback) { + UIManager.measure(findNumericNodeHandle$1(this), mountSafeCallback$3(this, callback)); + }, + measureInWindow: function(callback) { + UIManager.measureInWindow(findNumericNodeHandle$1(this), mountSafeCallback$3(this, callback)); + }, + measureLayout: function(relativeToNativeNode, onSuccess, onFail) { + UIManager.measureLayout(findNumericNodeHandle$1(this), relativeToNativeNode, mountSafeCallback$3(this, onFail), mountSafeCallback$3(this, onSuccess)); + }, + setNativeProps: function(nativeProps) { + injectedSetNativeProps$1(this, nativeProps); + }, + focus: function() { + TextInputState.focusTextInput(findNumericNodeHandle$1(this)); + }, + blur: function() { + TextInputState.blurTextInput(findNumericNodeHandle$1(this)); + } +}; + +function setNativePropsFiber$1(componentOrHandle, nativeProps) { + var maybeInstance = void 0; + try { + maybeInstance = findNodeHandle_1(componentOrHandle); + } catch (error) {} + if (null != maybeInstance) { + var viewConfig = maybeInstance.viewConfig, updatePayload = ReactNativeAttributePayload_1.create(nativeProps, viewConfig.validAttributes); + UIManager.updateView(maybeInstance._nativeTag, viewConfig.uiViewClassName, updatePayload); + } +} + +function setNativePropsStack$1(componentOrHandle, nativeProps) { + var maybeInstance = findNodeHandle_1(componentOrHandle); + if (null != maybeInstance) { + var viewConfig = void 0; + if (void 0 !== maybeInstance.viewConfig) viewConfig = maybeInstance.viewConfig; else if (void 0 !== maybeInstance._instance && void 0 !== maybeInstance._instance.viewConfig) viewConfig = maybeInstance._instance.viewConfig; else { + for (;void 0 !== maybeInstance._renderedComponent; ) maybeInstance = maybeInstance._renderedComponent; + viewConfig = maybeInstance.viewConfig; + } + var tag = "function" == typeof maybeInstance.getHostNode ? maybeInstance.getHostNode() : maybeInstance._rootNodeID, updatePayload = ReactNativeAttributePayload_1.create(nativeProps, viewConfig.validAttributes); + UIManager.updateView(tag, viewConfig.uiViewClassName, updatePayload); + } +} + +var injectedSetNativeProps$1 = void 0; + +injectedSetNativeProps$1 = ReactNativeFeatureFlags$1.useFiber ? setNativePropsFiber$1 : setNativePropsStack$1; + var NativeMethodsMixin_1 = NativeMethodsMixin, TouchHistoryMath = { centroidDimension: function(touchHistory, touchesChangedAfter, isXAxis, ofCurrent) { var touchBank = touchHistory.touchBank, total = 0, count = 0, oneTouchData = 1 === touchHistory.numberActiveTouches ? touchHistory.touchBank[touchHistory.indexOfSingleActiveTouch] : null; - if (null !== oneTouchData) oneTouchData.touchActive && oneTouchData.currentTimeStamp > touchesChangedAfter && (total += ofCurrent && isXAxis ? oneTouchData.currentPageX : ofCurrent && !isXAxis ? oneTouchData.currentPageY : !ofCurrent && isXAxis ? oneTouchData.previousPageX : oneTouchData.previousPageY, + if (null !== oneTouchData) oneTouchData.touchActive && oneTouchData.currentTimeStamp > touchesChangedAfter && (total += ofCurrent && isXAxis ? oneTouchData.currentPageX : ofCurrent && !isXAxis ? oneTouchData.currentPageY : !ofCurrent && isXAxis ? oneTouchData.previousPageX : oneTouchData.previousPageY, count = 1); else for (var i = 0; i < touchBank.length; i++) { var touchTrack = touchBank[i]; if (null !== touchTrack && void 0 !== touchTrack && touchTrack.touchActive && touchTrack.currentTimeStamp >= touchesChangedAfter) { var toAdd; - toAdd = ofCurrent && isXAxis ? touchTrack.currentPageX : ofCurrent && !isXAxis ? touchTrack.currentPageY : !ofCurrent && isXAxis ? touchTrack.previousPageX : touchTrack.previousPageY, + toAdd = ofCurrent && isXAxis ? touchTrack.currentPageX : ofCurrent && !isXAxis ? touchTrack.currentPageY : !ofCurrent && isXAxis ? touchTrack.previousPageX : touchTrack.previousPageY, total += toAdd, count++; } } @@ -3650,10 +3746,10 @@ var NativeMethodsMixin_1 = NativeMethodsMixin, TouchHistoryMath = { noCentroid: -1 }, TouchHistoryMath_1 = TouchHistoryMath, createReactNativeComponentClassFiber = function(viewConfig) { return ReactNativeViewConfigRegistry_1.register(viewConfig); -}, createReactNativeComponentClassFiber_1 = createReactNativeComponentClassFiber, createReactNativeComponentClass = ReactNativeFeatureFlags$1.useFiber ? createReactNativeComponentClassFiber_1 : DevOnlyStubShim, findNumericNodeHandle$1 = ReactNativeFeatureFlags$1.useFiber ? findNumericNodeHandleFiber : DevOnlyStubShim; +}, createReactNativeComponentClassFiber_1 = createReactNativeComponentClassFiber, createReactNativeComponentClass = ReactNativeFeatureFlags$1.useFiber ? createReactNativeComponentClassFiber_1 : DevOnlyStubShim, findNumericNodeHandle$2 = ReactNativeFeatureFlags$1.useFiber ? findNumericNodeHandleFiber : DevOnlyStubShim; function takeSnapshot(view, options) { - return "number" != typeof view && "window" !== view && (view = findNumericNodeHandle$1(view) || "window"), + return "number" != typeof view && "window" !== view && (view = findNumericNodeHandle$2(view) || "window"), UIManager.__takeSnapshot(view, options); } @@ -3666,10 +3762,11 @@ var roots = new Map(); ReactFiberErrorLogger.injection.injectDialog(ReactNativeFiberErrorDialog_1.showDialog); var ReactNative = { + NativeComponent: ReactNativeComponent_1, findNodeHandle: findNumericNodeHandleFiber, render: function(element, containerTag, callback) { var root = roots.get(containerTag); - return root || (root = ReactNativeFiberRenderer.createContainer(containerTag), roots.set(containerTag, root)), + return root || (root = ReactNativeFiberRenderer.createContainer(containerTag), roots.set(containerTag, root)), ReactNativeFiberRenderer.updateContainer(element, root, null, callback), ReactNativeFiberRenderer.getPublicRootInstance(root); }, unmountComponentAtNode: function(containerTag) { diff --git a/Libraries/Renderer/ReactNativeStack-dev.js b/Libraries/Renderer/ReactNativeStack-dev.js index 360bebb66..97a5f278f 100644 --- a/Libraries/Renderer/ReactNativeStack-dev.js +++ b/Libraries/Renderer/ReactNativeStack-dev.js @@ -76,9 +76,9 @@ var ReactNativeComponentTree = { function recomputePluginOrdering() { if (eventPluginOrder) for (var pluginName in namesToPlugins) { var pluginModule = namesToPlugins[pluginName], pluginIndex = eventPluginOrder.indexOf(pluginName); - if (invariant(pluginIndex > -1, "EventPluginRegistry: Cannot inject event plugins that do not exist in " + "the plugin ordering, `%s`.", pluginName), + if (invariant(pluginIndex > -1, "EventPluginRegistry: Cannot inject event plugins that do not exist in " + "the plugin ordering, `%s`.", pluginName), !EventPluginRegistry.plugins[pluginIndex]) { - invariant(pluginModule.extractEvents, "EventPluginRegistry: Event plugins must implement an `extractEvents` " + "method, but `%s` does not.", pluginName), + invariant(pluginModule.extractEvents, "EventPluginRegistry: Event plugins must implement an `extractEvents` " + "method, but `%s` does not.", pluginName), EventPluginRegistry.plugins[pluginIndex] = pluginModule; var publishedEvents = pluginModule.eventTypes; for (var eventName in publishedEvents) invariant(publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName), "EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.", eventName, pluginName); @@ -87,7 +87,7 @@ function recomputePluginOrdering() { } function publishEventForPlugin(dispatchConfig, pluginModule, eventName) { - invariant(!EventPluginRegistry.eventNameDispatchConfigs.hasOwnProperty(eventName), "EventPluginHub: More than one plugin attempted to publish the same " + "event name, `%s`.", eventName), + invariant(!EventPluginRegistry.eventNameDispatchConfigs.hasOwnProperty(eventName), "EventPluginHub: More than one plugin attempted to publish the same " + "event name, `%s`.", eventName), EventPluginRegistry.eventNameDispatchConfigs[eventName] = dispatchConfig; var phasedRegistrationNames = dispatchConfig.phasedRegistrationNames; if (phasedRegistrationNames) { @@ -97,15 +97,15 @@ function publishEventForPlugin(dispatchConfig, pluginModule, eventName) { } return !0; } - return !!dispatchConfig.registrationName && (publishRegistrationName(dispatchConfig.registrationName, pluginModule, eventName), + return !!dispatchConfig.registrationName && (publishRegistrationName(dispatchConfig.registrationName, pluginModule, eventName), !0); } function publishRegistrationName(registrationName, pluginModule, eventName) { - invariant(!EventPluginRegistry.registrationNameModules[registrationName], "EventPluginHub: More than one plugin attempted to publish the same " + "registration name, `%s`.", registrationName), + invariant(!EventPluginRegistry.registrationNameModules[registrationName], "EventPluginHub: More than one plugin attempted to publish the same " + "registration name, `%s`.", registrationName), EventPluginRegistry.registrationNameModules[registrationName] = pluginModule, EventPluginRegistry.registrationNameDependencies[registrationName] = pluginModule.eventTypes[eventName].dependencies; var lowerCasedName = registrationName.toLowerCase(); - EventPluginRegistry.possibleRegistrationNames[lowerCasedName] = registrationName, + EventPluginRegistry.possibleRegistrationNames[lowerCasedName] = registrationName, "onDoubleClick" === registrationName && (EventPluginRegistry.possibleRegistrationNames.ondblclick = registrationName); } @@ -116,14 +116,14 @@ var EventPluginRegistry = { registrationNameDependencies: {}, possibleRegistrationNames: {}, injectEventPluginOrder: function(injectedEventPluginOrder) { - invariant(!eventPluginOrder, "EventPluginRegistry: Cannot inject event plugin ordering more than " + "once. You are likely trying to load more than one copy of React."), + invariant(!eventPluginOrder, "EventPluginRegistry: Cannot inject event plugin ordering more than " + "once. You are likely trying to load more than one copy of React."), eventPluginOrder = Array.prototype.slice.call(injectedEventPluginOrder), recomputePluginOrdering(); }, injectEventPluginsByName: function(injectedNamesToPlugins) { var isOrderingDirty = !1; for (var pluginName in injectedNamesToPlugins) if (injectedNamesToPlugins.hasOwnProperty(pluginName)) { var pluginModule = injectedNamesToPlugins[pluginName]; - namesToPlugins.hasOwnProperty(pluginName) && namesToPlugins[pluginName] === pluginModule || (invariant(!namesToPlugins[pluginName], "EventPluginRegistry: Cannot inject two different event plugins " + "using the same name, `%s`.", pluginName), + namesToPlugins.hasOwnProperty(pluginName) && namesToPlugins[pluginName] === pluginModule || (invariant(!namesToPlugins[pluginName], "EventPluginRegistry: Cannot inject two different event plugins " + "using the same name, `%s`.", pluginName), namesToPlugins[pluginName] = pluginModule, isOrderingDirty = !0); } isOrderingDirty && recomputePluginOrdering(); @@ -149,7 +149,7 @@ if ("undefined" != typeof window && "function" == typeof window.dispatchEvent && }, evtType = "react-" + (name || "invokeguardedcallback") + "-" + depth; window.addEventListener("error", onFakeEventError), fakeNode.addEventListener(evtType, boundFunc, !1); var evt = document.createEvent("Event"); - return evt.initEvent(evtType, !1, !1), fakeNode.dispatchEvent(evt), fakeNode.removeEventListener(evtType, boundFunc, !1), + return evt.initEvent(evtType, !1, !1), fakeNode.dispatchEvent(evt), fakeNode.removeEventListener(evtType, boundFunc, !1), window.removeEventListener("error", onFakeEventError), depth--, fakeEventError; }; } @@ -162,7 +162,7 @@ var rethrowCaughtError = function() { }, ReactErrorUtils = { injection: { injectErrorUtils: function(injectedErrorUtils) { - invariant("function" == typeof injectedErrorUtils.invokeGuardedCallback, "Injected invokeGuardedCallback() must be a function."), + invariant("function" == typeof injectedErrorUtils.invokeGuardedCallback, "Injected invokeGuardedCallback() must be a function."), invokeGuardedCallback = injectedErrorUtils.invokeGuardedCallback; } }, @@ -203,7 +203,7 @@ validateEventDispatches = function(event) { function executeDispatch(event, simulated, listener, inst) { var type = event.type || "unknown-event"; - event.currentTarget = EventPluginUtils.getNodeFromInstance(inst), ReactErrorUtils_1.invokeGuardedCallbackAndCatchFirstError(type, listener, void 0, event), + event.currentTarget = EventPluginUtils.getNodeFromInstance(inst), ReactErrorUtils_1.invokeGuardedCallbackAndCatchFirstError(type, listener, void 0, event), event.currentTarget = null; } @@ -229,10 +229,10 @@ function executeDispatchesInOrderStopAtTrue(event) { function executeDirectDispatch(event) { validateEventDispatches(event); var dispatchListener = event._dispatchListeners, dispatchInstance = event._dispatchInstances; - invariant(!Array.isArray(dispatchListener), "executeDirectDispatch(...): Invalid `event`."), + invariant(!Array.isArray(dispatchListener), "executeDirectDispatch(...): Invalid `event`."), event.currentTarget = dispatchListener ? EventPluginUtils.getNodeFromInstance(dispatchInstance) : null; var res = dispatchListener ? dispatchListener(event) : null; - return event.currentTarget = null, event._dispatchListeners = null, event._dispatchInstances = null, + return event.currentTarget = null, event._dispatchListeners = null, event._dispatchInstances = null, res; } @@ -261,8 +261,8 @@ var EventPluginUtils = { }, EventPluginUtils_1 = EventPluginUtils; function accumulateInto(current, next) { - return invariant(null != next, "accumulateInto(...): Accumulated items must not be null or undefined."), - null == current ? next : Array.isArray(current) ? Array.isArray(next) ? (current.push.apply(current, next), + return invariant(null != next, "accumulateInto(...): Accumulated items must not be null or undefined."), + null == current ? next : Array.isArray(current) ? Array.isArray(next) ? (current.push.apply(current, next), current) : (current.push(next), current) : Array.isArray(next) ? [ current ].concat(next) : [ current, next ]; } @@ -323,7 +323,7 @@ var EventPluginHub = { var _props = currentElement.props; if (listener = _props[registrationName], shouldPreventMouseEvent(registrationName, currentElement.type, _props)) return null; } - return invariant(!listener || "function" == typeof listener, "Expected %s listener to be a function, instead got type %s", registrationName, typeof listener), + return invariant(!listener || "function" == typeof listener, "Expected %s listener to be a function, instead got type %s", registrationName, typeof listener), listener; }, extractEvents: function(topLevelType, targetInst, nativeEvent, nativeEventTarget) { @@ -341,8 +341,8 @@ var EventPluginHub = { }, processEventQueue: function(simulated) { var processingEventQueue = eventQueue; - eventQueue = null, simulated ? forEachAccumulated_1(processingEventQueue, executeDispatchesAndReleaseSimulated) : forEachAccumulated_1(processingEventQueue, executeDispatchesAndReleaseTopLevel), - invariant(!eventQueue, "processEventQueue(): Additional events were enqueued while processing " + "an event queue. Support for this has not yet been implemented."), + eventQueue = null, simulated ? forEachAccumulated_1(processingEventQueue, executeDispatchesAndReleaseSimulated) : forEachAccumulated_1(processingEventQueue, executeDispatchesAndReleaseTopLevel), + invariant(!eventQueue, "processEventQueue(): Additional events were enqueued while processing " + "an event queue. Support for this has not yet been implemented."), ReactErrorUtils_1.rethrowCaughtError(); } }, EventPluginHub_1 = EventPluginHub, ReactTypeOfWork = { @@ -402,7 +402,7 @@ function traverseTwoPhase(inst, fn, arg) { } function traverseEnterLeave(from, to, fn, argFrom, argTo) { - for (var common = from && to ? getLowestCommonAncestor(from, to) : null, pathFrom = []; from && from !== common; ) pathFrom.push(from), + for (var common = from && to ? getLowestCommonAncestor(from, to) : null, pathFrom = []; from && from !== common; ) pathFrom.push(from), from = getParent(from); for (var pathTo = []; to && to !== common; ) pathTo.push(to), to = getParent(to); var i; @@ -426,7 +426,7 @@ function listenerAtPhase(inst, event, propagationPhase) { function accumulateDirectionalDispatches(inst, phase, event) { warning(inst, "Dispatching inst must not be null"); var listener = listenerAtPhase(inst, event, phase); - listener && (event._dispatchListeners = accumulateInto_1(event._dispatchListeners, listener), + listener && (event._dispatchListeners = accumulateInto_1(event._dispatchListeners, listener), event._dispatchInstances = accumulateInto_1(event._dispatchInstances, inst)); } @@ -444,7 +444,7 @@ function accumulateTwoPhaseDispatchesSingleSkipTarget(event) { function accumulateDispatches(inst, ignoredDirection, event) { if (inst && event && event.dispatchConfig.registrationName) { var registrationName = event.dispatchConfig.registrationName, listener = getListener(inst, registrationName); - listener && (event._dispatchListeners = accumulateInto_1(event._dispatchListeners, listener), + listener && (event._dispatchListeners = accumulateInto_1(event._dispatchListeners, listener), event._dispatchInstances = accumulateInto_1(event._dispatchInstances, inst)); } } @@ -504,12 +504,12 @@ var EventPropagators = { return new Klass(a1, a2, a3, a4); }, standardReleaser = function(instance) { var Klass = this; - invariant(instance instanceof Klass, "Trying to release an instance into a pool of a different type."), + invariant(instance instanceof Klass, "Trying to release an instance into a pool of a different type."), instance.destructor(), Klass.instancePool.length < Klass.poolSize && Klass.instancePool.push(instance); }, DEFAULT_POOL_SIZE = 10, DEFAULT_POOLER = oneArgumentPooler, addPoolingTo = function(CopyConstructor, pooler) { var NewKlass = CopyConstructor; - return NewKlass.instancePool = [], NewKlass.getPooled = pooler || DEFAULT_POOLER, - NewKlass.poolSize || (NewKlass.poolSize = DEFAULT_POOL_SIZE), NewKlass.release = standardReleaser, + return NewKlass.instancePool = [], NewKlass.getPooled = pooler || DEFAULT_POOLER, + NewKlass.poolSize || (NewKlass.poolSize = DEFAULT_POOL_SIZE), NewKlass.release = standardReleaser, NewKlass; }, PooledClass = { addPoolingTo: addPoolingTo, @@ -532,7 +532,7 @@ var EventPropagators = { }; function SyntheticEvent(dispatchConfig, targetInst, nativeEvent, nativeEventTarget) { - delete this.nativeEvent, delete this.preventDefault, delete this.stopPropagation, + delete this.nativeEvent, delete this.preventDefault, delete this.stopPropagation, this.dispatchConfig = dispatchConfig, this._targetInst = targetInst, this.nativeEvent = nativeEvent; var Interface = this.constructor.Interface; for (var propName in Interface) if (Interface.hasOwnProperty(propName)) { @@ -541,7 +541,7 @@ function SyntheticEvent(dispatchConfig, targetInst, nativeEvent, nativeEventTarg normalize ? this[propName] = normalize(nativeEvent) : "target" === propName ? this.target = nativeEventTarget : this[propName] = nativeEvent[propName]; } var defaultPrevented = null != nativeEvent.defaultPrevented ? nativeEvent.defaultPrevented : !1 === nativeEvent.returnValue; - return this.isDefaultPrevented = defaultPrevented ? emptyFunction.thatReturnsTrue : emptyFunction.thatReturnsFalse, + return this.isDefaultPrevented = defaultPrevented ? emptyFunction.thatReturnsTrue : emptyFunction.thatReturnsFalse, this.isPropagationStopped = emptyFunction.thatReturnsFalse, this; } @@ -549,12 +549,12 @@ Object.assign(SyntheticEvent.prototype, { preventDefault: function() { this.defaultPrevented = !0; var event = this.nativeEvent; - event && (event.preventDefault ? event.preventDefault() : "unknown" != typeof event.returnValue && (event.returnValue = !1), + event && (event.preventDefault ? event.preventDefault() : "unknown" != typeof event.returnValue && (event.returnValue = !1), this.isDefaultPrevented = emptyFunction.thatReturnsTrue); }, stopPropagation: function() { var event = this.nativeEvent; - event && (event.stopPropagation ? event.stopPropagation() : "unknown" != typeof event.cancelBubble && (event.cancelBubble = !0), + event && (event.stopPropagation ? event.stopPropagation() : "unknown" != typeof event.cancelBubble && (event.cancelBubble = !0), this.isPropagationStopped = emptyFunction.thatReturnsTrue); }, persist: function() { @@ -565,8 +565,8 @@ Object.assign(SyntheticEvent.prototype, { var Interface = this.constructor.Interface; for (var propName in Interface) Object.defineProperty(this, propName, getPooledWarningPropertyDefinition(propName, Interface[propName])); for (var i = 0; i < shouldBeReleasedProperties.length; i++) this[shouldBeReleasedProperties[i]] = null; - Object.defineProperty(this, "nativeEvent", getPooledWarningPropertyDefinition("nativeEvent", null)), - Object.defineProperty(this, "preventDefault", getPooledWarningPropertyDefinition("preventDefault", emptyFunction)), + Object.defineProperty(this, "nativeEvent", getPooledWarningPropertyDefinition("nativeEvent", null)), + Object.defineProperty(this, "preventDefault", getPooledWarningPropertyDefinition("preventDefault", emptyFunction)), Object.defineProperty(this, "stopPropagation", getPooledWarningPropertyDefinition("stopPropagation", emptyFunction)); } }), SyntheticEvent.Interface = EventInterface, isProxySupported && (SyntheticEvent = new Proxy(SyntheticEvent, { @@ -576,7 +576,7 @@ Object.assign(SyntheticEvent.prototype, { apply: function(constructor, that, args) { return new Proxy(constructor.apply(that, args), { set: function(target, prop, value) { - return "isPersistent" === prop || target.constructor.Interface.hasOwnProperty(prop) || -1 !== shouldBeReleasedProperties.indexOf(prop) || (warning(didWarnForAddedNewProperty || target.isPersistent(), "This synthetic event is reused for performance reasons. If you're " + "seeing this, you're adding a new property in the synthetic event object. " + "The property is never released. See " + "https://fb.me/react-event-pooling for more information."), + return "isPersistent" === prop || target.constructor.Interface.hasOwnProperty(prop) || -1 !== shouldBeReleasedProperties.indexOf(prop) || (warning(didWarnForAddedNewProperty || target.isPersistent(), "This synthetic event is reused for performance reasons. If you're " + "seeing this, you're adding a new property in the synthetic event object. " + "The property is never released. See " + "https://fb.me/react-event-pooling for more information."), didWarnForAddedNewProperty = !0), target[prop] = value, !0; } }); @@ -585,8 +585,8 @@ Object.assign(SyntheticEvent.prototype, { var Super = this, E = function() {}; E.prototype = Super.prototype; var prototype = new E(); - Object.assign(prototype, Class.prototype), Class.prototype = prototype, Class.prototype.constructor = Class, - Class.Interface = Object.assign({}, Super.Interface, Interface), Class.augmentClass = Super.augmentClass, + Object.assign(prototype, Class.prototype), Class.prototype = prototype, Class.prototype.constructor = Class, + Class.Interface = Object.assign({}, Super.Interface, Interface), Class.augmentClass = Super.augmentClass, PooledClass_1.addPoolingTo(Class, PooledClass_1.fourArgumentPooler); }, PooledClass_1.addPoolingTo(SyntheticEvent, PooledClass_1.fourArgumentPooler); @@ -600,11 +600,11 @@ function getPooledWarningPropertyDefinition(propName, getVal) { get: get }; function set(val) { - return warn(isFunction ? "setting the method" : "setting the property", "This is effectively a no-op"), + return warn(isFunction ? "setting the method" : "setting the property", "This is effectively a no-op"), val; } function get() { - return warn(isFunction ? "accessing the method" : "accessing the property", isFunction ? "This is a no-op function" : "This is set to null"), + return warn(isFunction ? "accessing the method" : "accessing the property", isFunction ? "This is a no-op function" : "This is set to null"), getVal; } function warn(action, result) { @@ -622,7 +622,7 @@ var _extends = Object.assign || function(target) { for (var bubblingTypeName in customBubblingEventTypes) allTypesByEventName[bubblingTypeName] = customBubblingEventTypes[bubblingTypeName]; -for (var directTypeName in customDirectEventTypes) warning(!customBubblingEventTypes[directTypeName], "Event cannot be both direct and bubbling: %s", directTypeName), +for (var directTypeName in customDirectEventTypes) warning(!customBubblingEventTypes[directTypeName], "Event cannot be both direct and bubbling: %s", directTypeName), allTypesByEventName[directTypeName] = customDirectEventTypes[directTypeName]; var ReactNativeBridgeEventPlugin = { @@ -673,7 +673,7 @@ function restoreStateOfTarget(target) { var props = EventPluginUtils_1.getFiberCurrentPropsFromNode(internalInstance.stateNode); return void fiberHostComponent.restoreControlledState(internalInstance.stateNode, internalInstance.type, props); } - invariant("function" == typeof internalInstance.restoreControlledState, "The internal instance must be a React host component."), + invariant("function" == typeof internalInstance.restoreControlledState, "The internal instance must be a React host component."), internalInstance.restoreControlledState(); } } @@ -762,7 +762,7 @@ var ReactGenericBatchingInjection = { var touch = changedTouches[jj]; touch.changedTouches = changedTouches, touch.touches = touches; var nativeEvent = touch, rootNodeID = null, target = nativeEvent.target; - null !== target && void 0 !== target && (target < ReactNativeTagHandles_1.tagsStartAt ? warning(!1, "A view is reporting that a touch occurred on tag zero.") : rootNodeID = target), + null !== target && void 0 !== target && (target < ReactNativeTagHandles_1.tagsStartAt ? warning(!1, "A view is reporting that a touch occurred on tag zero.") : rootNodeID = target), ReactNativeEventEmitter._receiveRootNodeIDEvent(rootNodeID, eventTopLevelType, nativeEvent); } } @@ -812,38 +812,38 @@ function createTouchRecord(touch) { } function resetTouchRecord(touchRecord, touch) { - touchRecord.touchActive = !0, touchRecord.startPageX = touch.pageX, touchRecord.startPageY = touch.pageY, - touchRecord.startTimeStamp = timestampForTouch(touch), touchRecord.currentPageX = touch.pageX, - touchRecord.currentPageY = touch.pageY, touchRecord.currentTimeStamp = timestampForTouch(touch), - touchRecord.previousPageX = touch.pageX, touchRecord.previousPageY = touch.pageY, + touchRecord.touchActive = !0, touchRecord.startPageX = touch.pageX, touchRecord.startPageY = touch.pageY, + touchRecord.startTimeStamp = timestampForTouch(touch), touchRecord.currentPageX = touch.pageX, + touchRecord.currentPageY = touch.pageY, touchRecord.currentTimeStamp = timestampForTouch(touch), + touchRecord.previousPageX = touch.pageX, touchRecord.previousPageY = touch.pageY, touchRecord.previousTimeStamp = timestampForTouch(touch); } function getTouchIdentifier(_ref) { var identifier = _ref.identifier; - return invariant(null != identifier, "Touch object is missing identifier."), warning(identifier <= MAX_TOUCH_BANK, "Touch identifier %s is greater than maximum supported %s which causes " + "performance issues backfilling array locations for all of the indices.", identifier, MAX_TOUCH_BANK), + return invariant(null != identifier, "Touch object is missing identifier."), warning(identifier <= MAX_TOUCH_BANK, "Touch identifier %s is greater than maximum supported %s which causes " + "performance issues backfilling array locations for all of the indices.", identifier, MAX_TOUCH_BANK), identifier; } function recordTouchStart(touch) { var identifier = getTouchIdentifier(touch), touchRecord = touchBank[identifier]; - touchRecord ? resetTouchRecord(touchRecord, touch) : touchBank[identifier] = createTouchRecord(touch), + touchRecord ? resetTouchRecord(touchRecord, touch) : touchBank[identifier] = createTouchRecord(touch), touchHistory.mostRecentTimeStamp = timestampForTouch(touch); } function recordTouchMove(touch) { var touchRecord = touchBank[getTouchIdentifier(touch)]; - touchRecord ? (touchRecord.touchActive = !0, touchRecord.previousPageX = touchRecord.currentPageX, - touchRecord.previousPageY = touchRecord.currentPageY, touchRecord.previousTimeStamp = touchRecord.currentTimeStamp, - touchRecord.currentPageX = touch.pageX, touchRecord.currentPageY = touch.pageY, + touchRecord ? (touchRecord.touchActive = !0, touchRecord.previousPageX = touchRecord.currentPageX, + touchRecord.previousPageY = touchRecord.currentPageY, touchRecord.previousTimeStamp = touchRecord.currentTimeStamp, + touchRecord.currentPageX = touch.pageX, touchRecord.currentPageY = touch.pageY, touchRecord.currentTimeStamp = timestampForTouch(touch), touchHistory.mostRecentTimeStamp = timestampForTouch(touch)) : console.error("Cannot record touch move without a touch start.\n" + "Touch Move: %s\n", "Touch Bank: %s", printTouch(touch), printTouchBank()); } function recordTouchEnd(touch) { var touchRecord = touchBank[getTouchIdentifier(touch)]; - touchRecord ? (touchRecord.touchActive = !1, touchRecord.previousPageX = touchRecord.currentPageX, - touchRecord.previousPageY = touchRecord.currentPageY, touchRecord.previousTimeStamp = touchRecord.currentTimeStamp, - touchRecord.currentPageX = touch.pageX, touchRecord.currentPageY = touch.pageY, + touchRecord ? (touchRecord.touchActive = !1, touchRecord.previousPageX = touchRecord.currentPageX, + touchRecord.previousPageY = touchRecord.currentPageY, touchRecord.previousTimeStamp = touchRecord.currentTimeStamp, + touchRecord.currentPageX = touch.pageX, touchRecord.currentPageY = touch.pageY, touchRecord.currentTimeStamp = timestampForTouch(touch), touchHistory.mostRecentTimeStamp = timestampForTouch(touch)) : console.error("Cannot record touch end without a touch start.\n" + "Touch End: %s\n", "Touch Bank: %s", printTouch(touch), printTouchBank()); } @@ -858,14 +858,14 @@ function printTouch(touch) { function printTouchBank() { var printed = JSON.stringify(touchBank.slice(0, MAX_TOUCH_BANK)); - return touchBank.length > MAX_TOUCH_BANK && (printed += " (original size: " + touchBank.length + ")"), + return touchBank.length > MAX_TOUCH_BANK && (printed += " (original size: " + touchBank.length + ")"), printed; } var ResponderTouchHistoryStore = { recordTouchTrack: function(topLevelType, nativeEvent) { - if (isMoveish$2(topLevelType)) nativeEvent.changedTouches.forEach(recordTouchMove); else if (isStartish$2(topLevelType)) nativeEvent.changedTouches.forEach(recordTouchStart), - touchHistory.numberActiveTouches = nativeEvent.touches.length, 1 === touchHistory.numberActiveTouches && (touchHistory.indexOfSingleActiveTouch = nativeEvent.touches[0].identifier); else if (isEndish$2(topLevelType) && (nativeEvent.changedTouches.forEach(recordTouchEnd), + if (isMoveish$2(topLevelType)) nativeEvent.changedTouches.forEach(recordTouchMove); else if (isStartish$2(topLevelType)) nativeEvent.changedTouches.forEach(recordTouchStart), + touchHistory.numberActiveTouches = nativeEvent.touches.length, 1 === touchHistory.numberActiveTouches && (touchHistory.indexOfSingleActiveTouch = nativeEvent.touches[0].identifier); else if (isEndish$2(topLevelType) && (nativeEvent.changedTouches.forEach(recordTouchEnd), touchHistory.numberActiveTouches = nativeEvent.touches.length, 1 === touchHistory.numberActiveTouches)) { for (var i = 0; i < touchBank.length; i++) { var touchTrackToCheck = touchBank[i]; @@ -882,7 +882,7 @@ var ResponderTouchHistoryStore = { }, ResponderTouchHistoryStore_1 = ResponderTouchHistoryStore; function accumulate(current, next) { - return invariant(null != next, "accumulate(...): Accumulated items must be not be null or undefined."), + return invariant(null != next, "accumulate(...): Accumulated items must be not be null or undefined."), null == current ? next : Array.isArray(current) ? current.concat(next) : Array.isArray(next) ? [ current ].concat(next) : [ current, next ]; } @@ -944,24 +944,24 @@ function setResponderAndExtractTransfer(topLevelType, targetInst, nativeEvent, n var shouldSetEventType = isStartish$1(topLevelType) ? eventTypes.startShouldSetResponder : isMoveish$1(topLevelType) ? eventTypes.moveShouldSetResponder : "topSelectionChange" === topLevelType ? eventTypes.selectionChangeShouldSetResponder : eventTypes.scrollShouldSetResponder, bubbleShouldSetFrom = responderInst ? ReactTreeTraversal.getLowestCommonAncestor(responderInst, targetInst) : targetInst, skipOverBubbleShouldSetFrom = bubbleShouldSetFrom === responderInst, shouldSetEvent = ResponderSyntheticEvent_1.getPooled(shouldSetEventType, bubbleShouldSetFrom, nativeEvent, nativeEventTarget); shouldSetEvent.touchHistory = ResponderTouchHistoryStore_1.touchHistory, skipOverBubbleShouldSetFrom ? EventPropagators_1.accumulateTwoPhaseDispatchesSkipTarget(shouldSetEvent) : EventPropagators_1.accumulateTwoPhaseDispatches(shouldSetEvent); var wantsResponderInst = executeDispatchesInOrderStopAtTrue$1(shouldSetEvent); - if (shouldSetEvent.isPersistent() || shouldSetEvent.constructor.release(shouldSetEvent), + if (shouldSetEvent.isPersistent() || shouldSetEvent.constructor.release(shouldSetEvent), !wantsResponderInst || wantsResponderInst === responderInst) return null; var extracted, grantEvent = ResponderSyntheticEvent_1.getPooled(eventTypes.responderGrant, wantsResponderInst, nativeEvent, nativeEventTarget); grantEvent.touchHistory = ResponderTouchHistoryStore_1.touchHistory, EventPropagators_1.accumulateDirectDispatches(grantEvent); var blockHostResponder = !0 === executeDirectDispatch$1(grantEvent); if (responderInst) { var terminationRequestEvent = ResponderSyntheticEvent_1.getPooled(eventTypes.responderTerminationRequest, responderInst, nativeEvent, nativeEventTarget); - terminationRequestEvent.touchHistory = ResponderTouchHistoryStore_1.touchHistory, + terminationRequestEvent.touchHistory = ResponderTouchHistoryStore_1.touchHistory, EventPropagators_1.accumulateDirectDispatches(terminationRequestEvent); var shouldSwitch = !hasDispatches$1(terminationRequestEvent) || executeDirectDispatch$1(terminationRequestEvent); - if (terminationRequestEvent.isPersistent() || terminationRequestEvent.constructor.release(terminationRequestEvent), + if (terminationRequestEvent.isPersistent() || terminationRequestEvent.constructor.release(terminationRequestEvent), shouldSwitch) { var terminateEvent = ResponderSyntheticEvent_1.getPooled(eventTypes.responderTerminate, responderInst, nativeEvent, nativeEventTarget); - terminateEvent.touchHistory = ResponderTouchHistoryStore_1.touchHistory, EventPropagators_1.accumulateDirectDispatches(terminateEvent), + terminateEvent.touchHistory = ResponderTouchHistoryStore_1.touchHistory, EventPropagators_1.accumulateDirectDispatches(terminateEvent), extracted = accumulate_1(extracted, [ grantEvent, terminateEvent ]), changeResponder(wantsResponderInst, blockHostResponder); } else { var rejectEvent = ResponderSyntheticEvent_1.getPooled(eventTypes.responderReject, wantsResponderInst, nativeEvent, nativeEventTarget); - rejectEvent.touchHistory = ResponderTouchHistoryStore_1.touchHistory, EventPropagators_1.accumulateDirectDispatches(rejectEvent), + rejectEvent.touchHistory = ResponderTouchHistoryStore_1.touchHistory, EventPropagators_1.accumulateDirectDispatches(rejectEvent), extracted = accumulate_1(extracted, rejectEvent); } } else extracted = accumulate_1(extracted, grantEvent), changeResponder(wantsResponderInst, blockHostResponder); @@ -992,7 +992,7 @@ var ResponderEventPlugin = { eventTypes: eventTypes, extractEvents: function(topLevelType, targetInst, nativeEvent, nativeEventTarget) { if (isStartish$1(topLevelType)) trackedTouchCount += 1; else if (isEndish$1(topLevelType)) { - if (!(trackedTouchCount >= 0)) return console.error("Ended a touch event which was not counted in `trackedTouchCount`."), + if (!(trackedTouchCount >= 0)) return console.error("Ended a touch event which was not counted in `trackedTouchCount`."), null; trackedTouchCount -= 1; } @@ -1000,17 +1000,17 @@ var ResponderEventPlugin = { var extracted = canTriggerTransfer(topLevelType, targetInst, nativeEvent) ? setResponderAndExtractTransfer(topLevelType, targetInst, nativeEvent, nativeEventTarget) : null, isResponderTouchStart = responderInst && isStartish$1(topLevelType), isResponderTouchMove = responderInst && isMoveish$1(topLevelType), isResponderTouchEnd = responderInst && isEndish$1(topLevelType), incrementalTouch = isResponderTouchStart ? eventTypes.responderStart : isResponderTouchMove ? eventTypes.responderMove : isResponderTouchEnd ? eventTypes.responderEnd : null; if (incrementalTouch) { var gesture = ResponderSyntheticEvent_1.getPooled(incrementalTouch, responderInst, nativeEvent, nativeEventTarget); - gesture.touchHistory = ResponderTouchHistoryStore_1.touchHistory, EventPropagators_1.accumulateDirectDispatches(gesture), + gesture.touchHistory = ResponderTouchHistoryStore_1.touchHistory, EventPropagators_1.accumulateDirectDispatches(gesture), extracted = accumulate_1(extracted, gesture); } var isResponderTerminate = responderInst && "topTouchCancel" === topLevelType, isResponderRelease = responderInst && !isResponderTerminate && isEndish$1(topLevelType) && noResponderTouches(nativeEvent), finalTouch = isResponderTerminate ? eventTypes.responderTerminate : isResponderRelease ? eventTypes.responderRelease : null; if (finalTouch) { var finalEvent = ResponderSyntheticEvent_1.getPooled(finalTouch, responderInst, nativeEvent, nativeEventTarget); - finalEvent.touchHistory = ResponderTouchHistoryStore_1.touchHistory, EventPropagators_1.accumulateDirectDispatches(finalEvent), + finalEvent.touchHistory = ResponderTouchHistoryStore_1.touchHistory, EventPropagators_1.accumulateDirectDispatches(finalEvent), extracted = accumulate_1(extracted, finalEvent), changeResponder(null); } var numberActiveTouches = ResponderTouchHistoryStore_1.touchHistory.numberActiveTouches; - return ResponderEventPlugin.GlobalInteractionHandler && numberActiveTouches !== previousActiveTouches && ResponderEventPlugin.GlobalInteractionHandler.onChange(numberActiveTouches), + return ResponderEventPlugin.GlobalInteractionHandler && numberActiveTouches !== previousActiveTouches && ResponderEventPlugin.GlobalInteractionHandler.onChange(numberActiveTouches), previousActiveTouches = numberActiveTouches, extracted; }, GlobalResponderHandler: null, @@ -1026,8 +1026,8 @@ var ResponderEventPlugin = { }, ResponderEventPlugin_1 = ResponderEventPlugin; function inject() { - RCTEventEmitter.register(ReactNativeEventEmitter_1), EventPluginHub_1.injection.injectEventPluginOrder(ReactNativeEventPluginOrder_1), - EventPluginUtils_1.injection.injectComponentTree(ReactNativeComponentTree_1), ResponderEventPlugin_1.injection.injectGlobalResponderHandler(ReactNativeGlobalResponderHandler_1), + RCTEventEmitter.register(ReactNativeEventEmitter_1), EventPluginHub_1.injection.injectEventPluginOrder(ReactNativeEventPluginOrder_1), + EventPluginUtils_1.injection.injectComponentTree(ReactNativeComponentTree_1), ResponderEventPlugin_1.injection.injectGlobalResponderHandler(ReactNativeGlobalResponderHandler_1), EventPluginHub_1.injection.injectEventPluginsByName({ ResponderEventPlugin: ResponderEventPlugin_1, ReactNativeBridgeEventPlugin: ReactNativeBridgeEventPlugin_1 @@ -1079,7 +1079,7 @@ var ReactGlobalSharedState_1 = ReactGlobalSharedState, ReactComponentTreeHook = try { fn.call(context, arg1, arg2, arg3, arg4, arg5); } catch (e) { - warning(didHookThrowForEvent[event], "Exception thrown by hook while handling %s: %s", event, e + "\n" + e.stack), + warning(didHookThrowForEvent[event], "Exception thrown by hook while handling %s: %s", event, e + "\n" + e.stack), didHookThrowForEvent[event] = !0; } }, emitEvent = function(event, arg1, arg2, arg3, arg4, arg5) { @@ -1103,7 +1103,7 @@ var ReactGlobalSharedState_1 = ReactGlobalSharedState, ReactComponentTreeHook = }, {}); }, resetMeasurements = function() { var previousStartTime = currentFlushStartTime, previousMeasurements = currentFlushMeasurements, previousOperations = ReactHostOperationHistoryHook_1.getHistory(); - if (0 === currentFlushNesting) return currentFlushStartTime = 0, currentFlushMeasurements = [], + if (0 === currentFlushNesting) return currentFlushStartTime = 0, currentFlushMeasurements = [], void clearHistory(); if (previousMeasurements.length || previousOperations.length) { var registeredIDs = ReactComponentTreeHook.getRegisteredIDs(); @@ -1118,16 +1118,16 @@ var ReactGlobalSharedState_1 = ReactGlobalSharedState, ReactComponentTreeHook = }, checkDebugID = function(debugID) { arguments.length > 1 && void 0 !== arguments[1] && arguments[1] && 0 === debugID || debugID || warning(!1, "ReactDebugTool: debugID may not be empty."); }, beginLifeCycleTimer = function(debugID, timerType) { - 0 !== currentFlushNesting && (currentTimerType && !lifeCycleTimerHasWarned && (warning(!1, "There is an internal error in the React performance measurement code." + "\n\nDid not expect %s timer to start while %s timer is still in " + "progress for %s instance.", timerType, currentTimerType || "no", debugID === currentTimerDebugID ? "the same" : "another"), - lifeCycleTimerHasWarned = !0), currentTimerStartTime = performanceNow(), currentTimerNestedFlushDuration = 0, + 0 !== currentFlushNesting && (currentTimerType && !lifeCycleTimerHasWarned && (warning(!1, "There is an internal error in the React performance measurement code." + "\n\nDid not expect %s timer to start while %s timer is still in " + "progress for %s instance.", timerType, currentTimerType || "no", debugID === currentTimerDebugID ? "the same" : "another"), + lifeCycleTimerHasWarned = !0), currentTimerStartTime = performanceNow(), currentTimerNestedFlushDuration = 0, currentTimerDebugID = debugID, currentTimerType = timerType); }, endLifeCycleTimer = function(debugID, timerType) { - 0 !== currentFlushNesting && (currentTimerType === timerType || lifeCycleTimerHasWarned || (warning(!1, "There is an internal error in the React performance measurement code. " + "We did not expect %s timer to stop while %s timer is still in " + "progress for %s instance. Please report this as a bug in React.", timerType, currentTimerType || "no", debugID === currentTimerDebugID ? "the same" : "another"), + 0 !== currentFlushNesting && (currentTimerType === timerType || lifeCycleTimerHasWarned || (warning(!1, "There is an internal error in the React performance measurement code. " + "We did not expect %s timer to stop while %s timer is still in " + "progress for %s instance. Please report this as a bug in React.", timerType, currentTimerType || "no", debugID === currentTimerDebugID ? "the same" : "another"), lifeCycleTimerHasWarned = !0), isProfiling && currentFlushMeasurements.push({ timerType: timerType, instanceID: debugID, duration: performanceNow() - currentTimerStartTime - currentTimerNestedFlushDuration - }), currentTimerStartTime = 0, currentTimerNestedFlushDuration = 0, currentTimerDebugID = null, + }), currentTimerStartTime = 0, currentTimerNestedFlushDuration = 0, currentTimerDebugID = null, currentTimerType = null); }, pauseCurrentLifeCycleTimer = function() { var currentTimer = { @@ -1136,11 +1136,11 @@ var ReactGlobalSharedState_1 = ReactGlobalSharedState, ReactComponentTreeHook = debugID: currentTimerDebugID, timerType: currentTimerType }; - lifeCycleTimerStack.push(currentTimer), currentTimerStartTime = 0, currentTimerNestedFlushDuration = 0, + lifeCycleTimerStack.push(currentTimer), currentTimerStartTime = 0, currentTimerNestedFlushDuration = 0, currentTimerDebugID = null, currentTimerType = null; }, resumeCurrentLifeCycleTimer = function() { var _lifeCycleTimerStack$ = lifeCycleTimerStack.pop(), startTime = _lifeCycleTimerStack$.startTime, nestedFlushStartTime = _lifeCycleTimerStack$.nestedFlushStartTime, debugID = _lifeCycleTimerStack$.debugID, timerType = _lifeCycleTimerStack$.timerType, nestedFlushDuration = performanceNow() - nestedFlushStartTime; - currentTimerStartTime = startTime, currentTimerNestedFlushDuration += nestedFlushDuration, + currentTimerStartTime = startTime, currentTimerNestedFlushDuration += nestedFlushDuration, currentTimerDebugID = debugID, currentTimerType = timerType; }, lastMarkTimeStamp = 0, canUsePerformanceMeasure = "undefined" != typeof performance && "function" == typeof performance.mark && "function" == typeof performance.clearMarks && "function" == typeof performance.measure && "function" == typeof performance.clearMeasures, shouldMark = function(debugID) { if (!isProfiling || !canUsePerformanceMeasure) return !1; @@ -1167,14 +1167,14 @@ ReactDebugTool$1 = { hooks.push(hook); }, removeHook: function(hook) { - for (var i = 0; i < hooks.length; i++) hooks[i] === hook && (hooks.splice(i, 1), + for (var i = 0; i < hooks.length; i++) hooks[i] === hook && (hooks.splice(i, 1), i--); }, isProfiling: function() { return isProfiling; }, beginProfiling: function() { - isProfiling || (isProfiling = !0, flushHistory.length = 0, resetMeasurements(), + isProfiling || (isProfiling = !0, flushHistory.length = 0, resetMeasurements(), ReactDebugTool$1.addHook(ReactHostOperationHistoryHook_1)); }, endProfiling: function() { @@ -1190,11 +1190,11 @@ ReactDebugTool$1 = { resetMeasurements(), currentFlushNesting--, resumeCurrentLifeCycleTimer(), emitEvent("onEndFlush"); }, onBeginLifeCycleTimer: function(debugID, timerType) { - checkDebugID(debugID), emitEvent("onBeginLifeCycleTimer", debugID, timerType), markBegin(debugID, timerType), + checkDebugID(debugID), emitEvent("onBeginLifeCycleTimer", debugID, timerType), markBegin(debugID, timerType), beginLifeCycleTimer(debugID, timerType); }, onEndLifeCycleTimer: function(debugID, timerType) { - checkDebugID(debugID), endLifeCycleTimer(debugID, timerType), markEnd(debugID, timerType), + checkDebugID(debugID), endLifeCycleTimer(debugID, timerType), markEnd(debugID, timerType), emitEvent("onEndLifeCycleTimer", debugID, timerType); }, onBeginProcessingChildContext: function() { @@ -1213,7 +1213,7 @@ ReactDebugTool$1 = { checkDebugID(debugID), childDebugIDs.forEach(checkDebugID), emitEvent("onSetChildren", debugID, childDebugIDs); }, onBeforeMountComponent: function(debugID, element, parentDebugID) { - checkDebugID(debugID), checkDebugID(parentDebugID, !0), emitEvent("onBeforeMountComponent", debugID, element, parentDebugID), + checkDebugID(debugID), checkDebugID(parentDebugID, !0), emitEvent("onBeforeMountComponent", debugID, element, parentDebugID), markBegin(debugID, "mount"); }, onMountComponent: function(debugID) { @@ -1265,7 +1265,7 @@ var ReactOwner = { if (owner && owner.tag === ClassComponent) { var inst = owner.stateNode; (inst.refs === emptyObject ? inst.refs = {} : inst.refs)[ref] = component.getPublicInstance(); - } else invariant(isValidOwner(owner), "addComponentAsRefTo(...): Only a ReactOwner can have refs. You might " + "be adding a ref to a component that was not created inside a component's " + "`render` method, or you have multiple copies of React loaded " + "(details: https://fb.me/react-refs-must-have-owner)."), + } else invariant(isValidOwner(owner), "addComponentAsRefTo(...): Only a ReactOwner can have refs. You might " + "be adding a ref to a component that was not created inside a component's " + "`render` method, or you have multiple copies of React loaded " + "(details: https://fb.me/react-refs-must-have-owner)."), owner.attachRef(ref, component); }, removeComponentAsRefFrom: function(component, ref, owner) { @@ -1289,8 +1289,8 @@ function attachRef(ref, component, owner) { var info = "", ownerName = void 0; owner && ("function" == typeof owner.getName && (ownerName = owner.getName()), ownerName && (info += "\n\nCheck the render method of `" + ownerName + "`.")); var warningKey = ownerName || component._debugID, element = component._currentElement; - element && element._source && (warningKey = element._source.fileName + ":" + element._source.lineNumber), - warnedAboutStatelessRefs[warningKey] || (warnedAboutStatelessRefs[warningKey] = !0, + element && element._source && (warningKey = element._source.fileName + ":" + element._source.lineNumber), + warnedAboutStatelessRefs[warningKey] || (warnedAboutStatelessRefs[warningKey] = !0, warning$2(!1, "Stateless function components cannot be given refs. " + "Attempts to access this ref will fail.%s%s", info, ReactComponentTreeHook$1.getStackAddendumByID(component._debugID))); } "function" == typeof ref ? ref(component.getPublicInstance()) : ReactOwner_1.addComponentAsRefTo(component, ref, owner); @@ -1307,10 +1307,10 @@ ReactRef.attachRefs = function(instance, element) { } }, ReactRef.shouldUpdateRefs = function(prevElement, nextElement) { var prevRef = null, prevOwner = null; - null !== prevElement && "object" == typeof prevElement && (prevRef = prevElement.ref, + null !== prevElement && "object" == typeof prevElement && (prevRef = prevElement.ref, prevOwner = prevElement._owner); var nextRef = null, nextOwner = null; - return null !== nextElement && "object" == typeof nextElement && (nextRef = nextElement.ref, + return null !== nextElement && "object" == typeof nextElement && (nextRef = nextElement.ref, nextOwner = nextElement._owner), prevRef !== nextRef || "string" == typeof nextRef && nextOwner !== prevOwner; }, ReactRef.detachRefs = function(instance, element) { if (null !== element && "object" == typeof element) { @@ -1329,16 +1329,16 @@ var ReactReconciler = { mountComponent: function(internalInstance, transaction, hostParent, hostContainerInfo, context, parentDebugID) { 0 !== internalInstance._debugID && ReactInstrumentation.debugTool.onBeforeMountComponent(internalInstance._debugID, internalInstance._currentElement, parentDebugID); var markup = internalInstance.mountComponent(transaction, hostParent, hostContainerInfo, context, parentDebugID); - return internalInstance._currentElement && null != internalInstance._currentElement.ref && transaction.getReactMountReady().enqueue(attachRefs, internalInstance), - 0 !== internalInstance._debugID && ReactInstrumentation.debugTool.onMountComponent(internalInstance._debugID), + return internalInstance._currentElement && null != internalInstance._currentElement.ref && transaction.getReactMountReady().enqueue(attachRefs, internalInstance), + 0 !== internalInstance._debugID && ReactInstrumentation.debugTool.onMountComponent(internalInstance._debugID), markup; }, getHostNode: function(internalInstance) { return internalInstance.getHostNode(); }, unmountComponent: function(internalInstance, safely, skipLifecycle) { - 0 !== internalInstance._debugID && ReactInstrumentation.debugTool.onBeforeUnmountComponent(internalInstance._debugID), - ReactRef_1.detachRefs(internalInstance, internalInstance._currentElement), internalInstance.unmountComponent(safely, skipLifecycle), + 0 !== internalInstance._debugID && ReactInstrumentation.debugTool.onBeforeUnmountComponent(internalInstance._debugID), + ReactRef_1.detachRefs(internalInstance, internalInstance._currentElement), internalInstance.unmountComponent(safely, skipLifecycle), 0 !== internalInstance._debugID && ReactInstrumentation.debugTool.onUnmountComponent(internalInstance._debugID); }, receiveComponent: function(internalInstance, nextElement, transaction, context) { @@ -1346,14 +1346,14 @@ var ReactReconciler = { if (nextElement !== prevElement || context !== internalInstance._context) { 0 !== internalInstance._debugID && ReactInstrumentation.debugTool.onBeforeUpdateComponent(internalInstance._debugID, nextElement); var refsChanged = ReactRef_1.shouldUpdateRefs(prevElement, nextElement); - refsChanged && ReactRef_1.detachRefs(internalInstance, prevElement), internalInstance.receiveComponent(nextElement, transaction, context), - refsChanged && internalInstance._currentElement && null != internalInstance._currentElement.ref && transaction.getReactMountReady().enqueue(attachRefs, internalInstance), + refsChanged && ReactRef_1.detachRefs(internalInstance, prevElement), internalInstance.receiveComponent(nextElement, transaction, context), + refsChanged && internalInstance._currentElement && null != internalInstance._currentElement.ref && transaction.getReactMountReady().enqueue(attachRefs, internalInstance), 0 !== internalInstance._debugID && ReactInstrumentation.debugTool.onUpdateComponent(internalInstance._debugID); } }, performUpdateIfNecessary: function(internalInstance, transaction, updateBatchNumber) { if (internalInstance._updateBatchNumber !== updateBatchNumber) return void warning(null == internalInstance._updateBatchNumber || internalInstance._updateBatchNumber === updateBatchNumber + 1, "performUpdateIfNecessary: Unexpected batch number (current %s, " + "pending %s)", updateBatchNumber, internalInstance._updateBatchNumber); - 0 !== internalInstance._debugID && ReactInstrumentation.debugTool.onBeforeUpdateComponent(internalInstance._debugID, internalInstance._currentElement), + 0 !== internalInstance._debugID && ReactInstrumentation.debugTool.onBeforeUpdateComponent(internalInstance._debugID, internalInstance._currentElement), internalInstance.performUpdateIfNecessary(transaction), 0 !== internalInstance._debugID && ReactInstrumentation.debugTool.onUpdateComponent(internalInstance._debugID); } }, ReactReconciler_1 = ReactReconciler, ReactInstanceMap = { @@ -1369,14 +1369,9 @@ var ReactReconciler = { set: function(key, value) { key._reactInternalInstance = value; } -}, ReactInstanceMap_1 = ReactInstanceMap, ReactFeatureFlags = { - logTopLevelRenders: !1, - prepareNewChildrenBeforeUnmountInStack: !0, - disableNewFiberFeatures: !1, - enableAsyncSubtreeAPI: !1 -}, ReactFeatureFlags_1 = ReactFeatureFlags, OBSERVED_ERROR = {}, TransactionImpl = { +}, ReactInstanceMap_1 = ReactInstanceMap, OBSERVED_ERROR = {}, TransactionImpl = { reinitializeTransaction: function() { - this.transactionWrappers = this.getTransactionWrappers(), this.wrapperInitData ? this.wrapperInitData.length = 0 : this.wrapperInitData = [], + this.transactionWrappers = this.getTransactionWrappers(), this.wrapperInitData ? this.wrapperInitData.length = 0 : this.wrapperInitData = [], this._isInTransaction = !1; }, _isInTransaction: !1, @@ -1388,7 +1383,7 @@ var ReactReconciler = { invariant(!this.isInTransaction(), "Transaction.perform(...): Cannot initialize a transaction when there " + "is already an outstanding transaction."); var errorThrown, ret; try { - this._isInTransaction = !0, errorThrown = !0, this.initializeAll(0), ret = method.call(scope, a, b, c, d, e, f), + this._isInTransaction = !0, errorThrown = !0, this.initializeAll(0), ret = method.call(scope, a, b, c, d, e, f), errorThrown = !1; } finally { try { @@ -1418,7 +1413,7 @@ var ReactReconciler = { for (var transactionWrappers = this.transactionWrappers, i = startIndex; i < transactionWrappers.length; i++) { var errorThrown, wrapper = transactionWrappers[i], initData = this.wrapperInitData[i]; try { - errorThrown = !0, initData !== OBSERVED_ERROR && wrapper.close && wrapper.close.call(this, initData), + errorThrown = !0, initData !== OBSERVED_ERROR && wrapper.close && wrapper.close.call(this, initData), errorThrown = !1; } finally { if (errorThrown) try { @@ -1439,7 +1434,7 @@ var NESTED_UPDATES = { this.dirtyComponentsLength = dirtyComponents.length; }, close: function() { - this.dirtyComponentsLength !== dirtyComponents.length ? (dirtyComponents.splice(0, this.dirtyComponentsLength), + this.dirtyComponentsLength !== dirtyComponents.length ? (dirtyComponents.splice(0, this.dirtyComponentsLength), flushBatchedUpdates()) : dirtyComponents.length = 0; } }, TRANSACTION_WRAPPERS = [ NESTED_UPDATES ]; @@ -1453,7 +1448,7 @@ Object.assign(ReactUpdatesFlushTransaction.prototype, Transaction, { return TRANSACTION_WRAPPERS; }, destructor: function() { - this.dirtyComponentsLength = null, ReactUpdates.ReactReconcileTransaction.release(this.reconcileTransaction), + this.dirtyComponentsLength = null, ReactUpdates.ReactReconcileTransaction.release(this.reconcileTransaction), this.reconcileTransaction = null; }, perform: function(method, scope, a) { @@ -1471,17 +1466,11 @@ function mountOrderComparator(c1, c2) { function runBatchedUpdates(transaction) { var len = transaction.dirtyComponentsLength; - invariant(len === dirtyComponents.length, "Expected flush transaction's stored dirty-components length (%s) to " + "match dirty-components array length (%s).", len, dirtyComponents.length), + invariant(len === dirtyComponents.length, "Expected flush transaction's stored dirty-components length (%s) to " + "match dirty-components array length (%s).", len, dirtyComponents.length), dirtyComponents.sort(mountOrderComparator), updateBatchNumber++; for (var i = 0; i < len; i++) { - var markerName, component = dirtyComponents[i]; - if (ReactFeatureFlags_1.logTopLevelRenders) { - var namedComponent = component; - component._currentElement.type.isReactTopLevelWrapper && (namedComponent = component._renderedComponent), - markerName = "React update: " + namedComponent.getName(), console.time(markerName); - } - ReactReconciler_1.performUpdateIfNecessary(component, transaction.reconcileTransaction, updateBatchNumber), - markerName && console.timeEnd(markerName); + var component = dirtyComponents[i]; + ReactReconciler_1.performUpdateIfNecessary(component, transaction.reconcileTransaction, updateBatchNumber); } } @@ -1499,13 +1488,13 @@ function enqueueUpdate$1(component) { var ReactUpdatesInjection = { injectReconcileTransaction: function(ReconcileTransaction) { - invariant(ReconcileTransaction, "ReactUpdates: must provide a reconcile transaction class"), + invariant(ReconcileTransaction, "ReactUpdates: must provide a reconcile transaction class"), ReactUpdates.ReactReconcileTransaction = ReconcileTransaction; }, injectBatchingStrategy: function(_batchingStrategy) { - invariant(_batchingStrategy, "ReactUpdates: must provide a batching strategy"), - invariant("function" == typeof _batchingStrategy.batchedUpdates, "ReactUpdates: must provide a batchedUpdates() function"), - invariant("boolean" == typeof _batchingStrategy.isBatchingUpdates, "ReactUpdates: must provide an isBatchingUpdates boolean attribute"), + invariant(_batchingStrategy, "ReactUpdates: must provide a batching strategy"), + invariant("function" == typeof _batchingStrategy.batchedUpdates, "ReactUpdates: must provide a batchedUpdates() function"), + invariant("boolean" == typeof _batchingStrategy.isBatchingUpdates, "ReactUpdates: must provide an isBatchingUpdates boolean attribute"), batchingStrategy = _batchingStrategy; }, getBatchingStrategy: function() { @@ -1529,50 +1518,50 @@ function getInternalInstanceReadyForUpdate(publicInstance, callerName) { var internalInstance = ReactInstanceMap_1.get(publicInstance); if (!internalInstance) { var ctor = publicInstance.constructor; - return warning$3(!1, "Can only update a mounted or mounting component. This usually means " + "you called setState, replaceState, or forceUpdate on an unmounted " + "component. This is a no-op.\n\nPlease check the code for the " + "%s component.", ctor && (ctor.displayName || ctor.name) || "ReactClass"), + return warning$3(!1, "Can only update a mounted or mounting component. This usually means " + "you called setState, replaceState, or forceUpdate on an unmounted " + "component. This is a no-op.\n\nPlease check the code for the " + "%s component.", ctor && (ctor.displayName || ctor.name) || "ReactClass"), null; } - return warning$3(null == ReactCurrentOwner.current, "Cannot update during an existing state transition (such as within " + "`render` or another component's constructor). Render methods should " + "be a pure function of props and state; constructor side-effects are " + "an anti-pattern, but can be moved to `componentWillMount`."), + return warning$3(null == ReactCurrentOwner.current, "Cannot update during an existing state transition (such as within " + "`render` or another component's constructor). Render methods should " + "be a pure function of props and state; constructor side-effects are " + "an anti-pattern, but can be moved to `componentWillMount`."), internalInstance; } var ReactUpdateQueue = { isMounted: function(publicInstance) { var owner = ReactCurrentOwner.current; - null !== owner && (warning$3(owner._warnedAboutRefsInRender, "%s is accessing isMounted inside its render() function. " + "render() should be a pure function of props and state. It should " + "never access something that requires stale data from the previous " + "render, such as refs. Move this logic to componentDidMount and " + "componentDidUpdate instead.", owner.getName() || "A component"), + null !== owner && (warning$3(owner._warnedAboutRefsInRender, "%s is accessing isMounted inside its render() function. " + "render() should be a pure function of props and state. It should " + "never access something that requires stale data from the previous " + "render, such as refs. Move this logic to componentDidMount and " + "componentDidUpdate instead.", owner.getName() || "A component"), owner._warnedAboutRefsInRender = !0); var internalInstance = ReactInstanceMap_1.get(publicInstance); return !!internalInstance && !!internalInstance._renderedComponent; }, enqueueCallbackInternal: function(internalInstance, callback) { - internalInstance._pendingCallbacks ? internalInstance._pendingCallbacks.push(callback) : internalInstance._pendingCallbacks = [ callback ], + internalInstance._pendingCallbacks ? internalInstance._pendingCallbacks.push(callback) : internalInstance._pendingCallbacks = [ callback ], enqueueUpdate(internalInstance); }, enqueueForceUpdate: function(publicInstance, callback, callerName) { var internalInstance = getInternalInstanceReadyForUpdate(publicInstance); - internalInstance && (callback = void 0 === callback ? null : callback, null !== callback && (warnOnInvalidCallback(callback, callerName), - internalInstance._pendingCallbacks ? internalInstance._pendingCallbacks.push(callback) : internalInstance._pendingCallbacks = [ callback ]), + internalInstance && (callback = void 0 === callback ? null : callback, null !== callback && (warnOnInvalidCallback(callback, callerName), + internalInstance._pendingCallbacks ? internalInstance._pendingCallbacks.push(callback) : internalInstance._pendingCallbacks = [ callback ]), internalInstance._pendingForceUpdate = !0, enqueueUpdate(internalInstance)); }, enqueueReplaceState: function(publicInstance, completeState, callback, callerName) { var internalInstance = getInternalInstanceReadyForUpdate(publicInstance); - internalInstance && (internalInstance._pendingStateQueue = [ completeState ], internalInstance._pendingReplaceState = !0, - callback = void 0 === callback ? null : callback, null !== callback && (warnOnInvalidCallback(callback, callerName), - internalInstance._pendingCallbacks ? internalInstance._pendingCallbacks.push(callback) : internalInstance._pendingCallbacks = [ callback ]), + internalInstance && (internalInstance._pendingStateQueue = [ completeState ], internalInstance._pendingReplaceState = !0, + callback = void 0 === callback ? null : callback, null !== callback && (warnOnInvalidCallback(callback, callerName), + internalInstance._pendingCallbacks ? internalInstance._pendingCallbacks.push(callback) : internalInstance._pendingCallbacks = [ callback ]), enqueueUpdate(internalInstance)); }, enqueueSetState: function(publicInstance, partialState, callback, callerName) { ReactInstrumentation.debugTool.onSetState(), warning$3(null != partialState, "setState(...): You passed an undefined or null state object; " + "instead, use forceUpdate()."); var internalInstance = getInternalInstanceReadyForUpdate(publicInstance); if (internalInstance) { - (internalInstance._pendingStateQueue || (internalInstance._pendingStateQueue = [])).push(partialState), - callback = void 0 === callback ? null : callback, null !== callback && (warnOnInvalidCallback(callback, callerName), - internalInstance._pendingCallbacks ? internalInstance._pendingCallbacks.push(callback) : internalInstance._pendingCallbacks = [ callback ]), + (internalInstance._pendingStateQueue || (internalInstance._pendingStateQueue = [])).push(partialState), + callback = void 0 === callback ? null : callback, null !== callback && (warnOnInvalidCallback(callback, callerName), + internalInstance._pendingCallbacks ? internalInstance._pendingCallbacks.push(callback) : internalInstance._pendingCallbacks = [ callback ]), enqueueUpdate(internalInstance); } }, enqueueElementInternal: function(internalInstance, nextElement, nextContext) { - internalInstance._pendingElement = nextElement, internalInstance._context = nextContext, + internalInstance._pendingElement = nextElement, internalInstance._context = nextContext, enqueueUpdate(internalInstance); } }, ReactUpdateQueue_1 = ReactUpdateQueue, injected = !1, ReactComponentEnvironment = { @@ -1580,9 +1569,9 @@ var ReactUpdateQueue = { processChildrenUpdates: null, injection: { injectEnvironment: function(environment) { - invariant(!injected, "ReactCompositeComponent: injectEnvironment() can only be called once."), - ReactComponentEnvironment.replaceNodeWithMarkup = environment.replaceNodeWithMarkup, - ReactComponentEnvironment.processChildrenUpdates = environment.processChildrenUpdates, + invariant(!injected, "ReactCompositeComponent: injectEnvironment() can only be called once."), + ReactComponentEnvironment.replaceNodeWithMarkup = environment.replaceNodeWithMarkup, + ReactComponentEnvironment.processChildrenUpdates = environment.processChildrenUpdates, injected = !0; } } @@ -1630,44 +1619,44 @@ function measureLifeCyclePerf(fn, debugID, timerType) { var nextMountID = 1, ReactCompositeComponent = { construct: function(element) { - this._currentElement = element, this._rootNodeID = 0, this._compositeType = null, - this._instance = null, this._hostParent = null, this._hostContainerInfo = null, - this._updateBatchNumber = null, this._pendingElement = null, this._pendingStateQueue = null, - this._pendingReplaceState = !1, this._pendingForceUpdate = !1, this._renderedNodeType = null, - this._renderedComponent = null, this._context = null, this._mountOrder = 0, this._topLevelWrapper = null, + this._currentElement = element, this._rootNodeID = 0, this._compositeType = null, + this._instance = null, this._hostParent = null, this._hostContainerInfo = null, + this._updateBatchNumber = null, this._pendingElement = null, this._pendingStateQueue = null, + this._pendingReplaceState = !1, this._pendingForceUpdate = !1, this._renderedNodeType = null, + this._renderedComponent = null, this._context = null, this._mountOrder = 0, this._topLevelWrapper = null, this._pendingCallbacks = null, this._calledComponentWillUnmount = !1, this._warnedAboutRefsInRender = !1; }, mountComponent: function(transaction, hostParent, hostContainerInfo, context) { var _this = this; - this._context = context, this._mountOrder = nextMountID++, this._hostParent = hostParent, + this._context = context, this._mountOrder = nextMountID++, this._hostParent = hostParent, this._hostContainerInfo = hostContainerInfo; var renderedElement, publicProps = this._currentElement.props, publicContext = this._processContext(context), Component = this._currentElement.type, updateQueue = transaction.getUpdateQueue(), doConstruct = shouldConstruct(Component), inst = this._constructComponent(doConstruct, publicProps, publicContext, updateQueue); - doConstruct || null != inst && null != inst.render ? isPureComponent(Component) ? this._compositeType = ReactCompositeComponentTypes$1.PureClass : this._compositeType = ReactCompositeComponentTypes$1.ImpureClass : (renderedElement = inst, - warning(!Component.childContextTypes, "%s(...): childContextTypes cannot be defined on a functional component.", Component.displayName || Component.name || "Component"), - invariant(null === inst || !1 === inst || React.isValidElement(inst), "%s(...): A valid React element (or null) must be returned. You may have " + "returned undefined, an array or some other invalid object.", Component.displayName || Component.name || "Component"), - inst = new StatelessComponent(Component), this._compositeType = ReactCompositeComponentTypes$1.StatelessFunctional), + doConstruct || null != inst && null != inst.render ? isPureComponent(Component) ? this._compositeType = ReactCompositeComponentTypes$1.PureClass : this._compositeType = ReactCompositeComponentTypes$1.ImpureClass : (renderedElement = inst, + warning(!Component.childContextTypes, "%s(...): childContextTypes cannot be defined on a functional component.", Component.displayName || Component.name || "Component"), + invariant(null === inst || !1 === inst || React.isValidElement(inst), "%s(...): A valid React element (or null) must be returned. You may have " + "returned undefined, an array or some other invalid object.", Component.displayName || Component.name || "Component"), + inst = new StatelessComponent(Component), this._compositeType = ReactCompositeComponentTypes$1.StatelessFunctional), null == inst.render && warning(!1, "%s(...): No `render` method found on the returned component " + "instance: you may have forgotten to define `render`.", Component.displayName || Component.name || "Component"); var propsMutated = inst.props !== publicProps, componentName = Component.displayName || Component.name || "Component"; - warning(void 0 === inst.props || !propsMutated, "%s(...): When calling super() in `%s`, make sure to pass " + "up the same props that your component's constructor was passed.", componentName, componentName), - inst.props = publicProps, inst.context = publicContext, inst.refs = emptyObject, - inst.updater = updateQueue, this._instance = inst, ReactInstanceMap_1.set(inst, this), - warning(!inst.getInitialState || inst.getInitialState.isReactClassApproved || inst.state, "getInitialState was defined on %s, a plain JavaScript class. " + "This is only supported for classes created using React.createClass. " + "Did you mean to define a state property instead?", this.getName() || "a component"), - warning(!inst.getDefaultProps || inst.getDefaultProps.isReactClassApproved, "getDefaultProps was defined on %s, a plain JavaScript class. " + "This is only supported for classes created using React.createClass. " + "Use a static property to define defaultProps instead.", this.getName() || "a component"), - warning(!inst.propTypes, "propTypes was defined as an instance property on %s. Use a static " + "property to define propTypes instead.", this.getName() || "a component"), - warning(!inst.contextTypes, "contextTypes was defined as an instance property on %s. Use a " + "static property to define contextTypes instead.", this.getName() || "a component"), - warning("function" != typeof inst.componentShouldUpdate, "%s has a method called " + "componentShouldUpdate(). Did you mean shouldComponentUpdate()? " + "The name is phrased as a question because the function is " + "expected to return a value.", this.getName() || "A component"), - warning("function" != typeof inst.componentDidUnmount, "%s has a method called " + "componentDidUnmount(). But there is no such lifecycle method. " + "Did you mean componentWillUnmount()?", this.getName() || "A component"), - warning("function" != typeof inst.componentWillRecieveProps, "%s has a method called " + "componentWillRecieveProps(). Did you mean componentWillReceiveProps()?", this.getName() || "A component"), - isPureComponent(Component) && void 0 !== inst.shouldComponentUpdate && warning(!1, "%s has a method called shouldComponentUpdate(). " + "shouldComponentUpdate should not be used when extending React.PureComponent. " + "Please extend React.Component if shouldComponentUpdate is used.", this.getName() || "A pure component"), + warning(void 0 === inst.props || !propsMutated, "%s(...): When calling super() in `%s`, make sure to pass " + "up the same props that your component's constructor was passed.", componentName, componentName), + inst.props = publicProps, inst.context = publicContext, inst.refs = emptyObject, + inst.updater = updateQueue, this._instance = inst, ReactInstanceMap_1.set(inst, this), + warning(!inst.getInitialState || inst.getInitialState.isReactClassApproved || inst.state, "getInitialState was defined on %s, a plain JavaScript class. " + "This is only supported for classes created using React.createClass. " + "Did you mean to define a state property instead?", this.getName() || "a component"), + warning(!inst.getDefaultProps || inst.getDefaultProps.isReactClassApproved, "getDefaultProps was defined on %s, a plain JavaScript class. " + "This is only supported for classes created using React.createClass. " + "Use a static property to define defaultProps instead.", this.getName() || "a component"), + warning(!inst.propTypes, "propTypes was defined as an instance property on %s. Use a static " + "property to define propTypes instead.", this.getName() || "a component"), + warning(!inst.contextTypes, "contextTypes was defined as an instance property on %s. Use a " + "static property to define contextTypes instead.", this.getName() || "a component"), + warning("function" != typeof inst.componentShouldUpdate, "%s has a method called " + "componentShouldUpdate(). Did you mean shouldComponentUpdate()? " + "The name is phrased as a question because the function is " + "expected to return a value.", this.getName() || "A component"), + warning("function" != typeof inst.componentDidUnmount, "%s has a method called " + "componentDidUnmount(). But there is no such lifecycle method. " + "Did you mean componentWillUnmount()?", this.getName() || "A component"), + warning("function" != typeof inst.componentWillRecieveProps, "%s has a method called " + "componentWillRecieveProps(). Did you mean componentWillReceiveProps()?", this.getName() || "A component"), + isPureComponent(Component) && void 0 !== inst.shouldComponentUpdate && warning(!1, "%s has a method called shouldComponentUpdate(). " + "shouldComponentUpdate should not be used when extending React.PureComponent. " + "Please extend React.Component if shouldComponentUpdate is used.", this.getName() || "A pure component"), warning(!inst.defaultProps, "Setting defaultProps as an instance property on %s is not supported and will be ignored." + " Instead, define defaultProps as a static property on %s.", this.getName() || "a component", this.getName() || "a component"); var initialState = inst.state; - void 0 === initialState && (inst.state = initialState = null), invariant("object" == typeof initialState && !Array.isArray(initialState), "%s.state: must be set to an object or null", this.getName() || "ReactCompositeComponent"), - this._pendingStateQueue = null, this._pendingReplaceState = !1, this._pendingForceUpdate = !1, + void 0 === initialState && (inst.state = initialState = null), invariant("object" == typeof initialState && !Array.isArray(initialState), "%s.state: must be set to an object or null", this.getName() || "ReactCompositeComponent"), + this._pendingStateQueue = null, this._pendingReplaceState = !1, this._pendingForceUpdate = !1, inst.componentWillMount && (measureLifeCyclePerf(function() { return inst.componentWillMount(); }, this._debugID, "componentWillMount"), this._pendingStateQueue && (inst.state = this._processPendingState(inst.props, inst.context))); var markup; - markup = inst.unstable_handleError ? this.performInitialMountWithErrorHandling(renderedElement, hostParent, hostContainerInfo, transaction, context) : this.performInitialMount(renderedElement, hostParent, hostContainerInfo, transaction, context), + markup = inst.unstable_handleError ? this.performInitialMountWithErrorHandling(renderedElement, hostParent, hostContainerInfo, transaction, context) : this.performInitialMount(renderedElement, hostParent, hostContainerInfo, transaction, context), inst.componentDidMount && transaction.getReactMountReady().enqueue(function() { measureLifeCyclePerf(function() { return inst.componentDidMount(); @@ -1701,8 +1690,8 @@ var nextMountID = 1, ReactCompositeComponent = { try { markup = this.performInitialMount(renderedElement, hostParent, hostContainerInfo, transaction, context); } catch (e) { - transaction.rollback(checkpoint), this._instance.unstable_handleError(e), this._pendingStateQueue && (this._instance.state = this._processPendingState(this._instance.props, this._instance.context)), - checkpoint = transaction.checkpoint(), this._renderedComponent.unmountComponent(!0, !0), + transaction.rollback(checkpoint), this._instance.unstable_handleError(e), this._pendingStateQueue && (this._instance.state = this._processPendingState(this._instance.props, this._instance.context)), + checkpoint = transaction.checkpoint(), this._renderedComponent.unmountComponent(!0, !0), transaction.rollback(checkpoint), markup = this.performInitialMount(renderedElement, hostParent, hostContainerInfo, transaction, context); } return markup; @@ -1728,7 +1717,7 @@ var nextMountID = 1, ReactCompositeComponent = { unmountComponent: function(safely, skipLifecycle) { if (this._renderedComponent) { var inst = this._instance; - if (inst.componentWillUnmount && !inst._calledComponentWillUnmount) if (inst._calledComponentWillUnmount = !0, + if (inst.componentWillUnmount && !inst._calledComponentWillUnmount) if (inst._calledComponentWillUnmount = !0, safely) { if (!skipLifecycle) { var name = this.getName() + ".componentWillUnmount()"; @@ -1737,10 +1726,10 @@ var nextMountID = 1, ReactCompositeComponent = { } else measureLifeCyclePerf(function() { return inst.componentWillUnmount(); }, this._debugID, "componentWillUnmount"); - this._renderedComponent && (ReactReconciler_1.unmountComponent(this._renderedComponent, safely, skipLifecycle), - this._renderedNodeType = null, this._renderedComponent = null, this._instance = null), - this._pendingStateQueue = null, this._pendingReplaceState = !1, this._pendingForceUpdate = !1, - this._pendingCallbacks = null, this._pendingElement = null, this._context = null, + this._renderedComponent && (ReactReconciler_1.unmountComponent(this._renderedComponent, safely, skipLifecycle), + this._renderedNodeType = null, this._renderedComponent = null, this._instance = null), + this._pendingStateQueue = null, this._pendingReplaceState = !1, this._pendingForceUpdate = !1, + this._pendingCallbacks = null, this._pendingElement = null, this._context = null, this._rootNodeID = 0, this._topLevelWrapper = null, ReactInstanceMap_1.remove(inst); } }, @@ -1753,7 +1742,7 @@ var nextMountID = 1, ReactCompositeComponent = { }, _processContext: function(context) { var maskedContext = this._maskContext(context), Component = this._currentElement.type; - return Component.contextTypes && this._checkContextTypes(Component.contextTypes, maskedContext, "context"), + return Component.contextTypes && this._checkContextTypes(Component.contextTypes, maskedContext, "context"), maskedContext; }, _processChildContext: function(currentContext) { @@ -1765,18 +1754,18 @@ var nextMountID = 1, ReactCompositeComponent = { } finally { ReactInstrumentation.debugTool.onEndProcessingChildContext(); } - invariant("object" == typeof Component.childContextTypes, "%s.getChildContext(): childContextTypes must be defined in order to " + "use getChildContext().", this.getName() || "ReactCompositeComponent"), + invariant("object" == typeof Component.childContextTypes, "%s.getChildContext(): childContextTypes must be defined in order to " + "use getChildContext().", this.getName() || "ReactCompositeComponent"), this._checkContextTypes(Component.childContextTypes, childContext, "child context"); for (var name in childContext) invariant(name in Component.childContextTypes, '%s.getChildContext(): key "%s" is not defined in childContextTypes.', this.getName() || "ReactCompositeComponent", name); return Object.assign({}, currentContext, childContext); } var componentName = this.getName(); - return warningAboutMissingGetChildContext[componentName] || (warningAboutMissingGetChildContext[componentName] = !0, - warning(!Component.childContextTypes, "%s.childContextTypes is specified but there is no getChildContext() method " + "on the instance. You can either define getChildContext() on %s or remove " + "childContextTypes from it.", componentName, componentName)), + return warningAboutMissingGetChildContext[componentName] || (warningAboutMissingGetChildContext[componentName] = !0, + warning(!Component.childContextTypes, "%s.childContextTypes is specified but there is no getChildContext() method " + "on the instance. You can either define getChildContext() on %s or remove " + "childContextTypes from it.", componentName, componentName)), currentContext; }, _checkContextTypes: function(typeSpecs, values, location) { - ReactDebugCurrentFrame.current = this._debugID, checkPropTypes(typeSpecs, values, location, this.getName(), ReactDebugCurrentFrame.getStackAddendum), + ReactDebugCurrentFrame.current = this._debugID, checkPropTypes(typeSpecs, values, location, this.getName(), ReactDebugCurrentFrame.getStackAddendum), ReactDebugCurrentFrame.current = null; }, receiveComponent: function(nextElement, transaction, nextContext) { @@ -1794,7 +1783,7 @@ var nextMountID = 1, ReactCompositeComponent = { var inst = this._instance; invariant(null != inst, "Attempted to update component `%s` that has already been unmounted " + "(or failed to mount).", this.getName() || "ReactCompositeComponent"); var nextContext, willReceive = !1; - this._context === nextUnmaskedContext ? nextContext = inst.context : (nextContext = this._processContext(nextUnmaskedContext), + this._context === nextUnmaskedContext ? nextContext = inst.context : (nextContext = this._processContext(nextUnmaskedContext), willReceive = !0); var prevProps = prevParentElement.props, nextProps = nextParentElement.props; if (prevParentElement !== nextParentElement && (willReceive = !0), willReceive && inst.componentWillReceiveProps) { @@ -1803,7 +1792,7 @@ var nextMountID = 1, ReactCompositeComponent = { return inst.componentWillReceiveProps(nextProps, nextContext); }, this._debugID, "componentWillReceiveProps"); var afterState = inst.state; - beforeState !== afterState && (inst.state = beforeState, inst.updater.enqueueReplaceState(inst, afterState), + beforeState !== afterState && (inst.state = beforeState, inst.updater.enqueueReplaceState(inst, afterState), warning(!1, "%s.componentWillReceiveProps(): Assigning directly to " + "this.state is deprecated (except inside a component's " + "constructor). Use setState instead.", this.getName() || "ReactCompositeComponent")); } var callbacks = this._pendingCallbacks; @@ -1815,9 +1804,9 @@ var nextMountID = 1, ReactCompositeComponent = { return inst.shouldComponentUpdate(nextProps, nextState, nextContext); }, this._debugID, "shouldComponentUpdate") : this._compositeType === ReactCompositeComponentTypes$1.PureClass && (shouldUpdate = !shallowEqual(prevProps, nextProps) || !shallowEqual(inst.state, nextState)); } - if (warning(void 0 !== shouldUpdate, "%s.shouldComponentUpdate(): Returned undefined instead of a " + "boolean value. Make sure to return true or false.", this.getName() || "ReactCompositeComponent"), - this._updateBatchNumber = null, shouldUpdate ? (this._pendingForceUpdate = !1, this._performComponentUpdate(nextParentElement, nextProps, nextState, nextContext, transaction, nextUnmaskedContext)) : (this._currentElement = nextParentElement, - this._context = nextUnmaskedContext, inst.props = nextProps, inst.state = nextState, + if (warning(void 0 !== shouldUpdate, "%s.shouldComponentUpdate(): Returned undefined instead of a " + "boolean value. Make sure to return true or false.", this.getName() || "ReactCompositeComponent"), + this._updateBatchNumber = null, shouldUpdate ? (this._pendingForceUpdate = !1, this._performComponentUpdate(nextParentElement, nextProps, nextState, nextContext, transaction, nextUnmaskedContext)) : (this._currentElement = nextParentElement, + this._context = nextUnmaskedContext, inst.props = nextProps, inst.state = nextState, inst.context = nextContext), callbacks) for (var j = 0; j < callbacks.length; j++) transaction.getReactMountReady().enqueue(callbacks[j], this.getPublicInstance()); }, _processPendingState: function(props, context) { @@ -1834,8 +1823,8 @@ var nextMountID = 1, ReactCompositeComponent = { var prevProps, prevState, _this2 = this, inst = this._instance, hasComponentDidUpdate = !!inst.componentDidUpdate; hasComponentDidUpdate && (prevProps = inst.props, prevState = inst.state), inst.componentWillUpdate && measureLifeCyclePerf(function() { return inst.componentWillUpdate(nextProps, nextState, nextContext); - }, this._debugID, "componentWillUpdate"), this._currentElement = nextElement, this._context = unmaskedContext, - inst.props = nextProps, inst.state = nextState, inst.context = nextContext, inst.unstable_handleError ? this._updateRenderedComponentWithErrorHandling(transaction, unmaskedContext) : this._updateRenderedComponent(transaction, unmaskedContext), + }, this._debugID, "componentWillUpdate"), this._currentElement = nextElement, this._context = unmaskedContext, + inst.props = nextProps, inst.state = nextState, inst.context = nextContext, inst.unstable_handleError ? this._updateRenderedComponentWithErrorHandling(transaction, unmaskedContext) : this._updateRenderedComponent(transaction, unmaskedContext), hasComponentDidUpdate && transaction.getReactMountReady().enqueue(function() { measureLifeCyclePerf(inst.componentDidUpdate.bind(inst, prevProps, prevState), _this2._debugID, "componentDidUpdate"); }); @@ -1845,8 +1834,8 @@ var nextMountID = 1, ReactCompositeComponent = { try { this._updateRenderedComponent(transaction, context); } catch (e) { - transaction.rollback(checkpoint), this._instance.unstable_handleError(e), this._pendingStateQueue && (this._instance.state = this._processPendingState(this._instance.props, this._instance.context)), - checkpoint = transaction.checkpoint(), this._updateRenderedComponentWithNextElement(transaction, context, null, !0), + transaction.rollback(checkpoint), this._instance.unstable_handleError(e), this._pendingStateQueue && (this._instance.state = this._processPendingState(this._instance.props, this._instance.context)), + checkpoint = transaction.checkpoint(), this._updateRenderedComponentWithNextElement(transaction, context, null, !0), this._updateRenderedComponent(transaction, context); } }, @@ -1857,15 +1846,12 @@ var nextMountID = 1, ReactCompositeComponent = { _updateRenderedComponentWithNextElement: function(transaction, context, nextRenderedElement, safely) { var prevComponentInstance = this._renderedComponent, prevRenderedElement = prevComponentInstance._currentElement, debugID = 0; if (debugID = this._debugID, shouldUpdateReactComponent_1(prevRenderedElement, nextRenderedElement)) ReactReconciler_1.receiveComponent(prevComponentInstance, nextRenderedElement, transaction, this._processChildContext(context)); else { - var oldHostNode = ReactReconciler_1.getHostNode(prevComponentInstance); - ReactFeatureFlags_1.prepareNewChildrenBeforeUnmountInStack || ReactReconciler_1.unmountComponent(prevComponentInstance, safely, !1); - var nodeType = ReactNodeTypes_1.getType(nextRenderedElement); + var oldHostNode = ReactReconciler_1.getHostNode(prevComponentInstance), nodeType = ReactNodeTypes_1.getType(nextRenderedElement); this._renderedNodeType = nodeType; var child = this._instantiateReactComponent(nextRenderedElement, nodeType !== ReactNodeTypes_1.EMPTY); this._renderedComponent = child; var nextMarkup = ReactReconciler_1.mountComponent(child, transaction, this._hostParent, this._hostContainerInfo, this._processChildContext(context), debugID); - if (ReactFeatureFlags_1.prepareNewChildrenBeforeUnmountInStack && ReactReconciler_1.unmountComponent(prevComponentInstance, safely, !1), - 0 !== debugID) { + if (ReactReconciler_1.unmountComponent(prevComponentInstance, safely, !1), 0 !== debugID) { var childDebugIDs = 0 !== child._debugID ? [ child._debugID ] : []; ReactInstrumentation.debugTool.onSetChildren(debugID, childDebugIDs); } @@ -1879,7 +1865,7 @@ var nextMountID = 1, ReactCompositeComponent = { var renderedElement, inst = this._instance; return renderedElement = measureLifeCyclePerf(function() { return inst.render(); - }, this._debugID, "render"), void 0 === renderedElement && inst.render._isMockFunction && (renderedElement = null), + }, this._debugID, "render"), void 0 === renderedElement && inst.render._isMockFunction && (renderedElement = null), renderedElement; }, _renderValidatedComponent: function() { @@ -1892,7 +1878,7 @@ var nextMountID = 1, ReactCompositeComponent = { ReactCurrentOwner$1.current = null; } } - return invariant(null === renderedElement || !1 === renderedElement || React.isValidElement(renderedElement), "%s.render(): A valid React element (or null) must be returned. You may have " + "returned undefined, an array or some other invalid object.", this.getName() || "ReactCompositeComponent"), + return invariant(null === renderedElement || !1 === renderedElement || React.isValidElement(renderedElement), "%s.render(): A valid React element (or null) must be returned. You may have " + "returned undefined, an array or some other invalid object.", this.getName() || "ReactCompositeComponent"), renderedElement; }, attachRef: function(ref, component) { @@ -1935,7 +1921,7 @@ var ReactEmptyComponent_1 = ReactEmptyComponent, genericComponentClass = null, t }; function createInternalComponent(element) { - return invariant(genericComponentClass, "There is no registered component for the tag %s", element.type), + return invariant(genericComponentClass, "There is no registered component for the tag %s", element.type), new genericComponentClass(element); } @@ -1980,14 +1966,14 @@ function instantiateReactComponent(node, shouldHaveDebugID) { var element = node, type = element.type; if ("function" != typeof type && "string" != typeof type) { var info = ""; - (void 0 === type || "object" == typeof type && null !== type && 0 === Object.keys(type).length) && (info += " You likely forgot to export your component from the file " + "it's defined in."), + (void 0 === type || "object" == typeof type && null !== type && 0 === Object.keys(type).length) && (info += " You likely forgot to export your component from the file " + "it's defined in."), info += getDeclarationErrorAddendum(element._owner), invariant(!1, "Element type is invalid: expected a string (for built-in components) " + "or a class/function (for composite components) but got: %s.%s", null == type ? type : typeof type, info); } - "string" == typeof element.type ? instance = ReactHostComponent_1.createInternalComponent(element) : isInternalComponentType(element.type) ? (instance = new element.type(element), + "string" == typeof element.type ? instance = ReactHostComponent_1.createInternalComponent(element) : isInternalComponentType(element.type) ? (instance = new element.type(element), instance.getHostNode || (instance.getHostNode = instance.getNativeNode)) : instance = new ReactCompositeComponentWrapper(element); } else "string" == typeof node || "number" == typeof node ? instance = ReactHostComponent_1.createInstanceForText(node) : invariant(!1, "Encountered invalid React node of type %s", typeof node); - return warning("function" == typeof instance.mountComponent && "function" == typeof instance.receiveComponent && "function" == typeof instance.getHostNode && "function" == typeof instance.unmountComponent, "Only React Components can be mounted."), - instance._mountIndex = 0, instance._mountImage = null, instance._debugID = shouldHaveDebugID ? getNextDebugID_1() : 0, + return warning("function" == typeof instance.mountComponent && "function" == typeof instance.receiveComponent && "function" == typeof instance.getHostNode && "function" == typeof instance.unmountComponent, "Only React Components can be mounted."), + instance._mountIndex = 0, instance._mountImage = null, instance._debugID = shouldHaveDebugID ? getNextDebugID_1() : 0, Object.preventExtensions && Object.preventExtensions(instance), instance; } @@ -2008,17 +1994,17 @@ var instantiateReactComponent_1 = instantiateReactComponent, DevOnlyStubShim = n function findNodeHandle(componentOrHandle) { var owner = ReactCurrentOwner$2.current; - if (null !== owner && (warning(owner._warnedAboutRefsInRender, "%s is accessing findNodeHandle inside its render(). " + "render() should be a pure function of props and state. It should " + "never access something that requires stale data from the previous " + "render, such as refs. Move this logic to componentDidMount and " + "componentDidUpdate instead.", owner.getName() || "A component"), + if (null !== owner && (warning(owner._warnedAboutRefsInRender, "%s is accessing findNodeHandle inside its render(). " + "render() should be a pure function of props and state. It should " + "never access something that requires stale data from the previous " + "render, such as refs. Move this logic to componentDidMount and " + "componentDidUpdate instead.", owner.getName() || "A component"), owner._warnedAboutRefsInRender = !0), null == componentOrHandle) return null; if ("number" == typeof componentOrHandle) return componentOrHandle; var component = componentOrHandle, internalInstance = ReactInstanceMap_1.get(component); - return internalInstance ? injectedFindNode(internalInstance) : component || (invariant("object" == typeof component && ("_rootNodeID" in component || "_nativeTag" in component) || null != component.render && "function" == typeof component.render, "findNodeHandle(...): Argument is not a component " + "(type: %s, keys: %s)", typeof component, Object.keys(component)), + return internalInstance ? injectedFindNode(internalInstance) : component || (invariant("object" == typeof component && ("_rootNodeID" in component || "_nativeTag" in component) || null != component.render && "function" == typeof component.render, "findNodeHandle(...): Argument is not a component " + "(type: %s, keys: %s)", typeof component, Object.keys(component)), void invariant(!1, "findNodeHandle(...): Unable to find node handle for unmounted " + "component.")); } var findNodeHandle_1 = findNodeHandle, TopLevelWrapper = function() {}; -TopLevelWrapper.prototype.isReactComponent = {}, TopLevelWrapper.displayName = "TopLevelWrapper", +TopLevelWrapper.prototype.isReactComponent = {}, TopLevelWrapper.displayName = "TopLevelWrapper", TopLevelWrapper.prototype.render = function() { return this.props.child; }, TopLevelWrapper.isReactTopLevelWrapper = !0; @@ -2030,7 +2016,7 @@ function mountComponentIntoNode(componentInstance, containerTag, transaction) { function batchedMountComponentIntoNode(componentInstance, containerTag) { var transaction = ReactUpdates_1.ReactReconcileTransaction.getPooled(); - transaction.perform(mountComponentIntoNode, null, componentInstance, containerTag, transaction), + transaction.perform(mountComponentIntoNode, null, componentInstance, containerTag, transaction), ReactUpdates_1.ReactReconcileTransaction.release(transaction); } @@ -2043,12 +2029,12 @@ var ReactNativeMount = { }), topRootNodeID = containerTag, prevComponent = ReactNativeMount._instancesByContainerID[topRootNodeID]; if (prevComponent) { var prevWrappedElement = prevComponent._currentElement, prevElement = prevWrappedElement.props.child; - if (shouldUpdateReactComponent_1(prevElement, nextElement)) return ReactUpdateQueue_1.enqueueElementInternal(prevComponent, nextWrappedElement, emptyObject), - callback && ReactUpdateQueue_1.enqueueCallbackInternal(prevComponent, callback), + if (shouldUpdateReactComponent_1(prevElement, nextElement)) return ReactUpdateQueue_1.enqueueElementInternal(prevComponent, nextWrappedElement, emptyObject), + callback && ReactUpdateQueue_1.enqueueCallbackInternal(prevComponent, callback), prevComponent; ReactNativeMount.unmountComponentAtNode(containerTag); } - if (!ReactNativeTagHandles_1.reactTagIsNativeTopRootID(containerTag)) return console.error("You cannot render into anything but a top root"), + if (!ReactNativeTagHandles_1.reactTagIsNativeTopRootID(containerTag)) return console.error("You cannot render into anything but a top root"), null; ReactNativeTagHandles_1.assertRootTag(containerTag); var instance = instantiateReactComponent_1(nextWrappedElement, !1); @@ -2058,7 +2044,7 @@ var ReactNativeMount = { nonNullCallback.call(instance._renderedComponent.getPublicInstance()); } ]; } - return ReactUpdates_1.batchedUpdates(batchedMountComponentIntoNode, instance, containerTag), + return ReactUpdates_1.batchedUpdates(batchedMountComponentIntoNode, instance, containerTag), instance._renderedComponent.getPublicInstance(); }, _mountImageIntoNode: function(mountImage, containerID) { @@ -2069,11 +2055,11 @@ var ReactNativeMount = { ReactNativeMount.unmountComponentAtNode(containerTag), UIManager.removeRootView(containerTag); }, unmountComponentAtNode: function(containerTag) { - if (!ReactNativeTagHandles_1.reactTagIsNativeTopRootID(containerTag)) return console.error("You cannot render into anything but a top root"), + if (!ReactNativeTagHandles_1.reactTagIsNativeTopRootID(containerTag)) return console.error("You cannot render into anything but a top root"), !1; var instance = ReactNativeMount._instancesByContainerID[containerTag]; - return !!instance && (ReactInstrumentation.debugTool.onBeginFlush(), ReactNativeMount.unmountComponentFromNode(instance, containerTag), - delete ReactNativeMount._instancesByContainerID[containerTag], ReactInstrumentation.debugTool.onEndFlush(), + return !!instance && (ReactInstrumentation.debugTool.onBeginFlush(), ReactNativeMount.unmountComponentFromNode(instance, containerTag), + delete ReactNativeMount._instancesByContainerID[containerTag], ReactInstrumentation.debugTool.onEndFlush(), !0); }, unmountComponentFromNode: function(instance, containerID) { @@ -2109,7 +2095,7 @@ var transaction = new ReactDefaultBatchingStrategyTransaction(), ReactDefaultBat if (childrenUpdates.length) { for (var moveFromIndices, moveToIndices, addChildTags, addAtIndices, removeAtIndices, containerTag = ReactNativeComponentTree_1.getNodeFromInstance(inst), i = 0; i < childrenUpdates.length; i++) { var update = childrenUpdates[i]; - if ("MOVE_EXISTING" === update.type) (moveFromIndices || (moveFromIndices = [])).push(update.fromIndex), + if ("MOVE_EXISTING" === update.type) (moveFromIndices || (moveFromIndices = [])).push(update.fromIndex), (moveToIndices || (moveToIndices = [])).push(update.toIndex); else if ("REMOVE_NODE" === update.type) (removeAtIndices || (removeAtIndices = [])).push(update.fromIndex); else if ("INSERT_MARKUP" === update.type) { var mountImage = update.content, tag = mountImage; (addAtIndices || (addAtIndices = [])).push(update.toIndex), (addChildTags || (addChildTags = [])).push(tag); @@ -2137,16 +2123,16 @@ function _classCallCheck(instance, Constructor) { var CallbackQueue = function() { function CallbackQueue(arg) { - _classCallCheck(this, CallbackQueue), this._callbacks = null, this._contexts = null, + _classCallCheck(this, CallbackQueue), this._callbacks = null, this._contexts = null, this._arg = arg; } return CallbackQueue.prototype.enqueue = function(callback, context) { - this._callbacks = this._callbacks || [], this._callbacks.push(callback), this._contexts = this._contexts || [], + this._callbacks = this._callbacks || [], this._callbacks.push(callback), this._contexts = this._contexts || [], this._contexts.push(context); }, CallbackQueue.prototype.notifyAll = function() { var callbacks = this._callbacks, contexts = this._contexts, arg = this._arg; if (callbacks && contexts) { - invariant(callbacks.length === contexts.length, "Mismatched list of contexts in callback queue"), + invariant(callbacks.length === contexts.length, "Mismatched list of contexts in callback queue"), this._callbacks = null, this._contexts = null; for (var i = 0; i < callbacks.length; i++) validateCallback_1(callbacks[i]), callbacks[i].call(contexts[i], arg); callbacks.length = 0, contexts.length = 0; @@ -2199,7 +2185,7 @@ var Mixin = { } }; -Object.assign(ReactNativeReconcileTransaction.prototype, Transaction, ReactNativeReconcileTransaction, Mixin), +Object.assign(ReactNativeReconcileTransaction.prototype, Transaction, ReactNativeReconcileTransaction, Mixin), PooledClass_1.addPoolingTo(ReactNativeReconcileTransaction); var ReactNativeReconcileTransaction_1 = ReactNativeReconcileTransaction, ReactNativeComponentEnvironment = { @@ -2208,13 +2194,13 @@ var ReactNativeReconcileTransaction_1 = ReactNativeReconcileTransaction, ReactNa clearNode: function() {}, ReactReconcileTransaction: ReactNativeReconcileTransaction_1 }, ReactNativeComponentEnvironment_1 = ReactNativeComponentEnvironment, ReactNativeTextComponent = function(text) { - this._currentElement = text, this._stringText = "" + text, this._hostParent = null, + this._currentElement = text, this._stringText = "" + text, this._hostParent = null, this._rootNodeID = 0; }; Object.assign(ReactNativeTextComponent.prototype, { mountComponent: function(transaction, hostParent, hostContainerInfo, context) { - invariant(context.isInAParentText, 'RawText "%s" must be wrapped in an explicit component.', this._stringText), + invariant(context.isInAParentText, 'RawText "%s" must be wrapped in an explicit component.', this._stringText), this._hostParent = hostParent; var tag = ReactNativeTagHandles_1.allocateTag(); this._rootNodeID = tag; @@ -2236,7 +2222,7 @@ Object.assign(ReactNativeTextComponent.prototype, { } }, unmountComponent: function() { - ReactNativeComponentTree_1.uncacheNode(this), this._currentElement = null, this._stringText = null, + ReactNativeComponentTree_1.uncacheNode(this), this._currentElement = null, this._stringText = null, this._rootNodeID = 0; } }); @@ -2254,7 +2240,7 @@ Object.assign(ReactSimpleEmptyComponent.prototype, { return ReactReconciler_1.getHostNode(this._renderedComponent); }, unmountComponent: function(safely, skipLifecycle) { - ReactReconciler_1.unmountComponent(this._renderedComponent, safely, skipLifecycle), + ReactReconciler_1.unmountComponent(this._renderedComponent, safely, skipLifecycle), this._renderedComponent = null; } }); @@ -2262,9 +2248,9 @@ Object.assign(ReactSimpleEmptyComponent.prototype, { var ReactSimpleEmptyComponent_1 = ReactSimpleEmptyComponent; function inject$1() { - ReactGenericBatching_1.injection.injectStackBatchedUpdates(ReactUpdates_1.batchedUpdates), - ReactUpdates_1.injection.injectReconcileTransaction(ReactNativeComponentEnvironment_1.ReactReconcileTransaction), - ReactUpdates_1.injection.injectBatchingStrategy(ReactDefaultBatchingStrategy_1), + ReactGenericBatching_1.injection.injectStackBatchedUpdates(ReactUpdates_1.batchedUpdates), + ReactUpdates_1.injection.injectReconcileTransaction(ReactNativeComponentEnvironment_1.ReactReconcileTransaction), + ReactUpdates_1.injection.injectBatchingStrategy(ReactDefaultBatchingStrategy_1), ReactComponentEnvironment_1.injection.injectEnvironment(ReactNativeComponentEnvironment_1); var EmptyComponent = function(instantiate) { var View = require("View"); @@ -2275,10 +2261,10 @@ function inject$1() { } }), instantiate); }; - ReactEmptyComponent_1.injection.injectEmptyComponentFactory(EmptyComponent), ReactHostComponent_1.injection.injectTextComponentClass(ReactNativeTextComponent_1), + ReactEmptyComponent_1.injection.injectEmptyComponentFactory(EmptyComponent), ReactHostComponent_1.injection.injectTextComponentClass(ReactNativeTextComponent_1), ReactHostComponent_1.injection.injectGenericComponentClass(function(tag) { var info = ""; - "string" == typeof tag && /^[a-z]/.test(tag) && (info += " Each component name should start with an uppercase letter."), + "string" == typeof tag && /^[a-z]/.test(tag) && (info += " Each component name should start with an uppercase letter."), invariant(!1, "Expected a component class, got %s.%s", tag, info); }); } @@ -2334,7 +2320,6 @@ getInspectorDataForViewTag = function(viewTag) { var component = ReactNativeComponentTree_1.getClosestInstanceFromNode(viewTag), componentHierarchy = getOwnerHierarchy(component), instance = lastNotNativeInstance(componentHierarchy), hierarchy = createHierarchy(componentHierarchy), props = getHostProps(instance), source = instance._currentElement && instance._currentElement._source; return { hierarchy: hierarchy, - instance: instance, props: props, selection: componentHierarchy.indexOf(instance), source: source @@ -2348,13 +2333,13 @@ var ReactNativeStackInspector = { return null == nodeHandle || "number" == typeof nodeHandle ? nodeHandle : nodeHandle.getHostNode(); }; -function _classCallCheck$1(instance, Constructor) { +function _classCallCheck$2(instance, Constructor) { if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); } var objects = {}, uniqueID = 1, emptyObject$3 = {}, ReactNativePropRegistry = function() { function ReactNativePropRegistry() { - _classCallCheck$1(this, ReactNativePropRegistry); + _classCallCheck$2(this, ReactNativePropRegistry); } return ReactNativePropRegistry.register = function(object) { var id = ++uniqueID; @@ -2362,7 +2347,7 @@ var objects = {}, uniqueID = 1, emptyObject$3 = {}, ReactNativePropRegistry = fu }, ReactNativePropRegistry.getByID = function(id) { if (!id) return emptyObject$3; var object = objects[id]; - return object || (console.warn("Invalid style with id `" + id + "`. Skipping ..."), + return object || (console.warn("Invalid style with id `" + id + "`. Skipping ..."), emptyObject$3); }, ReactNativePropRegistry; }(), ReactNativePropRegistry_1 = ReactNativePropRegistry, emptyObject$2 = {}, removedKeys = null, removedKeyCount = 0; @@ -2383,7 +2368,7 @@ function restoreDeletedValuesInNestedArray(updatePayload, node, validAttributes) if (void 0 !== nextProp) { var attributeConfig = validAttributes[propKey]; if (attributeConfig) { - if ("function" == typeof nextProp && (nextProp = !0), void 0 === nextProp && (nextProp = null), + if ("function" == typeof nextProp && (nextProp = !0), void 0 === nextProp && (nextProp = null), "object" != typeof attributeConfig) updatePayload[propKey] = nextProp; else if ("function" == typeof attributeConfig.diff || "function" == typeof attributeConfig.process) { var nextValue = "function" == typeof attributeConfig.process ? attributeConfig.process(nextProp) : nextProp; updatePayload[propKey] = nextValue; @@ -2423,10 +2408,10 @@ function clearNestedProperty(updatePayload, prevProp, validAttributes) { function diffProperties(updatePayload, prevProps, nextProps, validAttributes) { var attributeConfig, nextProp, prevProp; - for (var propKey in nextProps) if (attributeConfig = validAttributes[propKey]) if (prevProp = prevProps[propKey], - nextProp = nextProps[propKey], "function" == typeof nextProp && (nextProp = !0, - "function" == typeof prevProp && (prevProp = !0)), void 0 === nextProp && (nextProp = null, - void 0 === prevProp && (prevProp = null)), removedKeys && (removedKeys[propKey] = !1), + for (var propKey in nextProps) if (attributeConfig = validAttributes[propKey]) if (prevProp = prevProps[propKey], + nextProp = nextProps[propKey], "function" == typeof nextProp && (nextProp = !0, + "function" == typeof prevProp && (prevProp = !0)), void 0 === nextProp && (nextProp = null, + void 0 === prevProp && (prevProp = null)), removedKeys && (removedKeys[propKey] = !1), updatePayload && void 0 !== updatePayload[propKey]) { if ("object" != typeof attributeConfig) updatePayload[propKey] = nextProp; else if ("function" == typeof attributeConfig.diff || "function" == typeof attributeConfig.process) { var nextValue = "function" == typeof attributeConfig.process ? attributeConfig.process(nextProp) : nextProp; @@ -2434,13 +2419,13 @@ function diffProperties(updatePayload, prevProps, nextProps, validAttributes) { } } else if (prevProp !== nextProp) if ("object" != typeof attributeConfig) defaultDiffer(prevProp, nextProp) && ((updatePayload || (updatePayload = {}))[propKey] = nextProp); else if ("function" == typeof attributeConfig.diff || "function" == typeof attributeConfig.process) { var shouldUpdate = void 0 === prevProp || ("function" == typeof attributeConfig.diff ? attributeConfig.diff(prevProp, nextProp) : defaultDiffer(prevProp, nextProp)); - shouldUpdate && (nextValue = "function" == typeof attributeConfig.process ? attributeConfig.process(nextProp) : nextProp, + shouldUpdate && (nextValue = "function" == typeof attributeConfig.process ? attributeConfig.process(nextProp) : nextProp, (updatePayload || (updatePayload = {}))[propKey] = nextValue); - } else removedKeys = null, removedKeyCount = 0, updatePayload = diffNestedProperty(updatePayload, prevProp, nextProp, attributeConfig), - removedKeyCount > 0 && updatePayload && (restoreDeletedValuesInNestedArray(updatePayload, nextProp, attributeConfig), + } else removedKeys = null, removedKeyCount = 0, updatePayload = diffNestedProperty(updatePayload, prevProp, nextProp, attributeConfig), + removedKeyCount > 0 && updatePayload && (restoreDeletedValuesInNestedArray(updatePayload, nextProp, attributeConfig), removedKeys = null); - for (propKey in prevProps) void 0 === nextProps[propKey] && (attributeConfig = validAttributes[propKey]) && (updatePayload && void 0 !== updatePayload[propKey] || void 0 !== (prevProp = prevProps[propKey]) && ("object" != typeof attributeConfig || "function" == typeof attributeConfig.diff || "function" == typeof attributeConfig.process ? ((updatePayload || (updatePayload = {}))[propKey] = null, - removedKeys || (removedKeys = {}), removedKeys[propKey] || (removedKeys[propKey] = !0, + for (propKey in prevProps) void 0 === nextProps[propKey] && (attributeConfig = validAttributes[propKey]) && (updatePayload && void 0 !== updatePayload[propKey] || void 0 !== (prevProp = prevProps[propKey]) && ("object" != typeof attributeConfig || "function" == typeof attributeConfig.diff || "function" == typeof attributeConfig.process ? ((updatePayload || (updatePayload = {}))[propKey] = null, + removedKeys || (removedKeys = {}), removedKeys[propKey] || (removedKeys[propKey] = !0, removedKeyCount++)) : updatePayload = clearNestedProperty(updatePayload, prevProp, attributeConfig))); return updatePayload; } @@ -2473,52 +2458,72 @@ function mountSafeCallback$1(context, callback) { }; } -function throwOnStylesProp$1(component, props) { +function throwOnStylesProp(component, props) { if (void 0 !== props.styles) { var owner = component._owner || null, name = component.constructor.displayName, msg = "`styles` is not a supported property of `" + name + "`, did " + "you mean `style` (singular)?"; - throw owner && owner.constructor && owner.constructor.displayName && (msg += "\n\nCheck the `" + owner.constructor.displayName + "` parent " + " component."), + throw owner && owner.constructor && owner.constructor.displayName && (msg += "\n\nCheck the `" + owner.constructor.displayName + "` parent " + " component."), new Error(msg); } } -function warnForStyleProps$1(props, validAttributes) { +function warnForStyleProps(props, validAttributes) { for (var key in validAttributes.style) validAttributes[key] || void 0 === props[key] || console.error("You are setting the style `{ " + key + ": ... }` as a prop. You " + "should nest it in a style object. " + "E.g. `{ style: { " + key + ": ... } }`"); } var NativeMethodsMixinUtils = { mountSafeCallback: mountSafeCallback$1, - throwOnStylesProp: throwOnStylesProp$1, - warnForStyleProps: warnForStyleProps$1 -}, mountSafeCallback = NativeMethodsMixinUtils.mountSafeCallback, throwOnStylesProp = NativeMethodsMixinUtils.throwOnStylesProp, warnForStyleProps = NativeMethodsMixinUtils.warnForStyleProps, findNumericNodeHandle = ReactNativeFeatureFlags$1.useFiber ? DevOnlyStubShim : findNumericNodeHandleStack, NativeMethodsMixin = { - measure: function(callback) { - UIManager.measure(findNumericNodeHandle(this), mountSafeCallback(this, callback)); - }, - measureInWindow: function(callback) { - UIManager.measureInWindow(findNumericNodeHandle(this), mountSafeCallback(this, callback)); - }, - measureLayout: function(relativeToNativeNode, onSuccess, onFail) { - UIManager.measureLayout(findNumericNodeHandle(this), relativeToNativeNode, mountSafeCallback(this, onFail), mountSafeCallback(this, onSuccess)); - }, - setNativeProps: function(nativeProps) { - injectedSetNativeProps(this, nativeProps); - }, - focus: function() { - TextInputState.focusTextInput(findNumericNodeHandle(this)); - }, - blur: function() { - TextInputState.blurTextInput(findNumericNodeHandle(this)); - } + throwOnStylesProp: throwOnStylesProp, + warnForStyleProps: warnForStyleProps }; +function _classCallCheck$1(instance, Constructor) { + if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); +} + +function _possibleConstructorReturn(self, call) { + if (!self) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); + return !call || "object" != typeof call && "function" != typeof call ? self : call; +} + +function _inherits(subClass, superClass) { + if ("function" != typeof superClass && null !== superClass) throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); + subClass.prototype = Object.create(superClass && superClass.prototype, { + constructor: { + value: subClass, + enumerable: !1, + writable: !0, + configurable: !0 + } + }), superClass && (Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass); +} + +var mountSafeCallback = NativeMethodsMixinUtils.mountSafeCallback, findNumericNodeHandle = ReactNativeFeatureFlags$1.useFiber ? DevOnlyStubShim : findNumericNodeHandleStack, ReactNativeComponent = function(_React$Component) { + _inherits(ReactNativeComponent, _React$Component); + function ReactNativeComponent() { + return _classCallCheck$1(this, ReactNativeComponent), _possibleConstructorReturn(this, _React$Component.apply(this, arguments)); + } + return ReactNativeComponent.prototype.blur = function() { + TextInputState.blurTextInput(findNumericNodeHandle(this)); + }, ReactNativeComponent.prototype.focus = function() { + TextInputState.focusTextInput(findNumericNodeHandle(this)); + }, ReactNativeComponent.prototype.measure = function(callback) { + UIManager.measure(findNumericNodeHandle(this), mountSafeCallback(this, callback)); + }, ReactNativeComponent.prototype.measureInWindow = function(callback) { + UIManager.measureInWindow(findNumericNodeHandle(this), mountSafeCallback(this, callback)); + }, ReactNativeComponent.prototype.measureLayout = function(relativeToNativeNode, onSuccess, onFail) { + UIManager.measureLayout(findNumericNodeHandle(this), relativeToNativeNode, mountSafeCallback(this, onFail), mountSafeCallback(this, onSuccess)); + }, ReactNativeComponent.prototype.setNativeProps = function(nativeProps) { + injectedSetNativeProps(this, nativeProps); + }, ReactNativeComponent; +}(React.Component); + function setNativePropsFiber(componentOrHandle, nativeProps) { var maybeInstance = void 0; try { maybeInstance = findNodeHandle_1(componentOrHandle); } catch (error) {} if (null != maybeInstance) { - var viewConfig = maybeInstance.viewConfig; - warnForStyleProps(nativeProps, viewConfig.validAttributes); - var updatePayload = ReactNativeAttributePayload_1.create(nativeProps, viewConfig.validAttributes); + var viewConfig = maybeInstance.viewConfig, updatePayload = ReactNativeAttributePayload_1.create(nativeProps, viewConfig.validAttributes); UIManager.updateView(maybeInstance._nativeTag, viewConfig.uiViewClassName, updatePayload); } } @@ -2531,9 +2536,7 @@ function setNativePropsStack(componentOrHandle, nativeProps) { for (;void 0 !== maybeInstance._renderedComponent; ) maybeInstance = maybeInstance._renderedComponent; viewConfig = maybeInstance.viewConfig; } - var tag = "function" == typeof maybeInstance.getHostNode ? maybeInstance.getHostNode() : maybeInstance._rootNodeID; - warnForStyleProps(nativeProps, viewConfig.validAttributes); - var updatePayload = ReactNativeAttributePayload_1.create(nativeProps, viewConfig.validAttributes); + var tag = "function" == typeof maybeInstance.getHostNode ? maybeInstance.getHostNode() : maybeInstance._rootNodeID, updatePayload = ReactNativeAttributePayload_1.create(nativeProps, viewConfig.validAttributes); UIManager.updateView(tag, viewConfig.uiViewClassName, updatePayload); } } @@ -2542,24 +2545,77 @@ var injectedSetNativeProps = void 0; injectedSetNativeProps = ReactNativeFeatureFlags$1.useFiber ? setNativePropsFiber : setNativePropsStack; +var ReactNativeComponent_1 = ReactNativeComponent, mountSafeCallback$2 = NativeMethodsMixinUtils.mountSafeCallback, throwOnStylesProp$1 = NativeMethodsMixinUtils.throwOnStylesProp, warnForStyleProps$1 = NativeMethodsMixinUtils.warnForStyleProps, findNumericNodeHandle$1 = ReactNativeFeatureFlags$1.useFiber ? DevOnlyStubShim : findNumericNodeHandleStack, NativeMethodsMixin = { + measure: function(callback) { + UIManager.measure(findNumericNodeHandle$1(this), mountSafeCallback$2(this, callback)); + }, + measureInWindow: function(callback) { + UIManager.measureInWindow(findNumericNodeHandle$1(this), mountSafeCallback$2(this, callback)); + }, + measureLayout: function(relativeToNativeNode, onSuccess, onFail) { + UIManager.measureLayout(findNumericNodeHandle$1(this), relativeToNativeNode, mountSafeCallback$2(this, onFail), mountSafeCallback$2(this, onSuccess)); + }, + setNativeProps: function(nativeProps) { + injectedSetNativeProps$1(this, nativeProps); + }, + focus: function() { + TextInputState.focusTextInput(findNumericNodeHandle$1(this)); + }, + blur: function() { + TextInputState.blurTextInput(findNumericNodeHandle$1(this)); + } +}; + +function setNativePropsFiber$1(componentOrHandle, nativeProps) { + var maybeInstance = void 0; + try { + maybeInstance = findNodeHandle_1(componentOrHandle); + } catch (error) {} + if (null != maybeInstance) { + var viewConfig = maybeInstance.viewConfig; + warnForStyleProps$1(nativeProps, viewConfig.validAttributes); + var updatePayload = ReactNativeAttributePayload_1.create(nativeProps, viewConfig.validAttributes); + UIManager.updateView(maybeInstance._nativeTag, viewConfig.uiViewClassName, updatePayload); + } +} + +function setNativePropsStack$1(componentOrHandle, nativeProps) { + var maybeInstance = findNodeHandle_1(componentOrHandle); + if (null != maybeInstance) { + var viewConfig = void 0; + if (void 0 !== maybeInstance.viewConfig) viewConfig = maybeInstance.viewConfig; else if (void 0 !== maybeInstance._instance && void 0 !== maybeInstance._instance.viewConfig) viewConfig = maybeInstance._instance.viewConfig; else { + for (;void 0 !== maybeInstance._renderedComponent; ) maybeInstance = maybeInstance._renderedComponent; + viewConfig = maybeInstance.viewConfig; + } + var tag = "function" == typeof maybeInstance.getHostNode ? maybeInstance.getHostNode() : maybeInstance._rootNodeID; + warnForStyleProps$1(nativeProps, viewConfig.validAttributes); + var updatePayload = ReactNativeAttributePayload_1.create(nativeProps, viewConfig.validAttributes); + UIManager.updateView(tag, viewConfig.uiViewClassName, updatePayload); + } +} + +var injectedSetNativeProps$1 = void 0; + +injectedSetNativeProps$1 = ReactNativeFeatureFlags$1.useFiber ? setNativePropsFiber$1 : setNativePropsStack$1; + var NativeMethodsMixin_DEV = NativeMethodsMixin; -invariant(!NativeMethodsMixin_DEV.componentWillMount && !NativeMethodsMixin_DEV.componentWillReceiveProps, "Do not override existing functions."), +invariant(!NativeMethodsMixin_DEV.componentWillMount && !NativeMethodsMixin_DEV.componentWillReceiveProps, "Do not override existing functions."), NativeMethodsMixin_DEV.componentWillMount = function() { - throwOnStylesProp(this, this.props); + throwOnStylesProp$1(this, this.props); }, NativeMethodsMixin_DEV.componentWillReceiveProps = function(newProps) { - throwOnStylesProp(this, newProps); + throwOnStylesProp$1(this, newProps); }; var NativeMethodsMixin_1 = NativeMethodsMixin, TouchHistoryMath = { centroidDimension: function(touchHistory, touchesChangedAfter, isXAxis, ofCurrent) { var touchBank = touchHistory.touchBank, total = 0, count = 0, oneTouchData = 1 === touchHistory.numberActiveTouches ? touchHistory.touchBank[touchHistory.indexOfSingleActiveTouch] : null; - if (null !== oneTouchData) oneTouchData.touchActive && oneTouchData.currentTimeStamp > touchesChangedAfter && (total += ofCurrent && isXAxis ? oneTouchData.currentPageX : ofCurrent && !isXAxis ? oneTouchData.currentPageY : !ofCurrent && isXAxis ? oneTouchData.previousPageX : oneTouchData.previousPageY, + if (null !== oneTouchData) oneTouchData.touchActive && oneTouchData.currentTimeStamp > touchesChangedAfter && (total += ofCurrent && isXAxis ? oneTouchData.currentPageX : ofCurrent && !isXAxis ? oneTouchData.currentPageY : !ofCurrent && isXAxis ? oneTouchData.previousPageX : oneTouchData.previousPageY, count = 1); else for (var i = 0; i < touchBank.length; i++) { var touchTrack = touchBank[i]; if (null !== touchTrack && void 0 !== touchTrack && touchTrack.touchActive && touchTrack.currentTimeStamp >= touchesChangedAfter) { var toAdd; - toAdd = ofCurrent && isXAxis ? touchTrack.currentPageX : ofCurrent && !isXAxis ? touchTrack.currentPageY : !ofCurrent && isXAxis ? touchTrack.previousPageX : touchTrack.previousPageY, + toAdd = ofCurrent && isXAxis ? touchTrack.currentPageX : ofCurrent && !isXAxis ? touchTrack.currentPageY : !ofCurrent && isXAxis ? touchTrack.previousPageX : touchTrack.previousPageY, total += toAdd, count++; } } @@ -2624,16 +2680,16 @@ function getComponentKey(component, index) { function traverseStackChildrenImpl(children, nameSoFar, callback, traverseContext) { var type = typeof children; - if ("undefined" !== type && "boolean" !== type || (children = null), null === children || "string" === type || "number" === type || "object" === type && children.$$typeof === ReactElementSymbol) return callback(traverseContext, children, "" === nameSoFar ? SEPARATOR + getComponentKey(children, 0) : nameSoFar), + if ("undefined" !== type && "boolean" !== type || (children = null), null === children || "string" === type || "number" === type || "object" === type && children.$$typeof === ReactElementSymbol) return callback(traverseContext, children, "" === nameSoFar ? SEPARATOR + getComponentKey(children, 0) : nameSoFar), 1; var child, nextName, subtreeCount = 0, nextNamePrefix = "" === nameSoFar ? SEPARATOR : nameSoFar + SUBSEPARATOR; - if (Array.isArray(children)) for (var i = 0; i < children.length; i++) child = children[i], + if (Array.isArray(children)) for (var i = 0; i < children.length; i++) child = children[i], nextName = nextNamePrefix + getComponentKey(child, i), subtreeCount += traverseStackChildrenImpl(child, nextName, callback, traverseContext); else { var iteratorFn = getIteratorFn_1(children); if (iteratorFn) { - iteratorFn === children.entries && (warning(didWarnAboutMaps, "Using Maps as children is unsupported and will likely yield " + "unexpected results. Convert it to a sequence/iterable of keyed " + "ReactElements instead.%s", getCurrentStackAddendum()), + iteratorFn === children.entries && (warning(didWarnAboutMaps, "Using Maps as children is unsupported and will likely yield " + "unexpected results. Convert it to a sequence/iterable of keyed " + "ReactElements instead.%s", getCurrentStackAddendum()), didWarnAboutMaps = !0); - for (var step, iterator = iteratorFn.call(children), ii = 0; !(step = iterator.next()).done; ) child = step.value, + for (var step, iterator = iteratorFn.call(children), ii = 0; !(step = iterator.next()).done; ) child = step.value, nextName = nextNamePrefix + getComponentKey(child, ii++), subtreeCount += traverseStackChildrenImpl(child, nextName, callback, traverseContext); } else if ("object" === type) { var addendum = ""; @@ -2655,8 +2711,8 @@ var traverseStackChildren_1 = traverseStackChildren, ReactComponentTreeHook$2; function instantiateChild(childInstances, child, name, selfDebugID) { var keyUnique = void 0 === childInstances[name]; - ReactComponentTreeHook$2 || (ReactComponentTreeHook$2 = ReactGlobalSharedState_1.ReactComponentTreeHook), - keyUnique || warning(!1, "flattenChildren(...): Encountered two children with the same key, " + "`%s`. Child keys must be unique; when two children share a key, only " + "the first child will be used.%s", KeyEscapeUtils_1.unescape(name), ReactComponentTreeHook$2.getStackAddendumByID(selfDebugID)), + ReactComponentTreeHook$2 || (ReactComponentTreeHook$2 = ReactGlobalSharedState_1.ReactComponentTreeHook), + keyUnique || warning(!1, "flattenChildren(...): Encountered two children with the same key, " + "`%s`. Child keys must be unique; when two children share a key, only " + "the first child will be used.%s", KeyEscapeUtils_1.unescape(name), ReactComponentTreeHook$2.getStackAddendumByID(selfDebugID)), null != child && keyUnique && (childInstances[name] = instantiateReactComponent_1(child, !0)); } @@ -2674,18 +2730,16 @@ var ReactChildReconciler = { for (name in nextChildren) if (nextChildren.hasOwnProperty(name)) { prevChild = prevChildren && prevChildren[name]; var prevElement = prevChild && prevChild._currentElement, nextElement = nextChildren[name]; - if (null != prevChild && shouldUpdateReactComponent_1(prevElement, nextElement)) ReactReconciler_1.receiveComponent(prevChild, nextElement, transaction, context), + if (null != prevChild && shouldUpdateReactComponent_1(prevElement, nextElement)) ReactReconciler_1.receiveComponent(prevChild, nextElement, transaction, context), nextChildren[name] = prevChild; else { - !ReactFeatureFlags_1.prepareNewChildrenBeforeUnmountInStack && prevChild && (removedNodes[name] = ReactReconciler_1.getHostNode(prevChild), - ReactReconciler_1.unmountComponent(prevChild, !1, !1)); var nextChildInstance = instantiateReactComponent_1(nextElement, !0); nextChildren[name] = nextChildInstance; var nextChildMountImage = ReactReconciler_1.mountComponent(nextChildInstance, transaction, hostParent, hostContainerInfo, context, selfDebugID); - mountImages.push(nextChildMountImage), ReactFeatureFlags_1.prepareNewChildrenBeforeUnmountInStack && prevChild && (removedNodes[name] = ReactReconciler_1.getHostNode(prevChild), + mountImages.push(nextChildMountImage), prevChild && (removedNodes[name] = ReactReconciler_1.getHostNode(prevChild), ReactReconciler_1.unmountComponent(prevChild, !1, !1)); } } - for (name in prevChildren) !prevChildren.hasOwnProperty(name) || nextChildren && nextChildren.hasOwnProperty(name) || (prevChild = prevChildren[name], + for (name in prevChildren) !prevChildren.hasOwnProperty(name) || nextChildren && nextChildren.hasOwnProperty(name) || (prevChild = prevChildren[name], removedNodes[name] = ReactReconciler_1.getHostNode(prevChild), ReactReconciler_1.unmountComponent(prevChild, !1, !1)); } }, @@ -2702,8 +2756,8 @@ var ReactChildReconciler = { function flattenSingleChildIntoContext(traverseContext, child, name, selfDebugID) { if (traverseContext && "object" == typeof traverseContext) { var result = traverseContext, keyUnique = void 0 === result[name]; - ReactComponentTreeHook$3 || (ReactComponentTreeHook$3 = ReactGlobalSharedState_1.ReactComponentTreeHook), - keyUnique || warning(!1, "flattenChildren(...): Encountered two children with the same key, " + "`%s`. Child keys must be unique; when two children share a key, only " + "the first child will be used.%s", KeyEscapeUtils_1.unescape(name), ReactComponentTreeHook$3.getStackAddendumByID(selfDebugID)), + ReactComponentTreeHook$3 || (ReactComponentTreeHook$3 = ReactGlobalSharedState_1.ReactComponentTreeHook), + keyUnique || warning(!1, "flattenChildren(...): Encountered two children with the same key, " + "`%s`. Child keys must be unique; when two children share a key, only " + "the first child will be used.%s", KeyEscapeUtils_1.unescape(name), ReactComponentTreeHook$3.getStackAddendumByID(selfDebugID)), keyUnique && null != child && (result[name] = child); } } @@ -2814,11 +2868,11 @@ var ReactMultiChild = { } finally { ReactCurrentOwner$3.current = null; } - return ReactChildReconciler_1.updateChildren(prevChildren, nextChildren, mountImages, removedNodes, transaction, this, this._hostContainerInfo, context, selfDebugID), + return ReactChildReconciler_1.updateChildren(prevChildren, nextChildren, mountImages, removedNodes, transaction, this, this._hostContainerInfo, context, selfDebugID), nextChildren; } - return nextChildren = flattenStackChildren_1(nextNestedChildrenElements, selfDebugID), - ReactChildReconciler_1.updateChildren(prevChildren, nextChildren, mountImages, removedNodes, transaction, this, this._hostContainerInfo, context, selfDebugID), + return nextChildren = flattenStackChildren_1(nextNestedChildrenElements, selfDebugID), + ReactChildReconciler_1.updateChildren(prevChildren, nextChildren, mountImages, removedNodes, transaction, this, this._hostContainerInfo, context, selfDebugID), nextChildren; }, mountChildren: function(nestedChildren, transaction, context) { @@ -2854,9 +2908,9 @@ var ReactMultiChild = { var name, updates = null, nextIndex = 0, lastIndex = 0, nextMountIndex = 0, lastPlacedNode = null; for (name in nextChildren) if (nextChildren.hasOwnProperty(name)) { var prevChild = prevChildren && prevChildren[name], nextChild = nextChildren[name]; - prevChild === nextChild ? (updates = enqueue(updates, this.moveChild(prevChild, lastPlacedNode, nextIndex, lastIndex)), - lastIndex = Math.max(prevChild._mountIndex, lastIndex), prevChild._mountIndex = nextIndex) : (prevChild && (lastIndex = Math.max(prevChild._mountIndex, lastIndex)), - updates = enqueue(updates, this._mountChildAtIndex(nextChild, mountImages[nextMountIndex], lastPlacedNode, nextIndex, transaction, context)), + prevChild === nextChild ? (updates = enqueue(updates, this.moveChild(prevChild, lastPlacedNode, nextIndex, lastIndex)), + lastIndex = Math.max(prevChild._mountIndex, lastIndex), prevChild._mountIndex = nextIndex) : (prevChild && (lastIndex = Math.max(prevChild._mountIndex, lastIndex)), + updates = enqueue(updates, this._mountChildAtIndex(nextChild, mountImages[nextMountIndex], lastPlacedNode, nextIndex, transaction, context)), nextMountIndex++), nextIndex++, lastPlacedNode = ReactReconciler_1.getHostNode(nextChild); } for (name in removedNodes) removedNodes.hasOwnProperty(name) && (updates = enqueue(updates, this._unmountChild(prevChildren[name], removedNodes[name]))); @@ -2865,7 +2919,7 @@ var ReactMultiChild = { }, unmountChildren: function(safely, skipLifecycle) { var renderedChildren = this._renderedChildren; - ReactChildReconciler_1.unmountChildren(renderedChildren, safely, skipLifecycle), + ReactChildReconciler_1.unmountChildren(renderedChildren, safely, skipLifecycle), this._renderedChildren = null; }, moveChild: function(child, afterNode, toIndex, lastIndex) { @@ -2893,7 +2947,7 @@ ReactNativeBaseComponent.Mixin = { return this; }, unmountComponent: function(safely, skipLifecycle) { - ReactNativeComponentTree_1.uncacheNode(this), this.unmountChildren(safely, skipLifecycle), + ReactNativeComponentTree_1.uncacheNode(this), this.unmountChildren(safely, skipLifecycle), this._rootNodeID = 0; }, initializeChildren: function(children, containerTag, transaction, context) { @@ -2911,7 +2965,7 @@ ReactNativeBaseComponent.Mixin = { this._currentElement = nextElement; for (var key in this.viewConfig.validAttributes) nextElement.props.hasOwnProperty(key) && deepFreezeAndThrowOnMutationInDev(nextElement.props[key]); var updatePayload = ReactNativeAttributePayload_1.diff(prevElement.props, nextElement.props, this.viewConfig.validAttributes); - updatePayload && UIManager.updateView(this._rootNodeID, this.viewConfig.uiViewClassName, updatePayload), + updatePayload && UIManager.updateView(this._rootNodeID, this.viewConfig.uiViewClassName, updatePayload), this.updateChildren(nextElement.props.children, transaction, context); }, getName: function() { @@ -2925,24 +2979,24 @@ ReactNativeBaseComponent.Mixin = { this._rootNodeID = tag, this._hostParent = hostParent, this._hostContainerInfo = hostContainerInfo; for (var key in this.viewConfig.validAttributes) this._currentElement.props.hasOwnProperty(key) && deepFreezeAndThrowOnMutationInDev(this._currentElement.props[key]); var updatePayload = ReactNativeAttributePayload_1.create(this._currentElement.props, this.viewConfig.validAttributes), nativeTopRootTag = hostContainerInfo._tag; - return UIManager.createView(tag, this.viewConfig.uiViewClassName, nativeTopRootTag, updatePayload), - ReactNativeComponentTree_1.precacheNode(this, tag), this.initializeChildren(this._currentElement.props.children, tag, transaction, context), + return UIManager.createView(tag, this.viewConfig.uiViewClassName, nativeTopRootTag, updatePayload), + ReactNativeComponentTree_1.precacheNode(this, tag), this.initializeChildren(this._currentElement.props.children, tag, transaction, context), tag; } }, Object.assign(ReactNativeBaseComponent.prototype, ReactMultiChild_1, ReactNativeBaseComponent.Mixin, NativeMethodsMixin_1); var ReactNativeBaseComponent_1 = ReactNativeBaseComponent, createReactNativeComponentClassStack = function(viewConfig) { var Constructor = function(element) { - this._currentElement = element, this._topLevelWrapper = null, this._hostParent = null, + this._currentElement = element, this._topLevelWrapper = null, this._hostParent = null, this._hostContainerInfo = null, this._rootNodeID = 0, this._renderedChildren = null; }; - return Constructor.displayName = viewConfig.uiViewClassName, Constructor.viewConfig = viewConfig, - Constructor.propTypes = viewConfig.propTypes, Constructor.prototype = new ReactNativeBaseComponent_1(viewConfig), + return Constructor.displayName = viewConfig.uiViewClassName, Constructor.viewConfig = viewConfig, + Constructor.propTypes = viewConfig.propTypes, Constructor.prototype = new ReactNativeBaseComponent_1(viewConfig), Constructor.prototype.constructor = Constructor, Constructor; -}, createReactNativeComponentClassStack_1 = createReactNativeComponentClassStack, createReactNativeComponentClass = ReactNativeFeatureFlags$1.useFiber ? DevOnlyStubShim : createReactNativeComponentClassStack_1, findNumericNodeHandle$1 = ReactNativeFeatureFlags$1.useFiber ? DevOnlyStubShim : findNumericNodeHandleStack; +}, createReactNativeComponentClassStack_1 = createReactNativeComponentClassStack, createReactNativeComponentClass = ReactNativeFeatureFlags$1.useFiber ? DevOnlyStubShim : createReactNativeComponentClassStack_1, findNumericNodeHandle$2 = ReactNativeFeatureFlags$1.useFiber ? DevOnlyStubShim : findNumericNodeHandleStack; function takeSnapshot(view, options) { - return "number" != typeof view && "window" !== view && (view = findNumericNodeHandle$1(view) || "window"), + return "number" != typeof view && "window" !== view && (view = findNumericNodeHandle$2(view) || "window"), UIManager.__takeSnapshot(view, options); } @@ -2996,7 +3050,7 @@ function getExclusive() { counts: {}, durations: {}, totalDuration: 0 - }), stats.durations[timerType] || (stats.durations[timerType] = 0), stats.counts[timerType] || (stats.counts[timerType] = 0), + }), stats.durations[timerType] || (stats.durations[timerType] = 0), stats.counts[timerType] || (stats.counts[timerType] = 0), affectedIDs[key][instanceID] = !0, applyUpdate(stats); } return flushHistory.forEach(function(flush) { @@ -3069,7 +3123,7 @@ function getWasted() { return flushHistory.forEach(function(flush) { var measurements = flush.measurements, treeSnapshot = flush.treeSnapshot, operations = flush.operations, isDefinitelyNotWastedByID = {}; operations.forEach(function(operation) { - for (var instanceID = operation.instanceID, nextParentID = instanceID; nextParentID; ) isDefinitelyNotWastedByID[nextParentID] = !0, + for (var instanceID = operation.instanceID, nextParentID = instanceID; nextParentID; ) isDefinitelyNotWastedByID[nextParentID] = !0, nextParentID = treeSnapshot[nextParentID].parentID; }); var renderedCompositeIDs = {}; @@ -3172,14 +3226,14 @@ function printOperations(flushHistory) { var warnedAboutPrintDOM = !1; function printDOM(measurements) { - return lowPriorityWarning_1(warnedAboutPrintDOM, "`ReactPerf.printDOM(...)` is deprecated. Use " + "`ReactPerf.printOperations(...)` instead."), + return lowPriorityWarning_1(warnedAboutPrintDOM, "`ReactPerf.printDOM(...)` is deprecated. Use " + "`ReactPerf.printOperations(...)` instead."), warnedAboutPrintDOM = !0, printOperations(measurements); } var warnedAboutGetMeasurementsSummaryMap = !1; function getMeasurementsSummaryMap(measurements) { - return lowPriorityWarning_1(warnedAboutGetMeasurementsSummaryMap, "`ReactPerf.getMeasurementsSummaryMap(...)` is deprecated. Use " + "`ReactPerf.getWasted(...)` instead."), + return lowPriorityWarning_1(warnedAboutGetMeasurementsSummaryMap, "`ReactPerf.getMeasurementsSummaryMap(...)` is deprecated. Use " + "`ReactPerf.getWasted(...)` instead."), warnedAboutGetMeasurementsSummaryMap = !0, getWasted(measurements); } @@ -3217,6 +3271,7 @@ ReactNativeInjection.inject(), ReactNativeStackInjection.inject(); var render = function(element, mountInto, callback) { return ReactNativeMount_1.renderComponent(element, mountInto, callback); }, ReactNative = { + NativeComponent: ReactNativeComponent_1, hasReactNativeInitialized: !1, findNodeHandle: findNumericNodeHandleStack, render: render, diff --git a/Libraries/Renderer/ReactNativeStack-prod.js b/Libraries/Renderer/ReactNativeStack-prod.js index 5945a41aa..55c0779f1 100644 --- a/Libraries/Renderer/ReactNativeStack-prod.js +++ b/Libraries/Renderer/ReactNativeStack-prod.js @@ -84,9 +84,9 @@ var ReactNativeComponentTree = { function recomputePluginOrdering() { if (eventPluginOrder) for (var pluginName in namesToPlugins) { var pluginModule = namesToPlugins[pluginName], pluginIndex = eventPluginOrder.indexOf(pluginName); - if (invariant(pluginIndex > -1, "EventPluginRegistry: Cannot inject event plugins that do not exist in " + "the plugin ordering, `%s`.", pluginName), + if (invariant(pluginIndex > -1, "EventPluginRegistry: Cannot inject event plugins that do not exist in " + "the plugin ordering, `%s`.", pluginName), !EventPluginRegistry.plugins[pluginIndex]) { - invariant(pluginModule.extractEvents, "EventPluginRegistry: Event plugins must implement an `extractEvents` " + "method, but `%s` does not.", pluginName), + invariant(pluginModule.extractEvents, "EventPluginRegistry: Event plugins must implement an `extractEvents` " + "method, but `%s` does not.", pluginName), EventPluginRegistry.plugins[pluginIndex] = pluginModule; var publishedEvents = pluginModule.eventTypes; for (var eventName in publishedEvents) invariant(publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName), "EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.", eventName, pluginName); @@ -95,7 +95,7 @@ function recomputePluginOrdering() { } function publishEventForPlugin(dispatchConfig, pluginModule, eventName) { - invariant(!EventPluginRegistry.eventNameDispatchConfigs.hasOwnProperty(eventName), "EventPluginHub: More than one plugin attempted to publish the same " + "event name, `%s`.", eventName), + invariant(!EventPluginRegistry.eventNameDispatchConfigs.hasOwnProperty(eventName), "EventPluginHub: More than one plugin attempted to publish the same " + "event name, `%s`.", eventName), EventPluginRegistry.eventNameDispatchConfigs[eventName] = dispatchConfig; var phasedRegistrationNames = dispatchConfig.phasedRegistrationNames; if (phasedRegistrationNames) { @@ -105,12 +105,12 @@ function publishEventForPlugin(dispatchConfig, pluginModule, eventName) { } return !0; } - return !!dispatchConfig.registrationName && (publishRegistrationName(dispatchConfig.registrationName, pluginModule, eventName), + return !!dispatchConfig.registrationName && (publishRegistrationName(dispatchConfig.registrationName, pluginModule, eventName), !0); } function publishRegistrationName(registrationName, pluginModule, eventName) { - invariant(!EventPluginRegistry.registrationNameModules[registrationName], "EventPluginHub: More than one plugin attempted to publish the same " + "registration name, `%s`.", registrationName), + invariant(!EventPluginRegistry.registrationNameModules[registrationName], "EventPluginHub: More than one plugin attempted to publish the same " + "registration name, `%s`.", registrationName), EventPluginRegistry.registrationNameModules[registrationName] = pluginModule, EventPluginRegistry.registrationNameDependencies[registrationName] = pluginModule.eventTypes[eventName].dependencies; } @@ -121,14 +121,14 @@ var EventPluginRegistry = { registrationNameDependencies: {}, possibleRegistrationNames: null, injectEventPluginOrder: function(injectedEventPluginOrder) { - invariant(!eventPluginOrder, "EventPluginRegistry: Cannot inject event plugin ordering more than " + "once. You are likely trying to load more than one copy of React."), + invariant(!eventPluginOrder, "EventPluginRegistry: Cannot inject event plugin ordering more than " + "once. You are likely trying to load more than one copy of React."), eventPluginOrder = Array.prototype.slice.call(injectedEventPluginOrder), recomputePluginOrdering(); }, injectEventPluginsByName: function(injectedNamesToPlugins) { var isOrderingDirty = !1; for (var pluginName in injectedNamesToPlugins) if (injectedNamesToPlugins.hasOwnProperty(pluginName)) { var pluginModule = injectedNamesToPlugins[pluginName]; - namesToPlugins.hasOwnProperty(pluginName) && namesToPlugins[pluginName] === pluginModule || (invariant(!namesToPlugins[pluginName], "EventPluginRegistry: Cannot inject two different event plugins " + "using the same name, `%s`.", pluginName), + namesToPlugins.hasOwnProperty(pluginName) && namesToPlugins[pluginName] === pluginModule || (invariant(!namesToPlugins[pluginName], "EventPluginRegistry: Cannot inject two different event plugins " + "using the same name, `%s`.", pluginName), namesToPlugins[pluginName] = pluginModule, isOrderingDirty = !0); } isOrderingDirty && recomputePluginOrdering(); @@ -149,7 +149,7 @@ var EventPluginRegistry = { }, ReactErrorUtils = { injection: { injectErrorUtils: function(injectedErrorUtils) { - invariant("function" == typeof injectedErrorUtils.invokeGuardedCallback, "Injected invokeGuardedCallback() must be a function."), + invariant("function" == typeof injectedErrorUtils.invokeGuardedCallback, "Injected invokeGuardedCallback() must be a function."), invokeGuardedCallback = injectedErrorUtils.invokeGuardedCallback; } }, @@ -183,7 +183,7 @@ function isStartish(topLevelType) { function executeDispatch(event, simulated, listener, inst) { var type = event.type || "unknown-event"; - event.currentTarget = EventPluginUtils.getNodeFromInstance(inst), ReactErrorUtils_1.invokeGuardedCallbackAndCatchFirstError(type, listener, void 0, event), + event.currentTarget = EventPluginUtils.getNodeFromInstance(inst), ReactErrorUtils_1.invokeGuardedCallbackAndCatchFirstError(type, listener, void 0, event), event.currentTarget = null; } @@ -208,10 +208,10 @@ function executeDispatchesInOrderStopAtTrue(event) { function executeDirectDispatch(event) { var dispatchListener = event._dispatchListeners, dispatchInstance = event._dispatchInstances; - invariant(!Array.isArray(dispatchListener), "executeDirectDispatch(...): Invalid `event`."), + invariant(!Array.isArray(dispatchListener), "executeDirectDispatch(...): Invalid `event`."), event.currentTarget = dispatchListener ? EventPluginUtils.getNodeFromInstance(dispatchInstance) : null; var res = dispatchListener ? dispatchListener(event) : null; - return event.currentTarget = null, event._dispatchListeners = null, event._dispatchInstances = null, + return event.currentTarget = null, event._dispatchListeners = null, event._dispatchInstances = null, res; } @@ -240,8 +240,8 @@ var EventPluginUtils = { }, EventPluginUtils_1 = EventPluginUtils; function accumulateInto(current, next) { - return invariant(null != next, "accumulateInto(...): Accumulated items must not be null or undefined."), - null == current ? next : Array.isArray(current) ? Array.isArray(next) ? (current.push.apply(current, next), + return invariant(null != next, "accumulateInto(...): Accumulated items must not be null or undefined."), + null == current ? next : Array.isArray(current) ? Array.isArray(next) ? (current.push.apply(current, next), current) : (current.push(next), current) : Array.isArray(next) ? [ current ].concat(next) : [ current, next ]; } @@ -302,7 +302,7 @@ var EventPluginHub = { var _props = currentElement.props; if (listener = _props[registrationName], shouldPreventMouseEvent(registrationName, currentElement.type, _props)) return null; } - return invariant(!listener || "function" == typeof listener, "Expected %s listener to be a function, instead got type %s", registrationName, typeof listener), + return invariant(!listener || "function" == typeof listener, "Expected %s listener to be a function, instead got type %s", registrationName, typeof listener), listener; }, extractEvents: function(topLevelType, targetInst, nativeEvent, nativeEventTarget) { @@ -320,8 +320,8 @@ var EventPluginHub = { }, processEventQueue: function(simulated) { var processingEventQueue = eventQueue; - eventQueue = null, simulated ? forEachAccumulated_1(processingEventQueue, executeDispatchesAndReleaseSimulated) : forEachAccumulated_1(processingEventQueue, executeDispatchesAndReleaseTopLevel), - invariant(!eventQueue, "processEventQueue(): Additional events were enqueued while processing " + "an event queue. Support for this has not yet been implemented."), + eventQueue = null, simulated ? forEachAccumulated_1(processingEventQueue, executeDispatchesAndReleaseSimulated) : forEachAccumulated_1(processingEventQueue, executeDispatchesAndReleaseTopLevel), + invariant(!eventQueue, "processEventQueue(): Additional events were enqueued while processing " + "an event queue. Support for this has not yet been implemented."), ReactErrorUtils_1.rethrowCaughtError(); } }, EventPluginHub_1 = EventPluginHub, ReactTypeOfWork = { @@ -381,7 +381,7 @@ function traverseTwoPhase(inst, fn, arg) { } function traverseEnterLeave(from, to, fn, argFrom, argTo) { - for (var common = from && to ? getLowestCommonAncestor(from, to) : null, pathFrom = []; from && from !== common; ) pathFrom.push(from), + for (var common = from && to ? getLowestCommonAncestor(from, to) : null, pathFrom = []; from && from !== common; ) pathFrom.push(from), from = getParent(from); for (var pathTo = []; to && to !== common; ) pathTo.push(to), to = getParent(to); var i; @@ -404,7 +404,7 @@ function listenerAtPhase(inst, event, propagationPhase) { function accumulateDirectionalDispatches(inst, phase, event) { var listener = listenerAtPhase(inst, event, phase); - listener && (event._dispatchListeners = accumulateInto_1(event._dispatchListeners, listener), + listener && (event._dispatchListeners = accumulateInto_1(event._dispatchListeners, listener), event._dispatchInstances = accumulateInto_1(event._dispatchInstances, inst)); } @@ -422,7 +422,7 @@ function accumulateTwoPhaseDispatchesSingleSkipTarget(event) { function accumulateDispatches(inst, ignoredDirection, event) { if (inst && event && event.dispatchConfig.registrationName) { var registrationName = event.dispatchConfig.registrationName, listener = getListener(inst, registrationName); - listener && (event._dispatchListeners = accumulateInto_1(event._dispatchListeners, listener), + listener && (event._dispatchListeners = accumulateInto_1(event._dispatchListeners, listener), event._dispatchInstances = accumulateInto_1(event._dispatchInstances, inst)); } } @@ -482,12 +482,12 @@ var EventPropagators = { return new Klass(a1, a2, a3, a4); }, standardReleaser = function(instance) { var Klass = this; - invariant(instance instanceof Klass, "Trying to release an instance into a pool of a different type."), + invariant(instance instanceof Klass, "Trying to release an instance into a pool of a different type."), instance.destructor(), Klass.instancePool.length < Klass.poolSize && Klass.instancePool.push(instance); }, DEFAULT_POOL_SIZE = 10, DEFAULT_POOLER = oneArgumentPooler, addPoolingTo = function(CopyConstructor, pooler) { var NewKlass = CopyConstructor; - return NewKlass.instancePool = [], NewKlass.getPooled = pooler || DEFAULT_POOLER, - NewKlass.poolSize || (NewKlass.poolSize = DEFAULT_POOL_SIZE), NewKlass.release = standardReleaser, + return NewKlass.instancePool = [], NewKlass.getPooled = pooler || DEFAULT_POOLER, + NewKlass.poolSize || (NewKlass.poolSize = DEFAULT_POOL_SIZE), NewKlass.release = standardReleaser, NewKlass; }, PooledClass = { addPoolingTo: addPoolingTo, @@ -517,7 +517,7 @@ function SyntheticEvent(dispatchConfig, targetInst, nativeEvent, nativeEventTarg normalize ? this[propName] = normalize(nativeEvent) : "target" === propName ? this.target = nativeEventTarget : this[propName] = nativeEvent[propName]; } var defaultPrevented = null != nativeEvent.defaultPrevented ? nativeEvent.defaultPrevented : !1 === nativeEvent.returnValue; - return this.isDefaultPrevented = defaultPrevented ? emptyFunction.thatReturnsTrue : emptyFunction.thatReturnsFalse, + return this.isDefaultPrevented = defaultPrevented ? emptyFunction.thatReturnsTrue : emptyFunction.thatReturnsFalse, this.isPropagationStopped = emptyFunction.thatReturnsFalse, this; } @@ -525,12 +525,12 @@ Object.assign(SyntheticEvent.prototype, { preventDefault: function() { this.defaultPrevented = !0; var event = this.nativeEvent; - event && (event.preventDefault ? event.preventDefault() : "unknown" != typeof event.returnValue && (event.returnValue = !1), + event && (event.preventDefault ? event.preventDefault() : "unknown" != typeof event.returnValue && (event.returnValue = !1), this.isDefaultPrevented = emptyFunction.thatReturnsTrue); }, stopPropagation: function() { var event = this.nativeEvent; - event && (event.stopPropagation ? event.stopPropagation() : "unknown" != typeof event.cancelBubble && (event.cancelBubble = !0), + event && (event.stopPropagation ? event.stopPropagation() : "unknown" != typeof event.cancelBubble && (event.cancelBubble = !0), this.isPropagationStopped = emptyFunction.thatReturnsTrue); }, persist: function() { @@ -546,8 +546,8 @@ Object.assign(SyntheticEvent.prototype, { var Super = this, E = function() {}; E.prototype = Super.prototype; var prototype = new E(); - Object.assign(prototype, Class.prototype), Class.prototype = prototype, Class.prototype.constructor = Class, - Class.Interface = Object.assign({}, Super.Interface, Interface), Class.augmentClass = Super.augmentClass, + Object.assign(prototype, Class.prototype), Class.prototype = prototype, Class.prototype.constructor = Class, + Class.Interface = Object.assign({}, Super.Interface, Interface), Class.augmentClass = Super.augmentClass, PooledClass_1.addPoolingTo(Class, PooledClass_1.fourArgumentPooler); }, PooledClass_1.addPoolingTo(SyntheticEvent, PooledClass_1.fourArgumentPooler); @@ -561,7 +561,7 @@ var SyntheticEvent_1 = SyntheticEvent, _extends = Object.assign || function(targ for (var bubblingTypeName in customBubblingEventTypes) allTypesByEventName[bubblingTypeName] = customBubblingEventTypes[bubblingTypeName]; -for (var directTypeName in customDirectEventTypes) warning(!customBubblingEventTypes[directTypeName], "Event cannot be both direct and bubbling: %s", directTypeName), +for (var directTypeName in customDirectEventTypes) warning(!customBubblingEventTypes[directTypeName], "Event cannot be both direct and bubbling: %s", directTypeName), allTypesByEventName[directTypeName] = customDirectEventTypes[directTypeName]; var ReactNativeBridgeEventPlugin = { @@ -612,7 +612,7 @@ function restoreStateOfTarget(target) { var props = EventPluginUtils_1.getFiberCurrentPropsFromNode(internalInstance.stateNode); return void fiberHostComponent.restoreControlledState(internalInstance.stateNode, internalInstance.type, props); } - invariant("function" == typeof internalInstance.restoreControlledState, "The internal instance must be a React host component."), + invariant("function" == typeof internalInstance.restoreControlledState, "The internal instance must be a React host component."), internalInstance.restoreControlledState(); } } @@ -701,7 +701,7 @@ var ReactGenericBatchingInjection = { var touch = changedTouches[jj]; touch.changedTouches = changedTouches, touch.touches = touches; var nativeEvent = touch, rootNodeID = null, target = nativeEvent.target; - null !== target && void 0 !== target && (target < ReactNativeTagHandles_1.tagsStartAt || (rootNodeID = target)), + null !== target && void 0 !== target && (target < ReactNativeTagHandles_1.tagsStartAt || (rootNodeID = target)), ReactNativeEventEmitter._receiveRootNodeIDEvent(rootNodeID, eventTopLevelType, nativeEvent); } } @@ -751,38 +751,38 @@ function createTouchRecord(touch) { } function resetTouchRecord(touchRecord, touch) { - touchRecord.touchActive = !0, touchRecord.startPageX = touch.pageX, touchRecord.startPageY = touch.pageY, - touchRecord.startTimeStamp = timestampForTouch(touch), touchRecord.currentPageX = touch.pageX, - touchRecord.currentPageY = touch.pageY, touchRecord.currentTimeStamp = timestampForTouch(touch), - touchRecord.previousPageX = touch.pageX, touchRecord.previousPageY = touch.pageY, + touchRecord.touchActive = !0, touchRecord.startPageX = touch.pageX, touchRecord.startPageY = touch.pageY, + touchRecord.startTimeStamp = timestampForTouch(touch), touchRecord.currentPageX = touch.pageX, + touchRecord.currentPageY = touch.pageY, touchRecord.currentTimeStamp = timestampForTouch(touch), + touchRecord.previousPageX = touch.pageX, touchRecord.previousPageY = touch.pageY, touchRecord.previousTimeStamp = timestampForTouch(touch); } function getTouchIdentifier(_ref) { var identifier = _ref.identifier; - return invariant(null != identifier, "Touch object is missing identifier."), warning(identifier <= MAX_TOUCH_BANK, "Touch identifier %s is greater than maximum supported %s which causes " + "performance issues backfilling array locations for all of the indices.", identifier, MAX_TOUCH_BANK), + return invariant(null != identifier, "Touch object is missing identifier."), warning(identifier <= MAX_TOUCH_BANK, "Touch identifier %s is greater than maximum supported %s which causes " + "performance issues backfilling array locations for all of the indices.", identifier, MAX_TOUCH_BANK), identifier; } function recordTouchStart(touch) { var identifier = getTouchIdentifier(touch), touchRecord = touchBank[identifier]; - touchRecord ? resetTouchRecord(touchRecord, touch) : touchBank[identifier] = createTouchRecord(touch), + touchRecord ? resetTouchRecord(touchRecord, touch) : touchBank[identifier] = createTouchRecord(touch), touchHistory.mostRecentTimeStamp = timestampForTouch(touch); } function recordTouchMove(touch) { var touchRecord = touchBank[getTouchIdentifier(touch)]; - touchRecord ? (touchRecord.touchActive = !0, touchRecord.previousPageX = touchRecord.currentPageX, - touchRecord.previousPageY = touchRecord.currentPageY, touchRecord.previousTimeStamp = touchRecord.currentTimeStamp, - touchRecord.currentPageX = touch.pageX, touchRecord.currentPageY = touch.pageY, + touchRecord ? (touchRecord.touchActive = !0, touchRecord.previousPageX = touchRecord.currentPageX, + touchRecord.previousPageY = touchRecord.currentPageY, touchRecord.previousTimeStamp = touchRecord.currentTimeStamp, + touchRecord.currentPageX = touch.pageX, touchRecord.currentPageY = touch.pageY, touchRecord.currentTimeStamp = timestampForTouch(touch), touchHistory.mostRecentTimeStamp = timestampForTouch(touch)) : console.error("Cannot record touch move without a touch start.\n" + "Touch Move: %s\n", "Touch Bank: %s", printTouch(touch), printTouchBank()); } function recordTouchEnd(touch) { var touchRecord = touchBank[getTouchIdentifier(touch)]; - touchRecord ? (touchRecord.touchActive = !1, touchRecord.previousPageX = touchRecord.currentPageX, - touchRecord.previousPageY = touchRecord.currentPageY, touchRecord.previousTimeStamp = touchRecord.currentTimeStamp, - touchRecord.currentPageX = touch.pageX, touchRecord.currentPageY = touch.pageY, + touchRecord ? (touchRecord.touchActive = !1, touchRecord.previousPageX = touchRecord.currentPageX, + touchRecord.previousPageY = touchRecord.currentPageY, touchRecord.previousTimeStamp = touchRecord.currentTimeStamp, + touchRecord.currentPageX = touch.pageX, touchRecord.currentPageY = touch.pageY, touchRecord.currentTimeStamp = timestampForTouch(touch), touchHistory.mostRecentTimeStamp = timestampForTouch(touch)) : console.error("Cannot record touch end without a touch start.\n" + "Touch End: %s\n", "Touch Bank: %s", printTouch(touch), printTouchBank()); } @@ -797,14 +797,14 @@ function printTouch(touch) { function printTouchBank() { var printed = JSON.stringify(touchBank.slice(0, MAX_TOUCH_BANK)); - return touchBank.length > MAX_TOUCH_BANK && (printed += " (original size: " + touchBank.length + ")"), + return touchBank.length > MAX_TOUCH_BANK && (printed += " (original size: " + touchBank.length + ")"), printed; } var ResponderTouchHistoryStore = { recordTouchTrack: function(topLevelType, nativeEvent) { - if (isMoveish$2(topLevelType)) nativeEvent.changedTouches.forEach(recordTouchMove); else if (isStartish$2(topLevelType)) nativeEvent.changedTouches.forEach(recordTouchStart), - touchHistory.numberActiveTouches = nativeEvent.touches.length, 1 === touchHistory.numberActiveTouches && (touchHistory.indexOfSingleActiveTouch = nativeEvent.touches[0].identifier); else if (isEndish$2(topLevelType) && (nativeEvent.changedTouches.forEach(recordTouchEnd), + if (isMoveish$2(topLevelType)) nativeEvent.changedTouches.forEach(recordTouchMove); else if (isStartish$2(topLevelType)) nativeEvent.changedTouches.forEach(recordTouchStart), + touchHistory.numberActiveTouches = nativeEvent.touches.length, 1 === touchHistory.numberActiveTouches && (touchHistory.indexOfSingleActiveTouch = nativeEvent.touches[0].identifier); else if (isEndish$2(topLevelType) && (nativeEvent.changedTouches.forEach(recordTouchEnd), touchHistory.numberActiveTouches = nativeEvent.touches.length, 1 === touchHistory.numberActiveTouches)) for (var i = 0; i < touchBank.length; i++) { var touchTrackToCheck = touchBank[i]; if (null != touchTrackToCheck && touchTrackToCheck.touchActive) { @@ -817,7 +817,7 @@ var ResponderTouchHistoryStore = { }, ResponderTouchHistoryStore_1 = ResponderTouchHistoryStore; function accumulate(current, next) { - return invariant(null != next, "accumulate(...): Accumulated items must be not be null or undefined."), + return invariant(null != next, "accumulate(...): Accumulated items must be not be null or undefined."), null == current ? next : Array.isArray(current) ? current.concat(next) : Array.isArray(next) ? [ current ].concat(next) : [ current, next ]; } @@ -879,24 +879,24 @@ function setResponderAndExtractTransfer(topLevelType, targetInst, nativeEvent, n var shouldSetEventType = isStartish$1(topLevelType) ? eventTypes.startShouldSetResponder : isMoveish$1(topLevelType) ? eventTypes.moveShouldSetResponder : "topSelectionChange" === topLevelType ? eventTypes.selectionChangeShouldSetResponder : eventTypes.scrollShouldSetResponder, bubbleShouldSetFrom = responderInst ? ReactTreeTraversal.getLowestCommonAncestor(responderInst, targetInst) : targetInst, skipOverBubbleShouldSetFrom = bubbleShouldSetFrom === responderInst, shouldSetEvent = ResponderSyntheticEvent_1.getPooled(shouldSetEventType, bubbleShouldSetFrom, nativeEvent, nativeEventTarget); shouldSetEvent.touchHistory = ResponderTouchHistoryStore_1.touchHistory, skipOverBubbleShouldSetFrom ? EventPropagators_1.accumulateTwoPhaseDispatchesSkipTarget(shouldSetEvent) : EventPropagators_1.accumulateTwoPhaseDispatches(shouldSetEvent); var wantsResponderInst = executeDispatchesInOrderStopAtTrue$1(shouldSetEvent); - if (shouldSetEvent.isPersistent() || shouldSetEvent.constructor.release(shouldSetEvent), + if (shouldSetEvent.isPersistent() || shouldSetEvent.constructor.release(shouldSetEvent), !wantsResponderInst || wantsResponderInst === responderInst) return null; var extracted, grantEvent = ResponderSyntheticEvent_1.getPooled(eventTypes.responderGrant, wantsResponderInst, nativeEvent, nativeEventTarget); grantEvent.touchHistory = ResponderTouchHistoryStore_1.touchHistory, EventPropagators_1.accumulateDirectDispatches(grantEvent); var blockHostResponder = !0 === executeDirectDispatch$1(grantEvent); if (responderInst) { var terminationRequestEvent = ResponderSyntheticEvent_1.getPooled(eventTypes.responderTerminationRequest, responderInst, nativeEvent, nativeEventTarget); - terminationRequestEvent.touchHistory = ResponderTouchHistoryStore_1.touchHistory, + terminationRequestEvent.touchHistory = ResponderTouchHistoryStore_1.touchHistory, EventPropagators_1.accumulateDirectDispatches(terminationRequestEvent); var shouldSwitch = !hasDispatches$1(terminationRequestEvent) || executeDirectDispatch$1(terminationRequestEvent); - if (terminationRequestEvent.isPersistent() || terminationRequestEvent.constructor.release(terminationRequestEvent), + if (terminationRequestEvent.isPersistent() || terminationRequestEvent.constructor.release(terminationRequestEvent), shouldSwitch) { var terminateEvent = ResponderSyntheticEvent_1.getPooled(eventTypes.responderTerminate, responderInst, nativeEvent, nativeEventTarget); - terminateEvent.touchHistory = ResponderTouchHistoryStore_1.touchHistory, EventPropagators_1.accumulateDirectDispatches(terminateEvent), + terminateEvent.touchHistory = ResponderTouchHistoryStore_1.touchHistory, EventPropagators_1.accumulateDirectDispatches(terminateEvent), extracted = accumulate_1(extracted, [ grantEvent, terminateEvent ]), changeResponder(wantsResponderInst, blockHostResponder); } else { var rejectEvent = ResponderSyntheticEvent_1.getPooled(eventTypes.responderReject, wantsResponderInst, nativeEvent, nativeEventTarget); - rejectEvent.touchHistory = ResponderTouchHistoryStore_1.touchHistory, EventPropagators_1.accumulateDirectDispatches(rejectEvent), + rejectEvent.touchHistory = ResponderTouchHistoryStore_1.touchHistory, EventPropagators_1.accumulateDirectDispatches(rejectEvent), extracted = accumulate_1(extracted, rejectEvent); } } else extracted = accumulate_1(extracted, grantEvent), changeResponder(wantsResponderInst, blockHostResponder); @@ -927,7 +927,7 @@ var ResponderEventPlugin = { eventTypes: eventTypes, extractEvents: function(topLevelType, targetInst, nativeEvent, nativeEventTarget) { if (isStartish$1(topLevelType)) trackedTouchCount += 1; else if (isEndish$1(topLevelType)) { - if (!(trackedTouchCount >= 0)) return console.error("Ended a touch event which was not counted in `trackedTouchCount`."), + if (!(trackedTouchCount >= 0)) return console.error("Ended a touch event which was not counted in `trackedTouchCount`."), null; trackedTouchCount -= 1; } @@ -935,17 +935,17 @@ var ResponderEventPlugin = { var extracted = canTriggerTransfer(topLevelType, targetInst, nativeEvent) ? setResponderAndExtractTransfer(topLevelType, targetInst, nativeEvent, nativeEventTarget) : null, isResponderTouchStart = responderInst && isStartish$1(topLevelType), isResponderTouchMove = responderInst && isMoveish$1(topLevelType), isResponderTouchEnd = responderInst && isEndish$1(topLevelType), incrementalTouch = isResponderTouchStart ? eventTypes.responderStart : isResponderTouchMove ? eventTypes.responderMove : isResponderTouchEnd ? eventTypes.responderEnd : null; if (incrementalTouch) { var gesture = ResponderSyntheticEvent_1.getPooled(incrementalTouch, responderInst, nativeEvent, nativeEventTarget); - gesture.touchHistory = ResponderTouchHistoryStore_1.touchHistory, EventPropagators_1.accumulateDirectDispatches(gesture), + gesture.touchHistory = ResponderTouchHistoryStore_1.touchHistory, EventPropagators_1.accumulateDirectDispatches(gesture), extracted = accumulate_1(extracted, gesture); } var isResponderTerminate = responderInst && "topTouchCancel" === topLevelType, isResponderRelease = responderInst && !isResponderTerminate && isEndish$1(topLevelType) && noResponderTouches(nativeEvent), finalTouch = isResponderTerminate ? eventTypes.responderTerminate : isResponderRelease ? eventTypes.responderRelease : null; if (finalTouch) { var finalEvent = ResponderSyntheticEvent_1.getPooled(finalTouch, responderInst, nativeEvent, nativeEventTarget); - finalEvent.touchHistory = ResponderTouchHistoryStore_1.touchHistory, EventPropagators_1.accumulateDirectDispatches(finalEvent), + finalEvent.touchHistory = ResponderTouchHistoryStore_1.touchHistory, EventPropagators_1.accumulateDirectDispatches(finalEvent), extracted = accumulate_1(extracted, finalEvent), changeResponder(null); } var numberActiveTouches = ResponderTouchHistoryStore_1.touchHistory.numberActiveTouches; - return ResponderEventPlugin.GlobalInteractionHandler && numberActiveTouches !== previousActiveTouches && ResponderEventPlugin.GlobalInteractionHandler.onChange(numberActiveTouches), + return ResponderEventPlugin.GlobalInteractionHandler && numberActiveTouches !== previousActiveTouches && ResponderEventPlugin.GlobalInteractionHandler.onChange(numberActiveTouches), previousActiveTouches = numberActiveTouches, extracted; }, GlobalResponderHandler: null, @@ -961,8 +961,8 @@ var ResponderEventPlugin = { }, ResponderEventPlugin_1 = ResponderEventPlugin; function inject() { - RCTEventEmitter.register(ReactNativeEventEmitter_1), EventPluginHub_1.injection.injectEventPluginOrder(ReactNativeEventPluginOrder_1), - EventPluginUtils_1.injection.injectComponentTree(ReactNativeComponentTree_1), ResponderEventPlugin_1.injection.injectGlobalResponderHandler(ReactNativeGlobalResponderHandler_1), + RCTEventEmitter.register(ReactNativeEventEmitter_1), EventPluginHub_1.injection.injectEventPluginOrder(ReactNativeEventPluginOrder_1), + EventPluginUtils_1.injection.injectComponentTree(ReactNativeComponentTree_1), ResponderEventPlugin_1.injection.injectGlobalResponderHandler(ReactNativeGlobalResponderHandler_1), EventPluginHub_1.injection.injectEventPluginsByName({ ResponderEventPlugin: ResponderEventPlugin_1, ReactNativeBridgeEventPlugin: ReactNativeBridgeEventPlugin_1 @@ -990,7 +990,7 @@ var ReactOwner = { if (owner && owner.tag === ClassComponent) { var inst = owner.stateNode; (inst.refs === emptyObject ? inst.refs = {} : inst.refs)[ref] = component.getPublicInstance(); - } else invariant(isValidOwner(owner), "addComponentAsRefTo(...): Only a ReactOwner can have refs. You might " + "be adding a ref to a component that was not created inside a component's " + "`render` method, or you have multiple copies of React loaded " + "(details: https://fb.me/react-refs-must-have-owner)."), + } else invariant(isValidOwner(owner), "addComponentAsRefTo(...): Only a ReactOwner can have refs. You might " + "be adding a ref to a component that was not created inside a component's " + "`render` method, or you have multiple copies of React loaded " + "(details: https://fb.me/react-refs-must-have-owner)."), owner.attachRef(ref, component); }, removeComponentAsRefFrom: function(component, ref, owner) { @@ -1020,10 +1020,10 @@ ReactRef.attachRefs = function(instance, element) { } }, ReactRef.shouldUpdateRefs = function(prevElement, nextElement) { var prevRef = null, prevOwner = null; - null !== prevElement && "object" == typeof prevElement && (prevRef = prevElement.ref, + null !== prevElement && "object" == typeof prevElement && (prevRef = prevElement.ref, prevOwner = prevElement._owner); var nextRef = null, nextOwner = null; - return null !== nextElement && "object" == typeof nextElement && (nextRef = nextElement.ref, + return null !== nextElement && "object" == typeof nextElement && (nextRef = nextElement.ref, nextOwner = nextElement._owner), prevRef !== nextRef || "string" == typeof nextRef && nextOwner !== prevOwner; }, ReactRef.detachRefs = function(instance, element) { if (null !== element && "object" == typeof element) { @@ -1041,7 +1041,7 @@ function attachRefs() { var ReactReconciler = { mountComponent: function(internalInstance, transaction, hostParent, hostContainerInfo, context, parentDebugID) { var markup = internalInstance.mountComponent(transaction, hostParent, hostContainerInfo, context, parentDebugID); - return internalInstance._currentElement && null != internalInstance._currentElement.ref && transaction.getReactMountReady().enqueue(attachRefs, internalInstance), + return internalInstance._currentElement && null != internalInstance._currentElement.ref && transaction.getReactMountReady().enqueue(attachRefs, internalInstance), markup; }, getHostNode: function(internalInstance) { @@ -1054,7 +1054,7 @@ var ReactReconciler = { var prevElement = internalInstance._currentElement; if (nextElement !== prevElement || context !== internalInstance._context) { var refsChanged = ReactRef_1.shouldUpdateRefs(prevElement, nextElement); - refsChanged && ReactRef_1.detachRefs(internalInstance, prevElement), internalInstance.receiveComponent(nextElement, transaction, context), + refsChanged && ReactRef_1.detachRefs(internalInstance, prevElement), internalInstance.receiveComponent(nextElement, transaction, context), refsChanged && internalInstance._currentElement && null != internalInstance._currentElement.ref && transaction.getReactMountReady().enqueue(attachRefs, internalInstance); } }, @@ -1075,14 +1075,9 @@ var ReactReconciler = { set: function(key, value) { key._reactInternalInstance = value; } -}, ReactInstanceMap_1 = ReactInstanceMap, ReactFeatureFlags = { - logTopLevelRenders: !1, - prepareNewChildrenBeforeUnmountInStack: !0, - disableNewFiberFeatures: !1, - enableAsyncSubtreeAPI: !1 -}, ReactFeatureFlags_1 = ReactFeatureFlags, OBSERVED_ERROR = {}, TransactionImpl = { +}, ReactInstanceMap_1 = ReactInstanceMap, OBSERVED_ERROR = {}, TransactionImpl = { reinitializeTransaction: function() { - this.transactionWrappers = this.getTransactionWrappers(), this.wrapperInitData ? this.wrapperInitData.length = 0 : this.wrapperInitData = [], + this.transactionWrappers = this.getTransactionWrappers(), this.wrapperInitData ? this.wrapperInitData.length = 0 : this.wrapperInitData = [], this._isInTransaction = !1; }, _isInTransaction: !1, @@ -1094,7 +1089,7 @@ var ReactReconciler = { invariant(!this.isInTransaction(), "Transaction.perform(...): Cannot initialize a transaction when there " + "is already an outstanding transaction."); var errorThrown, ret; try { - this._isInTransaction = !0, errorThrown = !0, this.initializeAll(0), ret = method.call(scope, a, b, c, d, e, f), + this._isInTransaction = !0, errorThrown = !0, this.initializeAll(0), ret = method.call(scope, a, b, c, d, e, f), errorThrown = !1; } finally { try { @@ -1124,7 +1119,7 @@ var ReactReconciler = { for (var transactionWrappers = this.transactionWrappers, i = startIndex; i < transactionWrappers.length; i++) { var errorThrown, wrapper = transactionWrappers[i], initData = this.wrapperInitData[i]; try { - errorThrown = !0, initData !== OBSERVED_ERROR && wrapper.close && wrapper.close.call(this, initData), + errorThrown = !0, initData !== OBSERVED_ERROR && wrapper.close && wrapper.close.call(this, initData), errorThrown = !1; } finally { if (errorThrown) try { @@ -1145,7 +1140,7 @@ var NESTED_UPDATES = { this.dirtyComponentsLength = dirtyComponents.length; }, close: function() { - this.dirtyComponentsLength !== dirtyComponents.length ? (dirtyComponents.splice(0, this.dirtyComponentsLength), + this.dirtyComponentsLength !== dirtyComponents.length ? (dirtyComponents.splice(0, this.dirtyComponentsLength), flushBatchedUpdates()) : dirtyComponents.length = 0; } }, TRANSACTION_WRAPPERS = [ NESTED_UPDATES ]; @@ -1159,7 +1154,7 @@ Object.assign(ReactUpdatesFlushTransaction.prototype, Transaction, { return TRANSACTION_WRAPPERS; }, destructor: function() { - this.dirtyComponentsLength = null, ReactUpdates.ReactReconcileTransaction.release(this.reconcileTransaction), + this.dirtyComponentsLength = null, ReactUpdates.ReactReconcileTransaction.release(this.reconcileTransaction), this.reconcileTransaction = null; }, perform: function(method, scope, a) { @@ -1177,17 +1172,11 @@ function mountOrderComparator(c1, c2) { function runBatchedUpdates(transaction) { var len = transaction.dirtyComponentsLength; - invariant(len === dirtyComponents.length, "Expected flush transaction's stored dirty-components length (%s) to " + "match dirty-components array length (%s).", len, dirtyComponents.length), + invariant(len === dirtyComponents.length, "Expected flush transaction's stored dirty-components length (%s) to " + "match dirty-components array length (%s).", len, dirtyComponents.length), dirtyComponents.sort(mountOrderComparator), updateBatchNumber++; for (var i = 0; i < len; i++) { - var markerName, component = dirtyComponents[i]; - if (ReactFeatureFlags_1.logTopLevelRenders) { - var namedComponent = component; - component._currentElement.type.isReactTopLevelWrapper && (namedComponent = component._renderedComponent), - markerName = "React update: " + namedComponent.getName(), console.time(markerName); - } - ReactReconciler_1.performUpdateIfNecessary(component, transaction.reconcileTransaction, updateBatchNumber), - markerName && console.timeEnd(markerName); + var component = dirtyComponents[i]; + ReactReconciler_1.performUpdateIfNecessary(component, transaction.reconcileTransaction, updateBatchNumber); } } @@ -1205,13 +1194,13 @@ function enqueueUpdate$1(component) { var ReactUpdatesInjection = { injectReconcileTransaction: function(ReconcileTransaction) { - invariant(ReconcileTransaction, "ReactUpdates: must provide a reconcile transaction class"), + invariant(ReconcileTransaction, "ReactUpdates: must provide a reconcile transaction class"), ReactUpdates.ReactReconcileTransaction = ReconcileTransaction; }, injectBatchingStrategy: function(_batchingStrategy) { - invariant(_batchingStrategy, "ReactUpdates: must provide a batching strategy"), - invariant("function" == typeof _batchingStrategy.batchedUpdates, "ReactUpdates: must provide a batchedUpdates() function"), - invariant("boolean" == typeof _batchingStrategy.isBatchingUpdates, "ReactUpdates: must provide an isBatchingUpdates boolean attribute"), + invariant(_batchingStrategy, "ReactUpdates: must provide a batching strategy"), + invariant("function" == typeof _batchingStrategy.batchedUpdates, "ReactUpdates: must provide a batchedUpdates() function"), + invariant("boolean" == typeof _batchingStrategy.isBatchingUpdates, "ReactUpdates: must provide an isBatchingUpdates boolean attribute"), batchingStrategy = _batchingStrategy; }, getBatchingStrategy: function() { @@ -1242,30 +1231,30 @@ var ReactUpdateQueue = { return !!internalInstance && !!internalInstance._renderedComponent; }, enqueueCallbackInternal: function(internalInstance, callback) { - internalInstance._pendingCallbacks ? internalInstance._pendingCallbacks.push(callback) : internalInstance._pendingCallbacks = [ callback ], + internalInstance._pendingCallbacks ? internalInstance._pendingCallbacks.push(callback) : internalInstance._pendingCallbacks = [ callback ], enqueueUpdate(internalInstance); }, enqueueForceUpdate: function(publicInstance, callback, callerName) { var internalInstance = getInternalInstanceReadyForUpdate(publicInstance); - internalInstance && (callback = void 0 === callback ? null : callback, null !== callback && (internalInstance._pendingCallbacks ? internalInstance._pendingCallbacks.push(callback) : internalInstance._pendingCallbacks = [ callback ]), + internalInstance && (callback = void 0 === callback ? null : callback, null !== callback && (internalInstance._pendingCallbacks ? internalInstance._pendingCallbacks.push(callback) : internalInstance._pendingCallbacks = [ callback ]), internalInstance._pendingForceUpdate = !0, enqueueUpdate(internalInstance)); }, enqueueReplaceState: function(publicInstance, completeState, callback, callerName) { var internalInstance = getInternalInstanceReadyForUpdate(publicInstance); - internalInstance && (internalInstance._pendingStateQueue = [ completeState ], internalInstance._pendingReplaceState = !0, - callback = void 0 === callback ? null : callback, null !== callback && (internalInstance._pendingCallbacks ? internalInstance._pendingCallbacks.push(callback) : internalInstance._pendingCallbacks = [ callback ]), + internalInstance && (internalInstance._pendingStateQueue = [ completeState ], internalInstance._pendingReplaceState = !0, + callback = void 0 === callback ? null : callback, null !== callback && (internalInstance._pendingCallbacks ? internalInstance._pendingCallbacks.push(callback) : internalInstance._pendingCallbacks = [ callback ]), enqueueUpdate(internalInstance)); }, enqueueSetState: function(publicInstance, partialState, callback, callerName) { var internalInstance = getInternalInstanceReadyForUpdate(publicInstance); if (internalInstance) { - (internalInstance._pendingStateQueue || (internalInstance._pendingStateQueue = [])).push(partialState), - callback = void 0 === callback ? null : callback, null !== callback && (internalInstance._pendingCallbacks ? internalInstance._pendingCallbacks.push(callback) : internalInstance._pendingCallbacks = [ callback ]), + (internalInstance._pendingStateQueue || (internalInstance._pendingStateQueue = [])).push(partialState), + callback = void 0 === callback ? null : callback, null !== callback && (internalInstance._pendingCallbacks ? internalInstance._pendingCallbacks.push(callback) : internalInstance._pendingCallbacks = [ callback ]), enqueueUpdate(internalInstance); } }, enqueueElementInternal: function(internalInstance, nextElement, nextContext) { - internalInstance._pendingElement = nextElement, internalInstance._context = nextContext, + internalInstance._pendingElement = nextElement, internalInstance._context = nextContext, enqueueUpdate(internalInstance); } }, ReactUpdateQueue_1 = ReactUpdateQueue, injected = !1, ReactComponentEnvironment = { @@ -1273,9 +1262,9 @@ var ReactUpdateQueue = { processChildrenUpdates: null, injection: { injectEnvironment: function(environment) { - invariant(!injected, "ReactCompositeComponent: injectEnvironment() can only be called once."), - ReactComponentEnvironment.replaceNodeWithMarkup = environment.replaceNodeWithMarkup, - ReactComponentEnvironment.processChildrenUpdates = environment.processChildrenUpdates, + invariant(!injected, "ReactCompositeComponent: injectEnvironment() can only be called once."), + ReactComponentEnvironment.replaceNodeWithMarkup = environment.replaceNodeWithMarkup, + ReactComponentEnvironment.processChildrenUpdates = environment.processChildrenUpdates, injected = !0; } } @@ -1317,28 +1306,28 @@ function isPureComponent(Component) { var nextMountID = 1, ReactCompositeComponent = { construct: function(element) { - this._currentElement = element, this._rootNodeID = 0, this._compositeType = null, - this._instance = null, this._hostParent = null, this._hostContainerInfo = null, - this._updateBatchNumber = null, this._pendingElement = null, this._pendingStateQueue = null, - this._pendingReplaceState = !1, this._pendingForceUpdate = !1, this._renderedNodeType = null, - this._renderedComponent = null, this._context = null, this._mountOrder = 0, this._topLevelWrapper = null, + this._currentElement = element, this._rootNodeID = 0, this._compositeType = null, + this._instance = null, this._hostParent = null, this._hostContainerInfo = null, + this._updateBatchNumber = null, this._pendingElement = null, this._pendingStateQueue = null, + this._pendingReplaceState = !1, this._pendingForceUpdate = !1, this._renderedNodeType = null, + this._renderedComponent = null, this._context = null, this._mountOrder = 0, this._topLevelWrapper = null, this._pendingCallbacks = null, this._calledComponentWillUnmount = !1; }, mountComponent: function(transaction, hostParent, hostContainerInfo, context) { - this._context = context, this._mountOrder = nextMountID++, this._hostParent = hostParent, + this._context = context, this._mountOrder = nextMountID++, this._hostParent = hostParent, this._hostContainerInfo = hostContainerInfo; var renderedElement, publicProps = this._currentElement.props, publicContext = this._processContext(context), Component = this._currentElement.type, updateQueue = transaction.getUpdateQueue(), doConstruct = shouldConstruct(Component), inst = this._constructComponent(doConstruct, publicProps, publicContext, updateQueue); - doConstruct || null != inst && null != inst.render ? isPureComponent(Component) ? this._compositeType = ReactCompositeComponentTypes$1.PureClass : this._compositeType = ReactCompositeComponentTypes$1.ImpureClass : (renderedElement = inst, - invariant(null === inst || !1 === inst || React.isValidElement(inst), "%s(...): A valid React element (or null) must be returned. You may have " + "returned undefined, an array or some other invalid object.", Component.displayName || Component.name || "Component"), - inst = new StatelessComponent(Component), this._compositeType = ReactCompositeComponentTypes$1.StatelessFunctional), - inst.props = publicProps, inst.context = publicContext, inst.refs = emptyObject, + doConstruct || null != inst && null != inst.render ? isPureComponent(Component) ? this._compositeType = ReactCompositeComponentTypes$1.PureClass : this._compositeType = ReactCompositeComponentTypes$1.ImpureClass : (renderedElement = inst, + invariant(null === inst || !1 === inst || React.isValidElement(inst), "%s(...): A valid React element (or null) must be returned. You may have " + "returned undefined, an array or some other invalid object.", Component.displayName || Component.name || "Component"), + inst = new StatelessComponent(Component), this._compositeType = ReactCompositeComponentTypes$1.StatelessFunctional), + inst.props = publicProps, inst.context = publicContext, inst.refs = emptyObject, inst.updater = updateQueue, this._instance = inst, ReactInstanceMap_1.set(inst, this); var initialState = inst.state; - void 0 === initialState && (inst.state = initialState = null), invariant("object" == typeof initialState && !Array.isArray(initialState), "%s.state: must be set to an object or null", this.getName() || "ReactCompositeComponent"), - this._pendingStateQueue = null, this._pendingReplaceState = !1, this._pendingForceUpdate = !1, + void 0 === initialState && (inst.state = initialState = null), invariant("object" == typeof initialState && !Array.isArray(initialState), "%s.state: must be set to an object or null", this.getName() || "ReactCompositeComponent"), + this._pendingStateQueue = null, this._pendingReplaceState = !1, this._pendingForceUpdate = !1, inst.componentWillMount && (inst.componentWillMount(), this._pendingStateQueue && (inst.state = this._processPendingState(inst.props, inst.context))); var markup; - markup = inst.unstable_handleError ? this.performInitialMountWithErrorHandling(renderedElement, hostParent, hostContainerInfo, transaction, context) : this.performInitialMount(renderedElement, hostParent, hostContainerInfo, transaction, context), + markup = inst.unstable_handleError ? this.performInitialMountWithErrorHandling(renderedElement, hostParent, hostContainerInfo, transaction, context) : this.performInitialMount(renderedElement, hostParent, hostContainerInfo, transaction, context), inst.componentDidMount && transaction.getReactMountReady().enqueue(inst.componentDidMount, inst); var callbacks = this._pendingCallbacks; if (callbacks) { @@ -1359,8 +1348,8 @@ var nextMountID = 1, ReactCompositeComponent = { try { markup = this.performInitialMount(renderedElement, hostParent, hostContainerInfo, transaction, context); } catch (e) { - transaction.rollback(checkpoint), this._instance.unstable_handleError(e), this._pendingStateQueue && (this._instance.state = this._processPendingState(this._instance.props, this._instance.context)), - checkpoint = transaction.checkpoint(), this._renderedComponent.unmountComponent(!0, !0), + transaction.rollback(checkpoint), this._instance.unstable_handleError(e), this._pendingStateQueue && (this._instance.state = this._processPendingState(this._instance.props, this._instance.context)), + checkpoint = transaction.checkpoint(), this._renderedComponent.unmountComponent(!0, !0), transaction.rollback(checkpoint), markup = this.performInitialMount(renderedElement, hostParent, hostContainerInfo, transaction, context); } return markup; @@ -1378,17 +1367,17 @@ var nextMountID = 1, ReactCompositeComponent = { unmountComponent: function(safely, skipLifecycle) { if (this._renderedComponent) { var inst = this._instance; - if (inst.componentWillUnmount && !inst._calledComponentWillUnmount) if (inst._calledComponentWillUnmount = !0, + if (inst.componentWillUnmount && !inst._calledComponentWillUnmount) if (inst._calledComponentWillUnmount = !0, safely) { if (!skipLifecycle) { var name = this.getName() + ".componentWillUnmount()"; ReactErrorUtils_1.invokeGuardedCallbackAndCatchFirstError(name, inst.componentWillUnmount, inst); } } else inst.componentWillUnmount(); - this._renderedComponent && (ReactReconciler_1.unmountComponent(this._renderedComponent, safely, skipLifecycle), - this._renderedNodeType = null, this._renderedComponent = null, this._instance = null), - this._pendingStateQueue = null, this._pendingReplaceState = !1, this._pendingForceUpdate = !1, - this._pendingCallbacks = null, this._pendingElement = null, this._context = null, + this._renderedComponent && (ReactReconciler_1.unmountComponent(this._renderedComponent, safely, skipLifecycle), + this._renderedNodeType = null, this._renderedComponent = null, this._instance = null), + this._pendingStateQueue = null, this._pendingReplaceState = !1, this._pendingForceUpdate = !1, + this._pendingCallbacks = null, this._pendingElement = null, this._context = null, this._rootNodeID = 0, this._topLevelWrapper = null, ReactInstanceMap_1.remove(inst); } }, @@ -1427,7 +1416,7 @@ var nextMountID = 1, ReactCompositeComponent = { var inst = this._instance; invariant(null != inst, "Attempted to update component `%s` that has already been unmounted " + "(or failed to mount).", this.getName() || "ReactCompositeComponent"); var nextContext, willReceive = !1; - this._context === nextUnmaskedContext ? nextContext = inst.context : (nextContext = this._processContext(nextUnmaskedContext), + this._context === nextUnmaskedContext ? nextContext = inst.context : (nextContext = this._processContext(nextUnmaskedContext), willReceive = !0); var prevProps = prevParentElement.props, nextProps = nextParentElement.props; if (prevParentElement !== nextParentElement && (willReceive = !0), willReceive && inst.componentWillReceiveProps) { @@ -1443,9 +1432,9 @@ var nextMountID = 1, ReactCompositeComponent = { var prevState = inst.state; shouldUpdate = willReceive || nextState !== prevState, inst.shouldComponentUpdate ? shouldUpdate = inst.shouldComponentUpdate(nextProps, nextState, nextContext) : this._compositeType === ReactCompositeComponentTypes$1.PureClass && (shouldUpdate = !shallowEqual(prevProps, nextProps) || !shallowEqual(inst.state, nextState)); } - if (this._updateBatchNumber = null, shouldUpdate ? (this._pendingForceUpdate = !1, - this._performComponentUpdate(nextParentElement, nextProps, nextState, nextContext, transaction, nextUnmaskedContext)) : (this._currentElement = nextParentElement, - this._context = nextUnmaskedContext, inst.props = nextProps, inst.state = nextState, + if (this._updateBatchNumber = null, shouldUpdate ? (this._pendingForceUpdate = !1, + this._performComponentUpdate(nextParentElement, nextProps, nextState, nextContext, transaction, nextUnmaskedContext)) : (this._currentElement = nextParentElement, + this._context = nextUnmaskedContext, inst.props = nextProps, inst.state = nextState, inst.context = nextContext), callbacks) for (var j = 0; j < callbacks.length; j++) transaction.getReactMountReady().enqueue(callbacks[j], this.getPublicInstance()); }, _processPendingState: function(props, context) { @@ -1460,9 +1449,9 @@ var nextMountID = 1, ReactCompositeComponent = { }, _performComponentUpdate: function(nextElement, nextProps, nextState, nextContext, transaction, unmaskedContext) { var prevProps, prevState, inst = this._instance, hasComponentDidUpdate = !!inst.componentDidUpdate; - hasComponentDidUpdate && (prevProps = inst.props, prevState = inst.state), inst.componentWillUpdate && inst.componentWillUpdate(nextProps, nextState, nextContext), - this._currentElement = nextElement, this._context = unmaskedContext, inst.props = nextProps, - inst.state = nextState, inst.context = nextContext, inst.unstable_handleError ? this._updateRenderedComponentWithErrorHandling(transaction, unmaskedContext) : this._updateRenderedComponent(transaction, unmaskedContext), + hasComponentDidUpdate && (prevProps = inst.props, prevState = inst.state), inst.componentWillUpdate && inst.componentWillUpdate(nextProps, nextState, nextContext), + this._currentElement = nextElement, this._context = unmaskedContext, inst.props = nextProps, + inst.state = nextState, inst.context = nextContext, inst.unstable_handleError ? this._updateRenderedComponentWithErrorHandling(transaction, unmaskedContext) : this._updateRenderedComponent(transaction, unmaskedContext), hasComponentDidUpdate && transaction.getReactMountReady().enqueue(inst.componentDidUpdate.bind(inst, prevProps, prevState), inst); }, _updateRenderedComponentWithErrorHandling: function(transaction, context) { @@ -1470,8 +1459,8 @@ var nextMountID = 1, ReactCompositeComponent = { try { this._updateRenderedComponent(transaction, context); } catch (e) { - transaction.rollback(checkpoint), this._instance.unstable_handleError(e), this._pendingStateQueue && (this._instance.state = this._processPendingState(this._instance.props, this._instance.context)), - checkpoint = transaction.checkpoint(), this._updateRenderedComponentWithNextElement(transaction, context, null, !0), + transaction.rollback(checkpoint), this._instance.unstable_handleError(e), this._pendingStateQueue && (this._instance.state = this._processPendingState(this._instance.props, this._instance.context)), + checkpoint = transaction.checkpoint(), this._updateRenderedComponentWithNextElement(transaction, context, null, !0), this._updateRenderedComponent(transaction, context); } }, @@ -1482,15 +1471,12 @@ var nextMountID = 1, ReactCompositeComponent = { _updateRenderedComponentWithNextElement: function(transaction, context, nextRenderedElement, safely) { var prevComponentInstance = this._renderedComponent, prevRenderedElement = prevComponentInstance._currentElement; if (shouldUpdateReactComponent_1(prevRenderedElement, nextRenderedElement)) ReactReconciler_1.receiveComponent(prevComponentInstance, nextRenderedElement, transaction, this._processChildContext(context)); else { - var oldHostNode = ReactReconciler_1.getHostNode(prevComponentInstance); - ReactFeatureFlags_1.prepareNewChildrenBeforeUnmountInStack || ReactReconciler_1.unmountComponent(prevComponentInstance, safely, !1); - var nodeType = ReactNodeTypes_1.getType(nextRenderedElement); + var oldHostNode = ReactReconciler_1.getHostNode(prevComponentInstance), nodeType = ReactNodeTypes_1.getType(nextRenderedElement); this._renderedNodeType = nodeType; var child = this._instantiateReactComponent(nextRenderedElement, nodeType !== ReactNodeTypes_1.EMPTY); this._renderedComponent = child; var nextMarkup = ReactReconciler_1.mountComponent(child, transaction, this._hostParent, this._hostContainerInfo, this._processChildContext(context), 0); - ReactFeatureFlags_1.prepareNewChildrenBeforeUnmountInStack && ReactReconciler_1.unmountComponent(prevComponentInstance, safely, !1), - this._replaceNodeWithMarkup(oldHostNode, nextMarkup, prevComponentInstance); + ReactReconciler_1.unmountComponent(prevComponentInstance, safely, !1), this._replaceNodeWithMarkup(oldHostNode, nextMarkup, prevComponentInstance); } }, _replaceNodeWithMarkup: function(oldHostNode, nextMarkup, prevInstance) { @@ -1510,7 +1496,7 @@ var nextMountID = 1, ReactCompositeComponent = { ReactCurrentOwner$1.current = null; } } - return invariant(null === renderedElement || !1 === renderedElement || React.isValidElement(renderedElement), "%s.render(): A valid React element (or null) must be returned. You may have " + "returned undefined, an array or some other invalid object.", this.getName() || "ReactCompositeComponent"), + return invariant(null === renderedElement || !1 === renderedElement || React.isValidElement(renderedElement), "%s.render(): A valid React element (or null) must be returned. You may have " + "returned undefined, an array or some other invalid object.", this.getName() || "ReactCompositeComponent"), renderedElement; }, attachRef: function(ref, component) { @@ -1553,7 +1539,7 @@ var ReactEmptyComponent_1 = ReactEmptyComponent, genericComponentClass = null, t }; function createInternalComponent(element) { - return invariant(genericComponentClass, "There is no registered component for the tag %s", element.type), + return invariant(genericComponentClass, "There is no registered component for the tag %s", element.type), new genericComponentClass(element); } @@ -1594,7 +1580,7 @@ function instantiateReactComponent(node, shouldHaveDebugID) { var info = ""; info += getDeclarationErrorAddendum(element._owner), invariant(!1, "Element type is invalid: expected a string (for built-in components) " + "or a class/function (for composite components) but got: %s.%s", null == type ? type : typeof type, info); } - "string" == typeof element.type ? instance = ReactHostComponent_1.createInternalComponent(element) : isInternalComponentType(element.type) ? (instance = new element.type(element), + "string" == typeof element.type ? instance = ReactHostComponent_1.createInternalComponent(element) : isInternalComponentType(element.type) ? (instance = new element.type(element), instance.getHostNode || (instance.getHostNode = instance.getNativeNode)) : instance = new ReactCompositeComponentWrapper(element); } else "string" == typeof node || "number" == typeof node ? instance = ReactHostComponent_1.createInstanceForText(node) : invariant(!1, "Encountered invalid React node of type %s", typeof node); return instance._mountIndex = 0, instance._mountImage = null, instance; @@ -1619,7 +1605,7 @@ function findNodeHandle(componentOrHandle) { if (null == componentOrHandle) return null; if ("number" == typeof componentOrHandle) return componentOrHandle; var component = componentOrHandle, internalInstance = ReactInstanceMap_1.get(component); - return internalInstance ? injectedFindNode(internalInstance) : component || (invariant("object" == typeof component && ("_rootNodeID" in component || "_nativeTag" in component) || null != component.render && "function" == typeof component.render, "findNodeHandle(...): Argument is not a component " + "(type: %s, keys: %s)", typeof component, Object.keys(component)), + return internalInstance ? injectedFindNode(internalInstance) : component || (invariant("object" == typeof component && ("_rootNodeID" in component || "_nativeTag" in component) || null != component.render && "function" == typeof component.render, "findNodeHandle(...): Argument is not a component " + "(type: %s, keys: %s)", typeof component, Object.keys(component)), void invariant(!1, "findNodeHandle(...): Unable to find node handle for unmounted " + "component.")); } @@ -1636,7 +1622,7 @@ function mountComponentIntoNode(componentInstance, containerTag, transaction) { function batchedMountComponentIntoNode(componentInstance, containerTag) { var transaction = ReactUpdates_1.ReactReconcileTransaction.getPooled(); - transaction.perform(mountComponentIntoNode, null, componentInstance, containerTag, transaction), + transaction.perform(mountComponentIntoNode, null, componentInstance, containerTag, transaction), ReactUpdates_1.ReactReconcileTransaction.release(transaction); } @@ -1649,12 +1635,12 @@ var ReactNativeMount = { }), topRootNodeID = containerTag, prevComponent = ReactNativeMount._instancesByContainerID[topRootNodeID]; if (prevComponent) { var prevWrappedElement = prevComponent._currentElement, prevElement = prevWrappedElement.props.child; - if (shouldUpdateReactComponent_1(prevElement, nextElement)) return ReactUpdateQueue_1.enqueueElementInternal(prevComponent, nextWrappedElement, emptyObject), - callback && ReactUpdateQueue_1.enqueueCallbackInternal(prevComponent, callback), + if (shouldUpdateReactComponent_1(prevElement, nextElement)) return ReactUpdateQueue_1.enqueueElementInternal(prevComponent, nextWrappedElement, emptyObject), + callback && ReactUpdateQueue_1.enqueueCallbackInternal(prevComponent, callback), prevComponent; ReactNativeMount.unmountComponentAtNode(containerTag); } - if (!ReactNativeTagHandles_1.reactTagIsNativeTopRootID(containerTag)) return console.error("You cannot render into anything but a top root"), + if (!ReactNativeTagHandles_1.reactTagIsNativeTopRootID(containerTag)) return console.error("You cannot render into anything but a top root"), null; ReactNativeTagHandles_1.assertRootTag(containerTag); var instance = instantiateReactComponent_1(nextWrappedElement, !1); @@ -1664,7 +1650,7 @@ var ReactNativeMount = { nonNullCallback.call(instance._renderedComponent.getPublicInstance()); } ]; } - return ReactUpdates_1.batchedUpdates(batchedMountComponentIntoNode, instance, containerTag), + return ReactUpdates_1.batchedUpdates(batchedMountComponentIntoNode, instance, containerTag), instance._renderedComponent.getPublicInstance(); }, _mountImageIntoNode: function(mountImage, containerID) { @@ -1675,10 +1661,10 @@ var ReactNativeMount = { ReactNativeMount.unmountComponentAtNode(containerTag), UIManager.removeRootView(containerTag); }, unmountComponentAtNode: function(containerTag) { - if (!ReactNativeTagHandles_1.reactTagIsNativeTopRootID(containerTag)) return console.error("You cannot render into anything but a top root"), + if (!ReactNativeTagHandles_1.reactTagIsNativeTopRootID(containerTag)) return console.error("You cannot render into anything but a top root"), !1; var instance = ReactNativeMount._instancesByContainerID[containerTag]; - return !!instance && (ReactNativeMount.unmountComponentFromNode(instance, containerTag), + return !!instance && (ReactNativeMount.unmountComponentFromNode(instance, containerTag), delete ReactNativeMount._instancesByContainerID[containerTag], !0); }, unmountComponentFromNode: function(instance, containerID) { @@ -1714,7 +1700,7 @@ var transaction = new ReactDefaultBatchingStrategyTransaction(), ReactDefaultBat if (childrenUpdates.length) { for (var moveFromIndices, moveToIndices, addChildTags, addAtIndices, removeAtIndices, containerTag = ReactNativeComponentTree_1.getNodeFromInstance(inst), i = 0; i < childrenUpdates.length; i++) { var update = childrenUpdates[i]; - if ("MOVE_EXISTING" === update.type) (moveFromIndices || (moveFromIndices = [])).push(update.fromIndex), + if ("MOVE_EXISTING" === update.type) (moveFromIndices || (moveFromIndices = [])).push(update.fromIndex), (moveToIndices || (moveToIndices = [])).push(update.toIndex); else if ("REMOVE_NODE" === update.type) (removeAtIndices || (removeAtIndices = [])).push(update.fromIndex); else if ("INSERT_MARKUP" === update.type) { var mountImage = update.content, tag = mountImage; (addAtIndices || (addAtIndices = [])).push(update.toIndex), (addChildTags || (addChildTags = [])).push(tag); @@ -1742,16 +1728,16 @@ function _classCallCheck(instance, Constructor) { var CallbackQueue = function() { function CallbackQueue(arg) { - _classCallCheck(this, CallbackQueue), this._callbacks = null, this._contexts = null, + _classCallCheck(this, CallbackQueue), this._callbacks = null, this._contexts = null, this._arg = arg; } return CallbackQueue.prototype.enqueue = function(callback, context) { - this._callbacks = this._callbacks || [], this._callbacks.push(callback), this._contexts = this._contexts || [], + this._callbacks = this._callbacks || [], this._callbacks.push(callback), this._contexts = this._contexts || [], this._contexts.push(context); }, CallbackQueue.prototype.notifyAll = function() { var callbacks = this._callbacks, contexts = this._contexts, arg = this._arg; if (callbacks && contexts) { - invariant(callbacks.length === contexts.length, "Mismatched list of contexts in callback queue"), + invariant(callbacks.length === contexts.length, "Mismatched list of contexts in callback queue"), this._callbacks = null, this._contexts = null; for (var i = 0; i < callbacks.length; i++) validateCallback_1(callbacks[i]), callbacks[i].call(contexts[i], arg); callbacks.length = 0, contexts.length = 0; @@ -1799,7 +1785,7 @@ var Mixin = { } }; -Object.assign(ReactNativeReconcileTransaction.prototype, Transaction, ReactNativeReconcileTransaction, Mixin), +Object.assign(ReactNativeReconcileTransaction.prototype, Transaction, ReactNativeReconcileTransaction, Mixin), PooledClass_1.addPoolingTo(ReactNativeReconcileTransaction); var ReactNativeReconcileTransaction_1 = ReactNativeReconcileTransaction, ReactNativeComponentEnvironment = { @@ -1808,13 +1794,13 @@ var ReactNativeReconcileTransaction_1 = ReactNativeReconcileTransaction, ReactNa clearNode: function() {}, ReactReconcileTransaction: ReactNativeReconcileTransaction_1 }, ReactNativeComponentEnvironment_1 = ReactNativeComponentEnvironment, ReactNativeTextComponent = function(text) { - this._currentElement = text, this._stringText = "" + text, this._hostParent = null, + this._currentElement = text, this._stringText = "" + text, this._hostParent = null, this._rootNodeID = 0; }; Object.assign(ReactNativeTextComponent.prototype, { mountComponent: function(transaction, hostParent, hostContainerInfo, context) { - invariant(context.isInAParentText, 'RawText "%s" must be wrapped in an explicit component.', this._stringText), + invariant(context.isInAParentText, 'RawText "%s" must be wrapped in an explicit component.', this._stringText), this._hostParent = hostParent; var tag = ReactNativeTagHandles_1.allocateTag(); this._rootNodeID = tag; @@ -1836,7 +1822,7 @@ Object.assign(ReactNativeTextComponent.prototype, { } }, unmountComponent: function() { - ReactNativeComponentTree_1.uncacheNode(this), this._currentElement = null, this._stringText = null, + ReactNativeComponentTree_1.uncacheNode(this), this._currentElement = null, this._stringText = null, this._rootNodeID = 0; } }); @@ -1854,7 +1840,7 @@ Object.assign(ReactSimpleEmptyComponent.prototype, { return ReactReconciler_1.getHostNode(this._renderedComponent); }, unmountComponent: function(safely, skipLifecycle) { - ReactReconciler_1.unmountComponent(this._renderedComponent, safely, skipLifecycle), + ReactReconciler_1.unmountComponent(this._renderedComponent, safely, skipLifecycle), this._renderedComponent = null; } }); @@ -1862,9 +1848,9 @@ Object.assign(ReactSimpleEmptyComponent.prototype, { var ReactSimpleEmptyComponent_1 = ReactSimpleEmptyComponent; function inject$1() { - ReactGenericBatching_1.injection.injectStackBatchedUpdates(ReactUpdates_1.batchedUpdates), - ReactUpdates_1.injection.injectReconcileTransaction(ReactNativeComponentEnvironment_1.ReactReconcileTransaction), - ReactUpdates_1.injection.injectBatchingStrategy(ReactDefaultBatchingStrategy_1), + ReactGenericBatching_1.injection.injectStackBatchedUpdates(ReactUpdates_1.batchedUpdates), + ReactUpdates_1.injection.injectReconcileTransaction(ReactNativeComponentEnvironment_1.ReactReconcileTransaction), + ReactUpdates_1.injection.injectBatchingStrategy(ReactDefaultBatchingStrategy_1), ReactComponentEnvironment_1.injection.injectEnvironment(ReactNativeComponentEnvironment_1); var EmptyComponent = function(instantiate) { var View = require("View"); @@ -1875,10 +1861,10 @@ function inject$1() { } }), instantiate); }; - ReactEmptyComponent_1.injection.injectEmptyComponentFactory(EmptyComponent), ReactHostComponent_1.injection.injectTextComponentClass(ReactNativeTextComponent_1), + ReactEmptyComponent_1.injection.injectEmptyComponentFactory(EmptyComponent), ReactHostComponent_1.injection.injectTextComponentClass(ReactNativeTextComponent_1), ReactHostComponent_1.injection.injectGenericComponentClass(function(tag) { var info = ""; - "string" == typeof tag && /^[a-z]/.test(tag) && (info += " Each component name should start with an uppercase letter."), + "string" == typeof tag && /^[a-z]/.test(tag) && (info += " Each component name should start with an uppercase letter."), invariant(!1, "Expected a component class, got %s.%s", tag, info); }); } @@ -1898,13 +1884,13 @@ var ReactNativeStackInspector = { return null == nodeHandle || "number" == typeof nodeHandle ? nodeHandle : nodeHandle.getHostNode(); }; -function _classCallCheck$1(instance, Constructor) { +function _classCallCheck$2(instance, Constructor) { if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); } var objects = {}, uniqueID = 1, emptyObject$3 = {}, ReactNativePropRegistry = function() { function ReactNativePropRegistry() { - _classCallCheck$1(this, ReactNativePropRegistry); + _classCallCheck$2(this, ReactNativePropRegistry); } return ReactNativePropRegistry.register = function(object) { var id = ++uniqueID; @@ -1912,7 +1898,7 @@ var objects = {}, uniqueID = 1, emptyObject$3 = {}, ReactNativePropRegistry = fu }, ReactNativePropRegistry.getByID = function(id) { if (!id) return emptyObject$3; var object = objects[id]; - return object || (console.warn("Invalid style with id `" + id + "`. Skipping ..."), + return object || (console.warn("Invalid style with id `" + id + "`. Skipping ..."), emptyObject$3); }, ReactNativePropRegistry; }(), ReactNativePropRegistry_1 = ReactNativePropRegistry, emptyObject$2 = {}, removedKeys = null, removedKeyCount = 0; @@ -1933,7 +1919,7 @@ function restoreDeletedValuesInNestedArray(updatePayload, node, validAttributes) if (void 0 !== nextProp) { var attributeConfig = validAttributes[propKey]; if (attributeConfig) { - if ("function" == typeof nextProp && (nextProp = !0), void 0 === nextProp && (nextProp = null), + if ("function" == typeof nextProp && (nextProp = !0), void 0 === nextProp && (nextProp = null), "object" != typeof attributeConfig) updatePayload[propKey] = nextProp; else if ("function" == typeof attributeConfig.diff || "function" == typeof attributeConfig.process) { var nextValue = "function" == typeof attributeConfig.process ? attributeConfig.process(nextProp) : nextProp; updatePayload[propKey] = nextValue; @@ -1973,10 +1959,10 @@ function clearNestedProperty(updatePayload, prevProp, validAttributes) { function diffProperties(updatePayload, prevProps, nextProps, validAttributes) { var attributeConfig, nextProp, prevProp; - for (var propKey in nextProps) if (attributeConfig = validAttributes[propKey]) if (prevProp = prevProps[propKey], - nextProp = nextProps[propKey], "function" == typeof nextProp && (nextProp = !0, - "function" == typeof prevProp && (prevProp = !0)), void 0 === nextProp && (nextProp = null, - void 0 === prevProp && (prevProp = null)), removedKeys && (removedKeys[propKey] = !1), + for (var propKey in nextProps) if (attributeConfig = validAttributes[propKey]) if (prevProp = prevProps[propKey], + nextProp = nextProps[propKey], "function" == typeof nextProp && (nextProp = !0, + "function" == typeof prevProp && (prevProp = !0)), void 0 === nextProp && (nextProp = null, + void 0 === prevProp && (prevProp = null)), removedKeys && (removedKeys[propKey] = !1), updatePayload && void 0 !== updatePayload[propKey]) { if ("object" != typeof attributeConfig) updatePayload[propKey] = nextProp; else if ("function" == typeof attributeConfig.diff || "function" == typeof attributeConfig.process) { var nextValue = "function" == typeof attributeConfig.process ? attributeConfig.process(nextProp) : nextProp; @@ -1984,13 +1970,13 @@ function diffProperties(updatePayload, prevProps, nextProps, validAttributes) { } } else if (prevProp !== nextProp) if ("object" != typeof attributeConfig) defaultDiffer(prevProp, nextProp) && ((updatePayload || (updatePayload = {}))[propKey] = nextProp); else if ("function" == typeof attributeConfig.diff || "function" == typeof attributeConfig.process) { var shouldUpdate = void 0 === prevProp || ("function" == typeof attributeConfig.diff ? attributeConfig.diff(prevProp, nextProp) : defaultDiffer(prevProp, nextProp)); - shouldUpdate && (nextValue = "function" == typeof attributeConfig.process ? attributeConfig.process(nextProp) : nextProp, + shouldUpdate && (nextValue = "function" == typeof attributeConfig.process ? attributeConfig.process(nextProp) : nextProp, (updatePayload || (updatePayload = {}))[propKey] = nextValue); - } else removedKeys = null, removedKeyCount = 0, updatePayload = diffNestedProperty(updatePayload, prevProp, nextProp, attributeConfig), - removedKeyCount > 0 && updatePayload && (restoreDeletedValuesInNestedArray(updatePayload, nextProp, attributeConfig), + } else removedKeys = null, removedKeyCount = 0, updatePayload = diffNestedProperty(updatePayload, prevProp, nextProp, attributeConfig), + removedKeyCount > 0 && updatePayload && (restoreDeletedValuesInNestedArray(updatePayload, nextProp, attributeConfig), removedKeys = null); - for (propKey in prevProps) void 0 === nextProps[propKey] && (attributeConfig = validAttributes[propKey]) && (updatePayload && void 0 !== updatePayload[propKey] || void 0 !== (prevProp = prevProps[propKey]) && ("object" != typeof attributeConfig || "function" == typeof attributeConfig.diff || "function" == typeof attributeConfig.process ? ((updatePayload || (updatePayload = {}))[propKey] = null, - removedKeys || (removedKeys = {}), removedKeys[propKey] || (removedKeys[propKey] = !0, + for (propKey in prevProps) void 0 === nextProps[propKey] && (attributeConfig = validAttributes[propKey]) && (updatePayload && void 0 !== updatePayload[propKey] || void 0 !== (prevProp = prevProps[propKey]) && ("object" != typeof attributeConfig || "function" == typeof attributeConfig.diff || "function" == typeof attributeConfig.process ? ((updatePayload || (updatePayload = {}))[propKey] = null, + removedKeys || (removedKeys = {}), removedKeys[propKey] || (removedKeys[propKey] = !0, removedKeyCount++)) : updatePayload = clearNestedProperty(updatePayload, prevProp, attributeConfig))); return updatePayload; } @@ -2023,43 +2009,65 @@ function mountSafeCallback$1(context, callback) { }; } -function throwOnStylesProp$1(component, props) { +function throwOnStylesProp(component, props) { if (void 0 !== props.styles) { var owner = component._owner || null, name = component.constructor.displayName, msg = "`styles` is not a supported property of `" + name + "`, did " + "you mean `style` (singular)?"; - throw owner && owner.constructor && owner.constructor.displayName && (msg += "\n\nCheck the `" + owner.constructor.displayName + "` parent " + " component."), + throw owner && owner.constructor && owner.constructor.displayName && (msg += "\n\nCheck the `" + owner.constructor.displayName + "` parent " + " component."), new Error(msg); } } -function warnForStyleProps$1(props, validAttributes) { +function warnForStyleProps(props, validAttributes) { for (var key in validAttributes.style) validAttributes[key] || void 0 === props[key] || console.error("You are setting the style `{ " + key + ": ... }` as a prop. You " + "should nest it in a style object. " + "E.g. `{ style: { " + key + ": ... } }`"); } var NativeMethodsMixinUtils = { mountSafeCallback: mountSafeCallback$1, - throwOnStylesProp: throwOnStylesProp$1, - warnForStyleProps: warnForStyleProps$1 -}, mountSafeCallback = NativeMethodsMixinUtils.mountSafeCallback, findNumericNodeHandle = ReactNativeFeatureFlags$1.useFiber ? DevOnlyStubShim : findNumericNodeHandleStack, NativeMethodsMixin = { - measure: function(callback) { - UIManager.measure(findNumericNodeHandle(this), mountSafeCallback(this, callback)); - }, - measureInWindow: function(callback) { - UIManager.measureInWindow(findNumericNodeHandle(this), mountSafeCallback(this, callback)); - }, - measureLayout: function(relativeToNativeNode, onSuccess, onFail) { - UIManager.measureLayout(findNumericNodeHandle(this), relativeToNativeNode, mountSafeCallback(this, onFail), mountSafeCallback(this, onSuccess)); - }, - setNativeProps: function(nativeProps) { - injectedSetNativeProps(this, nativeProps); - }, - focus: function() { - TextInputState.focusTextInput(findNumericNodeHandle(this)); - }, - blur: function() { - TextInputState.blurTextInput(findNumericNodeHandle(this)); - } + throwOnStylesProp: throwOnStylesProp, + warnForStyleProps: warnForStyleProps }; +function _classCallCheck$1(instance, Constructor) { + if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); +} + +function _possibleConstructorReturn(self, call) { + if (!self) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); + return !call || "object" != typeof call && "function" != typeof call ? self : call; +} + +function _inherits(subClass, superClass) { + if ("function" != typeof superClass && null !== superClass) throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); + subClass.prototype = Object.create(superClass && superClass.prototype, { + constructor: { + value: subClass, + enumerable: !1, + writable: !0, + configurable: !0 + } + }), superClass && (Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass); +} + +var mountSafeCallback = NativeMethodsMixinUtils.mountSafeCallback, findNumericNodeHandle = ReactNativeFeatureFlags$1.useFiber ? DevOnlyStubShim : findNumericNodeHandleStack, ReactNativeComponent = function(_React$Component) { + _inherits(ReactNativeComponent, _React$Component); + function ReactNativeComponent() { + return _classCallCheck$1(this, ReactNativeComponent), _possibleConstructorReturn(this, _React$Component.apply(this, arguments)); + } + return ReactNativeComponent.prototype.blur = function() { + TextInputState.blurTextInput(findNumericNodeHandle(this)); + }, ReactNativeComponent.prototype.focus = function() { + TextInputState.focusTextInput(findNumericNodeHandle(this)); + }, ReactNativeComponent.prototype.measure = function(callback) { + UIManager.measure(findNumericNodeHandle(this), mountSafeCallback(this, callback)); + }, ReactNativeComponent.prototype.measureInWindow = function(callback) { + UIManager.measureInWindow(findNumericNodeHandle(this), mountSafeCallback(this, callback)); + }, ReactNativeComponent.prototype.measureLayout = function(relativeToNativeNode, onSuccess, onFail) { + UIManager.measureLayout(findNumericNodeHandle(this), relativeToNativeNode, mountSafeCallback(this, onFail), mountSafeCallback(this, onSuccess)); + }, ReactNativeComponent.prototype.setNativeProps = function(nativeProps) { + injectedSetNativeProps(this, nativeProps); + }, ReactNativeComponent; +}(React.Component); + function setNativePropsFiber(componentOrHandle, nativeProps) { var maybeInstance = void 0; try { @@ -2088,15 +2096,64 @@ var injectedSetNativeProps = void 0; injectedSetNativeProps = ReactNativeFeatureFlags$1.useFiber ? setNativePropsFiber : setNativePropsStack; +var ReactNativeComponent_1 = ReactNativeComponent, mountSafeCallback$2 = NativeMethodsMixinUtils.mountSafeCallback, findNumericNodeHandle$1 = ReactNativeFeatureFlags$1.useFiber ? DevOnlyStubShim : findNumericNodeHandleStack, NativeMethodsMixin = { + measure: function(callback) { + UIManager.measure(findNumericNodeHandle$1(this), mountSafeCallback$2(this, callback)); + }, + measureInWindow: function(callback) { + UIManager.measureInWindow(findNumericNodeHandle$1(this), mountSafeCallback$2(this, callback)); + }, + measureLayout: function(relativeToNativeNode, onSuccess, onFail) { + UIManager.measureLayout(findNumericNodeHandle$1(this), relativeToNativeNode, mountSafeCallback$2(this, onFail), mountSafeCallback$2(this, onSuccess)); + }, + setNativeProps: function(nativeProps) { + injectedSetNativeProps$1(this, nativeProps); + }, + focus: function() { + TextInputState.focusTextInput(findNumericNodeHandle$1(this)); + }, + blur: function() { + TextInputState.blurTextInput(findNumericNodeHandle$1(this)); + } +}; + +function setNativePropsFiber$1(componentOrHandle, nativeProps) { + var maybeInstance = void 0; + try { + maybeInstance = findNodeHandle_1(componentOrHandle); + } catch (error) {} + if (null != maybeInstance) { + var viewConfig = maybeInstance.viewConfig, updatePayload = ReactNativeAttributePayload_1.create(nativeProps, viewConfig.validAttributes); + UIManager.updateView(maybeInstance._nativeTag, viewConfig.uiViewClassName, updatePayload); + } +} + +function setNativePropsStack$1(componentOrHandle, nativeProps) { + var maybeInstance = findNodeHandle_1(componentOrHandle); + if (null != maybeInstance) { + var viewConfig = void 0; + if (void 0 !== maybeInstance.viewConfig) viewConfig = maybeInstance.viewConfig; else if (void 0 !== maybeInstance._instance && void 0 !== maybeInstance._instance.viewConfig) viewConfig = maybeInstance._instance.viewConfig; else { + for (;void 0 !== maybeInstance._renderedComponent; ) maybeInstance = maybeInstance._renderedComponent; + viewConfig = maybeInstance.viewConfig; + } + var tag = "function" == typeof maybeInstance.getHostNode ? maybeInstance.getHostNode() : maybeInstance._rootNodeID, updatePayload = ReactNativeAttributePayload_1.create(nativeProps, viewConfig.validAttributes); + UIManager.updateView(tag, viewConfig.uiViewClassName, updatePayload); + } +} + +var injectedSetNativeProps$1 = void 0; + +injectedSetNativeProps$1 = ReactNativeFeatureFlags$1.useFiber ? setNativePropsFiber$1 : setNativePropsStack$1; + var NativeMethodsMixin_1 = NativeMethodsMixin, TouchHistoryMath = { centroidDimension: function(touchHistory, touchesChangedAfter, isXAxis, ofCurrent) { var touchBank = touchHistory.touchBank, total = 0, count = 0, oneTouchData = 1 === touchHistory.numberActiveTouches ? touchHistory.touchBank[touchHistory.indexOfSingleActiveTouch] : null; - if (null !== oneTouchData) oneTouchData.touchActive && oneTouchData.currentTimeStamp > touchesChangedAfter && (total += ofCurrent && isXAxis ? oneTouchData.currentPageX : ofCurrent && !isXAxis ? oneTouchData.currentPageY : !ofCurrent && isXAxis ? oneTouchData.previousPageX : oneTouchData.previousPageY, + if (null !== oneTouchData) oneTouchData.touchActive && oneTouchData.currentTimeStamp > touchesChangedAfter && (total += ofCurrent && isXAxis ? oneTouchData.currentPageX : ofCurrent && !isXAxis ? oneTouchData.currentPageY : !ofCurrent && isXAxis ? oneTouchData.previousPageX : oneTouchData.previousPageY, count = 1); else for (var i = 0; i < touchBank.length; i++) { var touchTrack = touchBank[i]; if (null !== touchTrack && void 0 !== touchTrack && touchTrack.touchActive && touchTrack.currentTimeStamp >= touchesChangedAfter) { var toAdd; - toAdd = ofCurrent && isXAxis ? touchTrack.currentPageX : ofCurrent && !isXAxis ? touchTrack.currentPageY : !ofCurrent && isXAxis ? touchTrack.previousPageX : touchTrack.previousPageY, + toAdd = ofCurrent && isXAxis ? touchTrack.currentPageX : ofCurrent && !isXAxis ? touchTrack.currentPageY : !ofCurrent && isXAxis ? touchTrack.previousPageX : touchTrack.previousPageY, total += toAdd, count++; } } @@ -2161,13 +2218,13 @@ function getComponentKey(component, index) { function traverseStackChildrenImpl(children, nameSoFar, callback, traverseContext) { var type = typeof children; - if ("undefined" !== type && "boolean" !== type || (children = null), null === children || "string" === type || "number" === type || "object" === type && children.$$typeof === ReactElementSymbol) return callback(traverseContext, children, "" === nameSoFar ? SEPARATOR + getComponentKey(children, 0) : nameSoFar), + if ("undefined" !== type && "boolean" !== type || (children = null), null === children || "string" === type || "number" === type || "object" === type && children.$$typeof === ReactElementSymbol) return callback(traverseContext, children, "" === nameSoFar ? SEPARATOR + getComponentKey(children, 0) : nameSoFar), 1; var child, nextName, subtreeCount = 0, nextNamePrefix = "" === nameSoFar ? SEPARATOR : nameSoFar + SUBSEPARATOR; - if (Array.isArray(children)) for (var i = 0; i < children.length; i++) child = children[i], + if (Array.isArray(children)) for (var i = 0; i < children.length; i++) child = children[i], nextName = nextNamePrefix + getComponentKey(child, i), subtreeCount += traverseStackChildrenImpl(child, nextName, callback, traverseContext); else { var iteratorFn = getIteratorFn_1(children); - if (iteratorFn) for (var step, iterator = iteratorFn.call(children), ii = 0; !(step = iterator.next()).done; ) child = step.value, + if (iteratorFn) for (var step, iterator = iteratorFn.call(children), ii = 0; !(step = iterator.next()).done; ) child = step.value, nextName = nextNamePrefix + getComponentKey(child, ii++), subtreeCount += traverseStackChildrenImpl(child, nextName, callback, traverseContext); else if ("object" === type) { var addendum = "", childrenString = "" + children; invariant(!1, "Objects are not valid as a React child (found: %s).%s", "[object Object]" === childrenString ? "object with keys {" + Object.keys(children).join(", ") + "}" : childrenString, addendum); @@ -2193,7 +2250,7 @@ var ReactChildReconciler = { instantiateChildren: function(nestedChildNodes, transaction, context, selfDebugID) { if (null == nestedChildNodes) return null; var childInstances = {}; - return traverseStackChildren_1(nestedChildNodes, instantiateChild, childInstances), + return traverseStackChildren_1(nestedChildNodes, instantiateChild, childInstances), childInstances; }, updateChildren: function(prevChildren, nextChildren, mountImages, removedNodes, transaction, hostParent, hostContainerInfo, context, selfDebugID) { @@ -2202,18 +2259,16 @@ var ReactChildReconciler = { for (name in nextChildren) if (nextChildren.hasOwnProperty(name)) { prevChild = prevChildren && prevChildren[name]; var prevElement = prevChild && prevChild._currentElement, nextElement = nextChildren[name]; - if (null != prevChild && shouldUpdateReactComponent_1(prevElement, nextElement)) ReactReconciler_1.receiveComponent(prevChild, nextElement, transaction, context), + if (null != prevChild && shouldUpdateReactComponent_1(prevElement, nextElement)) ReactReconciler_1.receiveComponent(prevChild, nextElement, transaction, context), nextChildren[name] = prevChild; else { - !ReactFeatureFlags_1.prepareNewChildrenBeforeUnmountInStack && prevChild && (removedNodes[name] = ReactReconciler_1.getHostNode(prevChild), - ReactReconciler_1.unmountComponent(prevChild, !1, !1)); var nextChildInstance = instantiateReactComponent_1(nextElement, !0); nextChildren[name] = nextChildInstance; var nextChildMountImage = ReactReconciler_1.mountComponent(nextChildInstance, transaction, hostParent, hostContainerInfo, context, selfDebugID); - mountImages.push(nextChildMountImage), ReactFeatureFlags_1.prepareNewChildrenBeforeUnmountInStack && prevChild && (removedNodes[name] = ReactReconciler_1.getHostNode(prevChild), + mountImages.push(nextChildMountImage), prevChild && (removedNodes[name] = ReactReconciler_1.getHostNode(prevChild), ReactReconciler_1.unmountComponent(prevChild, !1, !1)); } } - for (name in prevChildren) !prevChildren.hasOwnProperty(name) || nextChildren && nextChildren.hasOwnProperty(name) || (prevChild = prevChildren[name], + for (name in prevChildren) !prevChildren.hasOwnProperty(name) || nextChildren && nextChildren.hasOwnProperty(name) || (prevChild = prevChildren[name], removedNodes[name] = ReactReconciler_1.getHostNode(prevChild), ReactReconciler_1.unmountComponent(prevChild, !1, !1)); } }, @@ -2237,7 +2292,7 @@ function flattenSingleChildIntoContext(traverseContext, child, name, selfDebugID function flattenStackChildren(children, selfDebugID) { if (null == children) return children; var result = {}; - return traverseStackChildren_1(children, flattenSingleChildIntoContext, result), + return traverseStackChildren_1(children, flattenSingleChildIntoContext, result), result; } @@ -2312,8 +2367,8 @@ var ReactMultiChild = { }, _reconcilerUpdateChildren: function(prevChildren, nextNestedChildrenElements, mountImages, removedNodes, transaction, context) { var nextChildren, selfDebugID = 0; - return nextChildren = flattenStackChildren_1(nextNestedChildrenElements, selfDebugID), - ReactChildReconciler_1.updateChildren(prevChildren, nextChildren, mountImages, removedNodes, transaction, this, this._hostContainerInfo, context, selfDebugID), + return nextChildren = flattenStackChildren_1(nextNestedChildrenElements, selfDebugID), + ReactChildReconciler_1.updateChildren(prevChildren, nextChildren, mountImages, removedNodes, transaction, this, this._hostContainerInfo, context, selfDebugID), nextChildren; }, mountChildren: function(nestedChildren, transaction, context) { @@ -2347,9 +2402,9 @@ var ReactMultiChild = { var name, updates = null, nextIndex = 0, lastIndex = 0, nextMountIndex = 0, lastPlacedNode = null; for (name in nextChildren) if (nextChildren.hasOwnProperty(name)) { var prevChild = prevChildren && prevChildren[name], nextChild = nextChildren[name]; - prevChild === nextChild ? (updates = enqueue(updates, this.moveChild(prevChild, lastPlacedNode, nextIndex, lastIndex)), - lastIndex = Math.max(prevChild._mountIndex, lastIndex), prevChild._mountIndex = nextIndex) : (prevChild && (lastIndex = Math.max(prevChild._mountIndex, lastIndex)), - updates = enqueue(updates, this._mountChildAtIndex(nextChild, mountImages[nextMountIndex], lastPlacedNode, nextIndex, transaction, context)), + prevChild === nextChild ? (updates = enqueue(updates, this.moveChild(prevChild, lastPlacedNode, nextIndex, lastIndex)), + lastIndex = Math.max(prevChild._mountIndex, lastIndex), prevChild._mountIndex = nextIndex) : (prevChild && (lastIndex = Math.max(prevChild._mountIndex, lastIndex)), + updates = enqueue(updates, this._mountChildAtIndex(nextChild, mountImages[nextMountIndex], lastPlacedNode, nextIndex, transaction, context)), nextMountIndex++), nextIndex++, lastPlacedNode = ReactReconciler_1.getHostNode(nextChild); } for (name in removedNodes) removedNodes.hasOwnProperty(name) && (updates = enqueue(updates, this._unmountChild(prevChildren[name], removedNodes[name]))); @@ -2358,7 +2413,7 @@ var ReactMultiChild = { }, unmountChildren: function(safely, skipLifecycle) { var renderedChildren = this._renderedChildren; - ReactChildReconciler_1.unmountChildren(renderedChildren, safely, skipLifecycle), + ReactChildReconciler_1.unmountChildren(renderedChildren, safely, skipLifecycle), this._renderedChildren = null; }, moveChild: function(child, afterNode, toIndex, lastIndex) { @@ -2386,7 +2441,7 @@ ReactNativeBaseComponent.Mixin = { return this; }, unmountComponent: function(safely, skipLifecycle) { - ReactNativeComponentTree_1.uncacheNode(this), this.unmountChildren(safely, skipLifecycle), + ReactNativeComponentTree_1.uncacheNode(this), this.unmountChildren(safely, skipLifecycle), this._rootNodeID = 0; }, initializeChildren: function(children, containerTag, transaction, context) { @@ -2403,7 +2458,7 @@ ReactNativeBaseComponent.Mixin = { var prevElement = this._currentElement; this._currentElement = nextElement; var updatePayload = ReactNativeAttributePayload_1.diff(prevElement.props, nextElement.props, this.viewConfig.validAttributes); - updatePayload && UIManager.updateView(this._rootNodeID, this.viewConfig.uiViewClassName, updatePayload), + updatePayload && UIManager.updateView(this._rootNodeID, this.viewConfig.uiViewClassName, updatePayload), this.updateChildren(nextElement.props.children, transaction, context); }, getName: function() { @@ -2416,24 +2471,24 @@ ReactNativeBaseComponent.Mixin = { var tag = ReactNativeTagHandles_1.allocateTag(); this._rootNodeID = tag, this._hostParent = hostParent, this._hostContainerInfo = hostContainerInfo; var updatePayload = ReactNativeAttributePayload_1.create(this._currentElement.props, this.viewConfig.validAttributes), nativeTopRootTag = hostContainerInfo._tag; - return UIManager.createView(tag, this.viewConfig.uiViewClassName, nativeTopRootTag, updatePayload), - ReactNativeComponentTree_1.precacheNode(this, tag), this.initializeChildren(this._currentElement.props.children, tag, transaction, context), + return UIManager.createView(tag, this.viewConfig.uiViewClassName, nativeTopRootTag, updatePayload), + ReactNativeComponentTree_1.precacheNode(this, tag), this.initializeChildren(this._currentElement.props.children, tag, transaction, context), tag; } }, Object.assign(ReactNativeBaseComponent.prototype, ReactMultiChild_1, ReactNativeBaseComponent.Mixin, NativeMethodsMixin_1); var ReactNativeBaseComponent_1 = ReactNativeBaseComponent, createReactNativeComponentClassStack = function(viewConfig) { var Constructor = function(element) { - this._currentElement = element, this._topLevelWrapper = null, this._hostParent = null, + this._currentElement = element, this._topLevelWrapper = null, this._hostParent = null, this._hostContainerInfo = null, this._rootNodeID = 0, this._renderedChildren = null; }; - return Constructor.displayName = viewConfig.uiViewClassName, Constructor.viewConfig = viewConfig, - Constructor.propTypes = viewConfig.propTypes, Constructor.prototype = new ReactNativeBaseComponent_1(viewConfig), + return Constructor.displayName = viewConfig.uiViewClassName, Constructor.viewConfig = viewConfig, + Constructor.propTypes = viewConfig.propTypes, Constructor.prototype = new ReactNativeBaseComponent_1(viewConfig), Constructor.prototype.constructor = Constructor, Constructor; -}, createReactNativeComponentClassStack_1 = createReactNativeComponentClassStack, createReactNativeComponentClass = ReactNativeFeatureFlags$1.useFiber ? DevOnlyStubShim : createReactNativeComponentClassStack_1, findNumericNodeHandle$1 = ReactNativeFeatureFlags$1.useFiber ? DevOnlyStubShim : findNumericNodeHandleStack; +}, createReactNativeComponentClassStack_1 = createReactNativeComponentClassStack, createReactNativeComponentClass = ReactNativeFeatureFlags$1.useFiber ? DevOnlyStubShim : createReactNativeComponentClassStack_1, findNumericNodeHandle$2 = ReactNativeFeatureFlags$1.useFiber ? DevOnlyStubShim : findNumericNodeHandleStack; function takeSnapshot(view, options) { - return "number" != typeof view && "window" !== view && (view = findNumericNodeHandle$1(view) || "window"), + return "number" != typeof view && "window" !== view && (view = findNumericNodeHandle$2(view) || "window"), UIManager.__takeSnapshot(view, options); } @@ -2444,6 +2499,7 @@ ReactNativeInjection.inject(), ReactNativeStackInjection.inject(); var render = function(element, mountInto, callback) { return ReactNativeMount_1.renderComponent(element, mountInto, callback); }, ReactNative = { + NativeComponent: ReactNativeComponent_1, hasReactNativeInitialized: !1, findNodeHandle: findNumericNodeHandleStack, render: render, diff --git a/Libraries/Renderer/shims/PooledClass.js b/Libraries/Renderer/shims/PooledClass.js index a89b9e1a7..7b5d93ab7 100644 --- a/Libraries/Renderer/shims/PooledClass.js +++ b/Libraries/Renderer/shims/PooledClass.js @@ -95,8 +95,10 @@ var addPoolingTo = function( CopyConstructor: Class, pooler: Pooler, ): Class & { - getPooled(): /* arguments of the constructor */ T, - release(): void, + getPooled( + ...args: $ReadOnlyArray + ): /* arguments of the constructor */ T, + release(instance: mixed): void, } { // Casting as any so that flow ignores the actual implementation and trusts // it to match the type we declared diff --git a/Libraries/Renderer/shims/ReactNativeTypes.js b/Libraries/Renderer/shims/ReactNativeTypes.js index 594b8ac5a..3dbc7deee 100644 --- a/Libraries/Renderer/shims/ReactNativeTypes.js +++ b/Libraries/Renderer/shims/ReactNativeTypes.js @@ -71,10 +71,11 @@ type SecretInternalsType = { }; /** - * Flat ReactNative renderer bundles are too big for Flow to parse effeciently. - * Provide minimal Flow typing for the high-level RN API and call it a day. - */ + * Flat ReactNative renderer bundles are too big for Flow to parse efficiently. + * Provide minimal Flow typing for the high-level RN API and call it a day. + */ export type ReactNativeType = { + NativeComponent: any, findNodeHandle(componentOrHandle: any): ?number, render( element: React.Element,