You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 line
4.6 KiB
1 line
4.6 KiB
{"ast":null,"code":"import _classCallCheck from \"@babel/runtime/helpers/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/createClass\";\nimport _inherits from \"@babel/runtime/helpers/inherits\";\nimport _possibleConstructorReturn from \"@babel/runtime/helpers/possibleConstructorReturn\";\nimport _getPrototypeOf from \"@babel/runtime/helpers/getPrototypeOf\";\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nimport GestureHandler from \"./GestureHandler\";\nimport PixelRatio from \"react-native-web/dist/exports/PixelRatio\";\nvar DraggingGestureHandler = function (_GestureHandler) {\n _inherits(DraggingGestureHandler, _GestureHandler);\n var _super = _createSuper(DraggingGestureHandler);\n function DraggingGestureHandler() {\n _classCallCheck(this, DraggingGestureHandler);\n return _super.apply(this, arguments);\n }\n _createClass(DraggingGestureHandler, [{\n key: \"shouldEnableGestureOnSetup\",\n get: function get() {\n return true;\n }\n }, {\n key: \"transformNativeEvent\",\n value: function transformNativeEvent(_ref) {\n var deltaX = _ref.deltaX,\n deltaY = _ref.deltaY,\n velocityX = _ref.velocityX,\n velocityY = _ref.velocityY,\n _ref$center = _ref.center,\n x = _ref$center.x,\n y = _ref$center.y;\n var rect = this.view.getBoundingClientRect();\n var ratio = PixelRatio.get();\n return {\n translationX: deltaX - (this.__initialX || 0),\n translationY: deltaY - (this.__initialY || 0),\n absoluteX: x,\n absoluteY: y,\n velocityX: velocityX * ratio,\n velocityY: velocityY * ratio,\n x: x - rect.left,\n y: y - rect.top\n };\n }\n }]);\n return DraggingGestureHandler;\n}(GestureHandler);\nexport default DraggingGestureHandler;","map":{"version":3,"sources":["DraggingGestureHandler.ts"],"names":["GestureHandler","DraggingGestureHandler","shouldEnableGestureOnSetup","transformNativeEvent","deltaX","deltaY","velocityX","velocityY","center","x","y","rect","view","getBoundingClientRect","ratio","PixelRatio","get","translationX","__initialX","translationY","__initialY","absoluteX","absoluteY","left","top"],"mappings":";;;;;;;AAEA,OAAOA,cAAP;AAAA;AAAA,IAGeC,sBAAf;EAAA;EAAA;EAAA;IAAA;IAAA;EAAA;EAAA;IAAA;IAAA,KACMC,eAA6B;MAC/B,OAAO,IAAP;IACD;EAAA;IAAA;IAAA,OAEDC,oCAMmB;MAAA,IALjBC,MADmB,QACnBA,MADmB;QAEnBC,MAFmB,QAEnBA,MAFmB;QAGnBC,SAHmB,QAGnBA,SAHmB;QAInBC,SAJmB,QAInBA,SAJmB;QAAA,mBAKnBC,MAAM;QAAIC,CAAF,eAAEA,CAAF;QAAKC,CAAAA,eAAAA,CAAAA;MAGb,IAAMC,IAAI,GAAG,IAAA,CAAKC,IAAL,CAAWC,qBAAX,EAAb;MACA,IAAMC,KAAK,GAAGC,UAAU,CAACC,GAAXD,EAAd;MACA,OAAO;QACLE,YAAY,EAAEb,MAAM,IAAI,IAAA,CAAKc,UAAL,IAAmB,CAAvB,CADf;QAELC,YAAY,EAAEd,MAAM,IAAI,IAAA,CAAKe,UAAL,IAAmB,CAAvB,CAFf;QAGLC,SAAS,EAAEZ,CAHN;QAILa,SAAS,EAAEZ,CAJN;QAKLJ,SAAS,EAAEA,SAAS,GAAGQ,KALlB;QAMLP,SAAS,EAAEA,SAAS,GAAGO,KANlB;QAOLL,CAAC,EAAEA,CAAC,GAAGE,IAAI,CAACY,IAPP;QAQLb,CAAC,EAAEA,CAAC,GAAGC,IAAI,CAACa;MARP,CAAP;IAUD;EAAA;EAAA;AAAA,EAzB2CxB,cAA9C;AA4BA,eAAeC,sBAAf","sourcesContent":["/* eslint-disable eslint-comments/no-unlimited-disable */\n/* eslint-disable */\nimport GestureHandler, { HammerInputExt } from './GestureHandler';\nimport { PixelRatio } from 'react-native';\n\nabstract class DraggingGestureHandler extends GestureHandler {\n get shouldEnableGestureOnSetup() {\n return true;\n }\n\n transformNativeEvent({\n deltaX,\n deltaY,\n velocityX,\n velocityY,\n center: { x, y },\n }: HammerInputExt) {\n // @ts-ignore FIXME(TS)\n const rect = this.view!.getBoundingClientRect();\n const ratio = PixelRatio.get();\n return {\n translationX: deltaX - (this.__initialX || 0),\n translationY: deltaY - (this.__initialY || 0),\n absoluteX: x,\n absoluteY: y,\n velocityX: velocityX * ratio,\n velocityY: velocityY * ratio,\n x: x - rect.left,\n y: y - rect.top,\n };\n }\n}\n\nexport default DraggingGestureHandler;\n"]},"metadata":{},"sourceType":"module"} |