43 lines
1.8 KiB
JavaScript
43 lines
1.8 KiB
JavaScript
// Metro module 5317 (f5318).
|
|
import { Platform } from "react-native";
|
|
import { ghQueueMicrotask } from "./Module5297";
|
|
import { checkGestureCallbacksForWorklets, ALLOWED_PROPS, extractGestureRelations } from "./convertToHandlerTag";
|
|
import Module5282 from "./Module5282";
|
|
import { filterConfig, scheduleFlushOperations } from "./transformIntoHandlerTags";
|
|
import { registerHandler } from "./Module5276";
|
|
import { ActionType } from "./Module5295";
|
|
import { MountRegistry } from "./MountRegistry";
|
|
Platform;
|
|
export function attachHandlers(a0) {
|
|
const { preparedGesture, gestureConfig, gesturesToAttach, viewTag } = a0;
|
|
a0.webEventHandlersRef;
|
|
gestureConfig.initialize();
|
|
ghQueueMicrotask(() => {
|
|
if (preparedGesture.isMounted) {
|
|
gestureConfig.prepare();
|
|
}
|
|
});
|
|
for (const item of gesturesToAttach) {
|
|
checkGestureCallbacksForWorklets(item);
|
|
Module5282.createGestureHandler(item.handlerName, item.handlerTag, filterConfig(item.config, ALLOWED_PROPS));
|
|
registerHandler(item.handlerTag, item, item.config.testId);
|
|
}
|
|
ghQueueMicrotask(() => {
|
|
if (preparedGesture.isMounted) {
|
|
for (const item of gesturesToAttach) {
|
|
Module5282.updateGestureHandler(item.handlerTag, filterConfig(item.config, ALLOWED_PROPS, extractGestureRelations(item)));
|
|
}
|
|
scheduleFlushOperations();
|
|
}
|
|
});
|
|
for (const item2 of gesturesToAttach) {
|
|
const r96 = item2.shouldUseReanimated ? ActionType.REANIMATED_WORKLET : ActionType.JS_FUNCTION_NEW_API;
|
|
Module5282.attachGestureHandler(item2.handlerTag, viewTag, r96);
|
|
MountRegistry.gestureWillMount(item2);
|
|
}
|
|
preparedGesture.attachedGestures = gesturesToAttach;
|
|
if (preparedGesture.animatedHandlers) {
|
|
preparedGesture.animatedHandlers.value = gesturesToAttach.filter((item) => item.shouldUseReanimated).map((item) => item.handlers);
|
|
}
|
|
}
|