react-native-screen-transitions
Version:
Easy screen transitions for React Native and Expo
104 lines (97 loc) • 3.6 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.NO_STYLES = exports.NO_BOUNDS_MAP = exports.MASK_STYLE_ID = exports.GESTURE_VELOCITY_IMPACT = exports.GESTURE_FAIL_TOLERANCE_Y = exports.GESTURE_FAIL_TOLERANCE_X = exports.GESTURE_ACTIVATION_THRESHOLD_Y = exports.GESTURE_ACTIVATION_THRESHOLD_X = exports.FULLSCREEN_DIMENSIONS = exports.EXIT_RANGE = exports.ENTER_RANGE = exports.EMPTY_BOUND_HELPER_RESULT_RAW = exports.EMPTY_BOUND_HELPER_RESULT = exports.DEFAULT_SCREEN_TRANSITION_STATE = exports.DEFAULT_GESTURE_ENABLED = exports.DEFAULT_GESTURE_DRIVES_PROGRESS = exports.DEFAULT_GESTURE_DIRECTION = exports.DEFAULT_GESTURE_ACTIVATION_AREA = exports.DEFAULT_EDGE_DISTANCE_VERTICAL = exports.DEFAULT_EDGE_DISTANCE_HORIZONTAL = exports.DEFAULT_BUILDER_OPTIONS = exports.DEFAULT_ACTIVATION_AREA = exports.CONTAINER_STYLE_ID = void 0;
/**
* Masked view integration
*/
const MASK_STYLE_ID = exports.MASK_STYLE_ID = "_ROOT_MASKED";
const CONTAINER_STYLE_ID = exports.CONTAINER_STYLE_ID = "_ROOT_CONTAINER";
/**
* Styles
*/
const NO_STYLES = exports.NO_STYLES = Object.freeze({});
/**
* Default screen transition state
*/
const DEFAULT_SCREEN_TRANSITION_STATE = exports.DEFAULT_SCREEN_TRANSITION_STATE = Object.freeze({
progress: 0,
closing: 0,
animating: 0,
gesture: {
x: 0,
y: 0,
normalizedX: 0,
normalizedY: 0,
isDismissing: 0,
isDragging: 0,
direction: null
},
bounds: {},
route: {}
});
/**
* Bounds API Defaults
*/
const NO_BOUNDS_MAP = exports.NO_BOUNDS_MAP = Object.freeze({});
const EMPTY_BOUND_HELPER_RESULT = exports.EMPTY_BOUND_HELPER_RESULT = Object.freeze({});
const EMPTY_BOUND_HELPER_RESULT_RAW = exports.EMPTY_BOUND_HELPER_RESULT_RAW = Object.freeze({
scaleX: 1,
scaleY: 1,
scale: 1,
translateX: 0,
translateY: 0,
width: 0,
height: 0
});
const ENTER_RANGE = exports.ENTER_RANGE = [0, 1];
const EXIT_RANGE = exports.EXIT_RANGE = [1, 2];
const FULLSCREEN_DIMENSIONS = dimensions => {
"worklet";
return {
x: 0,
y: 0,
pageX: 0,
pageY: 0,
width: dimensions.width,
height: dimensions.height
};
};
exports.FULLSCREEN_DIMENSIONS = FULLSCREEN_DIMENSIONS;
const DEFAULT_BUILDER_OPTIONS = exports.DEFAULT_BUILDER_OPTIONS = Object.freeze({
gestures: {
x: 0,
y: 0
},
toFullscreen: false,
absolute: false,
relative: true,
method: "transform",
contentScaleMode: "auto",
//
space: "relative",
target: "bound",
scaleMode: "match",
anchor: "center",
raw: false
});
/**
* Default gesture config
*/
const GESTURE_VELOCITY_IMPACT = exports.GESTURE_VELOCITY_IMPACT = 0.3;
const DEFAULT_GESTURE_DIRECTION = exports.DEFAULT_GESTURE_DIRECTION = "horizontal";
const DEFAULT_GESTURE_ENABLED = exports.DEFAULT_GESTURE_ENABLED = false;
const DEFAULT_GESTURE_DRIVES_PROGRESS = exports.DEFAULT_GESTURE_DRIVES_PROGRESS = true;
const DEFAULT_GESTURE_ACTIVATION_AREA = exports.DEFAULT_GESTURE_ACTIVATION_AREA = "screen";
/**
* Default gesture offset
*/
const GESTURE_ACTIVATION_THRESHOLD_X = exports.GESTURE_ACTIVATION_THRESHOLD_X = 10;
const GESTURE_ACTIVATION_THRESHOLD_Y = exports.GESTURE_ACTIVATION_THRESHOLD_Y = 10;
const GESTURE_FAIL_TOLERANCE_X = exports.GESTURE_FAIL_TOLERANCE_X = 15;
const GESTURE_FAIL_TOLERANCE_Y = exports.GESTURE_FAIL_TOLERANCE_Y = 20;
const DEFAULT_EDGE_DISTANCE_HORIZONTAL = exports.DEFAULT_EDGE_DISTANCE_HORIZONTAL = 50;
const DEFAULT_EDGE_DISTANCE_VERTICAL = exports.DEFAULT_EDGE_DISTANCE_VERTICAL = 135;
const DEFAULT_ACTIVATION_AREA = exports.DEFAULT_ACTIVATION_AREA = "screen";
//# sourceMappingURL=constants.js.map