|
| 1 | +const ReactPrimitives = require('../ReactPrimitives'); |
| 2 | +const Animated = require('animated'); |
| 3 | +const Easing = require('animated/lib/Easing'); |
| 4 | +const { |
| 5 | + View, |
| 6 | + Text, |
| 7 | + Image, |
| 8 | + StyleSheet, |
| 9 | + // TODO(lmr): Dimensions |
| 10 | +} = require('react-figma'); |
| 11 | + |
| 12 | +const TouchableMixin = { |
| 13 | + componentWillUnmount() {}, |
| 14 | + touchableGetInitialState() { |
| 15 | + return { touchable: { touchState: undefined, responderID: null } }; |
| 16 | + }, |
| 17 | + touchableHandleResponderTerminationRequest() { return false; }, |
| 18 | + touchableHandleStartShouldSetResponder() { return false; }, |
| 19 | + touchableLongPressCancelsPress() { return true; }, |
| 20 | + touchableHandleResponderGrant() {}, |
| 21 | + touchableHandleResponderRelease() {}, |
| 22 | + touchableHandleResponderTerminate() {}, |
| 23 | + touchableHandleResponderMove() {}, |
| 24 | +}; |
| 25 | + |
| 26 | +Animated.inject.FlattenStyle(StyleSheet.flatten); |
| 27 | + |
| 28 | +ReactPrimitives.inject({ |
| 29 | + StyleSheet, |
| 30 | + View, |
| 31 | + Text, |
| 32 | + Image, |
| 33 | + Easing, |
| 34 | + Animated: { |
| 35 | + ...Animated, |
| 36 | + View: Animated.createAnimatedComponent(View), |
| 37 | + Text: Animated.createAnimatedComponent(Text), |
| 38 | + Image: Animated.createAnimatedComponent(Image), |
| 39 | + }, |
| 40 | + Platform: { |
| 41 | + OS: 'figma', |
| 42 | + Version: 1, |
| 43 | + }, |
| 44 | +}); |
| 45 | + |
| 46 | +ReactPrimitives.inject({ |
| 47 | + Touchable: require('../modules/Touchable')( |
| 48 | + Animated, |
| 49 | + StyleSheet, |
| 50 | + ReactPrimitives.Platform, |
| 51 | + TouchableMixin, |
| 52 | + ), |
| 53 | +}); |
0 commit comments