UNPKG

rn-web-cli

Version:

React Native for Web

1 lines 20.1 kB
{"version":3,"sources":["node_modules\\react-dom\\lib\\ReactBrowserEventEmitter.js"],"names":["_assign","require","EventPluginRegistry","ReactEventEmitterMixin","ViewportMetrics","getVendorPrefixedEventName","isEventSupported","hasEventPageXY","alreadyListeningTo","isMonitoringScrollValue","reactTopListenersCounter","topEventMapping","topAbort","topAnimationEnd","topAnimationIteration","topAnimationStart","topBlur","topCanPlay","topCanPlayThrough","topChange","topClick","topCompositionEnd","topCompositionStart","topCompositionUpdate","topContextMenu","topCopy","topCut","topDoubleClick","topDrag","topDragEnd","topDragEnter","topDragExit","topDragLeave","topDragOver","topDragStart","topDrop","topDurationChange","topEmptied","topEncrypted","topEnded","topError","topFocus","topInput","topKeyDown","topKeyPress","topKeyUp","topLoadedData","topLoadedMetadata","topLoadStart","topMouseDown","topMouseMove","topMouseOut","topMouseOver","topMouseUp","topPaste","topPause","topPlay","topPlaying","topProgress","topRateChange","topScroll","topSeeked","topSeeking","topSelectionChange","topStalled","topSuspend","topTextInput","topTimeUpdate","topTouchCancel","topTouchEnd","topTouchMove","topTouchStart","topTransitionEnd","topVolumeChange","topWaiting","topWheel","topListenersIDKey","String","Math","random","slice","getListeningForDocument","mountAt","Object","prototype","hasOwnProperty","call","ReactBrowserEventEmitter","ReactEventListener","injection","injectReactEventListener","setHandleTopLevel","handleTopLevel","setEnabled","enabled","isEnabled","listenTo","registrationName","contentDocumentHandle","isListening","dependencies","registrationNameDependencies","i","length","dependency","trapBubbledEvent","trapCapturedEvent","WINDOW_HANDLE","topLevelType","handlerBaseName","handle","supportsEventPageXY","document","createEvent","ev","ensureScrollValueMonitoring","undefined","refresh","refreshScrollValues","monitorScrollValue","module","exports"],"mappings":";;;;;;;;;;AAUA;;AAEA,GAAIA,SAAUC,QAAQ,eAAR,CAAd;;AAEA,GAAIC,qBAAsBD,QAAQ,uBAAR,CAA1B;AACA,GAAIE,wBAAyBF,QAAQ,0BAAR,CAA7B;AACA,G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0B,IAA1B;AACD;AACF;AACF,CApGgE;;AAsGjEC,iBAAkB,0BAAUG,YAAV,CAAwBC,eAAxB,CAAyCC,MAAzC,CAAiD;AACjE,MAAOvB,0BAAyBC,kBAAzB,CAA4CiB,gBAA5C,CAA6DG,YAA7D,CAA2EC,eAA3E,CAA4FC,MAA5F,CAAP;AACD,CAxGgE;;AA0GjEJ,kBAAmB,2BAAUE,YAAV,CAAwBC,eAAxB,CAAyCC,MAAzC,CAAiD;AAClE,MAAOvB,0BAAyBC,kBAAzB,CAA4CkB,iBAA5C,CAA8DE,YAA9D,CAA4EC,eAA5E,CAA6FC,MAA7F,CAAP;AACD,CA5GgE;;;;;;;AAmHjEC,oBAAqB,8BAAY;AAC/B,GAAI,CAACC,SAASC,WAAd,CAA2B;AACzB,MAAO,MAAP;AACD;AACD,GAAIC,IAAKF,SAASC,WAAT,CAAqB,YAArB,CAAT;AACA,MAAOC,KAAM,IAAN,EAAc,SAAWA,GAAhC;AACD,CAzHgE;;;;;;;;;;;;;AAsIjEC,4BAA6B,sCAAY;AACvC,GAAI5G,iBAAmB6G,SAAvB,CAAkC;AAChC7G,eAAiBgF,yBAAyBwB,mBAAzB,EAAjB;AACD;AACD,GAAI,CAACxG,cAAD,EAAmB,CAACE,uBAAxB,CAAiD;AAC/C,GAAI4G,SAAUjH,gBAAgBkH,mBAA9B;AACA/B,yBAAyBC,kBAAzB,CAA4C+B,kBAA5C,CAA+DF,OAA/D;AACA5G,wBAA0B,IAA1B;AACD;AACF,CA/IgE,CAApC,CAA/B;;;AAkJA+G,OAAOC,OAAP,CAAiBlC,wBAAjB","file":"ReactBrowserEventEmitter.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 _assign = require('object-assign');\n\nvar EventPluginRegistry = require('./EventPluginRegistry');\nvar ReactEventEmitterMixin = require('./ReactEventEmitterMixin');\nvar ViewportMetrics = require('./ViewportMetrics');\n\nvar getVendorPrefixedEventName = require('./getVendorPrefixedEventName');\nvar isEventSupported = require('./isEventSupported');\n\n/**\n * Summary of `ReactBrowserEventEmitter` event handling:\n *\n * - Top-level delegation is used to trap most native browser events. This\n * may only occur in the main thread and is the responsibility of\n * ReactEventListener, which is injected and can therefore support pluggable\n * event sources. This is the only work that occurs in the main thread.\n *\n * - We normalize and de-duplicate events to account for browser quirks. This\n * may be done in the worker thread.\n *\n * - Forward these native events (with the associated top-level type used to\n * trap it) to `EventPluginHub`, which in turn will ask plugins if they want\n * to extract any synthetic events.\n *\n * - The `EventPluginHub` will then process each event by annotating them with\n * \"dispatches\", a sequence of listeners and IDs that care about that event.\n *\n * - The `EventPluginHub` then dispatches the events.\n *\n * Overview of React and the event system:\n *\n * +------------+ .\n * | DOM | .\n * +------------+ .\n * | .\n * v .\n * +------------+ .\n * | ReactEvent | .\n * | Listener | .\n * +------------+ . +-----------+\n * | . +--------+|SimpleEvent|\n * | . | |Plugin |\n * +-----|------+ . v +-----------+\n * | | | . +--------------+ +------------+\n * | +-----------.--->|EventPluginHub| | Event |\n * | | . | | +-----------+ | Propagators|\n * | ReactEvent | . | | |TapEvent | |------------|\n * | Emitter | . | |<---+|Plugin | |other plugin|\n * | | . | | +-----------+ | utilities |\n * | +-----------.--->| | +------------+\n * | | | . +--------------+\n * +-----|------+ . ^ +-----------+\n * | . | |Enter/Leave|\n * + . +-------+|Plugin |\n * +-------------+ . +-----------+\n * | application | .\n * |-------------| .\n * | | .\n * | | .\n * +-------------+ .\n * .\n * React Core . General Purpose Event Plugin System\n */\n\nvar hasEventPageXY;\nvar alreadyListeningTo = {};\nvar isMonitoringScrollValue = false;\nvar reactTopListenersCounter = 0;\n\n// For events like 'submit' which don't consistently bubble (which we trap at a\n// lower node than `document`), binding at `document` would cause duplicate\n// events so we don't include them here\nvar topEventMapping = {\n topAbort: 'abort',\n topAnimationEnd: getVendorPrefixedEventName('animationend') || 'animationend',\n topAnimationIteration: getVendorPrefixedEventName('animationiteration') || 'animationiteration',\n topAnimationStart: getVendorPrefixedEventName('animationstart') || 'animationstart',\n topBlur: 'blur',\n topCanPlay: 'canplay',\n topCanPlayThrough: 'canplaythrough',\n topChange: 'change',\n topClick: 'click',\n topCompositionEnd: 'compositionend',\n topCompositionStart: 'compositionstart',\n topCompositionUpdate: 'compositionupdate',\n topContextMenu: 'contextmenu',\n topCopy: 'copy',\n topCut: 'cut',\n topDoubleClick: 'dblclick',\n topDrag: 'drag',\n topDragEnd: 'dragend',\n topDragEnter: 'dragenter',\n topDragExit: 'dragexit',\n topDragLeave: 'dragleave',\n topDragOver: 'dragover',\n topDragStart: 'dragstart',\n topDrop: 'drop',\n topDurationChange: 'durationchange',\n topEmptied: 'emptied',\n topEncrypted: 'encrypted',\n topEnded: 'ended',\n topError: 'error',\n topFocus: 'focus',\n topInput: 'input',\n topKeyDown: 'keydown',\n topKeyPress: 'keypress',\n topKeyUp: 'keyup',\n topLoadedData: 'loadeddata',\n topLoadedMetadata: 'loadedmetadata',\n topLoadStart: 'loadstart',\n topMouseDown: 'mousedown',\n topMouseMove: 'mousemove',\n topMouseOut: 'mouseout',\n topMouseOver: 'mouseover',\n topMouseUp: 'mouseup',\n topPaste: 'paste',\n topPause: 'pause',\n topPlay: 'play',\n topPlaying: 'playing',\n topProgress: 'progress',\n topRateChange: 'ratechange',\n topScroll: 'scroll',\n topSeeked: 'seeked',\n topSeeking: 'seeking',\n topSelectionChange: 'selectionchange',\n topStalled: 'stalled',\n topSuspend: 'suspend',\n topTextInput: 'textInput',\n topTimeUpdate: 'timeupdate',\n topTouchCancel: 'touchcancel',\n topTouchEnd: 'touchend',\n topTouchMove: 'touchmove',\n topTouchStart: 'touchstart',\n topTransitionEnd: getVendorPrefixedEventName('transitionend') || 'transitionend',\n topVolumeChange: 'volumechange',\n topWaiting: 'waiting',\n topWheel: 'wheel'\n};\n\n/**\n * To ensure no conflicts with other potential React instances on the page\n */\nvar topListenersIDKey = '_reactListenersID' + String(Math.random()).slice(2);\n\nfunction getListeningForDocument(mountAt) {\n // In IE8, `mountAt` is a host object and doesn't have `hasOwnProperty`\n // directly.\n if (!Object.prototype.hasOwnProperty.call(mountAt, topListenersIDKey)) {\n mountAt[topListenersIDKey] = reactTopListenersCounter++;\n alreadyListeningTo[mountAt[topListenersIDKey]] = {};\n }\n return alreadyListeningTo[mountAt[topListenersIDKey]];\n}\n\n/**\n * `ReactBrowserEventEmitter` is used to attach top-level event listeners. For\n * example:\n *\n * EventPluginHub.putListener('myID', 'onClick', myFunction);\n *\n * This would allocate a \"registration\" of `('onClick', myFunction)` on 'myID'.\n *\n * @internal\n */\nvar ReactBrowserEventEmitter = _assign({}, ReactEventEmitterMixin, {\n /**\n * Injectable event backend\n */\n ReactEventListener: null,\n\n injection: {\n /**\n * @param {object} ReactEventListener\n */\n injectReactEventListener: function (ReactEventListener) {\n ReactEventListener.setHandleTopLevel(ReactBrowserEventEmitter.handleTopLevel);\n ReactBrowserEventEmitter.ReactEventListener = ReactEventListener;\n }\n },\n\n /**\n * Sets whether or not any created callbacks should be enabled.\n *\n * @param {boolean} enabled True if callbacks should be enabled.\n */\n setEnabled: function (enabled) {\n if (ReactBrowserEventEmitter.ReactEventListener) {\n ReactBrowserEventEmitter.ReactEventListener.setEnabled(enabled);\n }\n },\n\n /**\n * @return {boolean} True if callbacks are enabled.\n */\n isEnabled: function () {\n return !!(ReactBrowserEventEmitter.ReactEventListener && ReactBrowserEventEmitter.ReactEventListener.isEnabled());\n },\n\n /**\n * We listen for bubbled touch events on the document object.\n *\n * Firefox v8.01 (and possibly others) exhibited strange behavior when\n * mounting `onmousemove` events at some node that was not the document\n * element. The symptoms were that if your mouse is not moving over something\n * contained within that mount point (for example on the background) the\n * top-level listeners for `onmousemove` won't be called. However, if you\n * register the `mousemove` on the document object, then it will of course\n * catch all `mousemove`s. This along with iOS quirks, justifies restricting\n * top-level listeners to the document object only, at least for these\n * movement types of events and possibly all events.\n *\n * @see http://www.quirksmode.org/blog/archives/2010/09/click_event_del.html\n *\n * Also, `keyup`/`keypress`/`keydown` do not bubble to the window on IE, but\n * they bubble to document.\n *\n * @param {string} registrationName Name of listener (e.g. `onClick`).\n * @param {object} contentDocumentHandle Document which owns the container\n */\n listenTo: function (registrationName, contentDocumentHandle) {\n var mountAt = contentDocumentHandle;\n var isListening = getListeningForDocument(mountAt);\n var dependencies = EventPluginRegistry.registrationNameDependencies[registrationName];\n\n for (var i = 0; i < dependencies.length; i++) {\n var dependency = dependencies[i];\n if (!(isListening.hasOwnProperty(dependency) && isListening[dependency])) {\n if (dependency === 'topWheel') {\n if (isEventSupported('wheel')) {\n ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent('topWheel', 'wheel', mountAt);\n } else if (isEventSupported('mousewheel')) {\n ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent('topWheel', 'mousewheel', mountAt);\n } else {\n // Firefox needs to capture a different mouse scroll event.\n // @see http://www.quirksmode.org/dom/events/tests/scroll.html\n ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent('topWheel', 'DOMMouseScroll', mountAt);\n }\n } else if (dependency === 'topScroll') {\n if (isEventSupported('scroll', true)) {\n ReactBrowserEventEmitter.ReactEventListener.trapCapturedEvent('topScroll', 'scroll', mountAt);\n } else {\n ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent('topScroll', 'scroll', ReactBrowserEventEmitter.ReactEventListener.WINDOW_HANDLE);\n }\n } else if (dependency === 'topFocus' || dependency === 'topBlur') {\n if (isEventSupported('focus', true)) {\n ReactBrowserEventEmitter.ReactEventListener.trapCapturedEvent('topFocus', 'focus', mountAt);\n ReactBrowserEventEmitter.ReactEventListener.trapCapturedEvent('topBlur', 'blur', mountAt);\n } else if (isEventSupported('focusin')) {\n // IE has `focusin` and `focusout` events which bubble.\n // @see http://www.quirksmode.org/blog/archives/2008/04/delegating_the.html\n ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent('topFocus', 'focusin', mountAt);\n ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent('topBlur', 'focusout', mountAt);\n }\n\n // to make sure blur and focus event listeners are only attached once\n isListening.topBlur = true;\n isListening.topFocus = true;\n } else if (topEventMapping.hasOwnProperty(dependency)) {\n ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(dependency, topEventMapping[dependency], mountAt);\n }\n\n isListening[dependency] = true;\n }\n }\n },\n\n trapBubbledEvent: function (topLevelType, handlerBaseName, handle) {\n return ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(topLevelType, handlerBaseName, handle);\n },\n\n trapCapturedEvent: function (topLevelType, handlerBaseName, handle) {\n return ReactBrowserEventEmitter.ReactEventListener.trapCapturedEvent(topLevelType, handlerBaseName, handle);\n },\n\n /**\n * Protect against document.createEvent() returning null\n * Some popup blocker extensions appear to do this:\n * https://github.com/facebook/react/issues/6887\n */\n supportsEventPageXY: function () {\n if (!document.createEvent) {\n return false;\n }\n var ev = document.createEvent('MouseEvent');\n return ev != null && 'pageX' in ev;\n },\n\n /**\n * Listens to window scroll and resize events. We cache scroll values so that\n * application code can access them without triggering reflows.\n *\n * ViewportMetrics is only used by SyntheticMouse/TouchEvent and only when\n * pageX/pageY isn't supported (legacy browsers).\n *\n * NOTE: Scroll events do not bubble.\n *\n * @see http://www.quirksmode.org/dom/events/scroll.html\n */\n ensureScrollValueMonitoring: function () {\n if (hasEventPageXY === undefined) {\n hasEventPageXY = ReactBrowserEventEmitter.supportsEventPageXY();\n }\n if (!hasEventPageXY && !isMonitoringScrollValue) {\n var refresh = ViewportMetrics.refreshScrollValues;\n ReactBrowserEventEmitter.ReactEventListener.monitorScrollValue(refresh);\n isMonitoringScrollValue = true;\n }\n }\n});\n\nmodule.exports = ReactBrowserEventEmitter;"]}