Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4825.js (118.4 MB)
75 lines
3.6 KiB
JavaScript
75 lines
3.6 KiB
JavaScript
// Module ID: 6849
|
|
// Function ID: 6850
|
|
// Dependencies: [19, 6788, 6771, 6850, 6834, 6810, 6797, 6770]
|
|
// Exports: useGesture
|
|
|
|
// Module 6849
|
|
import handlerIDToTag from "handlerIDToTag" /* 6770 */;
|
|
import transformIntoHandlerTags from "transformIntoHandlerTags" /* 6797 */;
|
|
import _mod6810 from "module_6810" /* 6810 */;
|
|
import DEFAULT_PROPS_TRANSFORMER from "DEFAULT_PROPS_TRANSFORMER" /* 6834 */;
|
|
import noop from "module_19" /* 19 */;
|
|
|
|
const require = globalThis.__r;
|
|
|
|
({ useEffect: c2, useMemo: c3 } = noop);
|
|
|
|
export const useGesture = function useGesture(Fling, clonedAndRemappedConfig) {
|
|
_require = Fling;
|
|
dependencyMap = clonedAndRemappedConfig;
|
|
const tmp2 = jsEventHandler(() => type(config[1]).getNextHandlerTag(), []);
|
|
const handlerTag = tmp2;
|
|
if (clonedAndRemappedConfig.disableReanimated !== jsEventHandler(() => config.disableReanimated, [])) {
|
|
const _Error2 = Error;
|
|
const error = new Error(require("tagMessage").tagMessage("The \"disableReanimated\" property must not be changed after the handler is created."));
|
|
throw error;
|
|
} else {
|
|
const gestureCallbacks = require("module_6850").useGestureCallbacks(tmp2, clonedAndRemappedConfig);
|
|
jsEventHandler = gestureCallbacks.jsEventHandler;
|
|
const reanimatedEventHandler = gestureCallbacks.reanimatedEventHandler;
|
|
const animatedEventHandler = gestureCallbacks.animatedEventHandler;
|
|
if (clonedAndRemappedConfig.shouldUseReanimatedDetector) {
|
|
if (!reanimatedEventHandler) {
|
|
const _Error = Error;
|
|
const error1 = new Error(require("tagMessage").tagMessage("Failed to create reanimated event handlers."));
|
|
throw error1;
|
|
}
|
|
}
|
|
const items = [tmp2, , , ];
|
|
({ simultaneousWith: arr[1], requireToFail: arr[2], block: arr[3] } = clonedAndRemappedConfig);
|
|
const tmpResult = tmp(() => DEFAULT_PROPS_TRANSFORMER.prepareRelations({ simultaneousWith: config.simultaneousWith, requireToFail: config.requireToFail, block: config.block }, closure_2), items);
|
|
const gestureRelations = tmpResult;
|
|
const items1 = [tmp2, Fling, clonedAndRemappedConfig, jsEventHandler, reanimatedEventHandler, animatedEventHandler, tmpResult];
|
|
const tmpResult2 = tmp(() => {
|
|
const obj = { handlerTag, type, config, detectorCallbacks: { jsEventHandler, animatedEventHandler, reanimatedEventHandler }, gestureRelations };
|
|
return obj;
|
|
}, items1);
|
|
closure_7 = tmpResult2;
|
|
const items2 = [Fling, tmp2];
|
|
handlerTag(() => {
|
|
let NativeProxy = _mod6810.NativeProxy;
|
|
NativeProxy.createGestureHandler(closure_0, closure_2, {});
|
|
let result = transformIntoHandlerTags.scheduleFlushOperations();
|
|
return () => {
|
|
const NativeProxy = closure_0(6810).NativeProxy;
|
|
NativeProxy.dropGestureHandler(handlerTag);
|
|
const result = closure_0(6797).scheduleFlushOperations();
|
|
};
|
|
}, items2);
|
|
const items3 = [tmp2, clonedAndRemappedConfig, Fling, tmpResult2];
|
|
handlerTag(() => {
|
|
const result = DEFAULT_PROPS_TRANSFORMER.prepareConfigForNativeSide(closure_0, dependencyMap);
|
|
const NativeProxy = _mod6810.NativeProxy;
|
|
const result1 = NativeProxy.setGestureHandlerConfig(closure_2, result);
|
|
const result2 = transformIntoHandlerTags.scheduleFlushOperations();
|
|
DEFAULT_PROPS_TRANSFORMER.bindSharedValues(dependencyMap, closure_2);
|
|
handlerIDToTag.registerGesture(closure_2, closure_7);
|
|
return () => {
|
|
closure_0(6834).unbindSharedValues(dependencyMap, handlerTag);
|
|
const obj = closure_0(6834);
|
|
closure_0(6770).unregisterGesture(handlerTag);
|
|
};
|
|
}, items3);
|
|
return tmpResult2;
|
|
}
|
|
};
|