decord/source/design/void/Pressables/native/Pressables.tsx

119 lines
4.4 KiB
TypeScript
Raw Normal View History

// Module ID: 5173
// Function ID: 5174
// Name: Pressables
// Dependencies: [19, 17, 5034, 1182, 21, 4605, 576, 1115, 5174, 2]
2026-07-20 16:05:17 +00:00
// Module 5173 (Pressables)
import nativeDefault from "native" /* 576 */;
import PlatformUtils from "PlatformUtils" /* 1115 */;
import StyleSheetUtilsDefault from "StyleSheetUtils" /* 5174 */;
import noop from "module_19" /* 19 */;
2026-07-23 10:11:24 +00:00
require = fn;
2026-07-20 16:05:17 +00:00
function PressableBase(androidRippleConfig) {
androidRippleConfig = androidRippleConfig.androidRippleConfig;
const style = androidRippleConfig.style;
const type = androidRippleConfig.type;
const activeOpacity = androidRippleConfig.activeOpacity;
const underlayColor = androidRippleConfig.underlayColor;
({ children, innerRef } = androidRippleConfig);
let merged = Object.assign(androidRippleConfig, Object.assign({ children: 0, androidRippleConfig: 0, style: 0, type: 0, activeOpacity: 0, underlayColor: 0, innerRef: 0 }));
const backgroundColor = closure_8().pressedHighlight.backgroundColor;
2026-07-23 10:11:24 +00:00
let items = [type, activeOpacity, underlayColor, style, backgroundColor];
2026-07-20 16:05:17 +00:00
const items1 = [androidRippleConfig, style];
const memo = activeOpacity.useMemo(() => PlatformUtils.isAndroid() ? style : ((pressed) => {
const items = [style, , ];
2026-07-20 16:05:17 +00:00
if (!pressed.pressed) {
items[1] = null;
items[2] = backgroundColor;
2026-07-20 16:05:17 +00:00
return items;
} else if ("highlight" === type) {
let tmp2 = underlayColor;
if (underlayColor == null) {
tmp2 = closure_1_5;
2026-07-29 08:29:29 +00:00
}
const obj2 = { backgroundColor: tmp2 };
2026-07-20 16:05:17 +00:00
} else {
let num = activeOpacity;
if (activeOpacity == null) {
2026-07-29 08:29:29 +00:00
num = 0.2;
2026-07-20 16:05:17 +00:00
}
const obj = { opacity: num };
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
}), items);
2026-07-29 08:29:29 +00:00
let obj = {
2026-07-23 10:11:24 +00:00
android_ripple: activeOpacity.useMemo(() => {
2026-07-20 16:05:17 +00:00
if (obj.isAndroid()) {
let obj2 = androidRippleConfig;
2026-07-29 08:29:29 +00:00
if (androidRippleConfig == null) {
obj2 = {};
2026-07-29 08:29:29 +00:00
}
const cornerRadius = obj2.cornerRadius;
2026-07-29 08:29:29 +00:00
let tmp4 = cornerRadius;
2026-07-20 16:05:17 +00:00
if (null == cornerRadius) {
const styleProp = StyleSheetUtilsDefault.getStyleProp(style, "borderRadius");
2026-07-29 08:29:29 +00:00
tmp4 = cornerRadius;
2026-07-20 16:05:17 +00:00
if (null != styleProp) {
2026-07-29 08:29:29 +00:00
tmp4 = styleProp;
2026-07-20 16:05:17 +00:00
}
}
const obj4 = {};
2026-07-29 08:29:29 +00:00
const merged = Object.assign(tmp2);
obj4.cornerRadius = tmp4;
return getThemedRippleConfig(obj4);
2026-07-20 16:05:17 +00:00
}
obj = PlatformUtils;
2026-07-20 16:05:17 +00:00
}, items1),
style: memo,
ref: innerRef
};
const merged1 = Object.assign(merged);
2026-07-29 08:29:29 +00:00
obj.children = children;
2026-07-23 10:11:24 +00:00
return <underlayColor android_ripple={activeOpacity.useMemo(() => {
if (obj.isAndroid()) {
let obj2 = androidRippleConfig;
2026-07-29 08:29:29 +00:00
if (androidRippleConfig == null) {
obj2 = {};
2026-07-29 08:29:29 +00:00
}
const cornerRadius = obj2.cornerRadius;
2026-07-29 08:29:29 +00:00
let tmp4 = cornerRadius;
2026-07-23 10:11:24 +00:00
if (null == cornerRadius) {
const styleProp = StyleSheetUtilsDefault.getStyleProp(style, "borderRadius");
2026-07-29 08:29:29 +00:00
tmp4 = cornerRadius;
2026-07-23 10:11:24 +00:00
if (null != styleProp) {
2026-07-29 08:29:29 +00:00
tmp4 = styleProp;
2026-07-23 10:11:24 +00:00
}
}
const obj4 = {};
2026-07-29 08:29:29 +00:00
const merged = Object.assign(tmp2);
obj4.cornerRadius = tmp4;
return getThemedRippleConfig(obj4);
2026-07-23 10:11:24 +00:00
}
obj = PlatformUtils;
2026-07-23 10:11:24 +00:00
}, items1)} style={memo} ref={innerRef} />;
2026-07-20 16:05:17 +00:00
}
const Pressable = fn(17).Pressable;
const IOS_POINTER_STYLE = fn(5034).IOS_POINTER_STYLE;
const getThemedRippleConfig = fn(1182).getThemedRippleConfig;
const jsx = fn(21).jsx;
const createStyles = fn(4605);
let obj = { pressedHighlight: { backgroundColor: nativeDefault.colors.BACKGROUND_MOD_MUTED } };
let closure_8 = createStyles.createStyles(obj);
let obj3 = { backgroundColor: nativeDefault.colors.BACKGROUND_MOD_MUTED };
const forwardRefResult = noop.forwardRef((activeOpacity, innerRef) => {
2026-07-20 16:05:17 +00:00
let num = activeOpacity.activeOpacity;
if (num === undefined) {
num = 0.2;
}
const merged = Object.assign(Object.assign(activeOpacity, Object.assign({ activeOpacity: 0 })));
2026-07-23 10:11:24 +00:00
return <PressableBase innerRef={arg1} type="opacity" activeOpacity={num} />;
2026-07-20 16:05:17 +00:00
});
const size = fn(2);
const result = size.fileFinishedImporting("design/void/Pressables/native/Pressables.tsx");
2026-07-20 16:05:17 +00:00
export const PressableOpacity = forwardRefResult;
export const PressableHighlight = noop.forwardRef((underlayColor, innerRef) => {
const merged = Object.assign(Object.assign(underlayColor, Object.assign({ underlayColor: 0 })));
return <PressableBase innerRef={arg1} type="highlight" underlayColor={arg0.underlayColor} />;
});