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
7.2 KiB
1 line
7.2 KiB
{"ast":null,"code":"import _toConsumableArray from \"@babel/runtime/helpers/toConsumableArray\";\nimport _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; } }\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n return obj;\n}\nimport React from 'react';\nimport { tagMessage } from \"../utils\";\nimport PlatformConstants from \"../PlatformConstants\";\nimport createHandler from \"./createHandler\";\nimport { baseGestureHandlerProps } from \"./gestureHandlerCommon\";\nexport var forceTouchGestureHandlerProps = ['minForce', 'maxForce', 'feedbackOnActivation'];\nvar ForceTouchFallback = function (_React$Component) {\n _inherits(ForceTouchFallback, _React$Component);\n var _super = _createSuper(ForceTouchFallback);\n function ForceTouchFallback() {\n _classCallCheck(this, ForceTouchFallback);\n return _super.apply(this, arguments);\n }\n _createClass(ForceTouchFallback, [{\n key: \"componentDidMount\",\n value: function componentDidMount() {\n console.warn(tagMessage('ForceTouchGestureHandler is not available on this platform. Please use ForceTouchGestureHandler.forceTouchAvailable to conditionally render other components that would provide a fallback behavior specific to your usecase'));\n }\n }, {\n key: \"render\",\n value: function render() {\n return this.props.children;\n }\n }]);\n return ForceTouchFallback;\n}(React.Component);\n_defineProperty(ForceTouchFallback, \"forceTouchAvailable\", false);\nexport var forceTouchHandlerName = 'ForceTouchGestureHandler';\nexport var ForceTouchGestureHandler = PlatformConstants !== null && PlatformConstants !== void 0 && PlatformConstants.forceTouchAvailable ? createHandler({\n name: forceTouchHandlerName,\n allowedProps: [].concat(_toConsumableArray(baseGestureHandlerProps), forceTouchGestureHandlerProps),\n config: {}\n}) : ForceTouchFallback;\nForceTouchGestureHandler.forceTouchAvailable = (PlatformConstants === null || PlatformConstants === void 0 ? void 0 : PlatformConstants.forceTouchAvailable) || false;","map":{"version":3,"sources":["ForceTouchGestureHandler.ts"],"names":["React","tagMessage","PlatformConstants","createHandler","baseGestureHandlerProps","forceTouchGestureHandlerProps","ForceTouchFallback","Component","componentDidMount","console","warn","render","props","children","forceTouchHandlerName","ForceTouchGestureHandler","forceTouchAvailable","name","allowedProps","config"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,OAAOA,KAAP,MAAyC,OAAzC;AACA,SAASC,UAAT;AACA,OAAOC,iBAAP;AACA,OAAOC,aAAP;AACA,SAEEC,uBAFF;AAKA,OAAO,IAAMC,6BAA6B,GAAG,CAC3C,UAD2C,EAE3C,UAF2C,EAG3C,sBAH2C,CAAtC;AAMP,IACMC,kBAAN;EAAA;EAAA;EAAA;IAAA;IAAA;EAAA;EAAA;IAAA;IAAA,OAEEE,6BAAoB;MAClBC,OAAO,CAACC,IAARD,CACER,UAAU,CACR,8NADQ,CADZQ,CAAAA;IAKD;EAAA;IAAA;IAAA,OACDE,kBAAS;MACP,OAAO,IAAA,CAAKC,KAAL,CAAWC,QAAlB;IACD;EAAA;EAAA;AAAA,EAX8Bb,KAAK,CAACO,SAAvC;gBAAMD,kB,yBACyB,K;AAsD/B,OAAO,IAAMQ,qBAAqB,GAAG,0BAA9B;AAGP,OAAO,IAAMC,wBAAwB,GAAG,iBAAiB,KAAA,IAAjB,IAAA,iBAAiB,KAAA,KAAA,CAAjB,IAAA,iBAAiB,CAAEC,mBAAnB,GACpCb,aAAa,CAGX;EACAc,IAAI,EAAEH,qBADN;EAEAI,YAAY,+BACPd,uBADS,GAETC,6BAFS,CAFd;EAMAc,MAAM,EAAE,CAAA;AANR,CAHW,CADuB,GAYpCb,kBAZG;AAcNS,wBAAD,CAAuDC,mBAAvD,GACE,CAAA,iBAAiB,KAAA,IAAjB,IAAA,iBAAiB,KAAA,KAAA,CAAjB,GAAA,KAAA,CAAA,GAAA,iBAAiB,CAAEA,mBAAnB,KAA0C,KAD5C","sourcesContent":["import React, { PropsWithChildren } from 'react';\nimport { tagMessage } from '../utils';\nimport PlatformConstants from '../PlatformConstants';\nimport createHandler from './createHandler';\nimport {\n BaseGestureHandlerProps,\n baseGestureHandlerProps,\n} from './gestureHandlerCommon';\n\nexport const forceTouchGestureHandlerProps = [\n 'minForce',\n 'maxForce',\n 'feedbackOnActivation',\n] as const;\n\n// implicit `children` prop has been removed in @types/react^18.0.0\nclass ForceTouchFallback extends React.Component<PropsWithChildren<unknown>> {\n static forceTouchAvailable = false;\n componentDidMount() {\n console.warn(\n tagMessage(\n 'ForceTouchGestureHandler is not available on this platform. Please use ForceTouchGestureHandler.forceTouchAvailable to conditionally render other components that would provide a fallback behavior specific to your usecase'\n )\n );\n }\n render() {\n return this.props.children;\n }\n}\n\nexport type ForceTouchGestureHandlerEventPayload = {\n x: number;\n y: number;\n absoluteX: number;\n absoluteY: number;\n\n /**\n * The pressure of a touch.\n */\n force: number;\n};\n\nexport interface ForceTouchGestureConfig {\n /**\n *\n * A minimal pressure that is required before handler can activate. Should be a\n * value from range `[0.0, 1.0]`. Default is `0.2`.\n */\n minForce?: number;\n\n /**\n * A maximal pressure that could be applied for handler. If the pressure is\n * greater, handler fails. Should be a value from range `[0.0, 1.0]`.\n */\n maxForce?: number;\n\n /**\n * Boolean value defining if haptic feedback has to be performed on\n * activation.\n */\n feedbackOnActivation?: boolean;\n}\n\nexport interface ForceTouchGestureHandlerProps\n extends BaseGestureHandlerProps<ForceTouchGestureHandlerEventPayload>,\n ForceTouchGestureConfig {}\n\nexport type ForceTouchGestureHandler = typeof ForceTouchGestureHandler & {\n forceTouchAvailable: boolean;\n};\n\nexport const forceTouchHandlerName = 'ForceTouchGestureHandler';\n\n// eslint-disable-next-line @typescript-eslint/no-redeclare -- backward compatibility; see description on the top of gestureHandlerCommon.ts file\nexport const ForceTouchGestureHandler = PlatformConstants?.forceTouchAvailable\n ? createHandler<\n ForceTouchGestureHandlerProps,\n ForceTouchGestureHandlerEventPayload\n >({\n name: forceTouchHandlerName,\n allowedProps: [\n ...baseGestureHandlerProps,\n ...forceTouchGestureHandlerProps,\n ] as const,\n config: {},\n })\n : ForceTouchFallback;\n\n(ForceTouchGestureHandler as ForceTouchGestureHandler).forceTouchAvailable =\n PlatformConstants?.forceTouchAvailable || false;\n"]},"metadata":{},"sourceType":"module"} |