0b6a118b3beeedc9b9f1c5ff753fc766.json
66.8 KB
{"ast":null,"code":"var _interopRequireDefault=require(\"@babel/runtime/helpers/interopRequireDefault\");Object.defineProperty(exports,\"__esModule\",{value:true});exports.default=void 0;var _AccessibilityUtil=_interopRequireDefault(require(\"../../modules/AccessibilityUtil\"));var _BoundingDimensions=_interopRequireDefault(require(\"./BoundingDimensions\"));var _findNodeHandle=_interopRequireDefault(require(\"../findNodeHandle\"));var _normalizeCssColor=_interopRequireDefault(require(\"normalize-css-color\"));var _Position=_interopRequireDefault(require(\"./Position\"));var _react=_interopRequireDefault(require(\"react\"));var _TouchEventUtils=_interopRequireDefault(require(\"fbjs/lib/TouchEventUtils\"));var _UIManager=_interopRequireDefault(require(\"../UIManager\"));var _View=_interopRequireDefault(require(\"../View\"));function _objectSpread(target){for(var i=1;i<arguments.length;i++){var source=arguments[i]!=null?arguments[i]:{};var ownKeys=Object.keys(source);if(typeof Object.getOwnPropertySymbols==='function'){ownKeys=ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym){return Object.getOwnPropertyDescriptor(source,sym).enumerable;}));}ownKeys.forEach(function(key){_defineProperty(target,key,source[key]);});}return target;}function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}var States={NOT_RESPONDER:'NOT_RESPONDER',RESPONDER_INACTIVE_PRESS_IN:'RESPONDER_INACTIVE_PRESS_IN',RESPONDER_INACTIVE_PRESS_OUT:'RESPONDER_INACTIVE_PRESS_OUT',RESPONDER_ACTIVE_PRESS_IN:'RESPONDER_ACTIVE_PRESS_IN',RESPONDER_ACTIVE_PRESS_OUT:'RESPONDER_ACTIVE_PRESS_OUT',RESPONDER_ACTIVE_LONG_PRESS_IN:'RESPONDER_ACTIVE_LONG_PRESS_IN',RESPONDER_ACTIVE_LONG_PRESS_OUT:'RESPONDER_ACTIVE_LONG_PRESS_OUT',ERROR:'ERROR'};var IsActive={RESPONDER_ACTIVE_PRESS_OUT:true,RESPONDER_ACTIVE_PRESS_IN:true};var IsPressingIn={RESPONDER_INACTIVE_PRESS_IN:true,RESPONDER_ACTIVE_PRESS_IN:true,RESPONDER_ACTIVE_LONG_PRESS_IN:true};var IsLongPressingIn={RESPONDER_ACTIVE_LONG_PRESS_IN:true};var Signals={DELAY:'DELAY',RESPONDER_GRANT:'RESPONDER_GRANT',RESPONDER_RELEASE:'RESPONDER_RELEASE',RESPONDER_TERMINATED:'RESPONDER_TERMINATED',ENTER_PRESS_RECT:'ENTER_PRESS_RECT',LEAVE_PRESS_RECT:'LEAVE_PRESS_RECT',LONG_PRESS_DETECTED:'LONG_PRESS_DETECTED'};var Transitions={NOT_RESPONDER:{DELAY:States.ERROR,RESPONDER_GRANT:States.RESPONDER_INACTIVE_PRESS_IN,RESPONDER_RELEASE:States.ERROR,RESPONDER_TERMINATED:States.ERROR,ENTER_PRESS_RECT:States.ERROR,LEAVE_PRESS_RECT:States.ERROR,LONG_PRESS_DETECTED:States.ERROR},RESPONDER_INACTIVE_PRESS_IN:{DELAY:States.RESPONDER_ACTIVE_PRESS_IN,RESPONDER_GRANT:States.ERROR,RESPONDER_RELEASE:States.NOT_RESPONDER,RESPONDER_TERMINATED:States.NOT_RESPONDER,ENTER_PRESS_RECT:States.RESPONDER_INACTIVE_PRESS_IN,LEAVE_PRESS_RECT:States.RESPONDER_INACTIVE_PRESS_OUT,LONG_PRESS_DETECTED:States.ERROR},RESPONDER_INACTIVE_PRESS_OUT:{DELAY:States.RESPONDER_ACTIVE_PRESS_OUT,RESPONDER_GRANT:States.ERROR,RESPONDER_RELEASE:States.NOT_RESPONDER,RESPONDER_TERMINATED:States.NOT_RESPONDER,ENTER_PRESS_RECT:States.RESPONDER_INACTIVE_PRESS_IN,LEAVE_PRESS_RECT:States.RESPONDER_INACTIVE_PRESS_OUT,LONG_PRESS_DETECTED:States.ERROR},RESPONDER_ACTIVE_PRESS_IN:{DELAY:States.ERROR,RESPONDER_GRANT:States.ERROR,RESPONDER_RELEASE:States.NOT_RESPONDER,RESPONDER_TERMINATED:States.NOT_RESPONDER,ENTER_PRESS_RECT:States.RESPONDER_ACTIVE_PRESS_IN,LEAVE_PRESS_RECT:States.RESPONDER_ACTIVE_PRESS_OUT,LONG_PRESS_DETECTED:States.RESPONDER_ACTIVE_LONG_PRESS_IN},RESPONDER_ACTIVE_PRESS_OUT:{DELAY:States.ERROR,RESPONDER_GRANT:States.ERROR,RESPONDER_RELEASE:States.NOT_RESPONDER,RESPONDER_TERMINATED:States.NOT_RESPONDER,ENTER_PRESS_RECT:States.RESPONDER_ACTIVE_PRESS_IN,LEAVE_PRESS_RECT:States.RESPONDER_ACTIVE_PRESS_OUT,LONG_PRESS_DETECTED:States.ERROR},RESPONDER_ACTIVE_LONG_PRESS_IN:{DELAY:States.ERROR,RESPONDER_GRANT:States.ERROR,RESPONDER_RELEASE:States.NOT_RESPONDER,RESPONDER_TERMINATED:States.NOT_RESPONDER,ENTER_PRESS_RECT:States.RESPONDER_ACTIVE_LONG_PRESS_IN,LEAVE_PRESS_RECT:States.RESPONDER_ACTIVE_LONG_PRESS_OUT,LONG_PRESS_DETECTED:States.RESPONDER_ACTIVE_LONG_PRESS_IN},RESPONDER_ACTIVE_LONG_PRESS_OUT:{DELAY:States.ERROR,RESPONDER_GRANT:States.ERROR,RESPONDER_RELEASE:States.NOT_RESPONDER,RESPONDER_TERMINATED:States.NOT_RESPONDER,ENTER_PRESS_RECT:States.RESPONDER_ACTIVE_LONG_PRESS_IN,LEAVE_PRESS_RECT:States.RESPONDER_ACTIVE_LONG_PRESS_OUT,LONG_PRESS_DETECTED:States.ERROR},error:{DELAY:States.NOT_RESPONDER,RESPONDER_GRANT:States.RESPONDER_INACTIVE_PRESS_IN,RESPONDER_RELEASE:States.NOT_RESPONDER,RESPONDER_TERMINATED:States.NOT_RESPONDER,ENTER_PRESS_RECT:States.NOT_RESPONDER,LEAVE_PRESS_RECT:States.NOT_RESPONDER,LONG_PRESS_DETECTED:States.NOT_RESPONDER}};var HIGHLIGHT_DELAY_MS=130;var PRESS_EXPAND_PX=20;var LONG_PRESS_THRESHOLD=500;var LONG_PRESS_DELAY_MS=LONG_PRESS_THRESHOLD-HIGHLIGHT_DELAY_MS;var LONG_PRESS_ALLOWED_MOVEMENT=10;var TouchableMixin={componentDidMount:function componentDidMount(){var _this=this;this._touchableNode=(0,_findNodeHandle.default)(this);if(this._touchableNode&&this._touchableNode.addEventListener){this._touchableBlurListener=function(e){if(_this._isTouchableKeyboardActive){if(_this.state.touchable.touchState&&_this.state.touchable.touchState!==States.NOT_RESPONDER){_this.touchableHandleResponderTerminate({nativeEvent:e});}_this._isTouchableKeyboardActive=false;}};this._touchableNode.addEventListener('blur',this._touchableBlurListener);}},componentWillUnmount:function componentWillUnmount(){if(this._touchableNode&&this._touchableNode.addEventListener){this._touchableNode.removeEventListener('blur',this._touchableBlurListener);}this.touchableDelayTimeout&&clearTimeout(this.touchableDelayTimeout);this.longPressDelayTimeout&&clearTimeout(this.longPressDelayTimeout);this.pressOutDelayTimeout&&clearTimeout(this.pressOutDelayTimeout);},touchableGetInitialState:function touchableGetInitialState(){return{touchable:{touchState:undefined,responderID:null}};},touchableHandleResponderTerminationRequest:function touchableHandleResponderTerminationRequest(){return!this.props.rejectResponderTermination;},touchableHandleStartShouldSetResponder:function touchableHandleStartShouldSetResponder(){return!this.props.disabled;},touchableLongPressCancelsPress:function touchableLongPressCancelsPress(){return true;},touchableHandleResponderGrant:function touchableHandleResponderGrant(e){var dispatchID=e.currentTarget;e.persist();this.pressOutDelayTimeout&&clearTimeout(this.pressOutDelayTimeout);this.pressOutDelayTimeout=null;this.state.touchable.touchState=States.NOT_RESPONDER;this.state.touchable.responderID=dispatchID;this._receiveSignal(Signals.RESPONDER_GRANT,e);var delayMS=this.touchableGetHighlightDelayMS!==undefined?Math.max(this.touchableGetHighlightDelayMS(),0):HIGHLIGHT_DELAY_MS;delayMS=isNaN(delayMS)?HIGHLIGHT_DELAY_MS:delayMS;if(delayMS!==0){this.touchableDelayTimeout=setTimeout(this._handleDelay.bind(this,e),delayMS);}else{this.state.touchable.positionOnActivate=null;this._handleDelay(e);}var longDelayMS=this.touchableGetLongPressDelayMS!==undefined?Math.max(this.touchableGetLongPressDelayMS(),10):LONG_PRESS_DELAY_MS;longDelayMS=isNaN(longDelayMS)?LONG_PRESS_DELAY_MS:longDelayMS;this.longPressDelayTimeout=setTimeout(this._handleLongDelay.bind(this,e),longDelayMS+delayMS);},touchableHandleResponderRelease:function touchableHandleResponderRelease(e){this._receiveSignal(Signals.RESPONDER_RELEASE,e);},touchableHandleResponderTerminate:function touchableHandleResponderTerminate(e){this._receiveSignal(Signals.RESPONDER_TERMINATED,e);},touchableHandleResponderMove:function touchableHandleResponderMove(e){if(this.state.touchable.touchState===States.RESPONDER_INACTIVE_PRESS_IN){return;}if(!this.state.touchable.positionOnActivate){return;}var positionOnActivate=this.state.touchable.positionOnActivate;var dimensionsOnActivate=this.state.touchable.dimensionsOnActivate;var pressRectOffset=this.touchableGetPressRectOffset?this.touchableGetPressRectOffset():{left:PRESS_EXPAND_PX,right:PRESS_EXPAND_PX,top:PRESS_EXPAND_PX,bottom:PRESS_EXPAND_PX};var pressExpandLeft=pressRectOffset.left;var pressExpandTop=pressRectOffset.top;var pressExpandRight=pressRectOffset.right;var pressExpandBottom=pressRectOffset.bottom;var hitSlop=this.touchableGetHitSlop?this.touchableGetHitSlop():null;if(hitSlop){pressExpandLeft+=hitSlop.left;pressExpandTop+=hitSlop.top;pressExpandRight+=hitSlop.right;pressExpandBottom+=hitSlop.bottom;}var touch=_TouchEventUtils.default.extractSingleTouch(e.nativeEvent);var pageX=touch&&touch.pageX;var pageY=touch&&touch.pageY;if(this.pressInLocation){var movedDistance=this._getDistanceBetweenPoints(pageX,pageY,this.pressInLocation.pageX,this.pressInLocation.pageY);if(movedDistance>LONG_PRESS_ALLOWED_MOVEMENT){this._cancelLongPressDelayTimeout();}}var isTouchWithinActive=pageX>positionOnActivate.left-pressExpandLeft&&pageY>positionOnActivate.top-pressExpandTop&&pageX<positionOnActivate.left+dimensionsOnActivate.width+pressExpandRight&&pageY<positionOnActivate.top+dimensionsOnActivate.height+pressExpandBottom;if(isTouchWithinActive){this._receiveSignal(Signals.ENTER_PRESS_RECT,e);var curState=this.state.touchable.touchState;if(curState===States.RESPONDER_INACTIVE_PRESS_IN){this._cancelLongPressDelayTimeout();}}else{this._cancelLongPressDelayTimeout();this._receiveSignal(Signals.LEAVE_PRESS_RECT,e);}},_remeasureMetricsOnActivation:function _remeasureMetricsOnActivation(){var tag=this.state.touchable.responderID;if(tag==null){return;}_UIManager.default.measure(tag,this._handleQueryLayout);},_handleQueryLayout:function _handleQueryLayout(x,y,width,height,globalX,globalY){if(!x&&!y&&!width&&!height&&!globalX&&!globalY){return;}this.state.touchable.positionOnActivate&&_Position.default.release(this.state.touchable.positionOnActivate);this.state.touchable.dimensionsOnActivate&&_BoundingDimensions.default.release(this.state.touchable.dimensionsOnActivate);this.state.touchable.positionOnActivate=_Position.default.getPooled(globalX,globalY);this.state.touchable.dimensionsOnActivate=_BoundingDimensions.default.getPooled(width,height);},_handleDelay:function _handleDelay(e){this.touchableDelayTimeout=null;this._receiveSignal(Signals.DELAY,e);},_handleLongDelay:function _handleLongDelay(e){this.longPressDelayTimeout=null;var curState=this.state.touchable.touchState;if(curState!==States.RESPONDER_ACTIVE_PRESS_IN&&curState!==States.RESPONDER_ACTIVE_LONG_PRESS_IN){console.error('Attempted to transition from state `'+curState+'` to `'+States.RESPONDER_ACTIVE_LONG_PRESS_IN+'`, which is not supported. This is '+'most likely due to `Touchable.longPressDelayTimeout` not being cancelled.');}else{this._receiveSignal(Signals.LONG_PRESS_DETECTED,e);}},_receiveSignal:function _receiveSignal(signal,e){var responderID=this.state.touchable.responderID;var curState=this.state.touchable.touchState;var nextState=Transitions[curState]&&Transitions[curState][signal];if(!responderID&&signal===Signals.RESPONDER_RELEASE){return;}if(!nextState){throw new Error('Unrecognized signal `'+signal+'` or state `'+curState+'` for Touchable responder `'+responderID+'`');}if(nextState===States.ERROR){throw new Error('Touchable cannot transition from `'+curState+'` to `'+signal+'` for responder `'+responderID+'`');}if(curState!==nextState){this._performSideEffectsForTransition(curState,nextState,signal,e);this.state.touchable.touchState=nextState;}},_cancelLongPressDelayTimeout:function _cancelLongPressDelayTimeout(){this.longPressDelayTimeout&&clearTimeout(this.longPressDelayTimeout);this.longPressDelayTimeout=null;},_isHighlight:function _isHighlight(state){return state===States.RESPONDER_ACTIVE_PRESS_IN||state===States.RESPONDER_ACTIVE_LONG_PRESS_IN;},_savePressInLocation:function _savePressInLocation(e){var touch=_TouchEventUtils.default.extractSingleTouch(e.nativeEvent);var pageX=touch&&touch.pageX;var pageY=touch&&touch.pageY;this.pressInLocation={pageX:pageX,pageY:pageY,get locationX(){return touch&&touch.locationX;},get locationY(){return touch&&touch.locationY;}};},_getDistanceBetweenPoints:function _getDistanceBetweenPoints(aX,aY,bX,bY){var deltaX=aX-bX;var deltaY=aY-bY;return Math.sqrt(deltaX*deltaX+deltaY*deltaY);},_performSideEffectsForTransition:function _performSideEffectsForTransition(curState,nextState,signal,e){var curIsHighlight=this._isHighlight(curState);var newIsHighlight=this._isHighlight(nextState);var isFinalSignal=signal===Signals.RESPONDER_TERMINATED||signal===Signals.RESPONDER_RELEASE;if(isFinalSignal){this._cancelLongPressDelayTimeout();}if(!IsActive[curState]&&IsActive[nextState]){this._remeasureMetricsOnActivation();}if(IsPressingIn[curState]&&signal===Signals.LONG_PRESS_DETECTED){this.touchableHandleLongPress&&this.touchableHandleLongPress(e);}if(newIsHighlight&&!curIsHighlight){this._startHighlight(e);}else if(!newIsHighlight&&curIsHighlight){this._endHighlight(e);}if(IsPressingIn[curState]&&signal===Signals.RESPONDER_RELEASE){var hasLongPressHandler=!!this.props.onLongPress;var pressIsLongButStillCallOnPress=IsLongPressingIn[curState]&&(!hasLongPressHandler||!this.touchableLongPressCancelsPress());var shouldInvokePress=!IsLongPressingIn[curState]||pressIsLongButStillCallOnPress;if(shouldInvokePress&&this.touchableHandlePress){if(!newIsHighlight&&!curIsHighlight){this._startHighlight(e);this._endHighlight(e);}this.touchableHandlePress(e);}}this.touchableDelayTimeout&&clearTimeout(this.touchableDelayTimeout);this.touchableDelayTimeout=null;},_startHighlight:function _startHighlight(e){this._savePressInLocation(e);this.touchableHandleActivePressIn&&this.touchableHandleActivePressIn(e);},_endHighlight:function _endHighlight(e){var _this2=this;if(this.touchableHandleActivePressOut){if(this.touchableGetPressOutDelayMS&&this.touchableGetPressOutDelayMS()){this.pressOutDelayTimeout=setTimeout(function(){_this2.touchableHandleActivePressOut(e);},this.touchableGetPressOutDelayMS());}else{this.touchableHandleActivePressOut(e);}}},touchableHandleKeyEvent:function touchableHandleKeyEvent(e){var ENTER=13;var SPACE=32;var type=e.type,which=e.which;if(which===ENTER||which===SPACE){if(type==='keydown'){if(!this._isTouchableKeyboardActive){if(!this.state.touchable.touchState||this.state.touchable.touchState===States.NOT_RESPONDER){this.touchableHandleResponderGrant(e);this._isTouchableKeyboardActive=true;}}}else if(type==='keyup'){if(this._isTouchableKeyboardActive){if(this.state.touchable.touchState&&this.state.touchable.touchState!==States.NOT_RESPONDER){this.touchableHandleResponderRelease(e);this._isTouchableKeyboardActive=false;}}}e.stopPropagation();if(!(which===ENTER&&_AccessibilityUtil.default.propsToAriaRole(this.props)==='link')){e.preventDefault();}}}};var Touchable={Mixin:TouchableMixin,TOUCH_TARGET_DEBUG:false,renderDebugView:function renderDebugView(_ref){var color=_ref.color,hitSlop=_ref.hitSlop;if(process.env.NODE_ENV!=='production'){if(!Touchable.TOUCH_TARGET_DEBUG){return null;}var debugHitSlopStyle={};hitSlop=hitSlop||{top:0,bottom:0,left:0,right:0};for(var key in hitSlop){debugHitSlopStyle[key]=-hitSlop[key];}var hexColor='#'+('00000000'+(0,_normalizeCssColor.default)(color).toString(16)).substr(-8);return _react.default.createElement(_View.default,{pointerEvents:\"none\",style:_objectSpread({position:'absolute',borderColor:hexColor.slice(0,-2)+'55',borderWidth:1,borderStyle:'dashed',backgroundColor:hexColor.slice(0,-2)+'0F'},debugHitSlopStyle)});}}};var _default=Touchable;exports.default=_default;","map":{"version":3,"sources":["C:/Users/bluej/Desktop/2_2/searchGuide/searchGuide/node_modules/react-native-web/dist/exports/Touchable/index.js"],"names":["_objectSpread","target","i","arguments","length","source","ownKeys","Object","keys","getOwnPropertySymbols","concat","filter","sym","getOwnPropertyDescriptor","enumerable","forEach","key","_defineProperty","obj","value","defineProperty","configurable","writable","States","NOT_RESPONDER","RESPONDER_INACTIVE_PRESS_IN","RESPONDER_INACTIVE_PRESS_OUT","RESPONDER_ACTIVE_PRESS_IN","RESPONDER_ACTIVE_PRESS_OUT","RESPONDER_ACTIVE_LONG_PRESS_IN","RESPONDER_ACTIVE_LONG_PRESS_OUT","ERROR","IsActive","IsPressingIn","IsLongPressingIn","Signals","DELAY","RESPONDER_GRANT","RESPONDER_RELEASE","RESPONDER_TERMINATED","ENTER_PRESS_RECT","LEAVE_PRESS_RECT","LONG_PRESS_DETECTED","Transitions","error","HIGHLIGHT_DELAY_MS","PRESS_EXPAND_PX","LONG_PRESS_THRESHOLD","LONG_PRESS_DELAY_MS","LONG_PRESS_ALLOWED_MOVEMENT","TouchableMixin","componentDidMount","_this","_touchableNode","addEventListener","_touchableBlurListener","e","_isTouchableKeyboardActive","state","touchable","touchState","touchableHandleResponderTerminate","nativeEvent","componentWillUnmount","removeEventListener","touchableDelayTimeout","clearTimeout","longPressDelayTimeout","pressOutDelayTimeout","touchableGetInitialState","undefined","responderID","touchableHandleResponderTerminationRequest","props","rejectResponderTermination","touchableHandleStartShouldSetResponder","disabled","touchableLongPressCancelsPress","touchableHandleResponderGrant","dispatchID","currentTarget","persist","_receiveSignal","delayMS","touchableGetHighlightDelayMS","Math","max","isNaN","setTimeout","_handleDelay","bind","positionOnActivate","longDelayMS","touchableGetLongPressDelayMS","_handleLongDelay","touchableHandleResponderRelease","touchableHandleResponderMove","dimensionsOnActivate","pressRectOffset","touchableGetPressRectOffset","left","right","top","bottom","pressExpandLeft","pressExpandTop","pressExpandRight","pressExpandBottom","hitSlop","touchableGetHitSlop","touch","TouchEventUtils","extractSingleTouch","pageX","pageY","pressInLocation","movedDistance","_getDistanceBetweenPoints","_cancelLongPressDelayTimeout","isTouchWithinActive","width","height","curState","_remeasureMetricsOnActivation","tag","UIManager","measure","_handleQueryLayout","x","y","globalX","globalY","Position","release","BoundingDimensions","getPooled","console","signal","nextState","Error","_performSideEffectsForTransition","_isHighlight","_savePressInLocation","locationX","locationY","aX","aY","bX","bY","deltaX","deltaY","sqrt","curIsHighlight","newIsHighlight","isFinalSignal","touchableHandleLongPress","_startHighlight","_endHighlight","hasLongPressHandler","onLongPress","pressIsLongButStillCallOnPress","shouldInvokePress","touchableHandlePress","touchableHandleActivePressIn","_this2","touchableHandleActivePressOut","touchableGetPressOutDelayMS","touchableHandleKeyEvent","ENTER","SPACE","type","which","stopPropagation","AccessibilityUtil","propsToAriaRole","preventDefault","Touchable","Mixin","TOUCH_TARGET_DEBUG","renderDebugView","_ref","color","process","env","NODE_ENV","debugHitSlopStyle","hexColor","toString","substr","React","createElement","View","pointerEvents","style","position","borderColor","slice","borderWidth","borderStyle","backgroundColor"],"mappings":"mKAeA,0FACA,gFACA,yEACA,8EACA,4DACA,oDACA,iFACA,+DACA,qDAvBA,QAASA,CAAAA,aAAT,CAAuBC,MAAvB,CAA+B,CAAE,IAAK,GAAIC,CAAAA,CAAC,CAAG,CAAb,CAAgBA,CAAC,CAAGC,SAAS,CAACC,MAA9B,CAAsCF,CAAC,EAAvC,CAA2C,CAAE,GAAIG,CAAAA,MAAM,CAAGF,SAAS,CAACD,CAAD,CAAT,EAAgB,IAAhB,CAAuBC,SAAS,CAACD,CAAD,CAAhC,CAAsC,EAAnD,CAAuD,GAAII,CAAAA,OAAO,CAAGC,MAAM,CAACC,IAAP,CAAYH,MAAZ,CAAd,CAAmC,GAAI,MAAOE,CAAAA,MAAM,CAAC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AT,CAAe,CAAf,CAAkB,CAAC,CAAnB,EAAwB,IAFlB,CAInBC,WAAW,CAAE,CAJM,CAKnBC,WAAW,CAAE,QALM,CAMnBC,eAAe,CAAEb,QAAQ,CAACU,KAAT,CAAe,CAAf,CAAkB,CAAC,CAAnB,EAAwB,IANtB,CAAD,CAOjBX,iBAPiB,CAFW,CAA1B,CAAP,CAWD,CACF,CA1Ca,CAAhB,C,aA4CeT,S","sourcesContent":["function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n/* eslint-disable react/prop-types */\n\n/**\n * Copyright (c) Nicolas Gallagher.\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\nimport AccessibilityUtil from '../../modules/AccessibilityUtil';\nimport BoundingDimensions from './BoundingDimensions';\nimport findNodeHandle from '../findNodeHandle';\nimport normalizeColor from 'normalize-css-color';\nimport Position from './Position';\nimport React from 'react';\nimport TouchEventUtils from 'fbjs/lib/TouchEventUtils';\nimport UIManager from '../UIManager';\nimport View from '../View';\n\n/**\n * `Touchable`: Taps done right.\n *\n * You hook your `ResponderEventPlugin` events into `Touchable`. `Touchable`\n * will measure time/geometry and tells you when to give feedback to the user.\n *\n * ====================== Touchable Tutorial ===============================\n * The `Touchable` mixin helps you handle the \"press\" interaction. It analyzes\n * the geometry of elements, and observes when another responder (scroll view\n * etc) has stolen the touch lock. It notifies your component when it should\n * give feedback to the user. (bouncing/highlighting/unhighlighting).\n *\n * - When a touch was activated (typically you highlight)\n * - When a touch was deactivated (typically you unhighlight)\n * - When a touch was \"pressed\" - a touch ended while still within the geometry\n * of the element, and no other element (like scroller) has \"stolen\" touch\n * lock (\"responder\") (Typically you bounce the element).\n *\n * A good tap interaction isn't as simple as you might think. There should be a\n * slight delay before showing a highlight when starting a touch. If a\n * subsequent touch move exceeds the boundary of the element, it should\n * unhighlight, but if that same touch is brought back within the boundary, it\n * should rehighlight again. A touch can move in and out of that boundary\n * several times, each time toggling highlighting, but a \"press\" is only\n * triggered if that touch ends while within the element's boundary and no\n * scroller (or anything else) has stolen the lock on touches.\n *\n * To create a new type of component that handles interaction using the\n * `Touchable` mixin, do the following:\n *\n * - Initialize the `Touchable` state.\n *\n * getInitialState: function() {\n * return merge(this.touchableGetInitialState(), yourComponentState);\n * }\n *\n * - Choose the rendered component who's touches should start the interactive\n * sequence. On that rendered node, forward all `Touchable` responder\n * handlers. You can choose any rendered node you like. Choose a node whose\n * hit target you'd like to instigate the interaction sequence:\n *\n * // In render function:\n * return (\n * <View\n * onStartShouldSetResponder={this.touchableHandleStartShouldSetResponder}\n * onResponderTerminationRequest={this.touchableHandleResponderTerminationRequest}\n * onResponderGrant={this.touchableHandleResponderGrant}\n * onResponderMove={this.touchableHandleResponderMove}\n * onResponderRelease={this.touchableHandleResponderRelease}\n * onResponderTerminate={this.touchableHandleResponderTerminate}>\n * <View>\n * Even though the hit detection/interactions are triggered by the\n * wrapping (typically larger) node, we usually end up implementing\n * custom logic that highlights this inner one.\n * </View>\n * </View>\n * );\n *\n * - You may set up your own handlers for each of these events, so long as you\n * also invoke the `touchable*` handlers inside of your custom handler.\n *\n * - Implement the handlers on your component class in order to provide\n * feedback to the user. See documentation for each of these class methods\n * that you should implement.\n *\n * touchableHandlePress: function() {\n * this.performBounceAnimation(); // or whatever you want to do.\n * },\n * touchableHandleActivePressIn: function() {\n * this.beginHighlighting(...); // Whatever you like to convey activation\n * },\n * touchableHandleActivePressOut: function() {\n * this.endHighlighting(...); // Whatever you like to convey deactivation\n * },\n *\n * - There are more advanced methods you can implement (see documentation below):\n * touchableGetHighlightDelayMS: function() {\n * return 20;\n * }\n * // In practice, *always* use a predeclared constant (conserve memory).\n * touchableGetPressRectOffset: function() {\n * return {top: 20, left: 20, right: 20, bottom: 100};\n * }\n */\n\n/**\n * Touchable states.\n */\nvar States = {\n NOT_RESPONDER: 'NOT_RESPONDER',\n // Not the responder\n RESPONDER_INACTIVE_PRESS_IN: 'RESPONDER_INACTIVE_PRESS_IN',\n // Responder, inactive, in the `PressRect`\n RESPONDER_INACTIVE_PRESS_OUT: 'RESPONDER_INACTIVE_PRESS_OUT',\n // Responder, inactive, out of `PressRect`\n RESPONDER_ACTIVE_PRESS_IN: 'RESPONDER_ACTIVE_PRESS_IN',\n // Responder, active, in the `PressRect`\n RESPONDER_ACTIVE_PRESS_OUT: 'RESPONDER_ACTIVE_PRESS_OUT',\n // Responder, active, out of `PressRect`\n RESPONDER_ACTIVE_LONG_PRESS_IN: 'RESPONDER_ACTIVE_LONG_PRESS_IN',\n // Responder, active, in the `PressRect`, after long press threshold\n RESPONDER_ACTIVE_LONG_PRESS_OUT: 'RESPONDER_ACTIVE_LONG_PRESS_OUT',\n // Responder, active, out of `PressRect`, after long press threshold\n ERROR: 'ERROR'\n};\n/**\n * Quick lookup map for states that are considered to be \"active\"\n */\n\nvar IsActive = {\n RESPONDER_ACTIVE_PRESS_OUT: true,\n RESPONDER_ACTIVE_PRESS_IN: true\n};\n/**\n * Quick lookup for states that are considered to be \"pressing\" and are\n * therefore eligible to result in a \"selection\" if the press stops.\n */\n\nvar IsPressingIn = {\n RESPONDER_INACTIVE_PRESS_IN: true,\n RESPONDER_ACTIVE_PRESS_IN: true,\n RESPONDER_ACTIVE_LONG_PRESS_IN: true\n};\nvar IsLongPressingIn = {\n RESPONDER_ACTIVE_LONG_PRESS_IN: true\n};\n/**\n * Inputs to the state machine.\n */\n\nvar Signals = {\n DELAY: 'DELAY',\n RESPONDER_GRANT: 'RESPONDER_GRANT',\n RESPONDER_RELEASE: 'RESPONDER_RELEASE',\n RESPONDER_TERMINATED: 'RESPONDER_TERMINATED',\n ENTER_PRESS_RECT: 'ENTER_PRESS_RECT',\n LEAVE_PRESS_RECT: 'LEAVE_PRESS_RECT',\n LONG_PRESS_DETECTED: 'LONG_PRESS_DETECTED'\n};\n/**\n * Mapping from States x Signals => States\n */\n\nvar Transitions = {\n NOT_RESPONDER: {\n DELAY: States.ERROR,\n RESPONDER_GRANT: States.RESPONDER_INACTIVE_PRESS_IN,\n RESPONDER_RELEASE: States.ERROR,\n RESPONDER_TERMINATED: States.ERROR,\n ENTER_PRESS_RECT: States.ERROR,\n LEAVE_PRESS_RECT: States.ERROR,\n LONG_PRESS_DETECTED: States.ERROR\n },\n RESPONDER_INACTIVE_PRESS_IN: {\n DELAY: States.RESPONDER_ACTIVE_PRESS_IN,\n RESPONDER_GRANT: States.ERROR,\n RESPONDER_RELEASE: States.NOT_RESPONDER,\n RESPONDER_TERMINATED: States.NOT_RESPONDER,\n ENTER_PRESS_RECT: States.RESPONDER_INACTIVE_PRESS_IN,\n LEAVE_PRESS_RECT: States.RESPONDER_INACTIVE_PRESS_OUT,\n LONG_PRESS_DETECTED: States.ERROR\n },\n RESPONDER_INACTIVE_PRESS_OUT: {\n DELAY: States.RESPONDER_ACTIVE_PRESS_OUT,\n RESPONDER_GRANT: States.ERROR,\n RESPONDER_RELEASE: States.NOT_RESPONDER,\n RESPONDER_TERMINATED: States.NOT_RESPONDER,\n ENTER_PRESS_RECT: States.RESPONDER_INACTIVE_PRESS_IN,\n LEAVE_PRESS_RECT: States.RESPONDER_INACTIVE_PRESS_OUT,\n LONG_PRESS_DETECTED: States.ERROR\n },\n RESPONDER_ACTIVE_PRESS_IN: {\n DELAY: States.ERROR,\n RESPONDER_GRANT: States.ERROR,\n RESPONDER_RELEASE: States.NOT_RESPONDER,\n RESPONDER_TERMINATED: States.NOT_RESPONDER,\n ENTER_PRESS_RECT: States.RESPONDER_ACTIVE_PRESS_IN,\n LEAVE_PRESS_RECT: States.RESPONDER_ACTIVE_PRESS_OUT,\n LONG_PRESS_DETECTED: States.RESPONDER_ACTIVE_LONG_PRESS_IN\n },\n RESPONDER_ACTIVE_PRESS_OUT: {\n DELAY: States.ERROR,\n RESPONDER_GRANT: States.ERROR,\n RESPONDER_RELEASE: States.NOT_RESPONDER,\n RESPONDER_TERMINATED: States.NOT_RESPONDER,\n ENTER_PRESS_RECT: States.RESPONDER_ACTIVE_PRESS_IN,\n LEAVE_PRESS_RECT: States.RESPONDER_ACTIVE_PRESS_OUT,\n LONG_PRESS_DETECTED: States.ERROR\n },\n RESPONDER_ACTIVE_LONG_PRESS_IN: {\n DELAY: States.ERROR,\n RESPONDER_GRANT: States.ERROR,\n RESPONDER_RELEASE: States.NOT_RESPONDER,\n RESPONDER_TERMINATED: States.NOT_RESPONDER,\n ENTER_PRESS_RECT: States.RESPONDER_ACTIVE_LONG_PRESS_IN,\n LEAVE_PRESS_RECT: States.RESPONDER_ACTIVE_LONG_PRESS_OUT,\n LONG_PRESS_DETECTED: States.RESPONDER_ACTIVE_LONG_PRESS_IN\n },\n RESPONDER_ACTIVE_LONG_PRESS_OUT: {\n DELAY: States.ERROR,\n RESPONDER_GRANT: States.ERROR,\n RESPONDER_RELEASE: States.NOT_RESPONDER,\n RESPONDER_TERMINATED: States.NOT_RESPONDER,\n ENTER_PRESS_RECT: States.RESPONDER_ACTIVE_LONG_PRESS_IN,\n LEAVE_PRESS_RECT: States.RESPONDER_ACTIVE_LONG_PRESS_OUT,\n LONG_PRESS_DETECTED: States.ERROR\n },\n error: {\n DELAY: States.NOT_RESPONDER,\n RESPONDER_GRANT: States.RESPONDER_INACTIVE_PRESS_IN,\n RESPONDER_RELEASE: States.NOT_RESPONDER,\n RESPONDER_TERMINATED: States.NOT_RESPONDER,\n ENTER_PRESS_RECT: States.NOT_RESPONDER,\n LEAVE_PRESS_RECT: States.NOT_RESPONDER,\n LONG_PRESS_DETECTED: States.NOT_RESPONDER\n }\n}; // ==== Typical Constants for integrating into UI components ====\n// var HIT_EXPAND_PX = 20;\n// var HIT_VERT_OFFSET_PX = 10;\n\nvar HIGHLIGHT_DELAY_MS = 130;\nvar PRESS_EXPAND_PX = 20;\nvar LONG_PRESS_THRESHOLD = 500;\nvar LONG_PRESS_DELAY_MS = LONG_PRESS_THRESHOLD - HIGHLIGHT_DELAY_MS;\nvar LONG_PRESS_ALLOWED_MOVEMENT = 10; // Default amount \"active\" region protrudes beyond box\n\n/**\n * By convention, methods prefixed with underscores are meant to be @private,\n * and not @protected. Mixers shouldn't access them - not even to provide them\n * as callback handlers.\n *\n *\n * ========== Geometry =========\n * `Touchable` only assumes that there exists a `HitRect` node. The `PressRect`\n * is an abstract box that is extended beyond the `HitRect`.\n *\n * +--------------------------+\n * | | - \"Start\" events in `HitRect` cause `HitRect`\n * | +--------------------+ | to become the responder.\n * | | +--------------+ | | - `HitRect` is typically expanded around\n * | | | | | | the `VisualRect`, but shifted downward.\n * | | | VisualRect | | | - After pressing down, after some delay,\n * | | | | | | and before letting up, the Visual React\n * | | +--------------+ | | will become \"active\". This makes it eligible\n * | | HitRect | | for being highlighted (so long as the\n * | +--------------------+ | press remains in the `PressRect`).\n * | PressRect o |\n * +----------------------|---+\n * Out Region |\n * +-----+ This gap between the `HitRect` and\n * `PressRect` allows a touch to move far away\n * from the original hit rect, and remain\n * highlighted, and eligible for a \"Press\".\n * Customize this via\n * `touchableGetPressRectOffset()`.\n *\n *\n *\n * ======= State Machine =======\n *\n * +-------------+ <---+ RESPONDER_RELEASE\n * |NOT_RESPONDER|\n * +-------------+ <---+ RESPONDER_TERMINATED\n * +\n * | RESPONDER_GRANT (HitRect)\n * v\n * +---------------------------+ DELAY +-------------------------+ T + DELAY +------------------------------+\n * |RESPONDER_INACTIVE_PRESS_IN|+-------->|RESPONDER_ACTIVE_PRESS_IN| +------------> |RESPONDER_ACTIVE_LONG_PRESS_IN|\n * +---------------------------+ +-------------------------+ +------------------------------+\n * + ^ + ^ + ^\n * |LEAVE_ |ENTER_ |LEAVE_ |ENTER_ |LEAVE_ |ENTER_\n * |PRESS_RECT |PRESS_RECT |PRESS_RECT |PRESS_RECT |PRESS_RECT |PRESS_RECT\n * | | | | | |\n * v + v + v +\n * +----------------------------+ DELAY +--------------------------+ +-------------------------------+\n * |RESPONDER_INACTIVE_PRESS_OUT|+------->|RESPONDER_ACTIVE_PRESS_OUT| |RESPONDER_ACTIVE_LONG_PRESS_OUT|\n * +----------------------------+ +--------------------------+ +-------------------------------+\n *\n * T + DELAY => LONG_PRESS_DELAY_MS + DELAY\n *\n * Not drawn are the side effects of each transition. The most important side\n * effect is the `touchableHandlePress` abstract method invocation that occurs\n * when a responder is released while in either of the \"Press\" states.\n *\n * The other important side effects are the highlight abstract method\n * invocations (internal callbacks) to be implemented by the mixer.\n *\n *\n * @lends Touchable.prototype\n */\n\nvar TouchableMixin = {\n // HACK (part 1): basic support for touchable interactions using a keyboard\n componentDidMount: function componentDidMount() {\n var _this = this;\n\n this._touchableNode = findNodeHandle(this);\n\n if (this._touchableNode && this._touchableNode.addEventListener) {\n this._touchableBlurListener = function (e) {\n if (_this._isTouchableKeyboardActive) {\n if (_this.state.touchable.touchState && _this.state.touchable.touchState !== States.NOT_RESPONDER) {\n _this.touchableHandleResponderTerminate({\n nativeEvent: e\n });\n }\n\n _this._isTouchableKeyboardActive = false;\n }\n };\n\n this._touchableNode.addEventListener('blur', this._touchableBlurListener);\n }\n },\n\n /**\n * Clear all timeouts on unmount\n */\n componentWillUnmount: function componentWillUnmount() {\n if (this._touchableNode && this._touchableNode.addEventListener) {\n this._touchableNode.removeEventListener('blur', this._touchableBlurListener);\n }\n\n this.touchableDelayTimeout && clearTimeout(this.touchableDelayTimeout);\n this.longPressDelayTimeout && clearTimeout(this.longPressDelayTimeout);\n this.pressOutDelayTimeout && clearTimeout(this.pressOutDelayTimeout);\n },\n\n /**\n * It's prefer that mixins determine state in this way, having the class\n * explicitly mix the state in the one and only `getInitialState` method.\n *\n * @return {object} State object to be placed inside of\n * `this.state.touchable`.\n */\n touchableGetInitialState: function touchableGetInitialState() {\n return {\n touchable: {\n touchState: undefined,\n responderID: null\n }\n };\n },\n // ==== Hooks to Gesture Responder system ====\n\n /**\n * Must return true if embedded in a native platform scroll view.\n */\n touchableHandleResponderTerminationRequest: function touchableHandleResponderTerminationRequest() {\n return !this.props.rejectResponderTermination;\n },\n\n /**\n * Must return true to start the process of `Touchable`.\n */\n touchableHandleStartShouldSetResponder: function touchableHandleStartShouldSetResponder() {\n return !this.props.disabled;\n },\n\n /**\n * Return true to cancel press on long press.\n */\n touchableLongPressCancelsPress: function touchableLongPressCancelsPress() {\n return true;\n },\n\n /**\n * Place as callback for a DOM element's `onResponderGrant` event.\n */\n touchableHandleResponderGrant: function touchableHandleResponderGrant(e) {\n var dispatchID = e.currentTarget; // Since e is used in a callback invoked on another event loop\n // (as in setTimeout etc), we need to call e.persist() on the\n // event to make sure it doesn't get reused in the event object pool.\n\n e.persist();\n this.pressOutDelayTimeout && clearTimeout(this.pressOutDelayTimeout);\n this.pressOutDelayTimeout = null;\n this.state.touchable.touchState = States.NOT_RESPONDER;\n this.state.touchable.responderID = dispatchID;\n\n this._receiveSignal(Signals.RESPONDER_GRANT, e);\n\n var delayMS = this.touchableGetHighlightDelayMS !== undefined ? Math.max(this.touchableGetHighlightDelayMS(), 0) : HIGHLIGHT_DELAY_MS;\n delayMS = isNaN(delayMS) ? HIGHLIGHT_DELAY_MS : delayMS;\n\n if (delayMS !== 0) {\n this.touchableDelayTimeout = setTimeout(this._handleDelay.bind(this, e), delayMS);\n } else {\n this.state.touchable.positionOnActivate = null;\n\n this._handleDelay(e);\n }\n\n var longDelayMS = this.touchableGetLongPressDelayMS !== undefined ? Math.max(this.touchableGetLongPressDelayMS(), 10) : LONG_PRESS_DELAY_MS;\n longDelayMS = isNaN(longDelayMS) ? LONG_PRESS_DELAY_MS : longDelayMS;\n this.longPressDelayTimeout = setTimeout(this._handleLongDelay.bind(this, e), longDelayMS + delayMS);\n },\n\n /**\n * Place as callback for a DOM element's `onResponderRelease` event.\n */\n touchableHandleResponderRelease: function touchableHandleResponderRelease(e) {\n this._receiveSignal(Signals.RESPONDER_RELEASE, e);\n },\n\n /**\n * Place as callback for a DOM element's `onResponderTerminate` event.\n */\n touchableHandleResponderTerminate: function touchableHandleResponderTerminate(e) {\n this._receiveSignal(Signals.RESPONDER_TERMINATED, e);\n },\n\n /**\n * Place as callback for a DOM element's `onResponderMove` event.\n */\n touchableHandleResponderMove: function touchableHandleResponderMove(e) {\n // Not enough time elapsed yet, wait for highlight -\n // this is just a perf optimization.\n if (this.state.touchable.touchState === States.RESPONDER_INACTIVE_PRESS_IN) {\n return;\n } // Measurement may not have returned yet.\n\n\n if (!this.state.touchable.positionOnActivate) {\n return;\n }\n\n var positionOnActivate = this.state.touchable.positionOnActivate;\n var dimensionsOnActivate = this.state.touchable.dimensionsOnActivate;\n var pressRectOffset = this.touchableGetPressRectOffset ? this.touchableGetPressRectOffset() : {\n left: PRESS_EXPAND_PX,\n right: PRESS_EXPAND_PX,\n top: PRESS_EXPAND_PX,\n bottom: PRESS_EXPAND_PX\n };\n var pressExpandLeft = pressRectOffset.left;\n var pressExpandTop = pressRectOffset.top;\n var pressExpandRight = pressRectOffset.right;\n var pressExpandBottom = pressRectOffset.bottom;\n var hitSlop = this.touchableGetHitSlop ? this.touchableGetHitSlop() : null;\n\n if (hitSlop) {\n pressExpandLeft += hitSlop.left;\n pressExpandTop += hitSlop.top;\n pressExpandRight += hitSlop.right;\n pressExpandBottom += hitSlop.bottom;\n }\n\n var touch = TouchEventUtils.extractSingleTouch(e.nativeEvent);\n var pageX = touch && touch.pageX;\n var pageY = touch && touch.pageY;\n\n if (this.pressInLocation) {\n var movedDistance = this._getDistanceBetweenPoints(pageX, pageY, this.pressInLocation.pageX, this.pressInLocation.pageY);\n\n if (movedDistance > LONG_PRESS_ALLOWED_MOVEMENT) {\n this._cancelLongPressDelayTimeout();\n }\n }\n\n var isTouchWithinActive = pageX > positionOnActivate.left - pressExpandLeft && pageY > positionOnActivate.top - pressExpandTop && pageX < positionOnActivate.left + dimensionsOnActivate.width + pressExpandRight && pageY < positionOnActivate.top + dimensionsOnActivate.height + pressExpandBottom;\n\n if (isTouchWithinActive) {\n this._receiveSignal(Signals.ENTER_PRESS_RECT, e);\n\n var curState = this.state.touchable.touchState;\n\n if (curState === States.RESPONDER_INACTIVE_PRESS_IN) {\n // fix for t7967420\n this._cancelLongPressDelayTimeout();\n }\n } else {\n this._cancelLongPressDelayTimeout();\n\n this._receiveSignal(Signals.LEAVE_PRESS_RECT, e);\n }\n },\n // ==== Abstract Application Callbacks ====\n\n /**\n * Invoked when the item should be highlighted. Mixers should implement this\n * to visually distinguish the `VisualRect` so that the user knows that\n * releasing a touch will result in a \"selection\" (analog to click).\n *\n * @abstract\n * touchableHandleActivePressIn: function,\n */\n\n /**\n * Invoked when the item is \"active\" (in that it is still eligible to become\n * a \"select\") but the touch has left the `PressRect`. Usually the mixer will\n * want to unhighlight the `VisualRect`. If the user (while pressing) moves\n * back into the `PressRect` `touchableHandleActivePressIn` will be invoked\n * again and the mixer should probably highlight the `VisualRect` again. This\n * event will not fire on an `touchEnd/mouseUp` event, only move events while\n * the user is depressing the mouse/touch.\n *\n * @abstract\n * touchableHandleActivePressOut: function\n */\n\n /**\n * Invoked when the item is \"selected\" - meaning the interaction ended by\n * letting up while the item was either in the state\n * `RESPONDER_ACTIVE_PRESS_IN` or `RESPONDER_INACTIVE_PRESS_IN`.\n *\n * @abstract\n * touchableHandlePress: function\n */\n\n /**\n * Invoked when the item is long pressed - meaning the interaction ended by\n * letting up while the item was in `RESPONDER_ACTIVE_LONG_PRESS_IN`. If\n * `touchableHandleLongPress` is *not* provided, `touchableHandlePress` will\n * be called as it normally is. If `touchableHandleLongPress` is provided, by\n * default any `touchableHandlePress` callback will not be invoked. To\n * override this default behavior, override `touchableLongPressCancelsPress`\n * to return false. As a result, `touchableHandlePress` will be called when\n * lifting up, even if `touchableHandleLongPress` has also been called.\n *\n * @abstract\n * touchableHandleLongPress: function\n */\n\n /**\n * Returns the number of millis to wait before triggering a highlight.\n *\n * @abstract\n * touchableGetHighlightDelayMS: function\n */\n\n /**\n * Returns the amount to extend the `HitRect` into the `PressRect`. Positive\n * numbers mean the size expands outwards.\n *\n * @abstract\n * touchableGetPressRectOffset: function\n */\n // ==== Internal Logic ====\n\n /**\n * Measures the `HitRect` node on activation. The Bounding rectangle is with\n * respect to viewport - not page, so adding the `pageXOffset/pageYOffset`\n * should result in points that are in the same coordinate system as an\n * event's `globalX/globalY` data values.\n *\n * - Consider caching this for the lifetime of the component, or possibly\n * being able to share this cache between any `ScrollMap` view.\n *\n * @sideeffects\n * @private\n */\n _remeasureMetricsOnActivation: function _remeasureMetricsOnActivation() {\n var tag = this.state.touchable.responderID;\n\n if (tag == null) {\n return;\n }\n\n UIManager.measure(tag, this._handleQueryLayout);\n },\n _handleQueryLayout: function _handleQueryLayout(x, y, width, height, globalX, globalY) {\n // don't do anything if UIManager failed to measure node\n if (!x && !y && !width && !height && !globalX && !globalY) {\n return;\n }\n\n this.state.touchable.positionOnActivate && Position.release(this.state.touchable.positionOnActivate);\n this.state.touchable.dimensionsOnActivate && // $FlowFixMe\n BoundingDimensions.release(this.state.touchable.dimensionsOnActivate);\n this.state.touchable.positionOnActivate = Position.getPooled(globalX, globalY); // $FlowFixMe\n\n this.state.touchable.dimensionsOnActivate = BoundingDimensions.getPooled(width, height);\n },\n _handleDelay: function _handleDelay(e) {\n this.touchableDelayTimeout = null;\n\n this._receiveSignal(Signals.DELAY, e);\n },\n _handleLongDelay: function _handleLongDelay(e) {\n this.longPressDelayTimeout = null;\n var curState = this.state.touchable.touchState;\n\n if (curState !== States.RESPONDER_ACTIVE_PRESS_IN && curState !== States.RESPONDER_ACTIVE_LONG_PRESS_IN) {\n console.error('Attempted to transition from state `' + curState + '` to `' + States.RESPONDER_ACTIVE_LONG_PRESS_IN + '`, which is not supported. This is ' + 'most likely due to `Touchable.longPressDelayTimeout` not being cancelled.');\n } else {\n this._receiveSignal(Signals.LONG_PRESS_DETECTED, e);\n }\n },\n\n /**\n * Receives a state machine signal, performs side effects of the transition\n * and stores the new state. Validates the transition as well.\n *\n * @param {Signals} signal State machine signal.\n * @throws Error if invalid state transition or unrecognized signal.\n * @sideeffects\n */\n _receiveSignal: function _receiveSignal(signal, e) {\n var responderID = this.state.touchable.responderID;\n var curState = this.state.touchable.touchState;\n var nextState = Transitions[curState] && Transitions[curState][signal];\n\n if (!responderID && signal === Signals.RESPONDER_RELEASE) {\n return;\n }\n\n if (!nextState) {\n throw new Error('Unrecognized signal `' + signal + '` or state `' + curState + '` for Touchable responder `' + responderID + '`');\n }\n\n if (nextState === States.ERROR) {\n throw new Error('Touchable cannot transition from `' + curState + '` to `' + signal + '` for responder `' + responderID + '`');\n }\n\n if (curState !== nextState) {\n this._performSideEffectsForTransition(curState, nextState, signal, e);\n\n this.state.touchable.touchState = nextState;\n }\n },\n _cancelLongPressDelayTimeout: function _cancelLongPressDelayTimeout() {\n this.longPressDelayTimeout && clearTimeout(this.longPressDelayTimeout);\n this.longPressDelayTimeout = null;\n },\n _isHighlight: function _isHighlight(state) {\n return state === States.RESPONDER_ACTIVE_PRESS_IN || state === States.RESPONDER_ACTIVE_LONG_PRESS_IN;\n },\n _savePressInLocation: function _savePressInLocation(e) {\n var touch = TouchEventUtils.extractSingleTouch(e.nativeEvent);\n var pageX = touch && touch.pageX;\n var pageY = touch && touch.pageY;\n this.pressInLocation = {\n pageX: pageX,\n pageY: pageY,\n\n get locationX() {\n return touch && touch.locationX;\n },\n\n get locationY() {\n return touch && touch.locationY;\n }\n\n };\n },\n _getDistanceBetweenPoints: function _getDistanceBetweenPoints(aX, aY, bX, bY) {\n var deltaX = aX - bX;\n var deltaY = aY - bY;\n return Math.sqrt(deltaX * deltaX + deltaY * deltaY);\n },\n\n /**\n * Will perform a transition between touchable states, and identify any\n * highlighting or unhighlighting that must be performed for this particular\n * transition.\n *\n * @param {States} curState Current Touchable state.\n * @param {States} nextState Next Touchable state.\n * @param {Signal} signal Signal that triggered the transition.\n * @param {Event} e Native event.\n * @sideeffects\n */\n _performSideEffectsForTransition: function _performSideEffectsForTransition(curState, nextState, signal, e) {\n var curIsHighlight = this._isHighlight(curState);\n\n var newIsHighlight = this._isHighlight(nextState);\n\n var isFinalSignal = signal === Signals.RESPONDER_TERMINATED || signal === Signals.RESPONDER_RELEASE;\n\n if (isFinalSignal) {\n this._cancelLongPressDelayTimeout();\n }\n\n if (!IsActive[curState] && IsActive[nextState]) {\n this._remeasureMetricsOnActivation();\n }\n\n if (IsPressingIn[curState] && signal === Signals.LONG_PRESS_DETECTED) {\n this.touchableHandleLongPress && this.touchableHandleLongPress(e);\n }\n\n if (newIsHighlight && !curIsHighlight) {\n this._startHighlight(e);\n } else if (!newIsHighlight && curIsHighlight) {\n this._endHighlight(e);\n }\n\n if (IsPressingIn[curState] && signal === Signals.RESPONDER_RELEASE) {\n var hasLongPressHandler = !!this.props.onLongPress;\n var pressIsLongButStillCallOnPress = IsLongPressingIn[curState] && ( // We *are* long pressing..\n !hasLongPressHandler || // But either has no long handler\n !this.touchableLongPressCancelsPress()); // or we're told to ignore it.\n\n var shouldInvokePress = !IsLongPressingIn[curState] || pressIsLongButStillCallOnPress;\n\n if (shouldInvokePress && this.touchableHandlePress) {\n if (!newIsHighlight && !curIsHighlight) {\n // we never highlighted because of delay, but we should highlight now\n this._startHighlight(e);\n\n this._endHighlight(e);\n }\n\n this.touchableHandlePress(e);\n }\n }\n\n this.touchableDelayTimeout && clearTimeout(this.touchableDelayTimeout);\n this.touchableDelayTimeout = null;\n },\n _startHighlight: function _startHighlight(e) {\n this._savePressInLocation(e);\n\n this.touchableHandleActivePressIn && this.touchableHandleActivePressIn(e);\n },\n _endHighlight: function _endHighlight(e) {\n var _this2 = this;\n\n if (this.touchableHandleActivePressOut) {\n if (this.touchableGetPressOutDelayMS && this.touchableGetPressOutDelayMS()) {\n this.pressOutDelayTimeout = setTimeout(function () {\n _this2.touchableHandleActivePressOut(e);\n }, this.touchableGetPressOutDelayMS());\n } else {\n this.touchableHandleActivePressOut(e);\n }\n }\n },\n // HACK (part 2): basic support for touchable interactions using a keyboard (including\n // delays and longPress)\n touchableHandleKeyEvent: function touchableHandleKeyEvent(e) {\n var ENTER = 13;\n var SPACE = 32;\n var type = e.type,\n which = e.which;\n\n if (which === ENTER || which === SPACE) {\n if (type === 'keydown') {\n if (!this._isTouchableKeyboardActive) {\n if (!this.state.touchable.touchState || this.state.touchable.touchState === States.NOT_RESPONDER) {\n this.touchableHandleResponderGrant(e);\n this._isTouchableKeyboardActive = true;\n }\n }\n } else if (type === 'keyup') {\n if (this._isTouchableKeyboardActive) {\n if (this.state.touchable.touchState && this.state.touchable.touchState !== States.NOT_RESPONDER) {\n this.touchableHandleResponderRelease(e);\n this._isTouchableKeyboardActive = false;\n }\n }\n }\n\n e.stopPropagation(); // prevent the default behaviour unless the Touchable functions as a link\n // and Enter is pressed\n\n if (!(which === ENTER && AccessibilityUtil.propsToAriaRole(this.props) === 'link')) {\n e.preventDefault();\n }\n }\n }\n};\nvar Touchable = {\n Mixin: TouchableMixin,\n TOUCH_TARGET_DEBUG: false,\n // Highlights all touchable targets. Toggle with Inspector.\n\n /**\n * Renders a debugging overlay to visualize touch target with hitSlop (might not work on Android).\n */\n renderDebugView: function renderDebugView(_ref) {\n var color = _ref.color,\n hitSlop = _ref.hitSlop;\n\n if (process.env.NODE_ENV !== 'production') {\n if (!Touchable.TOUCH_TARGET_DEBUG) {\n return null;\n }\n\n var debugHitSlopStyle = {};\n hitSlop = hitSlop || {\n top: 0,\n bottom: 0,\n left: 0,\n right: 0\n };\n\n for (var key in hitSlop) {\n debugHitSlopStyle[key] = -hitSlop[key];\n }\n\n var hexColor = '#' + ('00000000' + normalizeColor(color).toString(16)).substr(-8);\n return React.createElement(View, {\n pointerEvents: \"none\",\n style: _objectSpread({\n position: 'absolute',\n borderColor: hexColor.slice(0, -2) + '55',\n // More opaque\n borderWidth: 1,\n borderStyle: 'dashed',\n backgroundColor: hexColor.slice(0, -2) + '0F'\n }, debugHitSlopStyle)\n });\n }\n }\n};\nexport default Touchable;"]},"metadata":{},"sourceType":"script"}