1 line
2.9 KiB
Plaintext
1 line
2.9 KiB
Plaintext
{"version":3,"sources":["NativeViewGestureHandler.ts"],"names":["NativeViewGestureHandler","PressGestureHandler","onRawEvent","ev","isFinal","x","deltaX","y","deltaY","config","disallowInterruption","gestures","Object","values","NodeManager","getNodes","filter","gesture","handlerTag","view","isGestureRunning","DiscreteGestureHandler","contains","forceInvalidate"],"mappings":";;;;;;;AAAA;;AAEA;;AACA;;AACA;;;;;;;;AAEA,MAAMA,wBAAN,SAAuCC,4BAAvC,CAA2D;AACzDC,EAAAA,UAAU,CAACC,EAAD,EAAqB;AAC7B,UAAMD,UAAN,CAAiBC,EAAjB;;AACA,QAAI,CAACA,EAAE,CAACC,OAAR,EAAiB;AACf;AACA,UAAI,gCAAoB,uBAAW;AAAEC,QAAAA,CAAC,EAAEF,EAAE,CAACG,MAAR;AAAgBC,QAAAA,CAAC,EAAEJ,EAAE,CAACK;AAAtB,OAAX,CAApB,EAAgE,EAAhE,CAAJ,EAAyE;AACvE;AACA,YAAI,KAAKC,MAAL,CAAYC,oBAAhB,EAAsC;AACpC,gBAAMC,QAAQ,GAAGC,MAAM,CAACC,MAAP,CAAcC,WAAW,CAACC,QAAZ,EAAd,EAAsCC,MAAtC,CACdC,OAAD,IAAa;AACX,kBAAM;AAAEC,cAAAA,UAAF;AAAcC,cAAAA,IAAd;AAAoBC,cAAAA;AAApB,gBAAyCH,OAA/C;AACA,mBACE;AACAC,cAAAA,UAAU,KAAK,KAAKA,UAApB,IACA;AACAE,cAAAA,gBAFA,IAGA;AACAH,cAAAA,OAAO,YAAYI,+BAJnB,IAKA;AACAF,cAAAA,IANA,IAOA;AACA,mBAAKA,IAAL,CAAUG,QAAV,CAAmBH,IAAnB;AAVF;AAYD,WAfc,CAAjB,CADoC,CAkBpC;;AACA,eAAK,MAAMF,OAAX,IAAsBN,QAAtB,EAAgC;AAC9B;AACAM,YAAAA,OAAO,CAACM,eAAR,CAAwBpB,EAAxB;AACD;AACF;AACF;AACF;AACF;;AAjCwD;;eAoC5CH,wB","sourcesContent":["import DiscreteGestureHandler from './DiscreteGestureHandler';\nimport { HammerInputExt } from './GestureHandler';\nimport * as NodeManager from './NodeManager';\nimport PressGestureHandler from './PressGestureHandler';\nimport { TEST_MIN_IF_NOT_NAN, VEC_LEN_SQ } from './utils';\n\nclass NativeViewGestureHandler extends PressGestureHandler {\n onRawEvent(ev: HammerInputExt) {\n super.onRawEvent(ev);\n if (!ev.isFinal) {\n // if (this.ref instanceof ScrollView) {\n if (TEST_MIN_IF_NOT_NAN(VEC_LEN_SQ({ x: ev.deltaX, y: ev.deltaY }), 10)) {\n // @ts-ignore FIXME(TS) config type\n if (this.config.disallowInterruption) {\n const gestures = Object.values(NodeManager.getNodes()).filter(\n (gesture) => {\n const { handlerTag, view, isGestureRunning } = gesture;\n return (\n // Check if this gesture isn't self\n handlerTag !== this.handlerTag &&\n // Ensure the gesture needs to be cancelled\n isGestureRunning &&\n // ScrollView can cancel discrete gestures like taps and presses\n gesture instanceof DiscreteGestureHandler &&\n // Ensure a view exists and is a child of the current view\n view &&\n // @ts-ignore FIXME(TS) view type\n this.view.contains(view)\n );\n }\n );\n // Cancel all of the gestures that passed the filter\n for (const gesture of gestures) {\n // TODO: Bacon: Send some cached event.\n gesture.forceInvalidate(ev);\n }\n }\n }\n }\n }\n}\n\nexport default NativeViewGestureHandler;\n"]} |