rn-web-cli
Version:
React Native for Web
1 lines • 24.5 kB
Source Map (JSON)
{"version":3,"sources":["node_modules\\react-dom\\lib\\ReactMultiChild.js"],"names":["_prodInvariant","require","ReactComponentEnvironment","ReactInstanceMap","ReactInstrumentation","ReactCurrentOwner","ReactReconciler","ReactChildReconciler","emptyFunction","flattenChildren","invariant","makeInsertMarkup","markup","afterNode","toIndex","type","content","fromIndex","fromNode","makeMove","child","_mountIndex","getHostNode","makeRemove","node","makeSetMarkup","makeTextContent","textContent","enqueue","queue","update","push","processQueue","inst","updateQueue","processChildrenUpdates","setChildrenForInstrumentation","process","env","NODE_ENV","getDebugID","_debugID","internal","get","children","debugID","debugTool","onSetChildren","Object","keys","map","key","ReactMultiChild","Mixin","_reconcilerInstantiateChildren","nestedChildren","transaction","context","selfDebugID","_currentElement","current","_owner","instantiateChildren","_reconcilerUpdateChildren","prevChildren","nextNestedChildrenElements","mountImages","removedNodes","nextChildren","updateChildren","_hostContainerInfo","mountChildren","_renderedChildren","index","name","hasOwnProperty","mountImage","mountComponent","call","updateTextContent","nextContent","unmountChildren","updates","updateMarkup","nextMarkup","_updateChildren","nextIndex","lastIndex","nextMountIndex","lastPlacedNode","prevChild","nextChild","moveChild","Math","max","_mountChildAtIndex","_unmountChild","safely","renderedChildren","createChild","removeChild","module","exports"],"mappings":";;;;;;;;;;AAUA;;AAEA,GAAIA,gBAAiBC,QAAQ,sBAAR,CAArB;;AAEA,GAAIC,2BAA4BD,QAAQ,6BAAR,CAAhC;AACA,GAAIE,kBAAmBF,QAAQ,oBAAR,CAAvB;AACA,GAAIG,sBAAuBH,QAAQ,wBAAR,CAA3B;;AAEA,GAAII,mBAAoBJ,QAAQ,6BAAR,CAAxB;AACA,GAAIK,iBAAkBL,QAAQ,mBAAR,CAAtB;AACA,GAAIM,sBAAuBN,QAAQ,wBAAR,CAA3B;;AAEA,GAAIO,eAAgBP,QAAQ,wBAAR,CAApB;AACA,GAAIQ,iBAAkBR,QAAQ,mBAAR,CAAtB;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,uBAAU5E,KAAV,CAAiBI,IAAjB,CAAuB;AACpC,GAAIM,QAAS,KAAKsE,WAAL,CAAiBhF,KAAjB,CAAwBI,IAAxB,CAAb;AACAJ,MAAMC,WAAN,CAAoB,IAApB;AACA,MAAOS,OAAP;AACD,CAvQI,CARa,CAAtB;;;;AAmRAuE,OAAOC,OAAP,CAAiBlD,eAAjB","file":"ReactMultiChild.js","sourceRoot":"d:/Work/Office/react-native-on-web/cli/tmpl/project","sourcesContent":["/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n */\n\n'use strict';\n\nvar _prodInvariant = require('./reactProdInvariant');\n\nvar ReactComponentEnvironment = require('./ReactComponentEnvironment');\nvar ReactInstanceMap = require('./ReactInstanceMap');\nvar ReactInstrumentation = require('./ReactInstrumentation');\n\nvar ReactCurrentOwner = require('react/lib/ReactCurrentOwner');\nvar ReactReconciler = require('./ReactReconciler');\nvar ReactChildReconciler = require('./ReactChildReconciler');\n\nvar emptyFunction = require('fbjs/lib/emptyFunction');\nvar flattenChildren = require('./flattenChildren');\nvar invariant = require('fbjs/lib/invariant');\n\n/**\n * Make an update for markup to be rendered and inserted at a supplied index.\n *\n * @param {string} markup Markup that renders into an element.\n * @param {number} toIndex Destination index.\n * @private\n */\nfunction makeInsertMarkup(markup, afterNode, toIndex) {\n // NOTE: Null values reduce hidden classes.\n return {\n type: 'INSERT_MARKUP',\n content: markup,\n fromIndex: null,\n fromNode: null,\n toIndex: toIndex,\n afterNode: afterNode\n };\n}\n\n/**\n * Make an update for moving an existing element to another index.\n *\n * @param {number} fromIndex Source index of the existing element.\n * @param {number} toIndex Destination index of the element.\n * @private\n */\nfunction makeMove(child, afterNode, toIndex) {\n // NOTE: Null values reduce hidden classes.\n return {\n type: 'MOVE_EXISTING',\n content: null,\n fromIndex: child._mountIndex,\n fromNode: ReactReconciler.getHostNode(child),\n toIndex: toIndex,\n afterNode: afterNode\n };\n}\n\n/**\n * Make an update for removing an element at an index.\n *\n * @param {number} fromIndex Index of the element to remove.\n * @private\n */\nfunction makeRemove(child, node) {\n // NOTE: Null values reduce hidden classes.\n return {\n type: 'REMOVE_NODE',\n content: null,\n fromIndex: child._mountIndex,\n fromNode: node,\n toIndex: null,\n afterNode: null\n };\n}\n\n/**\n * Make an update for setting the markup of a node.\n *\n * @param {string} markup Markup that renders into an element.\n * @private\n */\nfunction makeSetMarkup(markup) {\n // NOTE: Null values reduce hidden classes.\n return {\n type: 'SET_MARKUP',\n content: markup,\n fromIndex: null,\n fromNode: null,\n toIndex: null,\n afterNode: null\n };\n}\n\n/**\n * Make an update for setting the text content.\n *\n * @param {string} textContent Text content to set.\n * @private\n */\nfunction makeTextContent(textContent) {\n // NOTE: Null values reduce hidden classes.\n return {\n type: 'TEXT_CONTENT',\n content: textContent,\n fromIndex: null,\n fromNode: null,\n toIndex: null,\n afterNode: null\n };\n}\n\n/**\n * Push an update, if any, onto the queue. Creates a new queue if none is\n * passed and always returns the queue. Mutative.\n */\nfunction enqueue(queue, update) {\n if (update) {\n queue = queue || [];\n queue.push(update);\n }\n return queue;\n}\n\n/**\n * Processes any enqueued updates.\n *\n * @private\n */\nfunction processQueue(inst, updateQueue) {\n ReactComponentEnvironment.processChildrenUpdates(inst, updateQueue);\n}\n\nvar setChildrenForInstrumentation = emptyFunction;\nif (process.env.NODE_ENV !== 'production') {\n var getDebugID = function (inst) {\n if (!inst._debugID) {\n // Check for ART-like instances. TODO: This is silly/gross.\n var internal;\n if (internal = ReactInstanceMap.get(inst)) {\n inst = internal;\n }\n }\n return inst._debugID;\n };\n setChildrenForInstrumentation = function (children) {\n var debugID = getDebugID(this);\n // TODO: React Native empty components are also multichild.\n // This means they still get into this method but don't have _debugID.\n if (debugID !== 0) {\n ReactInstrumentation.debugTool.onSetChildren(debugID, children ? Object.keys(children).map(function (key) {\n return children[key]._debugID;\n }) : []);\n }\n };\n}\n\n/**\n * ReactMultiChild are capable of reconciling multiple children.\n *\n * @class ReactMultiChild\n * @internal\n */\nvar ReactMultiChild = {\n /**\n * Provides common functionality for components that must reconcile multiple\n * children. This is used by `ReactDOMComponent` to mount, update, and\n * unmount child components.\n *\n * @lends {ReactMultiChild.prototype}\n */\n Mixin: {\n _reconcilerInstantiateChildren: function (nestedChildren, transaction, context) {\n if (process.env.NODE_ENV !== 'production') {\n var selfDebugID = getDebugID(this);\n if (this._currentElement) {\n try {\n ReactCurrentOwner.current = this._currentElement._owner;\n return ReactChildReconciler.instantiateChildren(nestedChildren, transaction, context, selfDebugID);\n } finally {\n ReactCurrentOwner.current = null;\n }\n }\n }\n return ReactChildReconciler.instantiateChildren(nestedChildren, transaction, context);\n },\n\n _reconcilerUpdateChildren: function (prevChildren, nextNestedChildrenElements, mountImages, removedNodes, transaction, context) {\n var nextChildren;\n var selfDebugID = 0;\n if (process.env.NODE_ENV !== 'production') {\n selfDebugID = getDebugID(this);\n if (this._currentElement) {\n try {\n ReactCurrentOwner.current = this._currentElement._owner;\n nextChildren = flattenChildren(nextNestedChildrenElements, selfDebugID);\n } finally {\n ReactCurrentOwner.current = null;\n }\n ReactChildReconciler.updateChildren(prevChildren, nextChildren, mountImages, removedNodes, transaction, this, this._hostContainerInfo, context, selfDebugID);\n return nextChildren;\n }\n }\n nextChildren = flattenChildren(nextNestedChildrenElements, selfDebugID);\n ReactChildReconciler.updateChildren(prevChildren, nextChildren, mountImages, removedNodes, transaction, this, this._hostContainerInfo, context, selfDebugID);\n return nextChildren;\n },\n\n /**\n * Generates a \"mount image\" for each of the supplied children. In the case\n * of `ReactDOMComponent`, a mount image is a string of markup.\n *\n * @param {?object} nestedChildren Nested child maps.\n * @return {array} An array of mounted representations.\n * @internal\n */\n mountChildren: function (nestedChildren, transaction, context) {\n var children = this._reconcilerInstantiateChildren(nestedChildren, transaction, context);\n this._renderedChildren = children;\n\n var mountImages = [];\n var index = 0;\n for (var name in children) {\n if (children.hasOwnProperty(name)) {\n var child = children[name];\n var selfDebugID = 0;\n if (process.env.NODE_ENV !== 'production') {\n selfDebugID = getDebugID(this);\n }\n var mountImage = ReactReconciler.mountComponent(child, transaction, this, this._hostContainerInfo, context, selfDebugID);\n child._mountIndex = index++;\n mountImages.push(mountImage);\n }\n }\n\n if (process.env.NODE_ENV !== 'production') {\n setChildrenForInstrumentation.call(this, children);\n }\n\n return mountImages;\n },\n\n /**\n * Replaces any rendered children with a text content string.\n *\n * @param {string} nextContent String of content.\n * @internal\n */\n updateTextContent: function (nextContent) {\n var prevChildren = this._renderedChildren;\n // Remove any rendered children.\n ReactChildReconciler.unmountChildren(prevChildren, false);\n for (var name in prevChildren) {\n if (prevChildren.hasOwnProperty(name)) {\n !false ? process.env.NODE_ENV !== 'production' ? invariant(false, 'updateTextContent called on non-empty component.') : _prodInvariant('118') : void 0;\n }\n }\n // Set new text content.\n var updates = [makeTextContent(nextContent)];\n processQueue(this, updates);\n },\n\n /**\n * Replaces any rendered children with a markup string.\n *\n * @param {string} nextMarkup String of markup.\n * @internal\n */\n updateMarkup: function (nextMarkup) {\n var prevChildren = this._renderedChildren;\n // Remove any rendered children.\n ReactChildReconciler.unmountChildren(prevChildren, false);\n for (var name in prevChildren) {\n if (prevChildren.hasOwnProperty(name)) {\n !false ? process.env.NODE_ENV !== 'production' ? invariant(false, 'updateTextContent called on non-empty component.') : _prodInvariant('118') : void 0;\n }\n }\n var updates = [makeSetMarkup(nextMarkup)];\n processQueue(this, updates);\n },\n\n /**\n * Updates the rendered children with new children.\n *\n * @param {?object} nextNestedChildrenElements Nested child element maps.\n * @param {ReactReconcileTransaction} transaction\n * @internal\n */\n updateChildren: function (nextNestedChildrenElements, transaction, context) {\n // Hook used by React ART\n this._updateChildren(nextNestedChildrenElements, transaction, context);\n },\n\n /**\n * @param {?object} nextNestedChildrenElements Nested child element maps.\n * @param {ReactReconcileTransaction} transaction\n * @final\n * @protected\n */\n _updateChildren: function (nextNestedChildrenElements, transaction, context) {\n var prevChildren = this._renderedChildren;\n var removedNodes = {};\n var mountImages = [];\n var nextChildren = this._reconcilerUpdateChildren(prevChildren, nextNestedChildrenElements, mountImages, removedNodes, transaction, context);\n if (!nextChildren && !prevChildren) {\n return;\n }\n var updates = null;\n var name;\n // `nextIndex` will increment for each child in `nextChildren`, but\n // `lastIndex` will be the last index visited in `prevChildren`.\n var nextIndex = 0;\n var lastIndex = 0;\n // `nextMountIndex` will increment for each newly mounted child.\n var nextMountIndex = 0;\n var lastPlacedNode = null;\n for (name in nextChildren) {\n if (!nextChildren.hasOwnProperty(name)) {\n continue;\n }\n var prevChild = prevChildren && prevChildren[name];\n var nextChild = nextChildren[name];\n if (prevChild === nextChild) {\n updates = enqueue(updates, this.moveChild(prevChild, lastPlacedNode, nextIndex, lastIndex));\n lastIndex = Math.max(prevChild._mountIndex, lastIndex);\n prevChild._mountIndex = nextIndex;\n } else {\n if (prevChild) {\n // Update `lastIndex` before `_mountIndex` gets unset by unmounting.\n lastIndex = Math.max(prevChild._mountIndex, lastIndex);\n // The `removedNodes` loop below will actually remove the child.\n }\n // The child must be instantiated before it's mounted.\n updates = enqueue(updates, this._mountChildAtIndex(nextChild, mountImages[nextMountIndex], lastPlacedNode, nextIndex, transaction, context));\n nextMountIndex++;\n }\n nextIndex++;\n lastPlacedNode = ReactReconciler.getHostNode(nextChild);\n }\n // Remove children that are no longer present.\n for (name in removedNodes) {\n if (removedNodes.hasOwnProperty(name)) {\n updates = enqueue(updates, this._unmountChild(prevChildren[name], removedNodes[name]));\n }\n }\n if (updates) {\n processQueue(this, updates);\n }\n this._renderedChildren = nextChildren;\n\n if (process.env.NODE_ENV !== 'production') {\n setChildrenForInstrumentation.call(this, nextChildren);\n }\n },\n\n /**\n * Unmounts all rendered children. This should be used to clean up children\n * when this component is unmounted. It does not actually perform any\n * backend operations.\n *\n * @internal\n */\n unmountChildren: function (safely) {\n var renderedChildren = this._renderedChildren;\n ReactChildReconciler.unmountChildren(renderedChildren, safely);\n this._renderedChildren = null;\n },\n\n /**\n * Moves a child component to the supplied index.\n *\n * @param {ReactComponent} child Component to move.\n * @param {number} toIndex Destination index of the element.\n * @param {number} lastIndex Last index visited of the siblings of `child`.\n * @protected\n */\n moveChild: function (child, afterNode, toIndex, lastIndex) {\n // If the index of `child` is less than `lastIndex`, then it needs to\n // be moved. Otherwise, we do not need to move it because a child will be\n // inserted or moved before `child`.\n if (child._mountIndex < lastIndex) {\n return makeMove(child, afterNode, toIndex);\n }\n },\n\n /**\n * Creates a child component.\n *\n * @param {ReactComponent} child Component to create.\n * @param {string} mountImage Markup to insert.\n * @protected\n */\n createChild: function (child, afterNode, mountImage) {\n return makeInsertMarkup(mountImage, afterNode, child._mountIndex);\n },\n\n /**\n * Removes a child component.\n *\n * @param {ReactComponent} child Child to remove.\n * @protected\n */\n removeChild: function (child, node) {\n return makeRemove(child, node);\n },\n\n /**\n * Mounts a child with the supplied name.\n *\n * NOTE: This is part of `updateChildren` and is here for readability.\n *\n * @param {ReactComponent} child Component to mount.\n * @param {string} name Name of the child.\n * @param {number} index Index at which to insert the child.\n * @param {ReactReconcileTransaction} transaction\n * @private\n */\n _mountChildAtIndex: function (child, mountImage, afterNode, index, transaction, context) {\n child._mountIndex = index;\n return this.createChild(child, afterNode, mountImage);\n },\n\n /**\n * Unmounts a rendered child.\n *\n * NOTE: This is part of `updateChildren` and is here for readability.\n *\n * @param {ReactComponent} child Component to unmount.\n * @private\n */\n _unmountChild: function (child, node) {\n var update = this.removeChild(child, node);\n child._mountIndex = null;\n return update;\n }\n }\n};\n\nmodule.exports = ReactMultiChild;"]}