rn-web-cli
Version:
React Native for Web
1 lines • 16 kB
Source Map (JSON)
{"version":3,"sources":["node_modules\\react-dom\\lib\\SyntheticEvent.js"],"names":["_assign","require","PooledClass","emptyFunction","warning","didWarnForAddedNewProperty","isProxySupported","Proxy","shouldBeReleasedProperties","EventInterface","type","target","currentTarget","thatReturnsNull","eventPhase","bubbles","cancelable","timeStamp","event","Date","now","defaultPrevented","isTrusted","SyntheticEvent","dispatchConfig","targetInst","nativeEvent","nativeEventTarget","process","env","NODE_ENV","preventDefault","stopPropagation","_targetInst","Interface","constructor","propName","hasOwnProperty","normalize","returnValue","isDefaultPrevented","thatReturnsTrue","thatReturnsFalse","isPropagationStopped","prototype","cancelBubble","persist","isPersistent","destructor","Object","defineProperty","getPooledWarningPropertyDefinition","i","length","construct","args","apply","create","that","set","prop","value","indexOf","augmentClass","Class","Super","E","addPoolingTo","fourArgumentPooler","module","exports","getVal","isFunction","configurable","get","val","action","warn","result","warningCondition"],"mappings":";;;;;;;;;;AAUA;;AAEA,GAAIA,SAAUC,QAAQ,eAAR,CAAd;;AAEA,GAAIC,aAAcD,QAAQ,eAAR,CAAlB;;AAEA,GAAIE,eAAgBF,QAAQ,wBAAR,CAApB;AACA,GAAIG,SAAUH,QAAQ,kBAAR,CAAd;;AAEA,GAAII,4BAA6B,KAAjC;AACA,GAAIC,kBAAmB,MAAOC,MAAP,GAAiB,UAAxC;;AAEA,GAAIC,4BAA6B,CAAC,gBAAD,CAAmB,aAAnB,CAAkC,aAAlC,CAAiD,oBAAjD,CAAuE,sBAAvE,CAA+F,oBAA/F,CAAqH,oBAArH,CAAjC;;;;;;AAMA,GAAIC,gBAAiB;AACnBC,KAAM,IADa;AAEnBC,OAAQ,IAFW;;AAInBC,cAAeT,cAAcU,eAJV;AAKnBC,WAAY,IALO;AAMnBC,QAAS,IANU;AAOnBC,WAAY,IAPO;AAQnBC,UAAW,mBAAUC,KAAV,CAAiB;AAC1B,MAAOA,OAAMD,SAAN,EAAmBE,KAAKC,GA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C5D,GAAIC,YAAa,MAAOD,OAAP,GAAkB,UAAnC;AACA,MAAO;AACLE,aAAc,IADT;AAELd,IAAKA,GAFA;AAGLe,IAAKA,GAHA,CAAP;;;AAMA,QAASf,IAAT,CAAagB,GAAb,CAAkB;AAChB,GAAIC,QAASJ,WAAa,oBAAb,CAAoC,sBAAjD;AACAK,KAAKD,MAAL,CAAa,6BAAb;AACA,MAAOD,IAAP;AACD;;AAED,QAASD,IAAT,EAAe;AACb,GAAIE,QAASJ,WAAa,sBAAb,CAAsC,wBAAnD;AACA,GAAIM,QAASN,WAAa,0BAAb,CAA0C,qBAAvD;AACAK,KAAKD,MAAL,CAAaE,MAAb;AACA,MAAOP,OAAP;AACD;;AAED,QAASM,KAAT,CAAcD,MAAd,CAAsBE,MAAtB,CAA8B;AAC5B,GAAIC,kBAAmB,KAAvB;AACAnD,QAAQC,GAAR,CAAYC,QAAZ,GAAyB,YAAzB,CAAwC1B,QAAQ2E,gBAAR,CAA0B,kFAAoF,8DAApF,CAAqJ,6EAArJ,CAAqO,6DAA/P,CAA8TH,MAA9T,CAAsUxC,QAAtU,CAAgV0C,MAAhV,CAAxC,CAAkY,IAAK,EAAvY;AACD;AACF","file":"SyntheticEvent.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 PooledClass = require('./PooledClass');\n\nvar emptyFunction = require('fbjs/lib/emptyFunction');\nvar warning = require('fbjs/lib/warning');\n\nvar didWarnForAddedNewProperty = false;\nvar isProxySupported = typeof Proxy === 'function';\n\nvar shouldBeReleasedProperties = ['dispatchConfig', '_targetInst', 'nativeEvent', 'isDefaultPrevented', 'isPropagationStopped', '_dispatchListeners', '_dispatchInstances'];\n\n/**\n * @interface Event\n * @see http://www.w3.org/TR/DOM-Level-3-Events/\n */\nvar EventInterface = {\n type: null,\n target: null,\n // currentTarget is set when dispatching; no use in copying it here\n currentTarget: emptyFunction.thatReturnsNull,\n eventPhase: null,\n bubbles: null,\n cancelable: null,\n timeStamp: function (event) {\n return event.timeStamp || Date.now();\n },\n defaultPrevented: null,\n isTrusted: null\n};\n\n/**\n * Synthetic events are dispatched by event plugins, typically in response to a\n * top-level event delegation handler.\n *\n * These systems should generally use pooling to reduce the frequency of garbage\n * collection. The system should check `isPersistent` to determine whether the\n * event should be released into the pool after being dispatched. Users that\n * need a persisted event should invoke `persist`.\n *\n * Synthetic events (and subclasses) implement the DOM Level 3 Events API by\n * normalizing browser quirks. Subclasses do not necessarily have to implement a\n * DOM interface; custom application-specific events can also subclass this.\n *\n * @param {object} dispatchConfig Configuration used to dispatch this event.\n * @param {*} targetInst Marker identifying the event target.\n * @param {object} nativeEvent Native browser event.\n * @param {DOMEventTarget} nativeEventTarget Target node.\n */\nfunction SyntheticEvent(dispatchConfig, targetInst, nativeEvent, nativeEventTarget) {\n if (process.env.NODE_ENV !== 'production') {\n // these have a getter/setter for warnings\n delete this.nativeEvent;\n delete this.preventDefault;\n delete this.stopPropagation;\n }\n\n this.dispatchConfig = dispatchConfig;\n this._targetInst = targetInst;\n this.nativeEvent = nativeEvent;\n\n var Interface = this.constructor.Interface;\n for (var propName in Interface) {\n if (!Interface.hasOwnProperty(propName)) {\n continue;\n }\n if (process.env.NODE_ENV !== 'production') {\n delete this[propName]; // this has a getter/setter for warnings\n }\n var normalize = Interface[propName];\n if (normalize) {\n this[propName] = normalize(nativeEvent);\n } else {\n if (propName === 'target') {\n this.target = nativeEventTarget;\n } else {\n this[propName] = nativeEvent[propName];\n }\n }\n }\n\n var defaultPrevented = nativeEvent.defaultPrevented != null ? nativeEvent.defaultPrevented : nativeEvent.returnValue === false;\n if (defaultPrevented) {\n this.isDefaultPrevented = emptyFunction.thatReturnsTrue;\n } else {\n this.isDefaultPrevented = emptyFunction.thatReturnsFalse;\n }\n this.isPropagationStopped = emptyFunction.thatReturnsFalse;\n return this;\n}\n\n_assign(SyntheticEvent.prototype, {\n preventDefault: function () {\n this.defaultPrevented = true;\n var event = this.nativeEvent;\n if (!event) {\n return;\n }\n\n if (event.preventDefault) {\n event.preventDefault();\n // eslint-disable-next-line valid-typeof\n } else if (typeof event.returnValue !== 'unknown') {\n event.returnValue = false;\n }\n this.isDefaultPrevented = emptyFunction.thatReturnsTrue;\n },\n\n stopPropagation: function () {\n var event = this.nativeEvent;\n if (!event) {\n return;\n }\n\n if (event.stopPropagation) {\n event.stopPropagation();\n // eslint-disable-next-line valid-typeof\n } else if (typeof event.cancelBubble !== 'unknown') {\n // The ChangeEventPlugin registers a \"propertychange\" event for\n // IE. This event does not support bubbling or cancelling, and\n // any references to cancelBubble throw \"Member not found\". A\n // typeof check of \"unknown\" circumvents this issue (and is also\n // IE specific).\n event.cancelBubble = true;\n }\n\n this.isPropagationStopped = emptyFunction.thatReturnsTrue;\n },\n\n /**\n * We release all dispatched `SyntheticEvent`s after each event loop, adding\n * them back into the pool. This allows a way to hold onto a reference that\n * won't be added back into the pool.\n */\n persist: function () {\n this.isPersistent = emptyFunction.thatReturnsTrue;\n },\n\n /**\n * Checks if this event should be released back into the pool.\n *\n * @return {boolean} True if this should not be released, false otherwise.\n */\n isPersistent: emptyFunction.thatReturnsFalse,\n\n /**\n * `PooledClass` looks for `destructor` on each instance it releases.\n */\n destructor: function () {\n var Interface = this.constructor.Interface;\n for (var propName in Interface) {\n if (process.env.NODE_ENV !== 'production') {\n Object.defineProperty(this, propName, getPooledWarningPropertyDefinition(propName, Interface[propName]));\n } else {\n this[propName] = null;\n }\n }\n for (var i = 0; i < shouldBeReleasedProperties.length; i++) {\n this[shouldBeReleasedProperties[i]] = null;\n }\n if (process.env.NODE_ENV !== 'production') {\n Object.defineProperty(this, 'nativeEvent', getPooledWarningPropertyDefinition('nativeEvent', null));\n Object.defineProperty(this, 'preventDefault', getPooledWarningPropertyDefinition('preventDefault', emptyFunction));\n Object.defineProperty(this, 'stopPropagation', getPooledWarningPropertyDefinition('stopPropagation', emptyFunction));\n }\n }\n});\n\nSyntheticEvent.Interface = EventInterface;\n\nif (process.env.NODE_ENV !== 'production') {\n if (isProxySupported) {\n /*eslint-disable no-func-assign */\n SyntheticEvent = new Proxy(SyntheticEvent, {\n construct: function (target, args) {\n return this.apply(target, Object.create(target.prototype), args);\n },\n apply: function (constructor, that, args) {\n return new Proxy(constructor.apply(that, args), {\n set: function (target, prop, value) {\n if (prop !== 'isPersistent' && !target.constructor.Interface.hasOwnProperty(prop) && shouldBeReleasedProperties.indexOf(prop) === -1) {\n process.env.NODE_ENV !== 'production' ? 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.') : void 0;\n didWarnForAddedNewProperty = true;\n }\n target[prop] = value;\n return true;\n }\n });\n }\n });\n /*eslint-enable no-func-assign */\n }\n}\n/**\n * Helper to reduce boilerplate when creating subclasses.\n *\n * @param {function} Class\n * @param {?object} Interface\n */\nSyntheticEvent.augmentClass = function (Class, Interface) {\n var Super = this;\n\n var E = function () {};\n E.prototype = Super.prototype;\n var prototype = new E();\n\n _assign(prototype, Class.prototype);\n Class.prototype = prototype;\n Class.prototype.constructor = Class;\n\n Class.Interface = _assign({}, Super.Interface, Interface);\n Class.augmentClass = Super.augmentClass;\n\n PooledClass.addPoolingTo(Class, PooledClass.fourArgumentPooler);\n};\n\nPooledClass.addPoolingTo(SyntheticEvent, PooledClass.fourArgumentPooler);\n\nmodule.exports = SyntheticEvent;\n\n/**\n * Helper to nullify syntheticEvent instance properties when destructing\n *\n * @param {object} SyntheticEvent\n * @param {String} propName\n * @return {object} defineProperty object\n */\nfunction getPooledWarningPropertyDefinition(propName, getVal) {\n var isFunction = typeof getVal === 'function';\n return {\n configurable: true,\n set: set,\n get: get\n };\n\n function set(val) {\n var action = isFunction ? 'setting the method' : 'setting the property';\n warn(action, 'This is effectively a no-op');\n return val;\n }\n\n function get() {\n var action = isFunction ? 'accessing the method' : 'accessing the property';\n var result = isFunction ? 'This is a no-op function' : 'This is set to null';\n warn(action, result);\n return getVal;\n }\n\n function warn(action, result) {\n var warningCondition = false;\n process.env.NODE_ENV !== 'production' ? warning(warningCondition, \"This synthetic event is reused for performance reasons. If you're seeing this, \" + \"you're %s `%s` on a released/nullified synthetic event. %s. \" + 'If you must keep the original synthetic event around, use event.persist(). ' + 'See https://fb.me/react-event-pooling for more information.', action, propName, result) : void 0;\n }\n}"]}